:root {
  color-scheme: light dark;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1c2128;
  --muted: #5b6673;
  --border: #d5dae1;
  --accent: #1f5fbf;
  --accent-text: #ffffff;
  --alert-bg: #fdecea;
  --alert-text: #8a1f17;
  --ok-bg: #e6f4ea;
  --ok-text: #1a6333;
  --warn-bg: #fff4d6;
  --warn-text: #6b4e00;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171b;
    --surface: #1e2329;
    --text: #e6e9ed;
    --muted: #9aa5b1;
    --border: #39414b;
    --accent: #6ea3f0;
    --accent-text: #0f1317;
    --alert-bg: #43201d;
    --alert-text: #ffc9c3;
    --ok-bg: #1b3a26;
    --ok-text: #b4e6c4;
    --warn-bg: #40340f;
    --warn-text: #ffe39a;
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

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

h1 { font-size: 1.4rem; margin: 0 0 .75rem; }
a { color: var(--accent); }
small { display: block; color: var(--muted); font-size: .85rem; }

input[type="text"], input[type="password"], select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: inherit;
  font: inherit;
  min-height: 40px;
  padding: 6px 10px;
  width: 100%;
}

button {
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent-text);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  min-height: 40px;
  padding: 6px 16px;
}

button.quiet { background: transparent; border-color: var(--border); color: var(--text); font-weight: 400; }

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

.visually-hidden {
  border: 0; clip-path: inset(50%); height: 1px; margin: -1px;
  overflow: hidden; padding: 0; position: absolute; white-space: nowrap; width: 1px;
}

.centered { align-items: flex-start; display: flex; justify-content: center; padding: 10vh 16px 32px; min-height: 100%; height: auto; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 24px; width: 100%; max-width: 640px; }
.card.narrow { max-width: 400px; }
.card.message { margin: 10vh auto; width: calc(100% - 32px); }
.card-head { align-items: center; display: flex; gap: 16px; justify-content: space-between; margin-bottom: 12px; }
.card-head h1 { margin: 0; }

.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.address { display: flex; flex: 1 1 240px; gap: 8px; min-width: 0; }
.note { color: var(--muted); font-size: .9rem; margin-bottom: 0; }

.alert, .success { border-radius: 6px; padding: 8px 12px; }
.alert { background: var(--alert-bg); color: var(--alert-text); }
.success { background: var(--ok-bg); color: var(--ok-text); }

fieldset { border: 1px solid var(--border); border-radius: 8px; margin: 0; padding: 8px 14px 12px; }
legend { color: var(--muted); font-size: .85rem; font-weight: 600; padding: 0 6px; }
.check { align-items: flex-start; display: flex; gap: 10px; padding: 6px 0; }
.check input { margin-top: 5px; }

.links { align-items: center; display: flex; gap: 12px; white-space: nowrap; }

.shell { display: flex; flex-direction: column; overflow: hidden; }
.bar { align-items: center; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 8px 16px; }
.brand { color: var(--text); font-weight: 700; text-decoration: none; }
.badge { background: var(--warn-bg); border-radius: 999px; color: var(--warn-text); font-size: .8rem; padding: 2px 10px; white-space: nowrap; }
.content { background: #ffffff; border: 0; display: block; flex: 1 1 auto; min-height: 0; width: 100%; }
