:root {
    --bg: #f7f8fa;
    --panel: #ffffff;
    --text: #1d2330;
    --muted: #5d6677;
    --border: #dde1e8;
    --accent: #1f6feb;
    --high: #c62828;
    --medium: #d97706;
    --low: #4b5563;
    --conflict-bg: #fdecea;
    --conflict: #9b1c1c;
    --ok: #15803d;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14171d;
        --panel: #1c2028;
        --text: #e6e8ec;
        --muted: #9aa3b2;
        --border: #2e3440;
        --accent: #58a6ff;
        --high: #f87171;
        --medium: #fbbf24;
        --low: #9ca3af;
        --conflict-bg: #3b1d1d;
        --conflict: #fca5a5;
        --ok: #4ade80;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

header, main {
    max-width: 920px;
    margin: 0 auto;
    padding: 0 16px;
}

header { padding-top: 40px; }

h1 { margin: 0; font-size: 2rem; }

h2 { font-size: 1.2rem; margin: 28px 0 12px; }

h3 { margin: 0 0 4px; font-size: 1.1rem; }

a { color: var(--accent); }

.tagline { margin: 6px 0 0; font-size: 1.1rem; }

.private { margin: 6px 0 24px; color: var(--ok); font-size: 0.95rem; }

.search {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    align-items: end;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}

.search label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--muted);
}

.search .name { grid-column: 1 / -1; }

.optional { font-size: 0.75rem; opacity: 0.8; }

input, select, button { font: inherit; }

input, select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    min-width: 0;
}

.search .name input { font-size: 1.1rem; }

button {
    cursor: pointer;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    padding: 8px 12px;
}

.search button[type=submit] {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

button:disabled { opacity: 0.6; cursor: progress; }

.examples { color: var(--muted); font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.examples button { font-size: 0.85rem; padding: 4px 10px; border-radius: 999px; }

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

.error { color: var(--conflict); background: var(--conflict-bg); padding: 10px 12px; border-radius: 6px; }

.clear { color: var(--ok); font-weight: 600; }

.match {
    display: flex;
    gap: 16px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.score {
    flex: 0 0 64px;
    height: 64px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff;
}

.score.high { background: var(--high); }
.score.medium { background: var(--medium); }
.score.low { background: var(--low); }

.detail { min-width: 0; flex: 1; }

.detail p { margin: 6px 0; }

.meta { color: var(--muted); font-size: 0.9rem; }

.conflict { color: var(--conflict); background: var(--conflict-bg); padding: 6px 10px; border-radius: 6px; }

table { border-collapse: collapse; width: 100%; margin: 10px 0 4px; font-size: 0.9rem; }

th, td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--border); }

th { color: var(--muted); font-weight: 600; }

.notice, .install {
    margin-top: 28px;
    color: var(--muted);
    font-size: 0.9rem;
}

.install { padding-bottom: 48px; }

pre {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    overflow-x: auto;
    color: var(--text);
}

@media (max-width: 560px) {
    .match { flex-direction: column; }
    .score { flex-basis: auto; width: 64px; }
}

#blazor-error-ui {
    background: lightyellow;
    color: #1d2330;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: var(--border);
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--accent);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }
