/* ── Design tokens (from andrsn) ────────────────────────── */
:root {
    --fs-micro: 9px;
    --fs-small: 10px;
    --fs-body: 11px;
    --fs-emphasis: 12px;
    --fs-large: 13px;

    --surface-page: #f7f7f7;
    --surface-card: #fff;
    --surface-tint: #f8f9fa;
    --surface-hover: #e6f0ff;

    --border-default: #ddd;
    --border-card: #e6eef8;
    --border-input: #ccc;

    --text-primary: #222;
    --text-secondary: #555;
    --text-muted: #888;

    --accent-action: #ff8c00;
    --accent-danger: #c23f3f;
    --accent-success: #2d8a4e;

    --radius-sm: 3px;
    --radius-md: 6px;

    --color-person: #4a90d9;
    --color-organization: #d94a4a;
    --color-event: #d9a34a;
    --color-place: #4ad99a;
    --color-program: #9a4ad9;
    --color-artwork: #d94a9a;
    --color-date: #888;
}

body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    background: var(--surface-page);
    color: var(--text-primary);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* ── Header bar ────────────────────────────────────────── */
.header-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    height: 2em;
    padding: 0 1em;
    background: #f4f6fa;
    border-bottom: 1px solid #c0c6d0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1em;
    width: 100%;
}

.app-title {
    font-size: var(--fs-emphasis);
    font-weight: 600;
    color: var(--text-primary);
}

.header-status {
    font-size: var(--fs-small);
    color: var(--text-muted);
}

.entry-count {
    font-size: var(--fs-micro);
    color: var(--text-muted);
    background: var(--surface-tint);
    padding: 0.1em 0.4em;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
}

.user-info-container {
    display: flex;
    align-items: center;
    gap: 0.4em;
    margin-left: auto;
}

.user-email {
    font-size: 0.7em;
    color: #999;
    max-width: 10em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-btn {
    padding: 0.15em 0.5em;
    font-size: 0.7em;
    background: #fff;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
}

.logout-btn:hover {
    background: var(--accent-danger);
    color: #fff;
    border-color: var(--accent-danger);
}

/* ── Navigation ────────────────────────────────────────── */
.app-nav {
    display: flex;
    background: #e8e8e8;
    height: 2em;
    align-items: stretch;
    position: fixed;
    top: 2em;
    left: 0;
    right: 0;
    z-index: 101;
}

.app-nav-btn {
    flex: 1;
    text-align: center;
    background: transparent;
    border: none;
    border-right: 1px solid #d0d0d0;
    color: #555;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    padding: 0 1em;
    transition:
        background 0.15s,
        color 0.15s;
    white-space: nowrap;
}

.app-nav-btn:last-child {
    border-right: none;
}
.app-nav-btn:hover {
    background: #f0f0f0;
    color: #222;
}
.app-nav-btn.active {
    background: #fff;
    color: #111;
}

/* ── Main container ────────────────────────────────────── */
.main-container {
    position: fixed;
    top: 4em;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.tab-content {
    display: none;
    height: 100%;
}

.tab-content.active {
    display: block;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
    padding: 0.35em 0.8em;
    font-size: var(--fs-small);
    font-weight: 600;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--surface-card);
    color: var(--text-primary);
    transition: background 0.15s;
}

.btn:hover {
    background: var(--surface-hover);
}
.btn:disabled {
    opacity: 0.4;
    cursor: default;
}

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

.btn-primary:hover {
    background: #e67e00;
}
.btn-primary:disabled {
    background: #ccc;
    border-color: #ccc;
}

.btn-small {
    padding: 0.2em 0.5em;
    font-size: var(--fs-micro);
}

/* ── Forms ─────────────────────────────────────────────── */
.form-group {
    margin-bottom: 0.6em;
}

.form-group label {
    display: block;
    font-size: var(--fs-small);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.2em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.4em;
    font-size: var(--fs-body);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    box-sizing: border-box;
    font-family: inherit;
}

.form-group textarea {
    min-height: 6em;
    resize: vertical;
}

/* ── Preview panels (shared) ───────────────────────────── */
.preview-header {
    padding: 0.4em 0.8em;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    flex: 0 0 auto;
}

.preview-body {
    flex: 1 1 0;
    overflow-y: auto;
    padding: 0.8em;
    font-size: var(--fs-body);
    line-height: 1.5;
}

/* ── Map tab: two-pane (andrsn pattern) ────────────────── */
.map-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    height: 100%;
}

