/* Оформление хаба «КГУ coding»: тёмная тема, современная и спокойная — бегущие символы на фоне,
   стеклянные панели со скруглениями, шрифт Inter (моноширинный — только для кода и ключей), изумрудный акцент.
   Шапка — общая для всех страниц (kgu-header.css). У каждого квеста своя тема в /<id>/assets/ — сюда она не попадает. */
:root {
  --bg: #0a0e14;
  --surface: rgba(17, 22, 31, .8);
  --surface-solid: #121822;
  --surface-2: rgba(255, 255, 255, .045);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #e6edf3;
  --dim: #94a3b8;
  --accent: #34d399;
  --accent-2: #10b981;
  --accent-ink: #03150d;
  --accent-soft: rgba(52, 211, 153, .14);
  --blue: #60a5fa;
  --bad: #f87171;
  --warn: #fbbf24;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 32px rgba(0, 0, 0, .35);
  --font: Inter, system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  /* прежние имена — для пульта презентаций и старых правил */
  --panel: var(--surface); --panel-2: var(--surface-solid); --green: var(--accent); --green-2: var(--accent-2); --green-ink: var(--accent-ink);
  --glow: var(--shadow);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.55 var(--font); color: var(--text); background: radial-gradient(1200px 600px at 15% -10%, rgba(52, 211, 153, .07), transparent 60%), radial-gradient(900px 500px at 100% 110%, rgba(96, 165, 250, .06), transparent 60%), var(--bg); min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
#rain { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .13; pointer-events: none; }
.hb-top, .hb-main { position: relative; z-index: 2; }
.hidden { display: none !important; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; font-family: var(--font); letter-spacing: -.015em; }
button, input, select, textarea { font: inherit; color: inherit; }
code, kbd { font-family: var(--mono); }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- шапка (общий вид — kgu-header.css) ---------- */
.hb-brand { display: flex; align-items: center; text-decoration: none; color: var(--text); min-width: 0; }
.hb-menu { position: relative; }
.hb-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-av { font-size: 17px; line-height: 1; }
.hb-caret { color: var(--dim); font-size: 11px; }
.hb-tlive { margin-left: 6px; color: #ff6b81; font-size: 12px; animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 520px) { .hb-user-name { display: none; } }

/* ---------- основное ---------- */
.hb-main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 48px; flex: 1; }
.hb-center { display: grid; place-items: center; min-height: calc(100vh - 220px); padding: 12px 0 32px; }
.hb-center > * { width: min(460px, 100%); }
/* подпись раздела (раньше — строка терминала) */
.hb-prompt { margin: 0 0 12px; color: var(--dim); font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.hb-prompt span { display: none; }
.hb-welcome { margin-bottom: 30px; }
.hb-welcome h1 { font-size: clamp(22px, 3vw, 30px); font-weight: 750; color: var(--text); }
.hb-welcome .hb-dim { margin: 6px 0 0; }
.hb-dim { color: var(--dim); }
/* текст прямо поверх символов — с мягким ореолом, чтобы читался */
.hb-prompt, .hb-welcome h1, .hb-welcome .hb-dim, .hb-page-title, .hb-crumbs { text-shadow: 0 1px 2px rgba(10, 14, 20, .9), 0 0 14px rgba(10, 14, 20, .9); }

/* ---------- панели (бывшие «окна терминала») ---------- */
.hb-term, .hb-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); }
.hb-card { padding: clamp(16px, 3vw, 24px); }
/* заголовок панели: маленькая подпись, без «точек окна» */
.hb-term-bar { display: flex; align-items: center; gap: 8px; padding: 14px 18px 0; color: var(--dim); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.hb-term-bar i { display: none; }
.hb-term-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-term-body { padding: 14px 18px 18px; }
.hb-term h2, .hb-card h2 { font-size: 19px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.hb-term .hb-dim { margin: 4px 0 6px; font-size: 13.5px; }

/* вкладки «вход · регистрация · по ключу» — сегменты */
.hb-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin-bottom: 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.hb-tab { border: 0; border-radius: 9px; background: none; padding: 8px 4px; color: var(--dim); cursor: pointer; font-weight: 600; font-size: 13.5px; transition: background .15s, color .15s; }
.hb-tab:hover { color: var(--text); }
.hb-tab.active { background: var(--surface-solid); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .35), inset 0 0 0 1px var(--line-2); }

/* формы */
.hb-form { display: flex; flex-direction: column; }
.hb-form label { font-size: 13px; font-weight: 500; color: var(--dim); margin: 12px 0 6px; }
.hb-form input, .hb-select { padding: 11px 13px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: rgba(5, 8, 12, .6); color: var(--text); caret-color: var(--accent); outline: 0; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.hb-form input:focus, .hb-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hb-select { width: 100%; }
.hb-check { margin: 6px 0 0; font-size: 12.5px; min-height: 18px; }
.hb-check.ok { color: var(--accent); }
.hb-check.bad { color: var(--bad); }
.hb-error { color: var(--bad); font-size: 13.5px; margin: 10px 0 0; min-height: 20px; }
.hb-hint { color: var(--dim); font-size: 13px; margin: 8px 0 0; }
.hb-form .hb-goal-auto { display: flex; align-items: center; gap: 8px; color: var(--text); cursor: pointer; }
.hb-form .hb-goal-auto input[type="checkbox"] { flex: none; width: 16px; height: 16px; padding: 0; margin: 0; accent-color: var(--accent); }

/* кнопки */
.hb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; padding: 11px 18px; border: 1px solid transparent; border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); font-weight: 650; text-decoration: none; text-align: center; cursor: pointer; box-shadow: 0 6px 18px rgba(16, 185, 129, .25); transition: transform .12s, box-shadow .15s, filter .15s; }
.hb-btn:hover { filter: brightness(1.06); box-shadow: 0 8px 24px rgba(16, 185, 129, .35); }
.hb-btn:active { transform: translateY(1px); }
.hb-btn:disabled { opacity: .55; cursor: wait; }
.hb-btn.ghost { background: var(--surface-2); color: var(--text); border-color: var(--line-2); box-shadow: none; }
.hb-btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.hb-btn.danger { background: linear-gradient(135deg, #f87171, #ef4444); color: #fff; box-shadow: 0 6px 18px rgba(239, 68, 68, .25); }
.hb-row { display: flex; gap: 10px; flex-wrap: wrap; }
.hb-small-btn { padding: 5px 11px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); font-weight: 600; font-size: 12.5px; cursor: pointer; white-space: nowrap; transition: border-color .15s, color .15s; }
.hb-small-btn:hover { border-color: var(--accent); color: var(--accent); }
.hb-small-btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.hb-linkbtn { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.hb-linkbtn:hover { color: var(--accent); }

/* аватары при регистрации */
.hb-avatars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.hb-avatars button { font-size: 20px; padding: 5px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; line-height: 1.35; transition: border-color .15s, background .15s, transform .12s; }
.hb-avatars button:hover { border-color: var(--line-2); transform: translateY(-1px); }
.hb-avatars button.sel { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 420px) { .hb-avatars { grid-template-columns: repeat(6, 1fr); } }

/* ---------- квесты ---------- */
/* разделы плашек: Изучение · Командная работа · Эксперименты */
.hb-cats { display: flex; flex-wrap: wrap; gap: 4px; align-self: flex-start; width: fit-content; max-width: 100%; padding: 4px; margin: 0 0 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.hb-cat { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 9px; background: none; padding: 8px 14px; color: var(--dim); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; transition: background .15s, color .15s; }
.hb-cat:hover { color: var(--text); }
.hb-cat.active { background: var(--surface-solid); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .35), inset 0 0 0 1px var(--line-2); }
.hb-cat b { min-width: 22px; padding: 1px 7px; border-radius: 99px; background: rgba(255, 255, 255, .07); color: var(--dim); font-size: 12px; text-align: center; }
.hb-cat.active b { background: var(--accent-soft); color: var(--accent); }
.hb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-content: start; gap: 18px; }
/* ячейка под плашку, которую квест рисует сам в своём стиле */
.hb-slot { display: flex; min-width: 0; }
.hb-slot > * { flex: 1; min-width: 0; }
/* стандартная плашка (если квест не рисует свою) */
.hb-quest { --qa: var(--accent); display: flex; flex-direction: column; gap: 12px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.hb-quest:hover { transform: translateY(-2px); border-color: var(--line-2); }
.hb-quest .hb-term-bar { display: none; }
.hb-quest-body { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.hb-quest-head { display: flex; gap: 12px; align-items: center; }
.hb-quest-icon { width: 46px; height: 46px; display: grid; place-items: center; font-size: 24px; border-radius: 12px; background: color-mix(in srgb, var(--qa) 16%, transparent); flex: none; }
.hb-quest h3 { font-size: 17px; }
.hb-tag { color: var(--dim); font-size: 12.5px; }
.hb-comment { margin: 0; color: var(--dim); font-size: 13.5px; }
.hb-stats { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--dim); }
.hb-stats b { color: var(--text); font-weight: 700; }
.hb-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; white-space: nowrap; overflow: hidden; }
.hb-ascii { color: var(--accent); letter-spacing: -.5px; overflow: hidden; }
.hb-ascii i { color: rgba(255, 255, 255, .15); font-style: normal; }
.hb-mine { padding: 6px 10px; border-radius: 8px; background: var(--accent-soft); font-size: 13.5px; }
.hb-quest-actions { display: flex; align-items: center; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.hb-quest-actions .hb-btn { margin-top: 0; }
.hb-link { color: var(--dim); text-decoration: none; font-size: 13px; padding: 8px 10px; border-radius: 8px; }
.hb-link:hover { background: var(--surface-2); color: var(--text); }
.hb-soon { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 260px; padding: 28px; border: 1px dashed var(--line-2); border-radius: 6px; color: var(--dim); font-size: 13.5px; text-align: center; }
.hb-soon b { color: var(--accent); font-size: 22px; }

/* ---------- низ, окна, уведомления ---------- */
.hb-modal { position: fixed; inset: 0; background: rgba(4, 7, 12, .6); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; z-index: 50; }
.hb-modal > * { width: min(480px, 100%); }
.hb-key { display: block; margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: rgba(5, 8, 12, .6); color: var(--accent); font-family: var(--mono); word-break: break-all; user-select: all; }
.hb-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 32px); padding: 11px 18px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(18, 24, 34, .95); color: var(--text); font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); backdrop-filter: blur(10px); }

