/* ============================================================
   QA Platform — дизайн-система
   Токены: светлая и тёмная тема через data-theme на <html>
   ============================================================ */

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'SF Mono', ui-monospace, Menlo, Consolas, monospace;

  --accent-1: #6366f1;
  --accent-2: #8b5cf6;
  --accent-3: #a855f7;
  --grad: linear-gradient(135deg, var(--accent-1), var(--accent-3));

  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 9px;

  --dur: .22s;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

:root[data-theme="light"] {
  --bg: #f5f6fa;
  --bg-soft: #eef0f6;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --text: #10162b;
  --text-2: #5b657c;
  --text-3: #9aa3b8;
  --border: #e6e9f2;
  --border-strong: #d5dae8;
  --accent-soft: #eef0ff;
  --success: #16a34a;
  --success-bg: #eafaf0;
  --danger: #dc2626;
  --danger-bg: #fdeeee;
  --warning: #b45309;
  --warning-bg: #fdf3e0;
  --shadow-sm: 0 1px 2px rgba(16, 22, 43, .05);
  --shadow: 0 1px 3px rgba(16, 22, 43, .06), 0 8px 24px -12px rgba(16, 22, 43, .14);
  --shadow-lg: 0 4px 12px rgba(16, 22, 43, .06), 0 24px 48px -16px rgba(16, 22, 43, .22);
  --topbar-bg: rgba(255, 255, 255, .82);
  --editor-bg: #0e1428;
  --editor-text: #dbe4ff;
  --editor-border: #232c4d;
}

:root[data-theme="dark"] {
  --bg: #0b0f1e;
  --bg-soft: #101529;
  --surface: #141a30;
  --surface-2: #1a2138;
  --text: #eef1fb;
  --text-2: #a7b0c8;
  --text-3: #6b7590;
  --border: #232b47;
  --border-strong: #2f3860;
  --accent-soft: #1e2350;
  --success: #4ade80;
  --success-bg: #12301f;
  --danger: #f87171;
  --danger-bg: #3a1a1c;
  --warning: #fbbf24;
  --warning-bg: #3a2c10;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, .35), 0 24px 48px -16px rgba(0, 0, 0, .6);
  --topbar-bg: rgba(15, 20, 40, .8);
  --editor-bg: #0e1428;
  --editor-text: #dbe4ff;
  --editor-border: #2b365e;
}

/* ---------- База ---------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; }
h2 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; margin: 0 0 14px; }
h3 { font-size: 13px; font-weight: 600; margin: 0 0 8px; }

.page-sub { color: var(--text-2); font-size: 14.5px; margin: 0 0 26px; }
.hint { color: var(--text-2); font-size: 13px; }

main { max-width: 1140px; margin: 0 auto; padding: 32px 24px 72px; }

::selection { background: rgba(139, 92, 246, .28); }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise .45s var(--ease) both; }
.rise-2 { animation: rise .45s var(--ease) .08s both; }
.rise-3 { animation: rise .45s var(--ease) .16s both; }

/* ---------- Шапка ---------- */

header.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 62px;
  padding: 0 24px;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand svg { display: block; }

header.topbar nav { display: flex; gap: 2px; flex: 1; }

header.topbar nav a {
  position: relative;
  color: var(--text-2);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 550;
  transition: color var(--dur), background var(--dur);
}
header.topbar nav a:hover { color: var(--text); background: var(--bg-soft); }
header.topbar nav a.active { color: var(--accent-1); background: var(--accent-soft); }

.top-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--dur);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.icon-btn svg { width: 17px; height: 17px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex: none;
}
.user-chip .user-email { font-size: 13px; color: var(--text-2); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#nav-burger { display: none; }

/* ---------- Панели ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  transition: background var(--dur), border-color var(--dur);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--grad);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--dur);
  box-shadow: 0 2px 10px -2px rgba(99, 102, 241, .45);
}
.btn:hover { filter: brightness(1.08); box-shadow: 0 4px 18px -4px rgba(99, 102, 241, .6); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; filter: none; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}
.btn-secondary:hover { background: var(--bg-soft); box-shadow: var(--shadow-sm); filter: none; }

.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

/* ---------- Формы ---------- */

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 16px 0 6px;
  color: var(--text-2);
}

input[type="email"], input[type="password"], input[type="text"], select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--dur), box-shadow var(--dur);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .18);
}

select { cursor: pointer; }

textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--editor-border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.65;
  background: var(--editor-bg);
  color: var(--editor-text);
  caret-color: #8b9dff;
  resize: vertical;
  tab-size: 2;
  transition: border-color var(--dur), box-shadow var(--dur);
}
textarea::placeholder { color: #52608f; }

.error-msg { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }
.ok-msg { color: var(--success); font-size: 13px; margin-top: 10px; }

/* ---------- Страницы авторизации ---------- */

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(99, 102, 241, .16), transparent 60%),
    radial-gradient(800px 500px at 110% 15%, rgba(168, 85, 247, .14), transparent 55%),
    radial-gradient(700px 600px at 50% 120%, rgba(56, 189, 248, .1), transparent 60%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 38px 36px 32px;
  box-shadow: var(--shadow-lg);
  animation: rise .5s var(--ease) both;
}

