:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5d6470;
  --border: #d9dde3;
  --accent: #2f5bd3;
  --accent-text: #ffffff;
  --accent-soft: #e6ecfb;
  --ok: #1d7a45;
  --ok-soft: #e3f4ea;
  --bad: #b3261e;
  --bad-soft: #fbe7e5;
  --warn: #8a5a00;
  --warn-soft: #fff3d6;
  --radius: 10px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #1b1e24;
    --text: #eceef2;
    --muted: #a1a8b3;
    --border: #343944;
    --accent: #7c9cf5;
    --accent-text: #0d1220;
    --accent-soft: #232c45;
    --ok: #5cc98a;
    --ok-soft: #173325;
    --bad: #f08a82;
    --bad-soft: #3a1c1a;
    --warn: #f0c060;
    --warn-soft: #3a2e12;
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: 40px;
  padding: 0.45em 1em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

.btn-danger {
  color: var(--bad);
  border-color: var(--bad);
}

.muted {
  color: var(--muted);
}

.notice {
  padding: 0.75em 1em;
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.notice-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.notice-bad {
  background: var(--bad-soft);
  color: var(--bad);
}

.notice-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

input[type='text'],
input[type='password'],
input[type='number'],
input[type='datetime-local'],
textarea,
select {
  width: 100%;
  padding: 0.55em 0.7em;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

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

[hidden] {
  display: none !important;
}
