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

:root {
    --bg: #f8f9fa;
    --surface: #ffffff;
    --border: #dee2e6;
    --text: #212529;
    --text-muted: #6c757d;
    --accent: #1a6e3c;
    --accent-hover: #145c31;
    --mono: "Courier New", Courier, monospace;
    --radius: 6px;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: var(--accent);
    color: #fff;
    padding: 0.9rem 1.5rem;
}

.header-inner {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.org { font-size: 1.1rem; font-weight: 600; }
.asn { font-size: 0.85rem; opacity: 0.75; }

main { flex: 1; padding: 2rem 1rem; }

.container {
    max-width: 860px;
    margin: 0 auto;
}

h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.subtitle { color: var(--text-muted); margin-bottom: 1.75rem; font-size: 0.95rem; }

form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.field { display: flex; flex-direction: column; gap: 0.35rem; }

label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

input, select {
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    width: 100%;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(26, 110, 60, 0.15);
}

.actions { display: flex; align-items: center; gap: 1rem; }

button {
    padding: 0.6rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

button:hover { background: var(--accent-hover); }

.spinner {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: none;
}

.htmx-request .spinner { display: inline; }
.htmx-request button { opacity: 0.6; pointer-events: none; }

/* Result */
#result { margin-top: 1.5rem; }

.result-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.result-meta {
    background: var(--accent);
    color: #fff;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    display: flex;
    gap: 1rem;
    align-items: baseline;
}

.result-device { font-weight: 600; }
.result-query { opacity: 0.8; }

.result-cmd {
    padding: 0.4rem 1rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    background: #f0f4f0;
    color: var(--accent);
    border-top: 1px solid var(--border);
}

.result-output {
    padding: 1rem;
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
    border-top: 1px solid var(--border);
}

.error {
    background: #fff5f5;
    border: 1px solid #fcc;
    border-radius: var(--radius);
    padding: 1rem;
    color: #c00;
    font-size: 0.95rem;
}

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