.map-pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.map-header {
    padding: 0.4em 0.8em;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
}

.map-controls {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.map-select {
    font-size: var(--fs-micro);
    padding: 0.15em 0.3em;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
}

.map-svg-container {
    flex: 1 1 0;
    position: relative;
    background: #fafafa;
    overflow: hidden;
}

.map-svg-container svg {
    width: 100%;
    height: 100%;
}

.map-side-pane {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-default);
    overflow: hidden;
}

/* Map dots */
.map-dot {
    cursor: pointer;
    transition: r 0.1s;
}

.map-dot:hover {
    r: 5;
}

.map-dot.pinned {
    stroke: #222;
    stroke-width: 1.5;
    r: 4.5;
}

/* Map tooltip */
.map-tooltip {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 0.3em 0.5em;
    font-size: var(--fs-micro);
    pointer-events: none;
    z-index: 10;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Entity badges ─────────────────────────────────────── */
.entity-badge {
    display: inline-block;
    padding: 0.15em 0.5em;
    font-size: var(--fs-micro);
    border-radius: var(--radius-sm);
    margin: 0.1em;
    font-weight: 600;
}

.entity-badge[data-type="person"] {
    background: #e8f0fe;
    color: var(--color-person);
    border: 1px solid var(--color-person);
}
.entity-badge[data-type="organization"] {
    background: #fee8e8;
    color: var(--color-organization);
    border: 1px solid var(--color-organization);
}
.entity-badge[data-type="event"] {
    background: #fef3e8;
    color: #b8860b;
    border: 1px solid var(--color-event);
}
.entity-badge[data-type="place"] {
    background: #e8fef0;
    color: #2d7a4e;
    border: 1px solid var(--color-place);
}
.entity-badge[data-type="program"] {
    background: #f0e8fe;
    color: var(--color-program);
    border: 1px solid var(--color-program);
}
.entity-badge[data-type="artwork"] {
    background: #fee8f0;
    color: var(--color-artwork);
    border: 1px solid var(--color-artwork);
}
.entity-badge[data-type="date"] {
    background: #f0f0f0;
    color: var(--color-date);
    border: 1px solid #ccc;
}

.entity-badge-clickable {
    transition:
        transform 0.1s ease,
        box-shadow 0.1s ease;
}

.entity-badge-clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    filter: brightness(0.95);
}

.ddg-search {
    margin-left: 0.3em;
    text-decoration: none;
    font-size: 0.85em;
    opacity: 0.5;
    transition: opacity 0.15s;
}
.ddg-search:hover {
    opacity: 1;
}

/* ── Entry cards in preview ────────────────────────────── */
.preview-entry {
    padding: 0.5em;
    border-bottom: 1px solid #eee;
}

.preview-entry:last-child {
    border-bottom: none;
}

.preview-entry-title {
    font-size: var(--fs-small);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2em;
}

.preview-entry-url {
    font-size: var(--fs-micro);
    color: var(--color-person);
    word-break: break-all;
}

.preview-entry-text {
    font-size: var(--fs-body);
    color: var(--text-secondary);
    margin-top: 0.3em;
    line-height: 1.5;
}

.preview-entry-entities {
    margin-top: 0.4em;
    display: flex;
    flex-wrap: wrap;
    gap: 0.15em;
}

/* ── Links list in ingest preview ──────────────────────── */
.links-section {
    margin-top: 0.8em;
    border-top: 1px solid #eee;
    padding-top: 0.5em;
}

.link-item {
    font-size: var(--fs-micro);
    padding: 0.15em 0;
    color: var(--text-secondary);
}

.link-item a {
    color: var(--color-person);
    text-decoration: none;
}

.link-item a:hover {
    text-decoration: underline;
}

/* ── Entries tab: two-pane ──────────────────────────────── */
.entries-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    height: 100%;
}

.entries-list-pane {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-default);
    overflow: hidden;
}

.entries-detail-pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.entry-item {
    padding: 0.5em 0.8em;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.entry-item:hover {
    background: var(--surface-hover);
}

/* ── Fetch link button ─────────────────────────────────── */
.btn-fetch-link {
    width: 18px;
    height: 18px;
    padding: 0;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--surface-card);
    color: var(--accent-action);
    cursor: pointer;
    flex: 0 0 18px;
}

.btn-fetch-link:hover {
    background: var(--accent-action);
    color: #fff;
    border-color: var(--accent-action);
}

