/* --- Reset & Base --- */

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

:root {
    --color-bg: #f0f2f5;
    --color-surface: #ffffff;
    --color-border: #e5e7eb;
    --color-border-light: #f1f3f5;
    --color-text: #1a1a2e;
    --color-text-secondary: #6b7280;
    --color-text-muted: #9ca3af;
    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-primary-light: #eef2ff;
    --color-success: #059669;
    --color-success-bg: #ecfdf5;
    --color-warning: #d97706;
    --color-warning-bg: #fffbeb;
    --color-danger: #dc2626;
    --color-danger-bg: #fef2f2;
    --color-info: #2563eb;
    --color-info-bg: #eff6ff;
    /* Il modello locale (llm_status "local"): un colore suo, perche' non e'
       ne' l'LLM (indaco) ne' un ripiego (rosso). */
    --color-local: #0f766e;
    --color-local-bg: #f0fdfa;
    --color-local-border: #99f6e4;
    --color-nav: #111827;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
    --transition: 150ms ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    color: var(--color-primary-hover);
}

code {
    font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
    font-size: 0.85em;
    background: var(--color-bg);
    padding: 2px 6px;
    border-radius: 4px;
}

/* --- Layout --- */

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

main.container {
    padding-top: 36px;
    padding-bottom: 72px;
}

/* --- Navbar --- */

.navbar {
    background: var(--color-nav);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.nav-brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.01em;
}

.nav-brand:hover {
    text-decoration: none;
    color: #c7d2fe;
}

