/* Soyle — чистый минималистичный интерфейс. Светлая тема по умолчанию,
   тёмная — по системной настройке или переключателю. */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f8;
  --border: #e4e7ee;
  --text: #151826;
  --muted: #6b7286;
  --accent: #5b5bd6;
  --accent-hover: #4b4bc4;
  --accent-soft: #ececfd;
  --ok: #138a52;
  --ok-soft: #e3f6ec;
  --bad: #d23c3c;
  --bad-soft: #fdeaea;
  --warn: #9a6200;
  --warn-soft: #fff4dc;
  --shadow: 0 1px 2px rgba(20, 24, 40, .04), 0 4px 16px rgba(20, 24, 40, .05);
  --radius: 16px;
  --radius-sm: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1016; --surface: #171a23; --surface-2: #1f2330; --border: #2a2f3e;
    --text: #e8eaf2; --muted: #8d93a8; --accent: #8b8bf5; --accent-hover: #a0a0ff; --accent-soft: #25264a;
    --ok: #3ccf87; --ok-soft: #133525; --bad: #ff6b6b; --bad-soft: #3a1818; --warn: #f4b740; --warn-soft: #3a2c10;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1016; --surface: #171a23; --surface-2: #1f2330; --border: #2a2f3e;
  --text: #e8eaf2; --muted: #8d93a8; --accent: #8b8bf5; --accent-hover: #a0a0ff; --accent-soft: #25264a;
  --ok: #3ccf87; --ok-soft: #133525; --bad: #ff6b6b; --bad-soft: #3a1818; --warn: #f4b740; --warn-soft: #3a2c10;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1 { font-size: clamp(24px, 3.2vw, 32px); line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.right { text-align: right; }
.accent { color: var(--accent); }
.bad { color: var(--bad); }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
main.container { flex: 1; padding-top: 28px; padding-bottom: 48px; }

/* ── Шапка ── */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1160px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--text); letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); font-size: 17px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 14px; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--accent); background: var(--accent-soft); }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.lang-switch { display: flex; padding: 3px; background: var(--surface-2); border-radius: 10px; gap: 2px; }
.lang-switch button { border: 0; background: transparent; color: var(--muted); font: 600 12px/1 inherit; padding: 7px 9px; border-radius: 7px; cursor: pointer; }
.lang-switch button:hover { color: var(--text); }
.lang-switch button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: 10px; cursor: pointer; font-size: 15px; }
.icon-btn:hover { background: var(--surface-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff;
  font-weight: 600; font-size: 14px; }
.avatar:hover { color: #fff; filter: brightness(1.08); }
.avatar-lg { width: 56px; height: 56px; font-size: 22px; flex-shrink: 0; }

@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px; }
  .topbar-right { margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; }
}

.footer { border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; gap: 12px; flex-wrap: wrap; }