.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth-logo .name { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.auth-logo .tagline { font-size: 12.5px; color: var(--text-2); margin-top: 1px; }

.auth-card h1 { font-size: 21px; }
.auth-card .btn { width: 100%; margin-top: 22px; padding: 12px; }

.auth-foot { text-align: center; margin-top: 20px; font-size: 12.5px; color: var(--text-3); }

/* ---------- Дашборд ---------- */

.hero { margin-bottom: 28px; }
.hero h1 { font-size: 30px; }

.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 18px;
}

.section-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  transition: all var(--dur) var(--ease);
  box-shadow: var(--shadow-sm);
}
.section-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad);
  opacity: 0;
  transition: opacity var(--dur);
}
.section-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}
.section-card:hover::before { opacity: 1; }

.section-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-1);
  margin-bottom: 4px;
}
.section-icon svg { width: 22px; height: 22px; }

.section-card h2 { margin: 0; font-size: 17px; }
.section-card p { font-size: 13.5px; color: var(--text-2); margin: 0; flex: 1; }

.card-progress { margin-top: 6px; }
.card-progress .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.card-progress .meta b { color: var(--text); font-weight: 650; }

.card-arrow {
  position: absolute;
  top: 22px;
  right: 20px;
  color: var(--text-3);
  transition: all var(--dur);
}
.section-card:hover .card-arrow { color: var(--accent-1); transform: translateX(3px); }

/* ---------- Прогресс ---------- */

.progress-bar {
  height: 8px;
  background: var(--bg-soft);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar > div {
  height: 100%;
  background: var(--grad);
  border-radius: 99px;
  transition: width .5s var(--ease);
}

.progress-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.progress-row .progress-bar { flex: 1; min-width: 160px; }

.stat-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
}
.stat-pill b { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-pill.accent { background: var(--accent-soft); border-color: transparent; }
.stat-pill.accent b { color: var(--accent-1); }

/* ---------- Раздел SQL ---------- */

.task-nav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.task-nav select { width: auto; min-width: 150px; }

.nav-arrow {
  width: 40px;
  height: 40px;
  padding: 0;
  flex: none;
}

.task-text { font-size: 15.5px; line-height: 1.65; margin: 2px 0 4px; }

.tables-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 720px) {
  .tables-grid { grid-template-columns: 1fr; }
}
.table-card {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--surface-2);
}
.table-card h3 {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent-2);
  display: flex;
  align-items: center;
  gap: 7px;
}
.table-card h3::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--grad);
  flex: none;
}

.collapse-btn { margin-left: auto; }
.collapsed .tables-grid { display: none; }

.editor-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.editor-label .kbd-hint { font-size: 11.5px; color: var(--text-3); text-transform: none; letter-spacing: 0; font-weight: 500; }
kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text-2);
}

.actions-row { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }

.verdict {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 550;
  animation: rise .3s var(--ease) both;
}
.verdict.pass { background: var(--success-bg); color: var(--success); }
.verdict.fail { background: var(--danger-bg); color: var(--danger); }
.hidden { display: none !important; }

#result-area { margin-top: 16px; overflow-x: auto; }
#result-area .result-title { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); margin: 0 0 8px; }

/* ---------- Раздел Git ---------- */

.cmd-input {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--editor-border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 14px;
  background: var(--editor-bg);
  color: var(--editor-text);
  caret-color: #8b9dff;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.cmd-input::placeholder { color: #52608f; }
.cmd-input:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .18);
}

.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 450;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  margin: 0;
  line-height: 1.5;
  transition: all var(--dur);
}
.choice:hover { border-color: var(--accent-1); background: var(--accent-soft); }
.choice input {
  accent-color: var(--accent-1);
  margin: 3px 0 0;
  flex: none;
  width: 16px;
  height: 16px;
}
.choice:has(input:checked) {
  border-color: var(--accent-1);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-1);
}

.diagram-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 18px 14px 10px;
  margin: 4px 0 18px;
}
.diagram-wrap svg { display: block; min-width: 100%; }

/* ---------- Раздел Bash: окно терминала ---------- */

