:root {
  /* Notion‑like neutral palette */
  --bg: #ffffff;
  --panel: #ffffff;
  --text: #1f2328;
  --muted: #6b7280; /* gray-500 */
  --line: #e5e7eb; /* gray-200 */
  --accent: #2563eb; /* subtle blue for focus */
  --danger: #b91c1c;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial; color: var(--text); background: var(--bg); }
h1, h2, h3, h4 { font-family: Poppins, Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial; }

/* Ссылки без подчеркивания */
a, a:visited { text-decoration: none; color: inherit; }
a:hover, a:focus { text-decoration: none; }

.container { max-width: 720px; margin: 0 auto; padding: 18px 16px 40px; }

.title { margin: 14px 0 6px; font-size: 28px; letter-spacing: -.2px; font-weight: 700; }
.muted { color: var(--muted); margin: 0 0 14px; line-height: 1.5; }

.gate-form { display: grid; gap: 12px; margin-top: 8px; }
.input-wrap { display: grid; gap: 6px; }
label { font-size: 13px; color: var(--muted); }
input { padding: 12px 12px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 16px; background: var(--panel); }
input:hover { border-color: #d1d5db; }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.btn { appearance: none; border: 1px solid #d1d5db; padding: 10px 14px; border-radius: 8px; background: #f8fafc; color: #111827; font-weight: 600; font-size: 15px; box-shadow: 0 1px 0 rgba(0,0,0,.02); }
.btn:hover { background: #f3f4f6; }
.btn:active { background: #eef2f7; }
.error { color: var(--danger); min-height: 20px; margin: 4px 0 0; }
.input-invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(185,28,28,.12) !important; }
.help { font-size: 12px; color: var(--muted); margin-top: -4px; }

.sticky-head { position: sticky; top: 0; background: var(--bg); padding: 10px 0; border-bottom: 1px solid var(--line); z-index: 1; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 700; }
.logo-img { width: 32px; height: 32px; border-radius: 8px; display: inline-block; }
.logo-text { font-family: Poppins, Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial; font-weight: 700; }
.back { color: #2563eb; font-weight: 600; cursor: pointer; }

.theory { line-height: 1.8; font-size: 16px; display: grid; gap: 0; margin-top: 12px; }
.theory h2 { margin: 32px 0 8px; font-weight: 700; }
.theory h3 { margin: 20px 0 8px; font-size: 20px; font-weight: 600; }
.theory h4 { margin: 8px 0 2px; font-size: 18px; font-weight: 600; }
.theory ol, .theory ul { margin: 0 0 6px 18px; }
.note { padding: 10px 12px; background: #fafafa; border: 1px solid var(--line); border-radius: var(--radius); color: #111827; }

@media (min-width: 720px) {
  .title { font-size: 32px; }
}

/* Dark theme */
[data-theme="dark"] {
  --bg: #1a1a1a;
  --panel: #2a2a2a;
  --text: #ffffff;
  --muted: #a0a0a0;
  --line: #333333;
  --accent: #4a9eff;
  --danger: #ff6b6b;
}

/* Theme and language switchers */
.controls {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  gap: 8px;
}

.control-btn {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.control-btn:hover {
  background: var(--panel);
  border-color: var(--muted);
}
