:root {
    color-scheme: dark;
    --bg: #14161a;
    --panel: #1d2026;
    --line: #2c313a;
    --text: #e6e8ec;
    --muted: #99a1ae;
    --accent: #4f8cff;
    --error: #ff6b6b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 1.5rem;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1 { font-size: 1.25rem; margin: 0; }
h2 { font-size: 1rem; margin: 0 0 .75rem; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.nav {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.nav a {
    color: var(--muted);
    text-decoration: none;
}

.nav a[aria-current="page"] {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: .25rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.25rem;
    align-items: start;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.25rem;
}

.card--wide { grid-column: 1 / -1; }

.card--narrow {
    max-width: 380px;
    margin: 8vh auto 0;
}

label {
    display: block;
    margin: .9rem 0 .3rem;
    font-size: .85rem;
    color: var(--muted);
}

label.checkbox {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--text);
}

input[type="text"], input[type="password"], input[type="email"] {
    width: 100%;
    padding: .55rem .7rem;
    background: #12141a;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
}

input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button {
    margin-top: 1.1rem;
    padding: .6rem 1.1rem;
    background: var(--accent);
    border: 0;
    border-radius: 6px;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.btn-link {
    margin: 0;
    padding: 0;
    background: none;
    color: var(--muted);
    font-weight: 400;
    text-decoration: underline;
}

.alert {
    padding: .6rem .8rem;
    border-radius: 6px;
    font-size: .9rem;
}

.alert--error {
    background: rgba(255, 107, 107, .12);
    border: 1px solid var(--error);
    color: var(--error);
}

.muted { color: var(--muted); }
.small { font-size: .8rem; }

code {
    background: #12141a;
    padding: .1rem .3rem;
    border-radius: 4px;
    font-size: .85em;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .45rem .3rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .8rem; font-weight: 600; }

.log {
    max-height: 460px;
    overflow: auto;
    padding: .9rem;
    background: #0e1014;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: 12.5px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.log--error { border-color: var(--error); }
