/* debugged_ — one stylesheet for the whole site.
   Change --accent to swap the brand color everywhere. */
:root {
  --bg: #0B0B0F;
  --card: #15151C;
  --nav: #0F0F14;
  --line: #24242E;
  --line2: #2E2E3A;
  --text: #EDEDF2;
  --soft: #D4D4DE;
  --muted: #A3A3B2;
  --dim: #8A8A99;
  --accent: #8B5CF6;
  --on-accent: #0B0B0F;
  --danger: #FF7A7A;
  --ok: #4ADE80;
  --code-key: #7DD3FC;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --sans: Inter, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; line-height: 1.5; }
a { color: var(--text); }
a:hover { color: #fff; }
button { font: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 460px; margin: 0 auto; padding: 0 20px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Brand */
.logo { font-family: var(--mono); font-weight: 700; font-size: 20px; text-decoration: none; color: var(--text); }
.logo span { color: var(--accent); }
.eyebrow { font-family: var(--mono); font-size: 13px; color: var(--accent); }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 12px; font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer; border: 1px solid var(--line2); background: transparent; color: var(--text); transition: filter .15s, border-color .15s; }
.btn:hover { filter: brightness(1.12); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn-primary:hover { color: var(--on-accent); }
.btn-danger { border-color: #5A2A2A; color: var(--danger); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; filter: none; }

/* Cards + forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 14px; font-weight: 600; }
.hint { font-size: 13px; color: var(--dim); }
.input, textarea.input, select.input { width: 100%; min-height: 48px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); font: 15px var(--sans); outline: none; }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; }
textarea.code-input { font-family: var(--mono); font-size: 13px; min-height: 260px; }
.input:focus { border-color: var(--accent); }
.error { color: var(--danger); font-size: 14px; min-height: 20px; margin: 0; }
.success { color: var(--ok); font-size: 14px; margin: 0; }

/* Pills */
.pill { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); }
.pill-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.badge-new { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--on-accent); background: var(--accent); padding: 3px 8px; border-radius: 999px; }

/* ---------- Landing ---------- */
.site-header { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding: 28px 0; }
.site-nav { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; font-size: 15px; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a.btn { color: var(--text); }
.hero { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; padding: 64px 0 96px; }
.hero-copy { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero h1 { margin: 0; font-size: clamp(44px, 7vw, 64px); line-height: 1.02; font-weight: 800; letter-spacing: -0.035em; }
.hero p { margin: 0; font-size: 19px; color: var(--muted); max-width: 480px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 8px; }
.editor { flex: 1 1 440px; min-width: 0; overflow: hidden; }
.editor-bar { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.editor-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line2); }
.editor-bar span { margin-left: 10px; font-family: var(--mono); font-size: 12px; color: var(--dim); }
.editor pre { margin: 0; padding: 22px 20px; font-family: var(--mono); font-size: 14px; line-height: 1.75; white-space: pre-wrap; overflow-x: auto; }
.c-com { color: var(--dim); } .c-bad { color: var(--danger); } .c-key { color: var(--code-key); } .c-str { color: var(--accent); }

.section { padding: 32px 0 96px; display: flex; flex-direction: column; gap: 36px; }
.section-head { display: flex; flex-direction: column; gap: 10px; }
.section h2 { margin: 0; font-size: clamp(30px, 5vw, 40px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.section-head p { margin: 0; color: var(--muted); font-size: 17px; max-width: 620px; }
.row { display: flex; flex-wrap: wrap; gap: 20px; }
.step { flex: 1 1 280px; min-width: 0; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.step b { font-family: var(--mono); font-size: 15px; color: var(--accent); }
.step h3 { margin: 0; font-size: 21px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
.price-card { flex: 1 1 320px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 20px; border-radius: 18px; }
.price-card.featured { border: 2px solid var(--accent); padding: 31px; }
.price-card h3 { margin: 0; font-size: 20px; }
.price-card .sub { margin: 0; color: var(--muted); font-size: 15px; }
.price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price strong { font-size: 52px; font-weight: 800; letter-spacing: -0.03em; }
.launch-tag { font-family: var(--mono); font-size: 13px; color: var(--bg); background: var(--text); padding: 4px 9px; border-radius: 6px; font-weight: 600; }
.ticks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; color: var(--soft); font-size: 15px; }
.ticks li::before { content: '✓'; color: var(--accent); margin-right: 10px; font-weight: 700; }
.price-card .btn { margin-top: auto; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.cat { padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; border-radius: 14px; }
.cat b { font-family: var(--mono); font-size: 15px; }
.cat span { font-size: 14px; color: var(--muted); }
.rules { padding: 28px 32px; display: flex; flex-wrap: wrap; gap: 24px 48px; border-radius: 18px; margin-bottom: 80px; }
.rules div { flex: 1 1 220px; display: flex; flex-direction: column; gap: 6px; }
.rules span { color: var(--muted); font-size: 14px; }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: 13px; color: var(--dim); }

/* ---------- Simple pages (order, login) ---------- */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.page-header { display: flex; align-items: center; justify-content: space-between; padding: 22px 20px; max-width: 460px; width: 100%; margin: 0 auto; }
.page-header a.link { color: var(--muted); text-decoration: none; font-size: 14px; min-height: 44px; display: flex; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.page h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.plan-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plan-opt { position: relative; }
.plan-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.plan-opt .card { padding: 16px; display: flex; flex-direction: column; gap: 4px; border-radius: 14px; transition: border-color .15s; }
.plan-opt input:checked + .card { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan-opt input:focus-visible + .card { outline: 2px solid var(--accent); outline-offset: 2px; }
.plan-opt b { font-size: 15px; }
.plan-opt strong { font-size: 26px; font-weight: 800; }
.ticket { overflow: hidden; border-radius: 20px; }
.ticket-top { padding: 30px 20px 26px; display: flex; flex-direction: column; align-items: center; gap: 10px; border-bottom: 2px dashed var(--line2); }
.ticket-top small { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .14em; }
.ticket-code { font-family: var(--mono); font-size: 54px; font-weight: 800; color: var(--accent); letter-spacing: .02em; }
.ticket-rows { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.ticket-rows div { display: flex; justify-content: space-between; gap: 12px; }
.ticket-rows span { color: var(--muted); }
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.steps li i { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #3A3A48; flex: none; display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 800; font-size: 14px; }
.steps li.done { color: var(--text); font-weight: 600; }
.steps li.done i { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- Member app ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; padding-bottom: 84px; position: relative; }
.app-header { display: flex; align-items: center; justify-content: space-between; padding: 20px; max-width: 760px; width: 100%; margin: 0 auto; }
.app-main { max-width: 760px; width: 100%; margin: 0 auto; padding: 0 20px 20px; flex: 1; }
.search { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; height: 48px; }
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text); font: 15px var(--sans); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--soft); font-size: 14px; font-weight: 500; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.entry-list { display: flex; flex-direction: column; gap: 10px; }
.entry-card { text-decoration: none; padding: 16px; display: flex; flex-direction: column; gap: 6px; border-radius: 14px; transition: border-color .15s, box-shadow .15s; }
.entry-card:hover { border-color: var(--accent); box-shadow: 0 0 24px -8px var(--accent); color: var(--text); }
.entry-card .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.entry-card .cat-label { font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.entry-card b { font-size: 16px; line-height: 1.3; }
.entry-card span.sum { font-size: 14px; color: var(--muted); }
.empty { padding: 40px 0; text-align: center; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 14px; min-height: 44px; }
.article h1 { margin: 6px 0 10px; font-size: 30px; letter-spacing: -0.03em; line-height: 1.15; }
.article .lede { color: var(--muted); font-size: 17px; margin: 0 0 22px; }
.article p { font-size: 16px; color: var(--soft); margin: 0 0 16px; }
.article pre.code { background: #101016; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin: 0 0 18px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.7; color: var(--text); }
code.inline { font-family: var(--mono); font-size: .9em; background: #1D1D26; border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; color: var(--text); }
.mistake { border: 1px solid #5A3A20; background: #1E1610; border-radius: 12px; padding: 16px 18px; margin-top: 8px; }
.mistake b { color: #FFB066; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; display: block; margin-bottom: 6px; }
.mistake p { margin: 0; color: #F2DCC8; font-size: 15px; }
.q-card { padding: 16px; border-radius: 14px; display: flex; flex-direction: column; gap: 10px; }
.q-card .q { white-space: pre-wrap; }
.q-card .a { white-space: pre-wrap; border-top: 1px solid var(--line); padding-top: 10px; color: var(--soft); }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; border-top: 1px solid var(--line); background: var(--nav); display: flex; justify-content: space-around; padding: 6px 0 calc(10px + env(safe-area-inset-bottom)); z-index: 20; }
.bottom-nav a { text-decoration: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 500; min-width: 80px; min-height: 52px; }
.bottom-nav a.on { color: var(--accent); font-weight: 600; }

/* Anti-copy + watermark (member area only) */
.protected { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.protected input, .protected textarea { -webkit-user-select: text; user-select: text; }
#wm { position: fixed; inset: -50%; transform: rotate(-24deg); opacity: .055; pointer-events: none; z-index: 30; display: flex; flex-direction: column; gap: 56px; font-family: var(--mono); font-size: 15px; white-space: nowrap; color: #fff; }
body.away .app-main { filter: blur(16px); }
@media print { body { display: none !important; } }

/* ---------- Admin ---------- */
.admin-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 18px; }
.admin-tabs button { flex: none; }
.admin-list { display: flex; flex-direction: column; gap: 10px; }
.admin-item { padding: 16px; border-radius: 14px; display: flex; flex-direction: column; gap: 10px; }
.admin-item .line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.admin-item .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.admin-item .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { padding: 16px; border-radius: 14px; }
.stat small { color: var(--muted); font-size: 13px; }
.stat strong { display: block; font-size: 28px; font-weight: 800; }
.warn { color: #FFB066; }
.big-code { font-family: var(--mono); font-size: 22px; font-weight: 800; color: var(--accent); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
h2.admin-h { font-size: 18px; margin: 26px 0 12px; }