.brand-icon {
    width: 30px;
    height: 30px;
    background: var(--color-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.nav-link {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all var(--transition);
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

/* Menu utente: un <details>, il pannello si apre sotto a destra */

.user-menu {
    position: relative;
    margin-left: 12px;
}

.user-menu-button {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 8px 5px 5px;
    border-radius: var(--radius-sm);
    color: #fff;
    cursor: pointer;
    transition: background var(--transition);
}

.user-menu-button::-webkit-details-marker {
    display: none;
}

.user-menu-button:hover,
.user-menu[open] .user-menu-button {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 50%;
    background: #3730a3;
    color: #e0e7ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.user-avatar-lg {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.user-menu-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.user-menu-name {
    font-size: 0.8rem;
    font-weight: 600;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-workspace {
    font-size: 0.72rem;
    color: #a5b4fc;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-chevron {
    color: #9ca3af;
    transition: transform var(--transition);
}

.user-menu[open] .user-menu-chevron {
    transform: rotate(180deg);
}

.user-menu-panel {
    position: absolute;
    z-index: 200;
    top: calc(100% + 8px);
    right: 0;
    width: 300px;
    max-width: calc(100vw - 24px);
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border-light);
}

.user-menu-who {
    min-width: 0;
}

.user-menu-header-name {
    font-weight: 600;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-header-meta {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.user-menu-section {
    padding: 10px 8px;
    border-bottom: 1px solid var(--color-border-light);
}

.user-menu-section:last-child {
    border-bottom: none;
}

.user-menu-label {
    padding: 2px 8px 6px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.workspace-current,
.workspace-option {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 8px;
    width: 100%;
    padding: 7px 8px;
    border-radius: 5px;
    font: inherit;
    font-size: 0.86rem;
    text-align: left;
    color: var(--color-text);
}

.workspace-current {
    grid-template-columns: 14px 1fr auto;
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 600;
}

.workspace-option {
    background: none;
    border: none;
    cursor: pointer;
}

.workspace-option:hover,
.workspace-option:focus-visible,
.workspace-option.is-active {
    background: var(--color-bg);
    outline: none;
}

.workspace-option.is-current {
    cursor: default;
    color: var(--color-text-secondary);
}

.workspace-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-hint {
    font-size: 0.74rem;
    font-weight: 400;
    color: var(--color-text-muted);
}

.workspace-search {
    position: relative;
    margin: 8px 0 4px;
    color: var(--color-text-muted);
}

.workspace-search[hidden] {
    display: none;
}

.workspace-search svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.workspace-search-input {
    width: 100%;
    padding: 7px 10px 7px 30px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 0.86rem;
    color: var(--color-text);
    background: var(--color-surface);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

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

.workspace-results,
.workspace-recent ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.workspace-results {
    max-height: 240px;
    overflow-y: auto;
}

.workspace-recent {
    margin-top: 8px;
}

.workspace-empty {
    padding: 10px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-align: center;
}

.user-menu-actions form {
    margin: 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 5px;
    background: none;
    font: inherit;
    font-size: 0.86rem;
    color: var(--color-text);
    text-align: left;
    cursor: pointer;
}

.user-menu-item:hover {
    background: var(--color-bg);
    color: var(--color-text);
    text-decoration: none;
}

.user-menu-item svg {
    color: var(--color-text-secondary);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
}

/* --- Page Header --- */

.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.page-header p {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* --- Stats Row --- */

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--color-surface);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

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

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
}

.stat-value.text-success { color: var(--color-success); }
.stat-value.text-primary { color: var(--color-primary); }
.stat-value.text-warning { color: var(--color-warning); }

/* --- Table --- */

.table-wrapper {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.875rem;
}

.table th {
    background: #fafbfc;
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom-color: var(--color-border);
}

.table tbody tr {
    transition: background var(--transition);
}

.table tbody tr:hover {
    background: #f9fafb;
}

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

.table td.domain-name {
    font-weight: 600;
    color: var(--color-text);
}

.table td.domain-name .domain-group {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.table td.url-cell {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table td.num {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.table .empty-row td {
    text-align: center;
    padding: 48px 16px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* --- Badges --- */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-muted { background: #f3f4f6; color: #6b7280; }
.badge-news { background: var(--color-info-bg); color: var(--color-info); }
.badge-article { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-other { background: #f3f4f6; color: #6b7280; }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-category { background: #ede9fe; color: #6d28d9; }
.badge-subcategory { background: #e0f2fe; color: #0369a1; }
/* Solo sulle pagine non in italiano, che sono l'eccezione: il codice basta. */
.badge-lang {
    background: transparent;
    color: var(--color-text-secondary);
    box-shadow: inset 0 0 0 1px var(--color-border);
    padding: 2px 7px;
}

.card-tags, .detail-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.detail-tags { margin-bottom: 12px; }

/* --- Filters --- */

.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.filters select,
.filters input[type="text"] {
    padding: 9px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color var(--transition), box-shadow var(--transition);
    min-width: 160px;
}

.filters select:focus,
.filters input[type="text"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.filters input[type="text"] {
    min-width: 220px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    color: #fff;
    text-decoration: none;
}

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

.btn-ghost:hover {
    background: var(--color-bg);
    color: var(--color-text);
    text-decoration: none;
}

/* --- Content Grid --- */

.content-grid {
    display: grid;
    gap: 12px;
}

.content-card {
    background: var(--color-surface);
    padding: 20px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: box-shadow var(--transition), border-color var(--transition);
}

.content-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #d1d5db;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.card-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-source {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.card-abstract {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* Nessuna data di pubblicazione nella pagina: mostriamo quella di scrape,
   etichettata, cosi' non viene scambiata per la data dell'articolo. */
.card-date-fallback {
    font-style: italic;
    opacity: 0.75;
}

.content-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.content-card h3 a {
    color: var(--color-text);
}

.content-card h3 a:hover {
    color: var(--color-primary);
}

.card-meta {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.card-meta .separator {
    color: var(--color-text-muted);
}

.content-grid .empty-state {
    text-align: center;
    padding: 48px 24px;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
}

.empty-state svg {
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.9rem;
}

/* --- Detail Layout --- */

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
    margin-top: 16px;
}

.detail-main {
    background: var(--color-surface);
    padding: 32px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.detail-main h1 {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.detail-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.detail-meta .separator {
    color: var(--color-text-muted);
}

.detail-content {
    line-height: 1.8;
    font-size: 0.95rem;
    color: #374151;
}

.detail-content h2,
.detail-content h3 {
    margin-top: 28px;
    margin-bottom: 10px;
    color: var(--color-text);
}

.detail-content p {
    margin-bottom: 14px;
}

.detail-content ul,
.detail-content ol {
    margin-bottom: 14px;
    padding-left: 24px;
}

.detail-content a {
    text-decoration: underline;
    text-decoration-color: rgba(79, 70, 229, 0.3);
    text-underline-offset: 2px;
}

.detail-source {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border-light);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.detail-source strong {
    color: var(--color-text);
}

.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 76px;
}

.side-card {
    background: var(--color-surface);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    font-size: 0.85rem;
}

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

.version-list {
    list-style: none;
    font-size: 0.85rem;
}

.version-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.version-list li:last-child {
    border-bottom: none;
}

.version-current {
    font-weight: 600;
}

/* --- Pagination --- */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    font-size: 0.875rem;
}

.pagination a {
    padding: 8px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-weight: 500;
    transition: all var(--transition);
}

.pagination a:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    text-decoration: none;
}

.pagination .page-info {
    padding: 8px 4px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.pagination .disabled {
    padding: 8px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    opacity: 0.4;
    cursor: default;
    font-weight: 500;
}

.pagination-jump {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-input {
    width: 56px;
    padding: 7px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    background: var(--color-surface);
    text-align: center;
}

.pagination-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* --- Back Link --- */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    transition: color var(--transition);
}

.back-link:hover {
    color: var(--color-primary);
    text-decoration: none;
}

/* --- Utility --- */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.muted-text {
    color: var(--color-text-muted);
}

.mono {
    font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
    font-size: 0.85em;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-primary);
    cursor: pointer;
}

.link-button:hover {
    color: var(--color-primary-hover);
}

/* --- Filter panel (/content/ e home) --- */

.filter-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    margin-bottom: 20px;
}

.filter-search-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-field {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text-muted);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-field:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.search-field input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    padding: 10px 0;
    font: inherit;
    font-size: 0.92rem;
    color: var(--color-text);
    background: transparent;
}

.search-hint {
    font-family: inherit;
    font-size: 0.72rem;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 0 6px;
    line-height: 1.5;
}

.search-field:focus-within .search-hint {
    display: none;
}

.filter-toggle {
    display: none;
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 16px;
    margin-top: 14px;
}

.filter-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
}

.filter-dates {
    grid-column: span 2;
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.field-error {
    color: var(--color-danger);
    font-size: 0.8rem;
}

/* Multiselect */

.ms {
    position: relative;
}

.ms-control {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-height: 40px;
    padding: 4px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    cursor: text;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.ms.is-open .ms-control,
.ms-control:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.ms-chips {
    display: contents;
}

.ms-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    max-width: 100%;
    padding: 2px 4px 2px 9px;
    border-radius: 14px;
    background: var(--color-primary-light);
    color: var(--color-primary-hover);
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.5;
}

.ms-chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 190px;
}

.ms-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.ms-chip-remove:hover,
.ms-chip-remove:focus-visible {
    background: rgba(79, 70, 229, 0.18);
    outline: none;
}

.ms-input {
    flex: 1;
    min-width: 90px;
    border: none;
    outline: none;
    padding: 5px 2px;
    font: inherit;
    font-size: 0.875rem;
    color: var(--color-text);
    background: transparent;
}

.ms-input::placeholder,
.search-field input::placeholder {
    color: var(--color-text-muted);
}

.ms-menu {
    position: absolute;
    z-index: 50;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 290px;
    overflow-y: auto;
    list-style: none;
    padding: 4px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}

.ms-option {
    display: grid;
    grid-template-columns: 18px 1fr;
    align-items: center;
    column-gap: 8px;
    padding: 7px 8px;
    border-radius: 5px;
    font-size: 0.86rem;
    cursor: pointer;
}

.ms-option.is-active {
    background: var(--color-bg);
}

.ms-option-hint {
    grid-column: 2;
    font-size: 0.74rem;
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ms-check {
    width: 16px;
    height: 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 4px;
    background: var(--color-surface);
}

.ms-option.is-selected .ms-check {
    border-color: var(--color-primary);
    background: var(--color-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.ms-option.is-selected .ms-option-label {
    font-weight: 600;
}

.ms-empty {
    padding: 10px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-align: center;
}

/* Pills (type): un controllo segmentato, i tre valori stanno su una riga */

.pill-group {
    display: flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    overflow: hidden;
    height: 40px;
}

.pill {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    cursor: pointer;
}

.pill + .pill {
    border-left: 1px solid var(--color-border);
}

.pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pill span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background var(--transition), color var(--transition);
}

.pill:hover span {
    background: var(--color-bg);
    color: var(--color-text);
}

.pill input:checked + span {
    background: var(--color-primary-light);
    color: var(--color-primary-hover);
    box-shadow: inset 0 -2px 0 var(--color-primary);
}

.pill input:focus-visible + span {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

/* Date range */

.date-range {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.date-range select,
.date-range input[type="date"],
.sort-field select {
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 0.875rem;
    color: var(--color-text);
    background: var(--color-surface);
}

.date-range select:focus,
.date-range input[type="date"]:focus,
.sort-field select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.date-sep {
    color: var(--color-text-muted);
}

.date-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.date-presets button {
    border: none;
    background: var(--color-bg);
    color: var(--color-text-secondary);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition);
}

.date-presets button:hover {
    background: var(--color-primary-light);
    color: var(--color-primary-hover);
}

/* --- Results --- */

.results {
    transition: opacity 120ms ease;
}

.is-loading .results {
    opacity: 0.55;
}

.results-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: var(--color-primary);
    z-index: 200;
    opacity: 0;
}

.is-loading .results-progress {
    opacity: 1;
    animation: progress 1.2s ease-out forwards;
}

@keyframes progress {
    from { width: 0; }
    to { width: 85%; }
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.results-count {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.results-count strong {
    color: var(--color-text);
    font-size: 1.05rem;
}

.sort-field {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--color-text-secondary);
}

.sort-field select {
    height: 34px;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 0.8rem;
    transition: all var(--transition);
}

.filter-chip:hover {
    border-color: var(--color-danger);
    color: var(--color-danger);
}

.filter-chip-label {
    color: var(--color-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.clear-filters {
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 4px;
}

.results-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    background: var(--color-info-bg);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-bottom: 12px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px 16px;
    flex-wrap: wrap;
}

.card-footer .card-tags {
    margin-top: 0;
}

.card-url {
    color: var(--color-text-muted);
}

.card-url:hover {
    color: var(--color-primary);
}

.content-card h3 a {
    overflow-wrap: anywhere;
}

/* --- LLM badges --- */

.llm-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px 2px 7px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
    cursor: help;
}

.llm-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.llm-badge-compact {
    padding: 0;
    border: none;
    background: none !important;
}

.llm-rewritten { background: var(--color-success-bg); color: var(--color-success); }
.llm-classified { background: var(--color-primary-light); color: var(--color-primary); }
.llm-rejected { background: var(--color-warning-bg); color: var(--color-warning); }
.llm-fallback { background: var(--color-danger-bg); color: var(--color-danger); }
.llm-local { background: var(--color-local-bg); color: var(--color-local); }
.llm-unknown { background: transparent; color: var(--color-text-muted); border-color: var(--color-border); border-style: dashed; }

/* --- Pagination (window) --- */

.pagination {
    flex-wrap: wrap;
}

.pagination a,
.pagination .page-current,
.pagination .page-gap,
.pagination .disabled {
    min-width: 38px;
    text-align: center;
    padding: 7px 12px;
}

.pagination .page-current {
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
}

.pagination .page-gap {
    color: var(--color-text-muted);
    min-width: 20px;
    padding: 7px 2px;
}

.pagination-jump {
    margin-left: 8px;
}

/* --- Detail: header, tabs, panels --- */

.detail-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.detail-domain {
    font-weight: 600;
    color: var(--color-text);
}

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    scroll-margin-top: 80px;
}

.tabs [role="tab"] {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: none;
    background: none;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    white-space: nowrap;
}

.tabs [role="tab"]:hover {
    color: var(--color-text);
}

.tabs [role="tab"][aria-selected="true"] {
    color: var(--color-primary);
    box-shadow: inset 0 -2px 0 var(--color-primary);
}

.tabs [role="tab"]:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
    border-radius: 4px 4px 0 0;
}

.tab-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.tab-dot.llm-rewritten,
.tab-dot.llm-classified,
.tab-dot.llm-rejected,
.tab-dot.llm-fallback,
.tab-dot.llm-local {
    background: none;
    box-shadow: inset 0 0 0 4px currentColor;
}

.code-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.markdown-source {
    background: #0f172a;
    color: #e2e8f0;
    padding: 18px;
    border-radius: var(--radius-sm);
    font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 70vh;
    overflow: auto;
}

.source-link {
    display: block;
    font-size: 0.82rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.source-link svg {
    vertical-align: -1px;
    margin-left: 2px;
}

.side-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.side-description {
    margin-top: 12px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.llm-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.kv {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    font-size: 0.82rem;
    width: 100%;
}

.kv dt {
    color: var(--color-text-secondary);
    font-weight: 500;
}

.kv dd {
    color: var(--color-text);
    overflow-wrap: anywhere;
    text-align: right;
}

.version-list a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.version-current a {
    color: var(--color-text);
}

/* --- LLM panel --- */

.llm-panel {
    font-size: 0.9rem;
}

.callout {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    line-height: 1.55;
    margin-bottom: 16px;
}

.callout-muted {
    background: var(--color-bg);
    color: var(--color-text-secondary);
}

.callout-warning {
    background: var(--color-warning-bg);
    color: #92400e;
    border: 1px solid #fde68a;
}

.llm-outcome {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    color: var(--color-text-secondary);
    line-height: 1.55;
}

.llm-outcome-rewritten { border-left-color: var(--color-success); }
.llm-outcome-classified { border-left-color: var(--color-primary); }
.llm-outcome-rejected { border-left-color: var(--color-warning); }
.llm-outcome-fallback { border-left-color: var(--color-danger); }
.llm-outcome-local { border-left-color: var(--color-local); }

.panel-heading {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin: 24px 0 10px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--color-border);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.stat-grid > div {
    background: var(--color-surface);
    padding: 10px 12px;
}

.stat-grid dt {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.stat-grid dd {
    font-weight: 600;
    color: var(--color-text);
    overflow-wrap: anywhere;
}

.panel-footnote {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-top: 8px;
}

.compare-table th[scope="row"] {
    vertical-align: top;
    font-size: 0.8rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--color-text);
    background: none;
    white-space: nowrap;
}

.compare-table td {
    vertical-align: top;
}

.tag {
    display: inline-block;
    padding: 1px 8px;
    margin: 0 4px 4px 0;
    border-radius: 4px;
    background: var(--color-bg);
    font-size: 0.78rem;
    line-height: 1.6;
}

.tag-nlp { background: #f3f4f6; color: #4b5563; }
.tag-llm { background: var(--color-primary-light); color: var(--color-primary-hover); }
.tag-local { background: var(--color-local-bg); color: var(--color-local); }

.source-tag {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 1px 6px;
    border-radius: 4px;
    margin-top: 2px;
}

.source-llm { color: var(--color-primary); border: 1px solid #c7d2fe; }
.source-nlp { color: var(--color-text-secondary); border: 1px solid var(--color-border); }
.source-local { color: var(--color-local); border: 1px solid var(--color-local-border); }

.ratio-bar {
    height: 6px;
    background: var(--color-bg);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
}

.ratio-bar span {
    display: block;
    height: 100%;
    background: var(--color-primary);
    border-radius: 3px;
}

/* --- Footer --- */

.footer {
    text-align: center;
    padding: 24px 0;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--color-border);
}

/* --- Responsive --- */

/* --- LLM usage --- */

.usage-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.usage-header .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.usage-filters {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.usage-filter-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.usage-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.usage-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.usage-chip {
    position: relative;
    cursor: pointer;
}

.usage-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.usage-chip span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-surface);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.usage-chip:hover span {
    border-color: var(--color-primary);
    color: var(--color-text);
}

.usage-chip input:checked + span {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
    color: var(--color-primary-hover);
}

.usage-chip input:focus-visible + span {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.usage-off {
    font-style: normal;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.usage-note {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--color-text-muted);
    text-transform: none;
    letter-spacing: 0;
}

.usage-stats {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 8px;
}

.usage-stat .stat-value {
    font-variant-numeric: tabular-nums;
}

.usage-delta {
    margin-top: 2px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    font-variant-numeric: tabular-nums;
}

.usage-delta span {
    font-weight: 400;
    color: var(--color-text-muted);
}

.usage-footnote {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 24px;
}

.usage-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 16px 20px 20px;
    margin-bottom: 20px;
    min-width: 0;
}

.usage-card-flush {
    padding: 0;
}

.usage-local {
    border-left: 4px solid var(--color-local);
}

.usage-local-summary {
    font-size: 0.95rem;
    color: var(--color-text);
    margin-bottom: 6px;
}

.usage-local-summary strong {
    font-variant-numeric: tabular-nums;
}

.usage-card-flush .usage-card-head {
    padding: 16px 20px 12px;
    margin: 0;
}

.usage-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.usage-card-head h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

.usage-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.usage-controls label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.usage-controls select {
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 0.85rem;
    color: var(--color-text);
    background: var(--color-surface);
}

.usage-chart {
    position: relative;
    height: 220px;
}

.usage-chart-tall {
    height: 340px;
}

.usage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.usage-grid .usage-card {
    margin-bottom: 20px;
}

.usage-table-scroll {
    overflow-x: auto;
}

.usage-table th.num,
.usage-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.usage-table tfoot th {
    border-top: 1px solid var(--color-border);
    border-bottom: none;
}

.usage-table td:nth-child(-n+3) {
    white-space: nowrap;
}

.usage-empty-row td {
    color: var(--color-text-muted);
}

.usage-details summary {
    cursor: pointer;
    list-style: none;
}

.usage-details summary::-webkit-details-marker {
    display: none;
}

.usage-details summary h2::before {
    content: "▸ ";
    color: var(--color-text-muted);
}

.usage-details[open] summary h2::before {
    content: "▾ ";
}

.usage-empty {
    text-align: center;
    color: var(--color-text-secondary);
    padding: 40px 20px;
}

@media (max-width: 768px) {
    .usage-header {
        flex-direction: column;
    }

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

    .stats-row.usage-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .usage-stat {
        padding: 14px;
    }

    .usage-chart-tall {
        height: 280px;
    }
}

@media (max-width: 960px) {
    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .filter-toggle {
        display: inline-flex;
        flex-shrink: 0;
        padding: 9px 12px;
    }

    .filter-panel {
        padding: 12px;
    }

    .filter-grid {
        display: none;
        grid-template-columns: 1fr;
    }

    .filter-panel.is-open .filter-grid {
        display: grid;
    }

    .filter-dates {
        grid-column: auto;
    }

    .date-range select {
        flex: 1 0 100%;
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-grid > div:last-child:nth-child(odd) {
        grid-column: span 2;
    }

    .date-range input[type="date"] {
        flex: 1;
        min-width: 0;
    }

    .search-hint {
        display: none;
    }

    .card-header {
        flex-wrap: wrap;
        gap: 6px;
    }

    .card-header-left {
        flex-wrap: wrap;
    }

    .pagination-jump {
        display: none;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--color-nav);
        flex-direction: column;
        padding: 8px 16px 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .nav-links.nav-open {
        display: flex;
    }

    .mobile-toggle {
        display: block;
    }

    /* Sul telefono il menu utente e' solo l'avatar, accanto al toggle. */
    .user-menu {
        margin-left: auto;
        margin-right: 4px;
    }

    .user-menu-text,
    .user-menu-chevron {
        display: none;
    }

    .navbar {
        position: relative;
    }

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

    .detail-sidebar {
        position: static;
    }

    .detail-main {
        padding: 20px;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* Promemoria del classificatore locale (scraper/ml/reminder.py) */
.nav-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 4px;
    border-radius: 50%;
    vertical-align: top;
}
.nav-dot-critical { background: var(--color-danger); }
.nav-dot-warning { background: var(--color-warning); }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.usage-reminder { border-left: 4px solid var(--color-info); }
.usage-reminder-critical { border-left-color: var(--color-danger); }
.usage-reminder-warning { border-left-color: var(--color-warning); }
.reminder-reasons {
    margin: 0.5rem 0;
    padding-left: 0;
    list-style: none;
}
.reminder-reasons li {
    margin: 0.35rem 0;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    background: var(--color-info-bg);
}
.reminder-reasons li.reminder-critical { background: var(--color-danger-bg); }
.reminder-reasons li.reminder-warning { background: var(--color-warning-bg); }
.reminder-level {
    display: inline-block;
    min-width: 4.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-text-secondary);
}
.reminder-howto summary { cursor: pointer; font-weight: 500; }
.reminder-howto ol { margin: 0.5rem 0 0.5rem 1.2rem; }
.reminder-howto code { word-break: break-word; }