.term {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--editor-border);
  margin: 4px 0 18px;
  box-shadow: var(--shadow-sm);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: #1b2340;
}
.term-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.term-dot.red { background: #ff5f57; }
.term-dot.yellow { background: #febc2e; }
.term-dot.green { background: #28c840; }
.term-title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: #8b93b8;
}
.term-body {
  margin: 0;
  padding: 14px 18px;
  background: var(--editor-bg);
  color: var(--editor-text);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
}

.cmd-row { display: flex; align-items: center; gap: 0; }
.cmd-row .cmd-prompt {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: #4ade80;
  background: var(--editor-bg);
  border: 1px solid var(--editor-border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 13px 4px 13px 16px;
  user-select: none;
}
.cmd-row .cmd-input {
  border-radius: 0 var(--radius) var(--radius) 0;
  border-left: none;
}
.cmd-row .cmd-input:focus { box-shadow: none; border-color: var(--editor-border); }

/* ---------- Достижения ---------- */

.ach-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 14, 30, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn .25s var(--ease) both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.ach-modal {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 40px 32px 30px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: achPop .45s cubic-bezier(.34, 1.56, .64, 1) both;
  overflow: hidden;
}
@keyframes achPop {
  from { opacity: 0; transform: scale(.8) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.ach-burst {
  position: absolute;
  top: -70px;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(139, 92, 246, .35), transparent 65%);
  pointer-events: none;
}

.ach-emoji {
  width: 92px;
  height: 92px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  background: var(--accent-soft);
  border: 2px solid var(--accent-1);
  box-shadow: 0 0 0 8px rgba(99, 102, 241, .12), 0 8px 24px -8px rgba(99, 102, 241, .5);
  animation: achGlow 1.8s ease-in-out infinite alternate;
}
@keyframes achGlow {
  from { box-shadow: 0 0 0 8px rgba(99, 102, 241, .10), 0 8px 24px -8px rgba(99, 102, 241, .4); }
  to   { box-shadow: 0 0 0 12px rgba(168, 85, 247, .16), 0 10px 30px -6px rgba(168, 85, 247, .6); }
}

.ach-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 6px;
}
.ach-title { font-size: 21px; margin: 0 0 8px; }
.ach-desc { font-size: 14.5px; color: var(--text-2); margin: 0 0 4px; line-height: 1.5; }
.ach-req { font-size: 12.5px; color: var(--text-3); margin: 6px 0 0; }
.ach-modal .btn { margin-top: 22px; width: 100%; }

/* Страница достижений */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.ach-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--dur);
  overflow: hidden;
}
.ach-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad);
}
.ach-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.ach-card .emoji {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 27px;
  background: var(--accent-soft);
  border: 1.5px solid var(--accent-1);
  margin-bottom: 4px;
}
.ach-card h3 { font-size: 15px; margin: 0; }
.ach-card .joke { font-size: 13px; color: var(--text-2); margin: 0; line-height: 1.45; flex: 1; }
.ach-card .req { font-size: 12px; color: var(--text-3); margin: 0; }
.ach-card .date { font-size: 12px; color: var(--success); font-weight: 600; margin: 0; }

.ach-card .mini-bar { height: 5px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.ach-card .mini-bar div { height: 100%; background: var(--grad); border-radius: 99px; }
.ach-card .mini-meta { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* Неполученные — серые */
.ach-card.locked::before { background: var(--border-strong); }
.ach-card.locked .emoji {
  filter: grayscale(1);
  opacity: .55;
  background: var(--bg-soft);
  border-color: var(--border-strong);
}
.ach-card.locked h3 { color: var(--text-2); }
.ach-card.locked .joke { color: var(--text-3); }
.ach-card.locked:hover { transform: none; box-shadow: none; }

.ach-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 30px 0 14px;
  font-size: 16px;
  font-weight: 650;
}
.ach-section-title:first-of-type { margin-top: 0; }
.ach-section-title .count { font-size: 12.5px; color: var(--text-3); font-weight: 500; }

/* ---------- Таблицы ---------- */

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
th, td { padding: 8px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
th {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-2);
  background: transparent;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--bg-soft); }
td.null { color: var(--text-3); font-style: italic; }

.table-wrap { overflow-x: auto; }

/* ---------- Бейджи и админка ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.admin { background: var(--accent-soft); color: var(--accent-2); }
.badge.user { background: var(--bg-soft); color: var(--text-2); }
.badge.active { background: var(--success-bg); color: var(--success); }
.badge.pending { background: var(--warning-bg); color: var(--warning); }

.invite-form { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.invite-form > div { flex: 1; min-width: 200px; }
.invite-form label { margin-top: 0; }
.invite-form .btn { margin: 0; height: 43px; }

.link-box {
  background: var(--bg-soft);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  font-family: var(--mono);
  word-break: break-all;
  margin-top: 12px;
  color: var(--text-2);
}

.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .avatar { width: 32px; height: 32px; font-size: 13px; }

/* ---------- Раздел Postman: мок интерфейса ---------- */

