:root {
    --bg: #0f1419;
    --surface: #1a2332;
    --surface-2: #243044;
    --text: #e8edf4;
    --text-muted: #8b9cb3;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --good: #22c55e;
    --medium: #eab308;
    --critical: #ef4444;
    --border: #2d3a4f;
    --radius: 10px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

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

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.site-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f1419 100%);
    border-bottom: 1px solid var(--border);
    padding: 2rem 0;
}

.site-header h1 {
    margin: 0 0 0.25rem;
    font-size: 1.75rem;
    font-weight: 700;
}

.tagline {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

main {
    padding: 2rem 0 3rem;
}

.search-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.url-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.input-row {
    display: flex;
    gap: 0.75rem;
}

.input-row input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

.input-row input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.input-row button,
.btn-secondary {
    padding: 0.75rem 1.25rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.input-row button:hover,
.btn-secondary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.hint {
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.alert {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--critical);
    color: #fca5a5;
}

.rating-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.rating-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-top: 0.35rem;
    flex-shrink: 0;
}

.rating-gut {
    background: rgba(34, 197, 94, 0.12);
    border-color: var(--good);
}

.rating-gut .rating-dot {
    background: var(--good);
    box-shadow: 0 0 12px var(--good);
}

.rating-mittel {
    background: rgba(234, 179, 8, 0.12);
    border-color: var(--medium);
}

.rating-mittel .rating-dot {
    background: var(--medium);
    box-shadow: 0 0 12px var(--medium);
}

.rating-kritisch {
    background: rgba(239, 68, 68, 0.12);
    border-color: var(--critical);
}

.rating-kritisch .rating-dot {
    background: var(--critical);
    box-shadow: 0 0 12px var(--critical);
}

.rating-banner p {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.card h2 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    color: var(--text);
}

.card h3 {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kv-list {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.35rem 1rem;
    margin: 0;
}

.kv-list.compact {
    grid-template-columns: 180px 1fr;
    font-size: 0.9rem;
}

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

.kv-list dd {
    margin: 0;
}

.break-all {
    word-break: break-all;
}

.header-grid {
    display: grid;
    gap: 0.5rem;
}

.header-item {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.header-item.present {
    background: rgba(34, 197, 94, 0.08);
    border-left: 3px solid var(--good);
}

.header-item.missing {
    background: rgba(239, 68, 68, 0.08);
    border-left: 3px solid var(--critical);
}

.header-name {
    font-family: ui-monospace, monospace;
    color: var(--text-muted);
}

.header-value {
    word-break: break-all;
}

.missing-note {
    margin: 1rem 0 0;
    font-size: 0.85rem;
    color: var(--critical);
}

.tag-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-list li {
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
}

.resource-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.resource-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.resource-list li {
    padding: 0.2rem 0;
    border-bottom: 1px solid var(--border);
}

.resource-list .more {
    font-style: italic;
    border: none;
}

.badge {
    font-size: 0.75rem;
    background: var(--surface-2);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: normal;
}

.code-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.8rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
}

.recommendations ol {
    margin: 0;
    padding-left: 1.25rem;
}

.recommendations li {
    margin-bottom: 0.5rem;
}

.export-card .export-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

details {
    margin-bottom: 0.75rem;
}

details summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-top: auto;
}

.site-footer p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 600px) {
    .input-row {
        flex-direction: column;
    }

    .kv-list,
    .header-item {
        grid-template-columns: 1fr;
    }

    .header-item .header-name {
        font-weight: 600;
    }
}