:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #6b6b66;
  --border: #e3e3de;
  --accent: #d99a00;
  --accent-text: #1c1c1a;
  --ok: #2f9e44;
  --warn: #d99a00;
  --error: #c92a2a;
  --off: #a8a8a2;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151514;
    --surface: #1f1f1d;
    --text: #ececea;
    --muted: #9a9a94;
    --border: #33332f;
    --accent: #f2b319;
    --off: #5c5c57;
  }
}

* { box-sizing: border-box; }

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

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand { font-weight: 700; letter-spacing: 0.02em; }
.brand::before { content: "●"; color: var(--accent); margin-right: 8px; }

main { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; }

h1 { font-size: 1.5rem; margin: 0 0 16px; }
h2 { font-size: 1rem; margin: 0 0 8px; }

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
}

.card p { margin: 4px 0; }
.narrow { max-width: 360px; margin: 48px auto; }
.narrow-form { max-width: 420px; }
section.card + section.card { margin-top: 16px; }
.muted { color: var(--muted); font-size: 0.9em; }
.nowrap { white-space: nowrap; }

label { display: block; font-weight: 600; margin: 12px 0 6px; }

input[type=password], input[type=text] {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

button {
  margin-top: 16px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

button.link {
  margin: 0;
  padding: 0;
  background: none;
  color: var(--muted);
  font-weight: 400;
}

button.link:hover { color: var(--text); }
.signout { margin: 0; }

nav { display: flex; align-items: center; gap: 20px; }
nav a, .muted a { color: var(--muted); }
nav a:hover, .muted a:hover { color: var(--text); }

button.danger { color: #fff; background: var(--error); }
code { font-size: 0.95em; }

.alert {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--error);
  border: 1px solid var(--error);
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: 1px;
}

.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.error { background: var(--error); }
.dot.off { background: var(--off); }

table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }

.tag { font-size: 0.8em; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border); }
.tag.warn { color: var(--warn); border-color: var(--warn); }
.tag.error { color: var(--error); border-color: var(--error); }

@media (max-width: 600px) {
  .top { padding: 12px 16px; }
  table { display: block; overflow-x: auto; }
}