/* ── Кнопки и поля ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 600 14px/1.2 inherit; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn-danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=password], input[type=file], textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: 15px/1.4 inherit; transition: border-color .15s, box-shadow .15s; }
input[type=file] { padding: 9px; font-size: 14px; }
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

/* ── Карточки и раскладка ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.page-head { margin-bottom: 24px; }
.page-head .lead { margin-top: 6px; color: var(--muted); max-width: 680px; }
.page-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.section-title { margin: 8px 0 12px; }
.back { display: inline-block; margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px; }
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.split-even { grid-template-columns: 1fr 1fr; }
.split-wide { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
@media (max-width: 860px) { .split, .split-even, .split-wide { grid-template-columns: minmax(0, 1fr); } }

.messages { margin-bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid transparent; margin-bottom: 16px; }
.messages .alert { margin: 0; }
.alert-success { background: var(--ok-soft); color: var(--ok); }
.alert-error { background: var(--bad-soft); color: var(--bad); }
.alert-warning { background: var(--warn-soft); color: var(--warn); }
.alert-info { background: var(--accent-soft); color: var(--text); }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; text-transform: none; letter-spacing: 0; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-muted { background: var(--surface-2); color: var(--muted); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .3s; }
.progress > span.ok { background: var(--ok); }
.progress > span.mid { background: var(--warn); }
.progress > span.low { background: var(--bad); }
.progress-sm { height: 5px; margin-top: 10px; }

.empty { color: var(--muted); text-align: center; padding: 28px 16px; grid-column: 1 / -1; }

/* ── Камера ── */
.cam-card { overflow: hidden; }
.cam { position: relative; aspect-ratio: 4 / 3; background: #0b0c10; }
.cam video, .cam canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#inputVideo { visibility: hidden; }
.cam-ref video { object-fit: contain; }
.cam-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: #a6abbd; text-align: center; padding: 24px; font-size: 14px; }
.cam-placeholder-ico { font-size: 40px; opacity: .8; }
.cam-placeholder.cam-error { color: #ffb4b4; }
.cam-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 10, 20, .35); color: #fff; }
.countdown { font-size: 96px; font-weight: 700; animation: pop .8s ease-out; text-shadow: 0 4px 24px rgba(0, 0, 0, .4); }
.rec { position: absolute; top: 14px; left: 14px; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); font-weight: 600; font-size: 14px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff4d4d; animation: blink 1s infinite; }
@keyframes pop { from { transform: scale(1.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes blink { 50% { opacity: .2; } }
.cam-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; flex-wrap: wrap; }
.cam-bar .label { margin: 0; }
.hand-pill { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); transition: background .2s; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }

/* ── Практика алфавита ── */
.letters { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.letter { aspect-ratio: 1; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 10px;
  font: 600 17px/1 inherit; cursor: pointer; transition: all .12s; }
.letter:hover { border-color: var(--accent); color: var(--accent); }
.letter.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.target-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.target-letter { font-size: 64px; font-weight: 700; line-height: 1; color: var(--accent); }
.hint { margin-top: 12px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 14px; }
.verdict { padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.verdict-pass { background: var(--ok-soft); color: var(--ok); }
.verdict-fail { background: var(--bad-soft); color: var(--bad); }
.result { margin-top: 16px; }
.result-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.result-row strong { font-size: 18px; }
.result-row > :last-child { margin-left: auto; }
.stat-row { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.stat { flex: 1; display: flex; flex-direction: column; }
.stat b { font-size: 20px; }
.stat span { font-size: 12px; color: var(--muted); }

/* ── Плитки (алфавит, жесты курса) ── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.tile { overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); }
.tile-media { position: relative; aspect-ratio: 1; background: var(--surface-2); cursor: pointer; }
.tile-media video, .tile-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-play { position: absolute; inset: auto 10px 10px auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; transition: opacity .2s; }
.tile-media.playing .tile-play { opacity: 0; }
.tile-empty { height: 100%; display: grid; place-items: center; font-size: 40px; opacity: .5; }
.tile-check { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok); color: #fff; font-weight: 700; }
.tile-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; flex: 1; }
.tile-body .btn { margin-top: auto; }
.tile-letter { font-size: 22px; font-weight: 700; line-height: 1.2; word-break: break-word; }
.tile-done { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }

/* ── Курсы ── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.cards-1 { grid-template-columns: 1fr; }
.course-card { display: flex; flex-direction: column; gap: 8px; color: var(--text); transition: border-color .15s, transform .15s; }
.course-card:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.course-card-foot { display: flex; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; }
.course-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--text); }
.course-row:hover { border-color: var(--accent); color: var(--text); }
.course-progress { margin-bottom: 20px; }
.pager { display: flex; gap: 8px; }

/* ── Проверка ── */
.check-card { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.verdict-box { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--radius-sm); width: 100%; }
.verdict-box.verdict-pass { background: var(--ok-soft); }
.verdict-box.verdict-fail { background: var(--bad-soft); }
.verdict-ico { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 700; color: #fff; }
.verdict-pass .verdict-ico { background: var(--ok); }
.verdict-fail .verdict-ico { background: var(--bad); }
.verdict-title { font-weight: 700; }
.verdict-pass .verdict-title { color: var(--ok); }
.verdict-fail .verdict-title { color: var(--bad); }
.verdict-next { margin-top: 8px; }
.check-card .alert { margin: 0; width: 100%; }
.history { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.history li { display: flex; gap: 10px; align-items: center; }
.history li > :last-child { margin-left: auto; }

/* ── Таблицы ── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th.center, .table td.center { text-align: center; }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--surface-2); display: block; }
.cell { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; font-weight: 700; font-size: 13px; }
.cell-pass { background: var(--ok-soft); color: var(--ok); }
.cell-fail { background: var(--bad-soft); color: var(--bad); }
.cell-none { color: var(--muted); }

/* ── Аутентификация и профиль ── */
.auth { display: grid; place-items: center; padding: 16px 0; }
.auth-card { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 16px; padding: 28px; }
.auth-card h1 { font-size: 26px; }
.auth-card .alert { margin: 0; }
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role input { position: absolute; opacity: 0; pointer-events: none; }
.role-box { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; height: 100%; transition: border-color .15s, background .15s; }
.role-box small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.role-ico { font-size: 22px; }
.role input:checked + .role-box { border-color: var(--accent); background: var(--accent-soft); }
.role input:focus-visible + .role-box { box-shadow: 0 0 0 3px var(--accent-soft); }
.profile-id { display: flex; align-items: center; gap: 16px; }
.profile-id h1 { margin-bottom: 4px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; }
.kpi b { font-size: 26px; }
.kpi span { color: var(--muted); font-size: 13px; }

/* ── Holistic: живая подсказка, крупная проверка ── */
.live-badge { position: absolute; top: 12px; right: 12px; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 14px;
  color: #fff; background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px); transition: background .2s; }
.live-badge.live-ok { background: rgba(19, 138, 82, .9); }
.live-badge.live-no { background: rgba(0, 0, 0, .55); }
.ref-letter { position: absolute; left: 12px; top: 10px; font-size: 34px; font-weight: 800; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.practice-area { margin-top: 20px; }
.btn-xl { width: 100%; padding: 18px 28px; font-size: 19px; border-radius: 14px; }
.check-card { align-items: stretch; }
.check-card > p { margin: -6px 0 0; }
.verdict-box { padding: 18px; }
.verdict-ico { width: 64px; height: 64px; font-size: 34px; }
.verdict-pct { font-size: 28px; font-weight: 800; line-height: 1.1; }
.verdict-pass .verdict-pct { color: var(--ok); }
.verdict-fail .verdict-pct { color: var(--bad); }
.verdict-text .verdict-next { display: inline-flex; margin-top: 10px; }
.hint-inline { text-align: right; }

/* ── Переключатели (алфавит kk/ru, язык курса) ── */
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 10px; gap: 2px; }
.seg a, .seg span { padding: 7px 14px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; display: block; }
.seg a.on, .seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg-form input { position: absolute; opacity: 0; pointer-events: none; }
.letter-kk { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.tile-kk { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.tile-flag { position: absolute; top: 8px; left: 8px; padding: 2px 7px; border-radius: 6px; font-size: 10px; font-weight: 700;
  background: var(--accent); color: #fff; letter-spacing: .05em; }
.tile-empty { flex-direction: column; gap: 4px; }
.tile-empty small { font-size: 11px; color: var(--muted); }
.tile-upload { display: flex; flex-direction: column; gap: 2px; }
.link { color: var(--accent); cursor: pointer; }

/* ── Обучение модели ── */
.train-card { display: flex; flex-direction: column; gap: 14px; }
.train-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.train-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.train-stats div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.train-stats dt { font-size: 12px; color: var(--muted); }
.train-stats dd { font-size: 18px; font-weight: 700; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; }
.train-log { font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 10px 12px; white-space: pre-wrap; max-height: 140px; overflow: auto; }

/* ── Алфавиты: фильтр, замки, страница буквы, форма ── */
.lang-filter { margin-bottom: 20px; }
.seg-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg-wrap { flex-wrap: wrap; }
.seg-form label { position: relative; }
.alpha-section { margin-bottom: 32px; }
.alpha-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.tiles-sm { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.tiles-sm .tile-letter { font-size: 26px; }
.tile-link { color: var(--text); }
.tile-link:hover { color: var(--text); border-color: var(--accent); }
.tile-locked { background: var(--surface-2); box-shadow: none; opacity: .75; }
.tile-locked:hover { transform: none; }
.tile-lock { display: grid; place-items: center; background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 8px, var(--border) 8px, var(--border) 9px); cursor: default; }
.lock { font-size: 28px; filter: grayscale(1); opacity: .7; }
.tile-locked .tile-letter { color: var(--muted); }
.letter-locked { opacity: .35; cursor: not-allowed; background: var(--surface-2); }
.letter-head { display: flex; align-items: center; gap: 16px; }
.letter-big { width: 72px; height: 72px; border-radius: 18px; display: grid; place-items: center; background: var(--accent); color: #fff;
  font-size: 40px; font-weight: 800; flex-shrink: 0; }
.cam-ref-big { aspect-ratio: 4 / 3; }
.how { display: flex; gap: 14px; align-items: flex-start; }
.how p + p { margin-top: 8px; }
.how-img { width: 110px; height: 110px; object-fit: cover; border-radius: 12px; flex-shrink: 0; }
.danger-zone { margin-top: 8px; display: flex; justify-content: flex-end; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } .how { flex-direction: column; } }
.letter-form { max-width: 760px; }
.new-lang { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.input-letter { font-size: 24px !important; font-weight: 700; max-width: 160px; }
.form-preview { width: 100%; max-height: 320px; border-radius: var(--radius-sm); background: #0b0c10; }
/* ── Страницы ошибок ── */
.error-page { text-align: center; padding: 48px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.error-code { font-size: 72px; font-weight: 800; color: var(--accent); line-height: 1; }

/* ── Подсказки «что исправить» ── */
.cam-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); max-width: calc(100% - 28px);
  padding: 9px 16px; border-radius: 999px; background: rgba(210, 40, 40, .92); color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .3); text-align: center; animation: hintIn .25s ease-out; }
@keyframes hintIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.hints { border-top: 1px solid var(--border); padding: 12px 14px 14px; background: var(--bad-soft); }
.hints-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--bad); margin-bottom: 8px; }
.hints ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.hints li { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.hint-ico { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: var(--surface); font-size: 18px; }