:root {
    --fg: #1d2330;
    --muted: #6b7280;
    --line: #e5e7eb;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --danger: #b91c1c;
    --danger-hover: #991b1b;
    --ok-bg: #ecfdf5;
    --err-bg: #fef2f2;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: var(--fg);
}

body { margin: 0; background: #f8fafc; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
.muted { color: var(--muted); font-weight: normal; }

.top { display: flex; align-items: center; gap: 2rem; padding: .75rem 1.5rem; background: #fff; border-bottom: 1px solid var(--line); }
.top .brand { font-weight: 700; color: var(--fg); }
.top nav { display: flex; gap: 1rem; flex: 1; }
.top nav a.active { font-weight: 600; text-decoration: underline; }
.top .user { display: flex; gap: .75rem; align-items: center; }
.top form { margin: 0; }

main { padding: 1.5rem; max-width: 1400px; }

table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); }
th, td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f1f5f9; font-weight: 600; }
tr.blocked td { background: var(--err-bg); }
code { font-size: .8rem; white-space: pre-wrap; word-break: break-all; }

.filters, .actions, .inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 1rem; }
.actions form, .inline { margin: 0; }
input, select { padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 4px; font: inherit; min-width: 9rem; }
button { position: relative; padding: .4rem .8rem; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 4px; cursor: pointer; font: inherit; transition: background-color .15s, opacity .15s, transform .05s; }
button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button:active { transform: translateY(1px); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.danger { background: var(--danger); border-color: var(--danger); }
button.danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
button.link { background: none; border: none; color: var(--accent); padding: 0; }
button.link:hover { background: none; text-decoration: underline; }
button:disabled, button[aria-disabled=true] { opacity: .55; cursor: progress; transform: none; }
form[aria-busy=true] { pointer-events: none; }
form[aria-busy=true] :is(input, select, textarea) { opacity: .7; }
button.loading { color: transparent; }
button.loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 1em; height: 1em; border: 2px solid #fff; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
button.link.loading::after { border-color: var(--accent); border-right-color: transparent; }

html.busy, html.busy * { cursor: progress; }
html.busy body::before { content: ""; position: fixed; top: 0; left: 0; z-index: 1000; height: 3px; width: 40%; background: var(--accent); animation: busy 1.1s ease-in-out infinite; }
@keyframes busy { from { left: -40%; } to { left: 100%; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    html.busy body::before { left: 0; width: 100%; animation: none; opacity: .6; }
    button.loading::after { animation-duration: 2s; }
}

.props { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.5rem; margin: 0 0 1rem; }
.props dt { color: var(--muted); }
.props dd { margin: 0; }
.props-inline { margin: 0; font-size: .9rem; gap: .15rem .75rem; }
.notice { padding: .6rem .8rem; border-radius: 4px; }
.notice.ok { background: var(--ok-bg); }
.notice.error { background: var(--err-bg); color: var(--danger); }
.more { display: inline-block; margin-top: .75rem; }
.map { height: 420px; margin: 0 0 1rem; border: 1px solid var(--line); background: #fff; }
.login { max-width: 32rem; }
.stack { display: flex; flex-direction: column; gap: .75rem; align-items: flex-start; }
.stack label { display: flex; flex-direction: column; gap: .25rem; }
.codes { columns: 2; font-size: 1rem; }
.qr { display: block; max-width: 100%; margin: 0 0 1rem; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 4px; image-rendering: pixelated; }
.manual { margin: 0 0 1rem; }
.manual summary { cursor: pointer; color: var(--accent); margin-bottom: .5rem; }
.news-form { max-width: 48rem; }
.news-form fieldset { display: flex; flex-direction: column; gap: .5rem; width: 100%; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.news-form label { width: 100%; }
.news-form textarea { padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 4px; font: inherit; }
