:root {
  --bg: #141018;
  --surface: #1d1720;
  --surface-hover: #261e29;
  --border: #33282f;
  --text: #f7f1ea;
  --muted: #b8aca4;
  --accent: #f5a524;
  --accent-strong: #e5482e;
  --danger-bg: #3a1a17;
  --danger-text: #ffb4a6;
  --success-bg: #1f2a1c;
  --radius: 16px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf6f1;
    --surface: #ffffff;
    --surface-hover: #fdf1e2;
    --border: #eadfd3;
    --text: #22181a;
    --muted: #6d5f58;
    --accent: #c46a00;
    --accent-strong: #c93a23;
    --danger-bg: #fde8e4;
    --danger-text: #8f2414;
    --success-bg: #e9f4e4;
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}
a { color: var(--accent); }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 960px; margin: 0 auto; padding: 20px 16px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand img { height: 40px; width: 40px; display: block; }
.brand span { font-size: 22px; font-weight: 800; letter-spacing: .01em; }
.languages { display: flex; gap: 4px; }
.languages a {
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
}
.languages a.active, .languages a:hover { color: var(--text); background: var(--surface); }
.page { max-width: 960px; margin: 0 auto; padding: 8px 16px 48px; }
.card {
  max-width: 460px; margin: 6vh auto 0; padding: 32px 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
h1 { font-size: 26px; line-height: 1.25; margin: 0 0 8px; text-wrap: balance; }
h2 { font-size: 15px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 32px 0 12px; }
.lead { color: var(--muted); margin: 0 0 24px; }
.notice { padding: 12px 14px; border-radius: 12px; margin: 0 0 20px; }
.notice.error { background: var(--danger-bg); color: var(--danger-text); }
.telegram { display: flex; justify-content: center; min-height: 48px; }
.form { display: grid; gap: 8px; }
.form label { font-weight: 600; }
.form input {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
}
.form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.form input[readonly] { color: var(--muted); }
.hint { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
button.primary, .button {
  font: inherit; font-weight: 700; color: #1b1210; cursor: pointer; text-decoration: none;
  display: inline-block; text-align: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border: 0; border-radius: 12px; padding: 12px 18px;
}
button.primary:focus-visible, .button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.home-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-top: 16px; }
.who { color: var(--muted); margin: 0; }
.tiles {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.tile {
  display: flex; gap: 16px; align-items: flex-start; height: 100%;
  padding: 18px; color: var(--text); text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: background-color .15s, border-color .15s, transform .15s;
}
.tile:hover { background: var(--surface-hover); border-color: var(--accent); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile img { width: 48px; height: 48px; flex: none; }
.tile-text { display: grid; gap: 4px; }
.tile-text strong { font-size: 18px; }
.tile-text span { color: var(--muted); font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
button.secondary {
  font: inherit; font-weight: 600; color: var(--text); cursor: pointer;
  background: transparent; border: 1px solid var(--border); border-radius: 12px; padding: 12px 18px;
}
button.secondary:hover { border-color: var(--accent); }
button.secondary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .6; cursor: progress; }
.wide { width: 100%; }
.muted { color: var(--muted); }
.notice.success { background: var(--success-bg); color: var(--text); display: grid; gap: 8px; }
.notice.success p { margin: 0; }
.copy {
  font: 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; width: 100%; padding: 10px 12px;
  color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
}
.list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 0; }
.list .row + .row { border-top: 1px solid var(--border); }
.row form { margin: 0; }
.row-actions { display: flex; gap: 16px; }
button.link {
  font: inherit; font-size: 14px; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer;
}
button.link:hover { text-decoration: underline; }
button.link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--accent); border: 1px solid currentColor;
}
.chip.danger { color: var(--danger-text); }
.admin { display: grid; gap: 16px; margin-top: 16px; }
.admin h1 { margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 20px 12px; }
.panel h2 { margin-top: 16px; }
.panel h3 { font-size: 15px; margin: 20px 0 4px; }
.form.inline { grid-template-columns: 1fr 120px auto; align-items: end; gap: 12px; }
.form.inline label { display: grid; gap: 6px; font-size: 14px; }
@media (max-width: 600px) { .form.inline { grid-template-columns: 1fr; } }
.actions { margin: 24px 0 0; color: var(--muted); }