.pm-window {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 4px 0 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  font-size: 13px;
}
.pm-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
}
.pm-top .pm-logo { display: flex; align-items: center; gap: 7px; font-weight: 650; color: var(--text); }
.pm-top .pm-logo::before {
  content: '';
  width: 14px; height: 14px; border-radius: 50%;
  background: #ff6c37;
  flex: none;
}
.pm-env {
  padding: 3px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  font-size: 12px;
  color: var(--text-2);
}

.pm-main { display: flex; }
.pm-side {
  flex: 0 0 220px;
  border-right: 1px solid var(--border);
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 2;
  color: var(--text-2);
  white-space: pre;
  overflow-x: auto;
}
.pm-content { flex: 1; min-width: 0; padding: 14px 16px; }

.pm-req { display: flex; align-items: center; gap: 0; margin-bottom: 12px; }
.pm-method {
  flex: none;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: var(--surface-2);
}
.pm-method.GET { color: #16a34a; }
.pm-method.POST { color: #d97706; }
.pm-method.PUT { color: #2563eb; }
.pm-method.PATCH { color: #9333ea; }
.pm-method.DELETE, .pm-method.DEL { color: #dc2626; }
.pm-url {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pm-url.empty { color: var(--text-3); font-style: italic; }
.pm-send {
  flex: none;
  padding: 9px 20px;
  background: #ff6c37;
  color: #fff;
  font-weight: 650;
  font-size: 13px;
  border-radius: 0 8px 8px 0;
  border: 1px solid #ff6c37;
}
.pm-save { flex: none; margin-left: 8px; padding: 9px 14px; border: 1px solid var(--border-strong); border-radius: 8px; color: var(--text-2); font-size: 12.5px; }

.pm-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 12px; flex-wrap: wrap; }
.pm-tab { padding: 7px 12px; font-size: 12px; color: var(--text-3); border-bottom: 2px solid transparent; white-space: nowrap; }
.pm-tab.active { color: var(--text); border-bottom-color: #ff6c37; font-weight: 600; }

.pm-kv { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pm-kv th, .pm-kv td {
  border: 1px solid var(--border);
  padding: 7px 10px;
  text-align: left;
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}
.pm-kv th { color: var(--text-3); font-weight: 600; background: var(--surface-2); }
.pm-kv td:empty::after { content: '…'; color: var(--text-3); }

.pm-code {
  background: var(--editor-bg);
  color: var(--editor-text);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.75;
  overflow-x: auto;
  white-space: pre;
}
.pm-code .pm-code-title { color: #8b93b8; font-size: 11px; margin-bottom: 6px; }

.pm-resp {
  margin-top: 12px;
  border-top: 1px dashed var(--border-strong);
  padding-top: 12px;
}
.pm-resp-meta { display: flex; gap: 18px; font-size: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.pm-resp-meta b { color: #16a34a; font-weight: 650; }
.pm-resp-meta b.err { color: #dc2626; }
.pm-resp-meta span { color: var(--text-2); }

.pm-focus { outline: 2px dashed #ff6c37; outline-offset: 3px; border-radius: 8px; }

.pm-caption { font-size: 12px; color: var(--text-3); padding: 8px 16px 12px; font-style: italic; }

@media (max-width: 720px) {
  .pm-side { display: none; }
}

/* ---------- Раздел Charles Proxy: мок интерфейса ---------- */

.ch-window {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 4px 0 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  font-size: 13px;
}
.ch-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 650;
  color: var(--text);
}
.ch-top::before {
  content: '';
  width: 14px; height: 14px; border-radius: 4px;
  background: linear-gradient(135deg, #eab308, #64748b);
  flex: none;
}
.ch-toolbar {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.ch-tool {
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}
.ch-tool.on {
  border-color: #eab308;
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 0 0 1px #eab308 inset;
}

.ch-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }

.ch-tree {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.95;
  color: var(--text-2);
  white-space: pre;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--surface-2);
}

.ch-seq { width: 100%; border-collapse: collapse; }
.ch-seq th, .ch-seq td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  text-align: left;
  white-space: nowrap;
}
.ch-seq th { background: var(--surface-2); color: var(--text-3); font-weight: 600; }

.ch-detail {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.ch-detail-tabs { display: flex; gap: 2px; padding: 6px 10px 0; background: var(--surface-2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ch-detail-tab { padding: 5px 11px; font-size: 11.5px; color: var(--text-3); border-radius: 6px 6px 0 0; white-space: nowrap; }
.ch-detail-tab.active { background: var(--surface); color: var(--text); font-weight: 600; border: 1px solid var(--border); border-bottom-color: var(--surface); }
.ch-detail-body {
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.85;
  color: var(--text-2);
  white-space: pre;
  overflow-x: auto;
}

.ch-dialog {
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  max-width: 520px;
}
.ch-dialog-title {
  padding: 8px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 650;
}
.ch-dialog-body {
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 2;
  color: var(--text-2);
  white-space: pre;
  overflow-x: auto;
}

.ch-focus { outline: 2px dashed #eab308; outline-offset: 3px; border-radius: 8px; }
.ch-caption { font-size: 12px; color: var(--text-3); padding: 0 16px 12px; font-style: italic; }

/* ---------- Раздел DevTools: мок интерфейса ---------- */

.dv-window {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 4px 0 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  font-size: 13px;
}
.dv-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 650;
}
.dv-top::before {
  content: '';
  width: 14px; height: 14px; border-radius: 4px;
  background: #4285f4;
  flex: none;
}
.dv-tabs { display: flex; gap: 2px; padding: 8px 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.dv-tab { padding: 6px 12px; font-size: 12px; color: var(--text-3); border-bottom: 2px solid transparent; white-space: nowrap; }
.dv-tab.active { color: var(--text); border-bottom-color: #4285f4; font-weight: 600; }
.dv-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }

.dv-tree {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.9;
  color: var(--text-2);
  white-space: pre;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--surface-2);
}
.dv-tree .tag { color: #a855f7; }

.dv-styles {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.dv-styles-sel { padding: 7px 12px; font-family: var(--mono); font-size: 12px; color: #4285f4; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.dv-styles-body { padding: 8px 12px; font-family: var(--mono); font-size: 12px; line-height: 1.9; }
.dv-styles-body .rule.strike { text-decoration: line-through; color: var(--text-3); }
.dv-styles-body .rule .prop { color: #e06c75; }
.dv-styles-body .rule .val { color: var(--text); }

.dv-console { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; font-family: var(--mono); font-size: 12px; }
.dv-console-line { padding: 7px 12px; border-bottom: 1px solid var(--border); }
.dv-console-line:last-child { border-bottom: none; }
.dv-console-line.log { color: var(--text-2); }
.dv-console-line.warn { background: var(--warning-bg); color: var(--warning); }
.dv-console-line.error { background: var(--danger-bg); color: var(--danger); }

.dv-table { width: 100%; border-collapse: collapse; }
.dv-table caption { caption-side: top; text-align: left; font-size: 12.5px; font-weight: 650; padding-bottom: 8px; }
.dv-table th, .dv-table td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  text-align: left;
  white-space: nowrap;
}
.dv-table th { background: var(--surface-2); color: var(--text-3); font-weight: 600; }

.dv-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  overflow: hidden;
  max-width: 560px;
}
.dv-panel-title { padding: 8px 14px; font-size: 12px; font-weight: 650; border-bottom: 1px solid var(--border); }
.dv-panel-body {
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 2;
  color: var(--text-2);
  white-space: pre;
  overflow-x: auto;
}

.dv-code {
  background: var(--editor-bg);
  color: var(--editor-text);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.85;
  overflow-x: auto;
  white-space: pre;
}
.dv-code .dv-code-title { color: #8b93b8; font-size: 11px; margin-bottom: 6px; }

.dv-focus { outline: 2px dashed #4285f4; outline-offset: 3px; border-radius: 8px; }
.dv-caption { font-size: 12px; color: var(--text-3); padding: 0 16px 12px; font-style: italic; }

/* ---------- Раздел Redis: мок интерфейса ---------- */

.rd-window {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 4px 0 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  font-size: 13px;
}
.rd-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 650;
}
.rd-top::before {
  content: '';
  width: 14px; height: 14px; border-radius: 4px;
  background: #dc382d;
  flex: none;
}
.rd-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }

.rd-table { width: 100%; border-collapse: collapse; }
.rd-table caption { caption-side: top; text-align: left; font-size: 12.5px; font-weight: 650; padding-bottom: 8px; }
.rd-table th, .rd-table td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  text-align: left;
  white-space: nowrap;
}
.rd-table th { background: var(--surface-2); color: var(--text-3); font-weight: 600; }

.rd-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  overflow: hidden;
  max-width: 560px;
}
.rd-panel-title { padding: 8px 14px; font-size: 12px; font-weight: 650; border-bottom: 1px solid var(--border); }
.rd-panel-body {
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 2;
  color: var(--text-2);
  white-space: pre;
  overflow-x: auto;
}

.rd-focus { outline: 2px dashed #dc382d; outline-offset: 3px; border-radius: 8px; }
.rd-caption { font-size: 12px; color: var(--text-3); padding: 0 16px 12px; font-style: italic; }

/* ---------- Раздел RabbitMQ: мок интерфейса ---------- */

.rq-window {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 4px 0 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  font-size: 13px;
}
.rq-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 650;
}
.rq-top::before {
  content: '';
  width: 14px; height: 14px; border-radius: 4px;
  background: #ff6600;
  flex: none;
}
.rq-tabs { display: flex; gap: 2px; padding: 8px 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rq-tab { padding: 6px 12px; font-size: 12px; color: var(--text-3); border-bottom: 2px solid transparent; white-space: nowrap; }
.rq-tab.active { color: var(--text); border-bottom-color: #ff6600; font-weight: 600; }
.rq-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }

.rq-table { width: 100%; border-collapse: collapse; }
.rq-table caption { caption-side: top; text-align: left; font-size: 12.5px; font-weight: 650; padding-bottom: 8px; }
.rq-table th, .rq-table td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  text-align: left;
  white-space: nowrap;
}
.rq-table th { background: var(--surface-2); color: var(--text-3); font-weight: 600; }

.rq-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  overflow: hidden;
  max-width: 560px;
}
.rq-panel-title { padding: 8px 14px; font-size: 12px; font-weight: 650; border-bottom: 1px solid var(--border); }
.rq-panel-body {
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 2;
  color: var(--text-2);
  white-space: pre;
  overflow-x: auto;
}

.rq-focus { outline: 2px dashed #ff6600; outline-offset: 3px; border-radius: 8px; }
.rq-caption { font-size: 12px; color: var(--text-3); padding: 0 16px 12px; font-style: italic; }

/* ---------- Раздел Kafka: мок интерфейса ---------- */

.kf-window {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 4px 0 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  font-size: 13px;
}
.kf-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 650;
}
.kf-top::before {
  content: '';
  width: 14px; height: 14px; border-radius: 4px;
  background: #14b8a6;
  flex: none;
}
.kf-tabs { display: flex; gap: 2px; padding: 8px 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.kf-tab { padding: 6px 12px; font-size: 12px; color: var(--text-3); border-bottom: 2px solid transparent; white-space: nowrap; }
.kf-tab.active { color: var(--text); border-bottom-color: #14b8a6; font-weight: 600; }
.kf-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }

.kf-table { width: 100%; border-collapse: collapse; }
.kf-table caption { caption-side: top; text-align: left; font-size: 12.5px; font-weight: 650; padding-bottom: 8px; }
.kf-table th, .kf-table td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  text-align: left;
  white-space: nowrap;
}
.kf-table th { background: var(--surface-2); color: var(--text-3); font-weight: 600; }

.kf-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  overflow: hidden;
  max-width: 560px;
}
.kf-panel-title { padding: 8px 14px; font-size: 12px; font-weight: 650; border-bottom: 1px solid var(--border); }
.kf-panel-body {
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 2;
  color: var(--text-2);
  white-space: pre;
  overflow-x: auto;
}

.kf-focus { outline: 2px dashed #14b8a6; outline-offset: 3px; border-radius: 8px; }
.kf-caption { font-size: 12px; color: var(--text-3); padding: 0 16px 12px; font-style: italic; }

/* ---------- Раздел Jira: мок интерфейса ---------- */

.jr-window {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 4px 0 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  font-size: 13px;
}
.jr-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 650;
}
.jr-top::before {
  content: '';
  width: 14px; height: 14px; border-radius: 4px;
  background: #0052cc;
  flex: none;
}
.jr-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }

.jr-board { display: flex; gap: 12px; overflow-x: auto; }
.jr-col {
  flex: 1;
  min-width: 170px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}
.jr-col-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}
.jr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  color: var(--text-2);
}

.jr-issue {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  max-width: 560px;
}
.jr-issue-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.jr-type {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 3px 9px;
  border-radius: 5px;
  color: #fff;
  flex: none;
}
.jr-type.Bug { background: #e5493a; }
.jr-type.Task { background: #4bade8; }
.jr-type.Story { background: #63ba3c; }
.jr-type.Epic { background: #904ee2; }
.jr-type.Test { background: #00a3bf; }
.jr-type.Execution { background: #6b778c; }
.jr-key { font-family: var(--mono); font-size: 12px; color: var(--text-3); flex: none; }
.jr-summary { font-weight: 600; font-size: 13px; }
.jr-fields { padding: 10px 14px; }
.jr-fields table { width: 100%; border-collapse: collapse; }
.jr-fields td {
  padding: 5px 8px 5px 0;
  font-size: 12.5px;
  border: none;
  vertical-align: top;
  white-space: pre-line;
}
.jr-fields td:first-child { color: var(--text-3); width: 130px; }
.jr-fields tr:hover { background: transparent; }

.jr-jql {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--surface);
  color: var(--text);
}
.jr-jql .jr-jql-label {
  flex: none;
  font-size: 10.5px;
  font-weight: 700;
  color: #0052cc;
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 1px 6px;
}
.jr-jql .jr-jql-q { overflow-x: auto; white-space: nowrap; }
.jr-jql .jr-jql-q:empty::after { content: 'введите JQL…'; color: var(--text-3); font-style: italic; }

.jr-dialog {
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  max-width: 540px;
}
.jr-dialog-title {
  padding: 8px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 650;
}
.jr-dialog-body {
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 2;
  color: var(--text-2);
  white-space: pre;
  overflow-x: auto;
}

.jr-focus { outline: 2px dashed #0052cc; outline-offset: 3px; border-radius: 8px; }
.jr-caption { font-size: 12px; color: var(--text-3); padding: 0 16px 12px; font-style: italic; }

/* ---------- Раздел Тест-дизайн: визуализации ---------- */

.td-wrap { display: flex; flex-direction: column; gap: 14px; margin: 4px 0 18px; }

.td-form {
  max-width: 380px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.td-form-title {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 650;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.td-form-body { padding: 16px 20px 20px; }
.td-field { margin-bottom: 12px; }
.td-field .td-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 4px;
}
.td-field .td-input {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  min-height: 36px;
}
.td-field .td-input.empty { color: var(--text-3); font-style: italic; }
.td-field .td-hint { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.td-form .btn { width: 100%; margin-top: 6px; pointer-events: none; }

.td-table { width: 100%; border-collapse: collapse; }
.td-table caption {
  caption-side: top;
  text-align: left;
  font-size: 12.5px;
  font-weight: 650;
  padding-bottom: 8px;
  color: var(--text);
}
.td-table th, .td-table td {
  border: 1px solid var(--border);
  padding: 7px 12px;
  font-size: 12.5px;
  text-align: left;
}
.td-table th { background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 11.5px; }

.td-spec {
  border: 1px solid var(--border);
  border-left: 3px solid #10b981;
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
  max-width: 560px;
}
.td-spec-title { padding: 9px 16px; font-size: 12px; font-weight: 650; border-bottom: 1px solid var(--border); }
.td-spec-body {
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.9;
  color: var(--text-2);
  white-space: pre;
  overflow-x: auto;
}

.td-diagram {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px;
  overflow-x: auto;
}
.td-diagram svg { display: block; min-width: 100%; }

.td-caption { font-size: 12px; color: var(--text-3); font-style: italic; }

/* ---------- Гостевая шапка и футер ---------- */

.guest-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 62px;
  padding: 0 24px;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--border);
}
.guest-nav { display: flex; gap: 2px; flex: 1; justify-content: center; }
.guest-nav a {
  color: var(--text-2);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 550;
  transition: color var(--dur), background var(--dur);
}
.guest-nav a:hover { color: var(--text); background: var(--bg-soft); }
.guest-nav a.active { color: var(--accent-1); background: var(--accent-soft); }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  max-width: 1140px;
  margin: 0 auto;
  padding: 22px 24px 34px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-3);
}
.site-footer nav { display: flex; gap: 18px; }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent-1); }

@media (max-width: 640px) {
  .guest-nav { display: none; }
  .site-footer { justify-content: center; text-align: center; }
}

/* ---------- FAQ ---------- */

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color var(--dur);
}
.faq-item[open] { border-color: var(--accent-1); }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 17px 20px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-plus {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-1);
  font-size: 17px;
  font-weight: 500;
  transition: transform var(--dur);
}
.faq-item[open] .faq-plus { transform: rotate(45deg); }
.faq-body { padding: 0 20px 18px; color: var(--text-2); font-size: 14.5px; line-height: 1.65; }
.faq-body code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
}

/* ---------- Форма обратной связи ---------- */

.textarea-plain {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  font-family: var(--font);
  font-size: 14.5px;
  caret-color: auto;
}
.textarea-plain::placeholder { color: var(--text-3); }

.feedback-sent { text-align: center; padding: 40px 20px; }
.feedback-sent .mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--success-bg);
  color: var(--success);
}
.feedback-sent .mark svg { width: 34px; height: 34px; }

/* ---------- Заглушки разделов ---------- */

.empty-state {
  text-align: center;
  padding: 64px 24px;
}
.empty-state .section-icon { margin: 0 auto 18px; width: 60px; height: 60px; border-radius: 17px; }
.empty-state .section-icon svg { width: 28px; height: 28px; }
.empty-state h2 { font-size: 19px; margin-bottom: 6px; }
.empty-state p { color: var(--text-2); font-size: 14px; max-width: 420px; margin: 0 auto; }

/* ---------- Раздел SQL: сабтабы Теория / Практика ---------- */

.subtabs {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
}
.subtab {
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--dur);
}
.subtab:hover { color: var(--text); border-color: var(--border-strong); }
.subtab.active {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px -2px rgba(99, 102, 241, .45);
}

/* ---------- Раздел SQL: теория ---------- */

.chapter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chapter-pill {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 650;
  font-family: var(--mono);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--dur);
  padding: 0;
}
.chapter-pill:hover { border-color: var(--accent-1); color: var(--text); }
.chapter-pill.read { background: var(--accent-soft); color: var(--accent-1); border-color: transparent; }
.chapter-pill.current { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 2px 10px -2px rgba(99, 102, 241, .5); }

.theory-content { font-size: 15px; line-height: 1.7; }
.theory-content h2 { font-size: 21px; margin: 0 0 4px; }
.theory-content .chapter-kicker {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-1);
  margin-bottom: 8px;
}
.theory-content .chapter-lead { color: var(--text-2); font-size: 15px; margin: 0 0 22px; }
.theory-content h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 30px 0 10px;
  padding-top: 4px;
  color: var(--text);
}
.theory-content h3:first-of-type { margin-top: 0; }
.theory-content p { margin: 0 0 14px; color: var(--text); }
.theory-content ul, .theory-content ol { margin: 0 0 14px; padding-left: 22px; }
.theory-content li { margin-bottom: 6px; }
.theory-content code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--accent-soft);
  color: var(--accent-1);
  padding: 2px 6px;
  border-radius: 5px;
}
.theory-content strong { font-weight: 650; }

