:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5f6673;
  --border: #e3e6eb;
  --accent: #2f6fed;
  --accent-text: #ffffff;
  --ok: #1f9d55;
  --radius: 10px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #1a1d23;
    --text: #eceef2;
    --muted: #9aa2af;
    --border: #2a2e36;
    --accent: #5b8cff;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px max(16px, calc((100vw - 960px) / 2));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  color: var(--text);
}
.brand img { width: 24px; height: 24px; }
.brand:hover { text-decoration: none; }

nav { display: flex; gap: 4px; }
nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
}
nav a:hover { background: var(--bg); text-decoration: none; }
nav a.active { color: var(--text); background: var(--bg); }

main {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px;
  outline: none;
}

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

h1 { font-size: 26px; margin: 0 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 0 0 8px; }
.muted { color: var(--muted); }

.button {
  display: inline-block;
  padding: 9px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.button:hover { text-decoration: none; filter: brightness(1.08); }
.button[disabled] { opacity: 0.55; cursor: default; }

.footer {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, #d93025 12%, transparent);
  color: #d93025;
  font-size: 14px;
}
.button.secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
