:root {
  --bg: #070b16;
  --ink: #e8eefc;
  --muted: #93a0bd;
  --line: rgba(232, 238, 252, 0.1);
  --card: #12182c;
  --card-2: #0d1324;
  --accent: #5b8cff;
  --accent-deep: #3d6fe6;
  --accent-ink: #f7f9ff;
  --peach: #1a2238;
  --sun: #16203a;
  --rose: #241c30;
  --warn: #ffb4a2;
  --warn-bg: #2a1c22;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  color: var(--ink);
  color-scheme: dark;
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(91, 140, 255, 0.22), transparent 60%),
    radial-gradient(700px 380px at -10% 0%, rgba(56, 189, 248, 0.08), transparent 55%),
    var(--bg);
  font-family: Outfit, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: var(--accent-deep); }
code, textarea, input, button, .button, table { font-family: inherit; }
h1, h2, .mark { font-family: Fraunces, Georgia, serif; font-weight: 560; letter-spacing: -0.02em; }

body.public .top, body.public main { width: min(1040px, calc(100% - 32px)); margin: 0 auto; }
.top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 0 8px;
  flex-wrap: wrap;
}
.mark { color: var(--ink); text-decoration: none; font-size: 26px; margin-right: auto; }
nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
nav a { color: var(--ink); text-decoration: none; }
.langs { display: flex; gap: 4px; }
.langs a {
  min-width: 40px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.langs a.on { background: var(--accent); color: #fff; }

main { padding-bottom: 80px; }
h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.08; margin: 0 0 12px; }
h2 { font-size: 26px; margin: 0 0 8px; }
.lead { font-size: 18px; max-width: 40rem; color: var(--ink); }
.eyebrow { color: var(--accent-deep); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 13px; }
.meta, .hint, .note { color: var(--muted); }
.hero { padding: 36px 0 8px; }

.tools { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 18px 0 22px; }
.tools li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
}
.tools li:nth-child(1) { background: #14233f; }
.tools li:nth-child(2) { background: #1a2744; }
.tools li:nth-child(3) { background: #1c2438; }
.tools li:nth-child(4) { background: #241c30; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 28px 0; }
.grid.two { grid-template-columns: 1fr 1fr; }
.card, .note, .flash {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
}
.note { background: var(--card-2); box-shadow: none; }
.flash { background: var(--warn-bg); color: var(--warn); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px 0 14px; }
.stats div { background: var(--bg); border-radius: 14px; padding: 12px; }
.stats span { display: block; color: var(--muted); font-size: 13px; }
.stats strong { font-family: Fraunces, Georgia, serif; font-size: 28px; font-weight: 560; }
.person h2 { margin-bottom: 0; }
.person { margin: 12px 0; }
.story {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 22px 8px;
  box-shadow: var(--shadow);
}
.story p { font-size: 18px; max-width: 42rem; }
.tiers td:last-child, .tiers th:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tiers tr:first-child th { color: var(--muted); font-weight: 600; }
.price { font-family: Fraunces, Georgia, serif; font-size: 28px; margin: 12px 0 0; }
.price span, .hint { display: block; font-size: 14px; color: var(--muted); font-family: Outfit, sans-serif; font-weight: 400; }

.steps { list-style: none; padding: 0; display: grid; gap: 10px; }
.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
}
.steps span {
  font-family: Fraunces, Georgia, serif;
  color: var(--accent-deep);
  font-size: 22px;
}
.steps p { margin: 0; }

.button, button {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  min-height: 44px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
}
.button:hover, button:hover { background: var(--accent-deep); }
button.link { background: transparent; color: var(--muted); min-height: 0; padding: 8px 0; font-weight: 500; }
button.link:hover { background: transparent; color: var(--ink); }
.button.wide { display: flex; width: 100%; margin: 12px 0; }
.narrow { max-width: 480px; }
.split, .row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.grow { flex: 1; min-width: 180px; }
label { display: grid; gap: 6px; font-size: 14px; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card-2);
  border-radius: 12px;
  padding: 12px 12px;
  color: var(--ink);
  font-size: 16px;
}
textarea { resize: vertical; }
input:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
fieldset { border: 1px solid var(--line); border-radius: 16px; padding: 8px 14px 12px; background: var(--card); }
legend { padding: 0 6px; font-weight: 600; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; }
.choice input { width: auto; margin-top: 4px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.list a { color: var(--ink); text-decoration: none; display: grid; gap: 2px; }
.list.compact code { max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; color: var(--muted); }
.telegram { margin-top: 18px; }
.danger { margin-top: 28px; }
.danger button { background: transparent; color: var(--warn); border: 1px solid var(--warn); }
.danger button:hover { background: var(--warn-bg); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
section { margin: 26px 0; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
pre {
  white-space: pre-wrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.progress { display: flex; gap: 8px; list-style: none; padding: 0; margin: 8px 0 18px; }
.progress li {
  width: 36px; height: 36px; border-radius: 999px;
  display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--muted); font-weight: 600;
}
.progress li.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.progress li.done { background: #14233f; color: var(--accent); }
.names { display: flex; flex-wrap: wrap; gap: 8px; }
.names button { background: var(--sun); color: var(--ink); }
input[type="range"] {
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
}
.meter { height: 10px; background: var(--line); border-radius: 99px; margin: 8px 0; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.table-wrap button { min-height: 36px; }
.preview { font-size: 18px; word-break: break-all; }
.onboard-page { max-width: 920px; }
.form-col { max-width: 560px; }
.strip { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 8px; align-items: stretch; margin: 8px 0 18px; }
.strip.two { grid-template-columns: 1fr auto 1fr; }
.strip.one { grid-template-columns: minmax(0, 560px); }
.panel {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 8px 8px 12px;
  box-shadow: 4px 4px 0 var(--ink);
}
.panel svg { width: 100%; height: auto; display: block; }
.panel figcaption { display: grid; gap: 4px; padding: 4px 6px 0; }
.panel strong { font-family: Fraunces, Georgia, serif; font-size: 18px; font-weight: 560; }
.panel figcaption span { color: var(--muted); font-size: 14px; }
.arrow { align-self: center; color: var(--accent-deep); }
.blink { animation: blink 1.8s steps(2, end) infinite; }
@keyframes blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) {
  .blink { animation: none; }
}
.price { font-family: Fraunces, Georgia, serif; font-size: 32px; margin: 8px 0; }
.tabs { display: flex; gap: 8px; margin: 12px 0; }
.tabs button { background: var(--peach); color: var(--ink); }
fieldset { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
legend { padding: 0 6px; }
dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  width: min(420px, calc(100% - 32px));
  padding: 20px;
}
dialog::backdrop { background: rgba(28, 43, 38, 0.35); }
dialog form { margin-top: 12px; }
.ready { background: #12233a; }
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: rgba(8, 12, 24, 0.92);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.side .mark { margin: 0 8px 4px; }
.side-nav { display: grid; gap: 4px; align-content: start; }
.side-label {
  margin: 14px 8px 4px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.side-nav a, .soon {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}
.side-nav a.on { background: var(--accent); color: #fff; }
.side-nav a:hover { background: #18233f; }
.side-nav a.on:hover { background: var(--accent-deep); }
.soon { color: var(--muted); cursor: default; }
.workspace { min-width: 0; }
.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px 0;
}
.bar form { flex: none; }
.bar .mark { display: none; font-size: 22px; }
.bar-grow { flex: 1; }
body.app main { width: min(1100px, calc(100% - 56px)); margin: 0; padding: 12px 0 72px; }
body.app h1 { font-size: clamp(32px, 4vw, 44px); }
.tiles, .proj-grid { display: grid; gap: 12px; margin: 16px 0 24px; }
.tiles { grid-template-columns: repeat(3, 1fr); }
.proj-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tile, .proj-card {
  display: grid;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}
.tile strong, .proj-card strong { font-family: Fraunces, Georgia, serif; font-size: 32px; font-weight: 560; }
.proj-card strong { font-size: 22px; }
.hint {
  background: #10192e;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 16px 4px;
}
.hint strong { display: block; margin-bottom: 6px; }
.split-page { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 16px; align-items: start; }
button.ghost, .button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
button.ghost:hover, .button.ghost:hover { background: #18233f; }
button.ghost.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
button:disabled { opacity: 0.4; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card code { display: block; overflow-wrap: anywhere; margin: 8px 0; }
.copy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.steps strong { display: block; font-weight: 600; margin-bottom: 4px; }

@media (max-width: 860px) {
  body.public .top, body.public main, body.app main { width: min(1100px, calc(100% - 24px)); }
  .grid, .grid.two, .stats, .strip, .strip.two, .tiles, .split-page, .copy-grid { grid-template-columns: 1fr; }
  .arrow { transform: rotate(90deg); justify-self: center; }
  .split, .row { align-items: stretch; }
  .split .button, .row button, .row .button { width: 100%; }
  .list li { align-items: flex-start; flex-direction: column; }
  .list.compact code { max-width: 100%; white-space: normal; word-break: break-all; }
  .hero { padding-top: 18px; }
  .shell { display: block; }
  .side {
    position: sticky;
    top: 0;
    height: auto;
    z-index: 4;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px;
  }
  .side .mark, .side-label { display: none; }
  .bar .mark { display: inline; }
  .side-nav { display: flex; gap: 6px; overflow-x: auto; }
  .bar { padding: 12px 12px 0; }
}