.theory-example { margin: 4px 0 22px; }
.theory-example .term { margin: 0 0 10px; }
.theory-example .example-caption {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 0 0 8px;
}

.theory-callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border-left: 3px solid var(--accent-1);
  margin: 4px 0 22px;
  font-size: 14px;
}
.theory-callout.warning { background: var(--warning-bg); border-left-color: var(--warning); }
.theory-callout b { display: block; margin-bottom: 3px; }
.theory-callout p { margin: 0; color: var(--text-2); }
.theory-callout p:not(:last-child) { margin-bottom: 6px; }

.pipeline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 2px;
}
.pipeline-step {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-2);
  white-space: nowrap;
}
.pipeline-step .ord {
  display: inline-block;
  margin-right: 7px;
  color: var(--text-3);
  font-weight: 700;
}
.pipeline-step.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-1); }
.pipeline-arrow { color: var(--text-3); flex: none; }
.pipeline-arrow svg { display: block; width: 15px; height: 15px; }
@media (max-width: 720px) { .pipeline { flex-direction: column; align-items: stretch; } .pipeline-arrow svg { transform: rotate(90deg); margin: 0 auto; } }

.group-grid { display: flex; gap: 14px; flex-wrap: wrap; margin: 4px 0 22px; }
.group-col {
  flex: 1;
  min-width: 150px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px 14px;
}
.group-col h4 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 650;
  color: var(--accent-1);
  font-family: var(--mono);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.group-col h4 span { color: var(--text-3); font-weight: 500; }
