:root {
  color-scheme: light;
  --background: #edf2f7;
  --surface: #ffffff;
  --text: #182638;
  --muted: #516278;
  --border: #c6d1de;
  --input: #f8fafc;
  --accent: #126954;
  --accent-text: #ffffff;
  --focus: #367ee7;
  --danger: #a6263b;
  --alert-background: #fff0f2;
  --code: #edf2f7;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --background: #101820;
    --surface: #192430;
    --text: #e4ecf5;
    --muted: #abbacd;
    --border: #43556b;
    --input: #121d28;
    --accent: #8bdcc3;
    --accent-text: #102c24;
    --focus: #8cbcff;
    --danger: #ffa1af;
    --alert-background: #35232d;
    --code: #121d28;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #101820;
  --surface: #192430;
  --text: #e4ecf5;
  --muted: #abbacd;
  --border: #43556b;
  --input: #121d28;
  --accent: #8bdcc3;
  --accent-text: #102c24;
  --focus: #8cbcff;
  --danger: #ffa1af;
  --alert-background: #35232d;
  --code: #121d28;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.page { max-width: 860px; margin: 0 auto; padding: 24px; }
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 36px;
}
.brand { font-weight: 750; letter-spacing: -.025em; font-size: 20px; }
.theme-control { display: flex; align-items: center; gap: 10px; color: var(--muted); }
h1, h2, h3 { line-height: 1.3; margin: 0 0 16px; overflow-wrap: anywhere; }
h1 { font-size: clamp(24px, 4vw, 30px); letter-spacing: -.025em; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0 0 20px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(20px, 4vw, 32px);
  margin-bottom: 24px;
}
.login-card { max-width: 540px; margin: 0 auto; }
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
input, select, button { font: inherit; border-radius: 8px; min-height: 44px; }
input, select { color: var(--text); background: var(--input); border: 1px solid var(--border); }
input { padding: 10px 12px; width: 100%; }
input[type="hidden"] { display: none; }
select { padding: 6px 32px 6px 10px; }
button {
  cursor: pointer;
  padding: 9px 18px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 650;
}
button:hover { filter: brightness(.92); }
button.secondary { background: transparent; color: var(--text); border-color: var(--border); }
button.danger { color: var(--danger); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.muted, .note { color: var(--muted); }
.note { font-size: 14px; margin-top: 24px; margin-bottom: 0; }
.alert { background: var(--alert-background); color: var(--danger); padding: 12px; border-radius: 8px; }
code { background: var(--code); border-radius: 5px; padding: 3px 6px; overflow-wrap: anywhere; }
.details { margin: 24px 0; }
.details dt { color: var(--muted); font-size: 14px; }
.details dd { margin: 2px 0 16px; overflow-wrap: anywhere; }
.grant + .grant { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 24px; }
.grant-id { font-size: 14px; font-weight: 400; color: var(--muted); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
@media (max-width: 480px) {
  .page { padding: 16px; }
  .page-header { margin-bottom: 24px; }
  .theme-control { font-size: 14px; }
  .actions button { width: 100%; }
}
