:root {
    --bg: #0d1117;
    --surface: #161b22;
    --border: #30363d;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --accent: #58a6ff;
    --green: #3fb950;
    --red: #f85149;
    --orange: #d29922;
    --purple: #bc8cff;
    --source-mcp: #58a6ff;
    --source-erc: #3fb950;
    --source-bazaar: #d29922;
    --source-manual: #f85149;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

header h1 {
    font-size: 20px;
    font-weight: 600;
}

header .last-scan {
    color: var(--text-muted);
    font-size: 14px;
}

.intro {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.intro a {
    color: var(--accent);
    text-decoration: none;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
    text-align: center;
}

.stat-card .number {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
}

.stat-card .label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.source-dist {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 24px;
}

.source-dist h3 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.source-bars {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.source-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.source-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}

.source-dot.mcp-registry { background: var(--source-mcp); }
.source-dot.erc8004 { background: var(--source-erc); }
.source-dot.bazaar { background: var(--source-bazaar); }
.source-dot.manual { background: var(--source-manual); }

.search-bar {
    margin-bottom: 16px;
}

.search-bar input {
    width: 100%;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.search-bar input:focus {
    border-color: var(--accent);
}

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

.endpoint-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.endpoint-table th {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
}

.endpoint-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.endpoint-table tr:hover {
    background: rgba(88, 166, 255, 0.04);
}

.endpoint-table .url {
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.endpoint-table .protocol {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

.protocol.mcp { background: rgba(88, 166, 255, 0.15); color: var(--accent); }
.protocol.a2a { background: rgba(188, 140, 255, 0.15); color: var(--purple); }

.source-tags {
    display: flex;
    gap: 4px;
}

.source-tag {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
}

.check-yes { color: var(--green); }
.check-no { color: var(--text-muted); }

.detail-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 16px;
}

.detail-link:hover {
    color: var(--accent);
}

/* Detail View */
.detail-view {
    display: none;
}

.detail-view.active {
    display: block;
}

.overview-view.hidden {
    display: none;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    display: inline-block;
    margin-bottom: 16px;
}

.back-link:hover {
    color: var(--accent);
}

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

.detail-header .endpoint-url {
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 18px;
    margin-bottom: 8px;
    word-break: break-all;
}

.detail-header .meta {
    display: flex;
    gap: 16px;
    color: var(--text-muted);
    font-size: 14px;
}

.detail-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
}

.detail-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.detail-source {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 8px;
}

.detail-source .source-type {
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-source .field {
    display: flex;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 4px;
}

.detail-source .field .label {
    color: var(--text-muted);
    min-width: 120px;
}

.probe-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.probe-category {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.probe-summary .field {
    display: flex;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 4px;
}

.probe-summary .field .label {
    color: var(--text-muted);
    min-width: 140px;
}

.legend {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .endpoint-table .url {
        max-width: 200px;
    }
}

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