.group-col .chip {
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  margin-bottom: 6px;
}
.group-col .chip:last-child { margin-bottom: 0; }

.venn-row { display: flex; gap: 22px; flex-wrap: wrap; margin: 4px 0 22px; justify-content: center; }
.venn-item { text-align: center; width: 150px; }
.venn-item svg { display: block; margin: 0 auto 8px; }
.venn-item .venn-label { font-size: 12.5px; font-weight: 650; color: var(--text); }
.venn-item .venn-sub { font-size: 11.5px; color: var(--text-3); }

.compare-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 4px 0 22px; }
.compare-col {
  flex: 1;
  min-width: 220px;
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--border);
}
.compare-col.bad { background: var(--danger-bg); border-color: transparent; }
.compare-col.good { background: var(--success-bg); border-color: transparent; }
.compare-col .compare-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.compare-col.bad .compare-tag { color: var(--danger); }
.compare-col.good .compare-tag { color: var(--success); }
.compare-col p { margin: 0; font-size: 13.5px; color: var(--text); }
.compare-col pre {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-2);
}

.glossary dt {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent-1);
  margin-top: 12px;
  font-size: 13.5px;
}
.glossary dd { margin: 3px 0 0; color: var(--text-2); font-size: 13.5px; }

.theory-nav-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ---------- Адаптивность ---------- */

@media (max-width: 860px) {
  main { padding: 22px 16px 56px; }
  .hero h1 { font-size: 24px; }
  h1 { font-size: 22px; }
  .panel { padding: 20px 18px; border-radius: 15px; }

  header.topbar { gap: 14px; padding: 0 16px; }
  header.topbar nav {
    display: none;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 10px 14px 14px;
    box-shadow: var(--shadow-lg);
    gap: 4px;
  }
  header.topbar.nav-open nav { display: flex; animation: rise .25s var(--ease) both; }
  header.topbar nav a { padding: 12px 14px; font-size: 15px; }
  .brand { flex: 1; }
  #nav-burger { display: inline-flex; }
  .user-chip .user-email { display: none; }
  .user-chip { padding: 4px; border: none; background: transparent; }

  .invite-form .btn { width: 100%; }
  .task-nav select { flex: 1; }
}

@media (max-width: 480px) {
  .stat-pills { width: 100%; }
  .stat-pill { flex: 1; justify-content: center; }
  .auth-card { padding: 30px 24px 26px; }
}