.btn-fetch-link:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ── Login screen ──────────────────────────────────────── */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    flex-direction: column;
    gap: 1em;
}

.login-screen h1 {
    font-size: 1.5em;
    color: var(--text-primary);
    font-weight: 300;
}

.login-screen .subtitle {
    font-size: var(--fs-body);
    color: var(--text-muted);
}

/* ── Loading spinner ───────────────────────────────────── */
.loading {
    color: var(--text-muted);
    font-size: var(--fs-small);
    font-style: italic;
}

/* ── Upload tab ────────────────────────────────────────── */
.upload-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    height: 100%;
}

.upload-left-pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border-default);
}

.upload-right-pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: background 0.2s ease;
}

.upload-right-pane.drag-over {
    background: #f0f8ff;
}

.upload-right-pane.drag-over::before {
    content: "Drop files here";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.1);
    border: 3px dashed #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: 600;
    color: #3b82f6;
    z-index: 1000;
    pointer-events: none;
}

.upload-controls {
    padding: 0.8em;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 0.5em;
    flex: 0 0 auto;
}

.upload-file-list {
    flex: 1 1 0;
    overflow-y: auto;
    padding: 0.8em;
}

.upload-file-chip {
    padding: 0.5em 0.8em;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5em;
    background: var(--surface-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.15s;
}

.upload-file-chip:hover {
    background: var(--surface-hover);
}

.upload-progress {
    padding: 0.8em;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    flex: 0 0 auto;
}

.upload-progress.hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 0.4em;
}

.progress-fill {
    height: 100%;
    background: var(--accent-action);
    transition: width 0.3s ease;
    width: 0%;
}

/* ── Research tab ───────────────────────────────────────── */
.research-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    height: 100%;
}

.research-left-pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border-default);
}

.research-right-pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.research-controls {
    padding: 0.8em;
    overflow-y: auto;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 0.6em;
}

.research-output {
    flex: 1 1 0;
    width: 100%;
    border: none;
    padding: 0.8em;
    font-family: monospace;
    font-size: var(--fs-body);
    line-height: 1.5;
    resize: none;
    box-sizing: border-box;
    background: var(--surface-card);
}

.research-output:focus {
    outline: none;
}

.research-row {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.research-section {
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 0.5em;
}

.research-keys-form {
    margin-top: 0.5em;
    display: flex;
    flex-direction: column;
    gap: 0.4em;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
    .map-layout,
    .entries-layout,
    .upload-layout,
    .research-layout,
    .discover-layout {
        grid-template-columns: 1fr;
    }

    .map-side-pane,
    .upload-left-pane {
        border: none;
    }

    .app-nav-btn {
        font-size: 0.75em;
        padding: 0 0.5em;
    }
}

/* ── Utilities ─────────────────────────────────────────── */
.flex {
    display: flex;
}
.flex-wrap {
    flex-wrap: wrap;
}
.gap-sm {
    gap: 0.3em;
}
.gap-md {
    gap: 0.6em;
}
.mt-sm {
    margin-top: 0.3em;
}
.mt-md {
    margin-top: 0.6em;
}
.mb-sm {
    margin-bottom: 0.3em;
}
.mb-md {
    margin-bottom: 0.6em;
}
.text-muted {
    color: var(--text-muted);
}
.text-small {
    font-size: var(--fs-small);
}
.text-micro {
    font-size: var(--fs-micro);
}
.hidden {
    display: none !important;
}

/* ── Graph tab ─────────────────────────────────────────── */
.graph-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0;
    height: 100%;
}

.graph-pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.graph-header {
    padding: 0.4em 0.8em;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
}

.graph-controls {
    display: flex;
    align-items: center;
    gap: 0.5em;
    flex-wrap: wrap;
}

.graph-svg-container {
    flex: 1 1 0;
    position: relative;
    background: #fafafa;
    overflow: hidden;
}

.graph-svg-container svg {
    width: 100%;
    height: 100%;
}

.graph-side-pane {
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-default);
    overflow: hidden;
}

/* Graph nodes */
.graph-node {
    cursor: pointer;
}

.graph-node text {
    font-size: 8px;
    fill: var(--text-secondary);
    pointer-events: none;
    user-select: none;
}

.graph-node.selected circle {
    stroke: #222;
    stroke-width: 2;
}

/* Graph edges */
.graph-edge {
    stroke-opacity: 0.4;
}

.graph-edge.highlighted {
    stroke-opacity: 1;
    stroke-width: 2 !important;
}

