:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #171a1f;
  --body: #3c434d;
  --muted: #6d7580;
  --line: #e3e7ec;
  --accent: #2f5d8c;
  --accent-soft: #eaf1f8;
  --danger: #b4342c;
  --ok: #1f7a4d;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

h1 { font-size: 30px; line-height: 1.2; color: var(--ink); margin: 0 0 12px; }
h2 { font-size: 15px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); margin: 0 0 10px; }

.topbar { background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { font-weight: 700; font-size: 17px; color: var(--ink); letter-spacing: .02em; }
nav { display: flex; gap: 18px; align-items: center; }
nav a, .link { color: var(--muted); text-decoration: none; font-size: 14px; background: none; border: 0; cursor: pointer; padding: 0; }
nav a:hover, .link:hover { color: var(--accent); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}

.gate { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: start; padding: 56px 0; }
.hero p { max-width: 46ch; }
.gate-card { margin: 0; }
#gate-pricing { grid-column: 1 / -1; }
#gate-plan-list button.link { margin-top: 4px; }

form { display: flex; flex-direction: column; gap: 6px; margin: 14px 0 0; }
label { font-size: 13px; color: var(--ink); font-weight: 600; }
input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.5; resize: vertical; }
input[type="color"] { padding: 3px; height: 38px; }
input[type="checkbox"] { width: auto; }
.checkline { display: flex; align-items: center; gap: 7px; font-weight: 600; }

button {
  font: inherit;
  font-weight: 600;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 9px 16px;
  cursor: pointer;
}
button:hover { border-color: var(--accent); color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; margin-top: 8px; }
button.primary:hover { filter: brightness(1.08); color: #fff; }
button.wide { width: 100%; margin-top: 16px; padding: 12px; }
button[disabled] { opacity: .55; cursor: progress; }

details { margin-top: 16px; }
summary { cursor: pointer; font-size: 14px; color: var(--muted); }

.grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 22px; padding: 26px 0; align-items: start; }
.row { display: flex; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.field { flex: 1 1 200px; display: flex; flex-direction: column; gap: 5px; }
.field.narrow { flex: 0 0 130px; }

.status { margin-top: 14px; padding: 10px 12px; border-radius: 7px; background: var(--accent-soft); color: var(--ink); font-size: 14px; }
.status.error, .error { background: #fdecea; color: var(--danger); border-radius: 7px; padding: 10px 12px; font-size: 14px; }
.result { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.result a.download {
  display: inline-block; background: var(--ok); color: #fff; text-decoration: none;
  padding: 11px 18px; border-radius: 7px; font-weight: 600;
}
.result ul { margin: 12px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }

.meter { height: 7px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 10px 0 8px; }
#meter-fill { height: 100%; width: 0; background: var(--accent); transition: width .3s; }

.stack { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.plans { list-style: none; margin: 0; padding: 0; }
.plans li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.plans li:last-child { border-bottom: 0; }
.plans strong { color: var(--ink); }
.plans .price { float: right; color: var(--ink); font-weight: 700; }

.history { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.history li { padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.history li:last-child { border-bottom: 0; }
.history a { color: var(--accent); text-decoration: none; }

pre {
  background: #12161b; color: #dbe3ea; border-radius: 7px;
  padding: 12px; overflow-x: auto; font-size: 12px; line-height: 1.5;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

footer { padding: 30px 20px 50px; }

@media (max-width: 860px) {
  .gate, .grid { grid-template-columns: 1fr; }
}
