:root {
  --bg: #f6f5f0;
  --card: #ffffff;
  --ink: #182c33;
  --muted: #5e6f74;
  --line: #dce2dd;
  --accent: #17646a;
  --accent-ink: #ffffff;
  --accent-soft: #eaf3ef;
  --warn: #84531c;
  --warn-soft: #fff3df;
  --error: #993f3d;
  --error-soft: #f8e7e5;
  --field: #fafbf7;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111b1f;
    --card: #182429;
    --ink: #e7eeea;
    --muted: #9db0aa;
    --line: #2c3c40;
    --accent: #5fb3a8;
    --accent-ink: #0e1a1d;
    --accent-soft: #1d3436;
    --warn: #e9b56f;
    --warn-soft: #33291a;
    --error: #ec9a93;
    --error-soft: #3a2324;
    --field: #142024;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

main { width: 100%; max-width: 420px; }

.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 750; letter-spacing: .06em;
}
.brand b { font-size: 15px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
}

h1 { font-size: 20px; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 15px; margin: 22px 0 8px; }
p { margin: 0 0 12px; color: var(--muted); }
p.lead { color: var(--ink); }

label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 5px; }
input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--field); color: var(--ink); font: inherit;
}
input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
button {
  flex: 1 1 auto; min-width: 120px; padding: 10px 14px; border-radius: 8px; font: inherit; font-weight: 650;
  cursor: pointer; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
}
button.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
button:disabled { opacity: .6; cursor: progress; }

a { color: var(--accent); }

.facts { margin: 14px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.facts li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.facts span { color: var(--muted); }
.facts strong { text-align: right; overflow-wrap: anywhere; }

.message { margin-top: 14px; padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.message.info { background: var(--accent-soft); color: var(--ink); }
.message.warn { background: var(--warn-soft); color: var(--warn); }
.message.error { background: var(--error-soft); color: var(--error); }

.foot { margin-top: 14px; font-size: 13px; color: var(--muted); text-align: center; }
.small { font-size: 13px; }
.foot-left { margin: 14px 0 0; }

.app-access { margin-top: 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.app-access summary { padding: 14px 0; cursor: pointer; font-weight: 650; }
.grants { margin: 8px 0 0; padding: 0; list-style: none; }
.grants li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px 10px; padding: 14px 0; border-top: 1px solid var(--line); font-size: 14px; }
.grant-name { font-weight: 650; overflow-wrap: anywhere; }
.grant-meta { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.grant-meta p { margin: 0 0 4px; }
.grant-meta code { font-size: 12px; overflow-wrap: anywhere; }
.grants button { min-width: 0; padding: 6px 10px; font-size: 13px; }

[hidden] { display: none !important; }