/* Graph tooltip */
.graph-tooltip {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 0.3em 0.5em;
    font-size: var(--fs-micro);
    pointer-events: none;
    z-index: 10;
    max-width: 250px;
}

/* Graph legend */
.graph-legend {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 0.5em;
    font-size: var(--fs-micro);
}

.graph-legend-item {
    display: flex;
    align-items: center;
    gap: 0.3em;
    margin-bottom: 0.2em;
}

.graph-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.graph-merge-bar {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.4em 0.8em;
    background: #fff8e1;
    border: 1px solid #ffcc02;
    border-radius: 4px;
    font-size: var(--fs-micro);
    margin-top: 0.3em;
}
.graph-merge-bar.hidden {
    display: none;
}

/* Responsive: stack graph layout on mobile */
@media (max-width: 768px) {
    .graph-layout {
        grid-template-columns: 1fr;
    }
}

/* Connection lines (for Map tab) */
.connection-line {
    pointer-events: none;
}

/* Help button */
.help-btn {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    margin: 0 0.5em;
}

.help-btn:hover {
    background: var(--surface-tint);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: var(--radius-md);
    max-width: 700px;
    max-height: 85vh;
    width: 90%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 1em 1.5em;
    border-bottom: 1px solid var(--border-default);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: var(--fs-large);
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 32px;
    height: 32px;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5em;
    overflow-y: auto;
    flex: 1;
}

.modal-body h3 {
    margin: 1.5em 0 0.5em 0;
    font-size: var(--fs-emphasis);
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body p {
    margin: 0.5em 0;
    line-height: 1.5;
    color: var(--text-primary);
}

.modal-body pre {
    background: var(--surface-tint);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 0.75em;
    overflow-x: auto;
    margin: 0.5em 0;
}

.modal-body code {
    font-family: "Courier New", monospace;
    font-size: var(--fs-small);
    color: var(--text-primary);
}

.modal-body ul {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.modal-body li {
    margin: 0.3em 0;
    line-height: 1.5;
    color: var(--text-primary);
}

/* ── Discover tab ──────────────────────────────────────── */
.discover-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    height: 100%;
}

.discover-left-pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border-default);
}

.discover-right-pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.discover-controls {
    padding: 0.8em;
    overflow-y: auto;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 0.4em;
}

.discover-person-item {
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    margin-bottom: 0.4em;
}

.discover-person-header {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.4em 0.6em;
    cursor: pointer;
    user-select: none;
}

.discover-person-header:hover {
    background: var(--surface-tint);
}

.discover-person-name {
    flex: 1;
    font-size: var(--fs-small);
    font-weight: 600;
}

.discover-person-status {
    font-size: var(--fs-micro);
    color: var(--text-muted);
}

.discover-results {
    border-top: 1px solid var(--border-default);
    padding: 0.4em 0.6em;
}

.discover-result-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5em;
    padding: 0.4em 0;
    border-bottom: 1px solid #f0f0f0;
}

.discover-result-item:last-child {
    border-bottom: none;
}

.discover-result-info {
    flex: 1;
    min-width: 0;
}

.discover-result-title {
    font-size: var(--fs-small);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.discover-result-url {
    font-size: var(--fs-micro);
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.discover-result-snippet {
    font-size: var(--fs-micro);
    color: var(--text-secondary);
    margin-top: 0.2em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.discover-result-actions {
    display: flex;
    gap: 0.3em;
    flex-shrink: 0;
}

.discover-cv-score {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: var(--fs-micro);
    font-weight: 600;
    color: white;
}

.discover-cv-score.high {
    background: #2ecc71;
}
.discover-cv-score.medium {
    background: #f39c12;
}
.discover-cv-score.low {
    background: #95a5a6;
}

.discover-pdf-badge {
    display: inline-block;
    background: #c0392b;
    color: #fff;
    font-size: 0.7em;
    font-weight: 700;
    padding: 0.1em 0.4em;
    border-radius: 3px;
    vertical-align: middle;
}

.discover-drilldown {
    padding: 0.4em 0.6em;
    border-top: 1px solid var(--border-default);
}

.discover-link-item {
    display: flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.2em 0;
    font-size: var(--fs-micro);
    cursor: pointer;
}

.discover-link-item:hover {
    background: var(--surface-tint);
}

.discover-link-num {
    color: var(--text-muted);
    width: 2em;
    text-align: right;
    flex-shrink: 0;
}

.discover-link-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-person);
}