/* ---------- окно подтверждения (KGU.confirm) ---------- */
.kgu-confirm { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(4, 7, 12, .6); backdrop-filter: blur(6px); }
.kgu-confirm-box { width: min(460px, 100%); padding: 22px 24px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface-solid); box-shadow: 0 24px 60px rgba(0, 0, 0, .55); font-family: var(--font); }
.kgu-confirm-title { margin: 0 0 8px; font-size: 18px; font-weight: 700; color: var(--text); }
.kgu-confirm-text { margin: 0 0 6px; color: var(--dim); font-size: 14px; }
.kgu-confirm-label { display: block; margin: 12px 0 6px; color: var(--dim); font-size: 13px; }
.kgu-confirm-label b { color: var(--warn); }
.kgu-confirm-input { width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: rgba(5, 8, 12, .6); color: var(--text); caret-color: var(--accent); outline: 0; font: inherit; }
.kgu-confirm-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.kgu-confirm-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.kgu-confirm-actions button { padding: 10px 16px; border: 1px solid transparent; border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); font: inherit; font-weight: 650; cursor: pointer; }
.kgu-confirm-ok.danger { background: linear-gradient(135deg, #f87171, #ef4444); color: #fff; }
.kgu-confirm-ok:disabled { opacity: .45; cursor: not-allowed; }
.kgu-confirm-cancel { background: var(--surface-2) !important; border-color: var(--line-2) !important; color: var(--text) !important; }

/* ---------- приложение преподавателя: разделы, таблицы, карточки настроек ---------- */
.hb-admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.hb-admin-table th, .hb-admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.hb-admin-table td.hb-td-wrap { white-space: normal; }
.hb-admin-table th { color: var(--dim); font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.hb-admin-table tbody tr:last-child td { border-bottom: 0; }
.hb-admin-table tr:hover td { background: rgba(255, 255, 255, .025); }
.hb-table-wrap { overflow-x: auto; padding: 4px 6px 6px; }
.hb-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--dim); font-size: 12px; font-weight: 600; white-space: nowrap; }
.hb-pill.ok { background: var(--accent-soft); border-color: rgba(52, 211, 153, .3); color: var(--accent); }
.hb-pill.warn { background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .3); color: var(--warn); }
.hb-pill-btn { cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
.hb-pill-btn:hover { border-color: var(--accent); color: var(--accent); }
.hb-admin-summary { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.hb-page-title { font-size: clamp(21px, 2.6vw, 27px); font-weight: 750; color: var(--text); margin-bottom: 4px; }
.hb-admin-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px 18px; flex-wrap: wrap; }
.hb-admin-title-row .hb-world-switch { margin: 0; }
.hb-admin-links { gap: 10px; }
.hb-admin-links .hb-btn { margin-top: 0; }
.hb-admin-stack { display: flex; flex-direction: column; gap: 16px; }
.hb-admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; }
.hb-admin-grid .hb-form input { flex: 1; }
.hb-danger { border-color: rgba(248, 113, 113, .3); }
.hb-danger .hb-small-btn { white-space: normal; text-align: left; }
.hb-git-phase { margin: 0 0 6px; font-weight: 600; color: var(--text); }
.hb-world-switch { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; padding: 8px 8px 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); backdrop-filter: blur(10px); }
.hb-crumbs { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--dim); font-size: 13px; }
.hb-crumbs button { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.hb-crumbs button:hover { text-decoration: underline; text-underline-offset: 3px; }
.hb-crumbs b { color: var(--text); font-weight: 600; }
.hb-tapp { display: flex; flex-direction: column; min-height: 0; }
.hb-tapp > .tv { display: flex; flex-direction: column; min-height: 0; }
.hb-tapp > .tv.hidden { display: none; }
/* шестерёнка управления внутри плашки квеста: на месте прежней ссылки «экран», цвет — от плашки */
.hb-tslot { position: relative; }
.hb-tslot .hb-gear { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 1px solid color-mix(in srgb, currentColor 45%, transparent); border-radius: 10px; background: none; box-shadow: none; font-size: 18px; line-height: 1; letter-spacing: 0; text-transform: none; text-decoration: none; opacity: .9; cursor: pointer; transition: opacity .15s, border-color .15s; }
.hb-tslot .hb-gear:hover { opacity: 1; border-color: currentColor; }
/* у Git основная кнопка — часть плашки-ссылки: строка «кнопка + шестерёнка» внизу плашки */
.hb-trow { display: inline-flex; align-items: center; gap: 10px; margin-top: auto; align-self: flex-start; }
.hb-trow > .qc-git-btn { margin: 0; }

/* выпадающие списки (select.js) — в палитре хаба */
body.hb-home { --ks-bg: #0d121a; --ks-panel: #121822; --ks-line: rgba(255, 255, 255, .1); --ks-line2: rgba(255, 255, 255, .18); --ks-text: #e6edf3; --ks-dim: #94a3b8; --ks-accent: #34d399; --ks-hover: rgba(52, 211, 153, .12); --ks-radius: 10px; }
.hb-form .ks-btn { padding: 10px 12px; }

/* ---------- широкий экран: всё в одном экране ----------
   Шапка и подвал на месте; карточки квестов и таблицы — в своих блоках со своей прокруткой. */
@media (min-width: 1000px) and (min-height: 500px), (min-width: 760px) and (min-height: 900px) {
  body.hb-home { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  body.hb-home .hb-main { min-height: 0; max-width: 1560px; display: flex; flex-direction: column; padding-top: 18px; padding-bottom: 12px; }
  body.hb-home .hb-center { min-height: 0; flex: 1; overflow: auto; padding: 8px 0; }
  body.hb-home .hb-welcome { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 16px; }
  body.hb-home .hb-welcome .hb-prompt { display: none; }
  body.hb-home .hb-welcome h1 { font-size: 24px; }
  body.hb-home .hb-welcome .hb-dim { margin: 0; }
  body.hb-home .hb-section { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  body.hb-home .hb-section > .hb-prompt, body.hb-home .hb-section > .hb-cats { flex: none; margin-bottom: 12px; }
  /* место вокруг карточек — под их тени и подъём при наведении */
  body.hb-home .hb-grid { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 6px 8px 16px; margin: 0 -8px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
  /* карточки компактнее: картинка квеста ниже, описание — до трёх строк */
  body.hb-home .hb-grid :is(.qc-css-art, .qc-jsif-map, .qc-jsl-art) { aspect-ratio: auto; height: 124px; max-height: none; }
  body.hb-home .hb-grid :is(.qc-jss-pic svg, .qc-jsf-plan svg) { height: 124px; }
  body.hb-home .hb-grid :is(.qc-html-desc, .qc-css-desc, .qc-jss-desc, .qc-jsif-desc, .qc-jsl-desc, .qc-jsf-desc, .qc-git-desc, .hb-comment) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  body.hb-home .hb-soon { min-height: 0; }
  /* приложение преподавателя: раздел занимает весь экран, длинное листается внутри */
  .hb-tapp:not(.hidden) { flex: 1; }
  .hb-tapp > .tv:not(.hidden) { flex: 1; overflow: auto; overscroll-behavior: contain; }
  .hb-tapp > .tv > .hb-admin-app, .hb-tapp > .tv > .pc-app { flex: 1; min-height: 0; }
  .hb-admin-app:not(.hidden) { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
  .hb-admin-head { flex: none; }
  .hb-admin-head .hb-admin-summary { margin: 8px 0 0; }
  .hb-admin-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, 420px); gap: 16px; }
  .hb-admin-body-left { grid-template-columns: minmax(330px, 440px) minmax(0, 1fr); }
  .hb-admin-app > .hb-admin-main { flex: 1; }
  .hb-admin-main { min-height: 0; display: flex; flex-direction: column; gap: 8px; }
  .hb-admin-main > .hb-term { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .hb-admin-main .hb-table-wrap { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
  .hb-admin-main thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-solid); }
  .hb-admin-main > .hb-hint { flex: none; margin: 0; }
  .hb-admin-aside { min-height: 0; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 14px; padding-right: 2px; }
  .hb-admin-aside .hb-admin-grid { grid-template-columns: 1fr; gap: 14px; }
}
@media (min-width: 1000px) and (max-width: 1199px) and (min-height: 500px) {
  body.hb-home .hb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1000px) and (max-width: 1279px) and (min-height: 500px) {
  .hb-admin-body { grid-template-columns: minmax(0, 1fr) minmax(290px, 340px); }
  .hb-admin-body-left { grid-template-columns: minmax(290px, 350px) minmax(0, 1fr); }
}
/* невысокий экран ноутбука: карточки целиком уменьшаем, чтобы первый ряд влезал вместе с кнопками */
@media (min-width: 1000px) and (min-height: 500px) and (max-height: 760px) {
  body.hb-home .hb-grid > * { zoom: .84; }
  body.hb-home .hb-grid { gap: 14px; }
}
@media (min-width: 760px) and (max-width: 999px) and (min-height: 900px) {
  body.hb-home .hb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* вход и регистрация на широком экране: плотнее, пароль и повтор — рядом, аватары — в одну строку */
@media (min-width: 1000px) and (min-height: 500px) {
  body.hb-home .hb-center > * { width: min(560px, 100%); }
  body.hb-home .hb-center .hb-term-body { padding: 14px 24px 18px; }
  body.hb-home .hb-tabs { margin-bottom: 10px; }
  body.hb-home .hb-center .hb-form label { margin: 8px 0 5px; }
  body.hb-home .hb-center .hb-form input { padding: 10px 12px; }
  body.hb-home .hb-center .hb-btn { margin-top: 14px; }
  body.hb-home .hb-center .hb-error { margin-top: 6px; }
  body.hb-home .hb-avatars { grid-template-columns: repeat(16, 1fr); gap: 4px; }
  body.hb-home .hb-avatars button { font-size: 17px; }
  #form-register:not(.hidden), #form-setup .hb-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px; }
  #form-register > *, #form-setup .hb-form > * { grid-column: 1 / -1; }
  #form-register label[for="reg-pass"], #reg-pass, #form-setup label[for="setup-pass"], #setup-pass { grid-column: 1; }
  #form-register label[for="reg-pass2"], #reg-pass2, #form-setup label[for="setup-pass2"], #setup-pass2 { grid-column: 2; }
  #form-register label[for="reg-pass"], #form-register label[for="reg-pass2"] { grid-row: 4; }
  #reg-pass, #reg-pass2 { grid-row: 5; }
  #form-setup label[for="setup-pass"], #form-setup label[for="setup-pass2"] { grid-row: 6; }
  #setup-pass, #setup-pass2 { grid-row: 7; }
}
