:root {
  --gr-orange: #D9781E;
  --gr-green: #365234;
  --gr-sand: #DCC59F;
  --gr-bg: var(--gr-sand);
  --gr-surface: #f3e6d0;
  --gr-text: var(--gr-green);
  --gr-header: var(--gr-green);
  --gr-accent: var(--gr-orange);
  --gr-accent-text: #1a1208;
  --gr-muted: #4d5c43;
  --gr-line: rgba(54, 82, 52, 0.25);
  --gr-danger: #8c1d18;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --gr-bg: #141210;
    --gr-surface: #243028;
    --gr-text: #f4e6d0;
    --gr-header: #d7e0cf;
    --gr-accent: #e0943a;
    --gr-accent-text: #1a1208;
    --gr-muted: #c4b49a;
    --gr-line: rgba(220, 197, 159, 0.28);
    --gr-danger: #ffb4ab;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --gr-bg: #141210;
  --gr-surface: #243028;
  --gr-text: #f4e6d0;
  --gr-header: #d7e0cf;
  --gr-accent: #e0943a;
  --gr-accent-text: #1a1208;
  --gr-muted: #c4b49a;
  --gr-line: rgba(220, 197, 159, 0.28);
  --gr-danger: #ffb4ab;
  color-scheme: dark;
}

:root[data-theme="light"] {
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--gr-bg);
  color: var(--gr-text);
  font-family: "Segoe UI", Candara, sans-serif;
  line-height: 1.5;
}

a { color: inherit; }

a.link {
  color: var(--gr-header);
  font-weight: 650;
  text-decoration: underline;
}

.site-header, .page {
  width: min(42rem, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--gr-line);
}

.logo {
  display: block;
  height: 3.25rem;
  width: auto;
}

h1 {
  font-size: 1.75rem;
  line-height: 1.2;
  color: var(--gr-header);
  margin: 1.5rem 0 0.75rem;
}

p { margin: 0 0 1rem; }

.muted { color: var(--gr-muted); }

button, .button {
  appearance: none;
  border: 0;
  border-radius: 0.25rem;
  background: var(--gr-accent);
  color: var(--gr-accent-text);
  font: inherit;
  font-weight: 650;
  padding: 0.55rem 0.9rem;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}

button:focus-visible, .button:focus-visible, a:focus-visible {
  outline: 2px solid var(--gr-header);
  outline-offset: 3px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 1rem;
}

.field span {
  font-weight: 650;
}

input[type="text"], input[type="password"], textarea {
  font: inherit;
  color: var(--gr-text);
  background: var(--gr-surface);
  border: 1px solid var(--gr-line);
  border-radius: 0.25rem;
  padding: 0.55rem 0.65rem;
  width: 100%;
}

textarea {
  min-height: 5rem;
  resize: vertical;
}

.guns {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.guns .actions {
  margin-top: 0.75rem;
}

.error {
  color: var(--gr-danger);
  font-weight: 650;
}

.panel {
  background: var(--gr-surface);
  border: 1px solid var(--gr-line);
  border-radius: 0.35rem;
  padding: 1rem;
}

.recovery-code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  word-break: break-all;
}

.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 1rem 0;
}

.dashboard { margin-top: 1.5rem; }

.dashboard-title {
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--gr-header);
  margin: 0 0 0.75rem;
}

.counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.75rem 1.25rem;
  margin: 0;
}

.counts div { margin: 0; }

.counts dt {
  color: var(--gr-muted);
  font-size: 0.9rem;
}

.counts dd {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
