:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef1ec;
  --text: #17211c;
  --muted: #5d6b63;
  --line: #dde3dc;
  --accent: #1f7a5a;
  --accent-ink: #ffffff;
  --accent-soft: #e2f1ea;
  --warn: #9a5b00;
  --warn-soft: #fbefd9;
  --bad: #b0302a;
  --bad-soft: #f8e1df;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .05), 0 6px 24px rgba(20, 30, 25, .05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1412;
    --surface: #161d1a;
    --surface-2: #1d2622;
    --text: #e7eee9;
    --muted: #97a59d;
    --line: #2a3530;
    --accent: #45b88c;
    --accent-ink: #08130e;
    --accent-soft: #183327;
    --warn: #e5a54a;
    --warn-soft: #33270f;
    --bad: #ec7a72;
    --bad-soft: #3a1c1a;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--text); text-decoration: none; }
.logo-mark { width: 28px; height: 28px; display: block; }
nav { display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: center; font-size: 15px; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--text); }
nav .nav-cta { color: var(--accent); font-weight: 600; }
main.wrap { padding-top: 28px; padding-bottom: 48px; }
.foot { color: var(--muted); font-size: 14px; padding-bottom: 32px; }
.foot a { color: var(--muted); }

h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.15; margin: 0 0 14px; letter-spacing: -.01em; }
h2 { font-size: 24px; margin: 0 0 14px; }
h3 { font-size: 17px; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.lead { font-size: 18px; color: var(--muted); max-width: 640px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.hero { padding: 24px 0 12px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
section { margin-top: 44px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.grid > .card { margin-top: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.step-n { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px;
  padding: 12px 20px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid var(--line); }

form.stack { display: grid; gap: 12px; max-width: 420px; }
label { font-weight: 600; font-size: 15px; }
input[type=email], input[type=text], select {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit;
}
input:focus-visible, .btn:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice { padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); margin-bottom: 16px; }
.notice.warn { background: var(--warn-soft); }
.notice.bad { background: var(--bad-soft); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 18px 0 4px; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.stat .k { color: var(--muted); font-size: 13px; }
.stat .v { font-weight: 700; font-size: 18px; }
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--accent); }

.key-box { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; margin: 12px 0; }
.key-box code {
  flex: 1 1 260px; min-width: 0; padding: 12px; border-radius: 10px; background: var(--surface-2);
  font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; user-select: all;
}
.key-layout { display: grid; gap: 20px; grid-template-columns: 1fr auto; align-items: start; }
@media (max-width: 640px) { .key-layout { grid-template-columns: 1fr; } }
.qr { background: #fff; padding: 12px; border-radius: 12px; width: 204px; height: 204px; }
.qr img, .qr canvas { display: block; width: 180px !important; height: 180px !important; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { font: inherit; font-size: 15px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.tabs button[aria-selected=true] { background: var(--text); color: var(--bg); border-color: var(--text); }
.tab-panel[hidden] { display: none; }
ol.steps { padding-left: 22px; margin: 0; }
ol.steps li { margin-bottom: 8px; }

details { border-top: 1px solid var(--line); padding: 12px 0; }
details:last-child { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 10px 0 0; color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 14px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* admin */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-head h1 { font-size: clamp(24px, 4vw, 30px); margin: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 14px; padding: 5px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.chip b { color: var(--text); }
.who { font-weight: 600; }
.mono { font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.nowrap { white-space: nowrap; }
td select { min-width: 140px; padding: 8px 12px; }
td .btn { white-space: nowrap; }
.term { margin-top: 6px; }
td .row-actions { flex-wrap: nowrap; justify-content: flex-end; }
.hint { margin: 16px 0 0; }

@media (max-width: 600px) { .br-wide { display: none; } }

/* landing */
.quotes { display: grid; gap: 12px; margin: 8px 0 28px; max-width: 640px; }
.rating { margin: -16px 0 24px; }
.quote { margin: 0; padding: 18px 20px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; box-shadow: var(--shadow); max-width: 640px; }
.quote p { margin: 0 0 6px; font-size: 17px; }
.facts { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.facts li { display: flex; flex-direction: column; gap: 4px; padding-left: 14px; border-left: 2px solid var(--line); font-size: 15px; }
details.big > summary { font-weight: 600; font-size: 17px; cursor: pointer; }
details.big[open] > summary { margin-bottom: 16px; }
@media (max-width: 600px) {
  .hero-actions .btn { width: 100%; text-align: center; justify-content: center; }
  .nav-hide-m { display: none; }
}
