:root {
  --bg: #ffffff; --surface: #f5f7fa; --card: #ffffff; --text: #17202b; --muted: #5b6675;
  --line: #dbe1e8; --accent: #186edc; --accent-ink: #ffffff; --accent-soft: #e9f1fd;
  --good: #1a7f37; --bad: #b3261e; --warn: #9a6700; --shadow: 0 10px 30px rgba(23, 32, 43, .10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151c; --surface: #161d27; --card: #1b2430; --text: #e8edf3; --muted: #9aa7b6;
    --line: #2c3848; --accent: #4f97f5; --accent-ink: #0b1220; --accent-soft: #1c2c44;
    --good: #5bd07a; --bad: #ff8a80; --warn: #e3b341; --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  }
}
* { box-sizing: border-box; }
/* Rules below that set "display" must not bring a hidden element back. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 "Segoe UI", system-ui, -apple-system, sans-serif; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
code, .mono { font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }

/* top bar */
.bar { display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--line);
  background: var(--bg); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
.brand img { border-radius: 6px; }
.nav { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav a:hover { color: var(--text); }
.bar-title { color: var(--muted); margin-right: auto; }

.button { display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 9px 16px; border-radius: 8px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.button:hover { border-color: var(--accent); }
.button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button.quiet { font-weight: 500; padding: 6px 12px; }
.button.small { font-size: 13px; padding: 4px 9px; }
.button[disabled] { opacity: .5; cursor: default; }

/* hero */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 56px 0 0; text-align: center; }
.hero h1 { font-size: clamp(30px, 5vw, 48px); letter-spacing: -.02em; max-width: 820px; margin: 0 auto; }
.hero p.lead { font-size: 19px; color: var(--muted); max-width: 720px; margin: 16px auto 0; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 26px 0 36px; }
.hero figure { margin: 0 auto; max-width: 980px; }
.hero figure img { display: block; border-radius: 12px 12px 0 0; border: 1px solid var(--line); border-bottom: 0; box-shadow: var(--shadow); }

section { padding: 64px 0; }
section + section { border-top: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 30px; }
.section-head h2 { font-size: 30px; letter-spacing: -.01em; }
.section-head p { color: var(--muted); margin: 10px 0 0; }

.cta-left { display: flex; gap: 12px; flex-wrap: wrap; }
.section-head.sub { margin: 40px 0 20px; }
.section-head.sub h3 { font-size: 21px; }

/* features */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { margin: 0; color: var(--muted); }
.feature ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); }
.feature li { margin: 3px 0; }

/* screenshots */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; align-items: start; }
.shots figure { margin: 0; }
.shots img { display: block; width: 100%; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); background: var(--surface); }
.shots figcaption { color: var(--muted); font-size: 14px; margin-top: 10px; }
.shots .wide { grid-column: 1 / -1; }

/* steps and plans */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: step; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.steps li::before { content: counter(step); 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; }
.steps h3 { font-size: 17px; margin-bottom: 6px; }
.steps p { margin: 0; color: var(--muted); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.plan.featured { border-color: var(--accent); }
.plan h3 { font-size: 20px; }
.plan .term { font-size: 15px; color: var(--muted); margin: 4px 0 14px; }
.plan ul { margin: 0; padding-left: 18px; }
.plan li { margin: 5px 0; }
.note { margin-top: 22px; padding: 14px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; }
.limits { columns: 2 320px; column-gap: 40px; padding-left: 18px; margin: 0; color: var(--muted); }
.limits li { break-inside: avoid; margin: 0 0 8px; }
footer.site { border-top: 1px solid var(--line); padding: 26px 0; color: var(--muted); font-size: 14px; }
footer.site .wrap { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }

/* admin */
.admin { background: var(--surface); min-height: 100vh; }
/* minmax(0, 1fr) lets the cards shrink to the window; the wide key table then scrolls inside its card. */
.admin-main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 60px; display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
#panel { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
#panel[hidden], .login[hidden] { display: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.card h1, .card h2 { font-size: 19px; margin-bottom: 14px; }
.login { max-width: 380px; margin: 60px auto 0; display: grid; gap: 10px; width: 100%; }
label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
input, select { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.create-row { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; }
.create-row .grow { flex: 1; min-width: 220px; }
.created { margin: 14px 0 0; padding: 10px 14px; background: var(--accent-soft); border-radius: 8px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.created code { font-size: 17px; font-weight: 600; user-select: all; }
.error { color: var(--bad); margin: 10px 0 0; }
.notice { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--warn); border-radius: 8px;
  background: color-mix(in srgb, var(--warn) 10%, transparent); }
.list-head { display: flex; align-items: baseline; gap: 12px; }
.list-head h2 { margin-bottom: 14px; }
.list-head .button { margin-left: auto; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td.key code { user-select: all; }
td.actions .button + .button { margin-left: 6px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid currentColor; }
.badge.active { color: var(--good); }
.badge.unused { color: var(--muted); }
.badge.expired { color: var(--warn); }
.badge.revoked { color: var(--bad); }

@media (max-width: 640px) {
  .nav { display: none; }
  section { padding: 44px 0; }
}
