/* ============================================================
   МОХ — учебный партнёр
   Light/dark design system
   ============================================================ */

:root {
  --bg-0: #0b0f16;
  --bg-1: #0f141c;
  --bg-2: #151b24;
  --panel: #151c26;
  --panel-2: #1b2431;
  --panel-3: #243042;
  --inset: #0a0f16;
  --text: #e8edf4;
  --text-strong: #f8fafc;
  --text-soft: #c3ccda;
  --muted: #94a3b8;
  --muted-2: #7b8aa0;
  --accent: #7c9cff;
  --accent-2: #5b7cfa;
  --accent-rgb: 124, 156, 255;
  --accent-ink: #0b1220;
  --accent-soft: rgba(124, 156, 255, 0.14);
  --accent-softer: rgba(124, 156, 255, 0.07);
  --line-rgb: 148, 163, 184;
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.3);
  --subtle-rgb: 255, 255, 255;
  --panel-rgb: 21, 28, 38;
  --panel-deep-rgb: 13, 18, 26;
  --topbar-rgb: 11, 15, 22;
  --toast-bg: #1c2635;
  --graph-idle: #64748b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --topbar-h: 72px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg-0: #f5f7fb;
  --bg-1: #eef2f8;
  --bg-2: #e7ecf4;
  --panel: #ffffff;
  --panel-2: #f5f8fc;
  --panel-3: #e9eef7;
  --inset: #f8fafc;
  --text: #172033;
  --text-strong: #0b1220;
  --text-soft: #334155;
  --muted: #5b6778;
  --muted-2: #667386;
  --accent: #3556d9;
  --accent-2: #2b49c6;
  --accent-rgb: 53, 86, 217;
  --accent-ink: #ffffff;
  --accent-soft: rgba(53, 86, 217, 0.10);
  --accent-softer: rgba(53, 86, 217, 0.05);
  --line-rgb: 15, 23, 42;
  --line: rgba(15, 23, 42, 0.12);
  --line-strong: rgba(15, 23, 42, 0.22);
  --subtle-rgb: 15, 23, 42;
  --panel-rgb: 255, 255, 255;
  --panel-deep-rgb: 248, 250, 252;
  --topbar-rgb: 255, 255, 255;
  --toast-bg: #ffffff;
  --graph-idle: #94a3b8;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    linear-gradient(rgba(var(--line-rgb), 0.018) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(var(--line-rgb), 0.018) 1px, transparent 1px) 0 0 / 48px 48px,
    radial-gradient(1100px 680px at 82% -10%, rgba(var(--accent-rgb), 0.13), transparent 62%),
    radial-gradient(900px 620px at -8% 20%, rgba(var(--accent-rgb), 0.26), transparent 60%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1) 46%, var(--bg-1));
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

svg {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(var(--accent-rgb), 0.32);
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   App shell
   ============================================================ */

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app--workspace {
  height: 100dvh;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  flex: 0 0 auto;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 24px;
  background: rgba(var(--topbar-rgb), 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  border: 1px solid var(--line-strong);
  background: linear-gradient(145deg, var(--panel-3), var(--panel));
  box-shadow: inset 0 0 22px rgba(var(--accent-rgb), 0.08);
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

.brand-name {
  display: block;
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1;
  letter-spacing: 0.16em;
  color: var(--text-strong);
}

.brand-sub {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.menu {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.menu::-webkit-scrollbar {
  display: none;
}

.menu a {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.menu a:hover {
  color: var(--text);
  background: var(--accent-softer);
}

.menu a.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(var(--accent-rgb), 0.2);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.11);
}

.ai-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 999px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  font-size: 10.5px;
  font-weight: 550;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.ai-status[hidden] {
  display: none;
}

[data-theme="light"] .ai-status {
  color: #9a6700;
}

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--text);
  background: linear-gradient(145deg, var(--panel-3), var(--panel));
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.avatar:hover {
  border-color: var(--accent);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--panel-2);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--line-strong);
  background: var(--accent-softer);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

/* ============================================================
   Panels & shared bits
   ============================================================ */

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(var(--panel-rgb), 0.9), rgba(var(--panel-deep-rgb), 0.94));
  box-shadow: var(--shadow);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chip--muted {
  color: var(--muted);
  background: rgba(var(--subtle-rgb), 0.025);
  border-color: var(--line);
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 26px rgba(var(--accent-rgb), 0.16);
}

.btn--primary:hover {
  filter: brightness(1.06);
}

.btn--ghost {
  color: var(--text-soft);
  border-color: var(--line-strong);
  background: rgba(var(--subtle-rgb), 0.015);
}

.btn--ghost:hover {
  color: var(--text);
  background: var(--accent-softer);
  border-color: rgba(var(--accent-rgb), 0.45);
}

.btn--small {
  padding: 7px 11px;
  font-size: 11px;
}

.btn--wide {
  width: 100%;
}

/* ============================================================
   Main workspace: 4 zones
   ============================================================ */

.workspace {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
  padding: 16px 20px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.main-column {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-window {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ai-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.ai-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.ai-title {
  font-size: 13px;
  font-weight: 650;
}

.ai-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
}

.ai-sub .status-dot {
  width: 5px;
  height: 5px;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.ai-head .chip {
  margin-left: auto;
}

/* Chat */

.chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 22px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.22) transparent;
}

.chat::-webkit-scrollbar {
  width: 7px;
}

.chat::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.2);
  border-radius: 999px;
}

.msg {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 880px;
  margin: 0 auto 14px;
  animation: rise 0.26s ease both;
}

.msg--user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin-top: 1px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(var(--subtle-rgb), 0.025);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.msg--ai .msg-avatar {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.2);
  background: var(--accent-soft);
}

.msg--user .msg-avatar {
  border-radius: 50%;
  color: var(--text);
  background: var(--panel-3);
}

.msg-body {
  min-width: 0;
  max-width: 100%;
}

.msg--user .msg-body {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.msg-meta {
  display: flex;
  gap: 7px;
  margin: 0 0 5px;
  color: var(--muted-2);
  font-size: 10px;
}

.msg--user .msg-meta {
  justify-content: flex-end;
}

.msg-bubble {
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 4px 15px 15px 15px;
  color: var(--text);
  background: var(--panel-2);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.62;
}

.msg--user .msg-bubble {
  max-width: 640px;
  border-color: rgba(var(--accent-rgb), 0.24);
  border-radius: 15px 4px 15px 15px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.16), rgba(var(--accent-rgb), 0.08));
}

.msg--notice .msg-bubble {
  border-style: dashed;
  border-color: rgba(var(--accent-rgb), 0.42);
  background: linear-gradient(135deg, var(--accent-soft), var(--panel-2) 70%);
}

.msg--notice .msg-avatar {
  color: var(--accent);
}

.msg-bubble p {
  margin: 0 0 8px;
  white-space: pre-wrap;
}

.msg-bubble p:last-child {
  margin-bottom: 0;
}

.msg-bubble strong {
  color: var(--text);
  font-weight: 700;
}

.msg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

/* Goal card inside a message */

.goal-card {
  margin-top: 8px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--inset);
}

.goal-head {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.goal-row {
  display: flex;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(var(--line-rgb), 0.11);
  font-size: 12px;
  line-height: 1.45;
}

.goal-row:last-of-type {
  border-bottom: 0;
}

.goal-note {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.4;
}

.task-card {
  border-left: 3px solid var(--accent);
}

.task-card .goal-note {
  padding-top: 6px;
  border-top: 1px dashed rgba(var(--line-rgb), 0.11);
}

/* Quiz card */

.quiz-card {
  border-left: 3px solid var(--accent);
}

.quiz-item {
  padding: 10px 0;
  border-bottom: 1px dashed rgba(var(--line-rgb), 0.12);
}

.quiz-item:last-of-type {
  border-bottom: 0;
}

.quiz-question {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.quiz-item__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}

.quiz-item__strand {
  color: var(--accent);
  font-size: 8.5px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quiz-item__level {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-2);
  background: var(--panel-2);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quiz-options {
  display: grid;
  gap: 6px;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text-soft);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.quiz-option:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: var(--accent-soft);
  color: var(--text);
}

.quiz-option.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.quiz-mark {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  margin-top: 1px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.quiz-option--multi .quiz-mark {
  border-radius: 4px;
}

.quiz-option.is-selected .quiz-mark {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--panel-2);
}

.quiz-option--dontknow {
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}

.quiz-option.is-correct {
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  color: var(--text);
}

.quiz-option.is-correct .quiz-mark {
  border-color: #4ade80;
  background: #4ade80;
  box-shadow: none;
}

.quiz-option.is-wrong {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.1);
  color: var(--text);
}

.quiz-option.is-wrong .quiz-mark {
  border-color: #f87171;
  background: #f87171;
  box-shadow: none;
}

.quiz-option:disabled {
  cursor: default;
  opacity: 0.92;
}

.quiz-feedback {
  margin-top: 7px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.quiz-feedback--ok {
  background: rgba(74, 222, 128, 0.08);
}

.quiz-feedback--bad {
  background: rgba(248, 113, 113, 0.08);
}

.quiz-feedback strong {
  color: var(--text);
  font-weight: 700;
}

.quiz-explanation {
  margin-top: 4px;
  color: var(--muted-2);
}

.quiz-note-label {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 10.5px;
}

.quiz-note {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  resize: vertical;
}

.quiz-note:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.55);
}

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

.quiz-meta {
  color: var(--muted-2);
}

/* Probe report */

.probe-card {
  border-left: 3px solid var(--accent);
}

.probe-verdict {
  margin-bottom: 4px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.probe-strand {
  padding: 9px 0;
  border-bottom: 1px dashed rgba(var(--line-rgb), 0.12);
}

.probe-strand:last-of-type {
  border-bottom: 0;
}

.probe-strand__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.probe-strand__name {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 650;
}

.probe-strand__info {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.45;
}

.probe-strand__mis {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  font-style: italic;
  line-height: 1.45;
}

.probe-pill {
  flex: 0 0 auto;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-2);
  background: var(--panel-2);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.probe-pill--strong,
.probe-pill--edge {
  border-color: rgba(74, 222, 128, 0.5);
  color: var(--text);
  background: rgba(74, 222, 128, 0.1);
}

.probe-pill--floor {
  border-color: rgba(var(--accent-rgb), 0.4);
  color: var(--text);
  background: var(--accent-soft);
}

.probe-pill--gap {
  border-color: rgba(248, 113, 113, 0.5);
  color: var(--text);
  background: rgba(248, 113, 113, 0.1);
}

.probe-pill--unstable {
  border-color: rgba(251, 191, 36, 0.55);
  color: var(--text);
  background: rgba(251, 191, 36, 0.1);
}

.goal-key {
  flex: 0 0 72px;
  color: var(--muted);
}

.goal-val {
  color: var(--text-soft);
}

/* Stage check verdict */

.stage-verdict {
  border-left: 3px solid var(--line-strong);
}

.stage-verdict--pass {
  border-left-color: #4ade80;
  background: rgba(74, 222, 128, 0.07);
}

.stage-verdict--pass .goal-head {
  color: #4ade80;
}

.stage-verdict--fail {
  border-left-color: #fbbf24;
  background: rgba(251, 191, 36, 0.07);
}

.stage-verdict--fail .goal-head {
  color: #fbbf24;
}

[data-theme="light"] .stage-verdict--pass .goal-head {
  color: #1a7f37;
}

[data-theme="light"] .stage-verdict--fail .goal-head {
  color: #9a6700;
}

/* Rich content card: graph / table */

.rich-card {
  margin-top: 11px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--inset);
}

.rich-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
}

.rich-title {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
}

.tabs {
  display: inline-flex;
  gap: 2px;
  margin-left: auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(var(--subtle-rgb), 0.025);
}

.tab {
  padding: 4px 9px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.tab:hover {
  color: var(--text-soft);
}

.tab.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.rich-view {
  padding: 12px;
}

.dep-graph {
  width: 100%;
  height: auto;
  color: var(--muted);
}

.dep-graph text {
  font-family: var(--font-sans);
}

.dep-graph .g-caption {
  fill: currentColor;
  font-size: 9px;
  letter-spacing: 2px;
  opacity: 0.55;
}

.dep-graph .g-node circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  opacity: 0.35;
}

.dep-graph .g-node text {
  fill: currentColor;
  font-family: var(--font-sans);
}

.dep-graph .g-node .g-num {
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
}

.dep-graph .g-node .g-name {
  font-size: 10px;
  text-anchor: middle;
}

.dep-graph .g-node .g-state {
  font-size: 8.5px;
  text-anchor: middle;
  opacity: 0.6;
}

.dep-graph .g-node--done circle {
  stroke: var(--accent);
  opacity: 1;
}

.dep-graph .g-node--done .g-state {
  fill: var(--accent);
  opacity: 1;
}

.dep-graph .g-node--active circle {
  fill: var(--accent);
  stroke: var(--accent);
  opacity: 1;
}

.dep-graph .g-node--active .g-num {
  fill: var(--accent-ink);
}

.dep-graph .g-node--active .g-name {
  fill: var(--text);
}

.dep-graph .g-node--active .g-state {
  fill: var(--accent);
  opacity: 1;
}

.dep-graph .g-node--idle {
  opacity: 0.55;
}

.dep-graph .g-edge {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  opacity: 0.25;
  stroke-dasharray: 4 6;
}

.dep-graph .g-edge--done {
  stroke: var(--accent);
  opacity: 1;
  stroke-dasharray: none;
}

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

.mini-table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: 11.5px;
}

.mini-table th {
  padding: 7px 7px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.mini-table td {
  padding: 8px 7px;
  border-bottom: 1px solid rgba(var(--line-rgb), 0.08);
  color: var(--text-soft);
  vertical-align: top;
}

.mini-table tr:last-child td {
  border-bottom: 0;
}

.mini-table .chip {
  padding: 3px 7px;
  font-size: 8.5px;
}

/* Composer */

.composer {
  flex: 0 0 auto;
  padding: 10px 12px 8px;
}

.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.icon-btn {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: rgba(var(--subtle-rgb), 0.02);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.icon-btn:hover {
  color: var(--accent);
  border-color: var(--line-strong);
  background: var(--accent-softer);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 43px;
  max-height: 132px;
  resize: none;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: var(--inset);
  font-size: 13.5px;
  line-height: 1.45;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.composer textarea::placeholder {
  color: var(--muted-2);
}

.composer textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.075);
}

.send-btn {
  height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 0 15px;
  border: 0;
  border-radius: 13px;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(var(--accent-rgb), 0.16);
  transition: filter 0.18s ease, transform 0.18s ease;
}

.send-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.send-btn svg {
  width: 15px;
  height: 15px;
}

.composer-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 4px 0;
  color: var(--muted-2);
  font-size: 9.5px;
}

.file-chip {
  display: none;
  max-width: 240px;
  overflow: hidden;
  color: var(--accent);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip.show {
  display: inline-block;
  cursor: pointer;
}

.cooldown-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cooldown-hint[hidden] {
  display: none;
}

.cooldown-hint::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.65;
}

.composer-keys {
  white-space: nowrap;
}

.paywall {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid rgba(var(--accent-rgb), 0.38);
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%);
}

.paywall[hidden] {
  display: none;
}

.paywall-copy strong {
  display: block;
  color: var(--text-strong);
  font-size: 13px;
}

.paywall-copy p {
  max-width: 64ch;
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.5;
}

.paywall .btn {
  flex: 0 0 auto;
}

.composer--locked {
  opacity: 0.7;
}

.composer--locked textarea {
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .paywall {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   Right-side learning map
   ============================================================ */

.map-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.map-head {
  flex: 0 0 auto;
  padding: 16px 16px 11px;
  border-bottom: 1px solid var(--line);
}

.map-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.map-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 7px;
  color: var(--accent);
  background: var(--accent-soft);
}

.map-icon svg {
  width: 13px;
  height: 13px;
}

.map-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.map-goal {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.progress {
  height: 5px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(var(--subtle-rgb), 0.05);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.map-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.18) transparent;
}

.map-list::-webkit-scrollbar {
  width: 6px;
}

.map-list::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.18);
  border-radius: 999px;
}

.map-node {
  position: relative;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  gap: 9px;
  padding: 9px 7px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
}

.map-node + .map-node::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 20px;
  width: 1px;
  height: 17px;
  background: var(--line-strong);
}

.map-node--done + .map-node::before,
.map-node--active + .map-node::before {
  background: rgba(var(--accent-rgb), 0.45);
}

.map-node__dot {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  z-index: 1;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  background: var(--bg-2);
  font-size: 9px;
  font-weight: 700;
}

.map-node__body {
  min-width: 0;
  padding-top: 1px;
}

.map-node__title {
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
}

.map-node__sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.4;
}

.map-node__deps {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.map-node__status {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.map-node--done .map-node__dot {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.35);
  background: var(--accent-soft);
}

.map-node--done .map-node__status {
  color: var(--accent);
}

.map-node--active {
  border-color: rgba(var(--accent-rgb), 0.18);
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.08), transparent 80%);
}

.map-node--active .map-node__dot {
  color: var(--accent-ink);
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(var(--accent-rgb), 0.09);
  animation: pulse 2.6s ease-in-out infinite;
}

.map-node--active .map-node__title {
  color: var(--text);
}

.map-node--active .map-node__status {
  color: var(--accent);
}

.map-node--locked {
  opacity: 0.55;
}

.map-foot {
  flex: 0 0 auto;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--line);
}

.map-next {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.map-next strong {
  color: var(--text-soft);
  font-weight: 600;
}

.map-foot .btn {
  width: 100%;
  justify-content: center;
}

.map-foot .stage-escape {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

/* ============================================================
   Subpages
   ============================================================ */

.page {
  flex: 1;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 42px 24px 68px;
}

.page-head {
  max-width: 760px;
  margin-bottom: 28px;
}

.eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.page-title {
  margin: 9px 0 11px;
  font-family: var(--font-serif);
  font-size: clamp(34px, 4.2vw, 50px);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.025em;
  color: var(--text-strong);
}

.page-lede {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.7;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(var(--panel-rgb), 0.82), rgba(var(--panel-deep-rgb), 0.92));
  box-shadow: var(--shadow);
}

/* FAQ */

.faq-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  align-items: start;
}

.faq-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.faq-search {
  position: relative;
  flex: 1;
}

.faq-search svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--muted-2);
  transform: translateY(-50%);
  pointer-events: none;
}

.faq-search input {
  width: 100%;
  padding: 10px 13px 10px 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--inset);
  font-size: 12.5px;
  outline: none;
}

.faq-search input::placeholder {
  color: var(--muted-2);
}

.faq-search input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.07);
}

.faq-count {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 10px;
  white-space: nowrap;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(var(--panel-rgb), 0.72);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.faq-item:hover {
  border-color: rgba(var(--line-rgb), 0.24);
}

.faq-item.open {
  border-color: rgba(var(--accent-rgb), 0.3);
  background: rgba(var(--panel-rgb), 0.92);
}

.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.faq-q .q-badge {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.faq-q .plus {
  position: relative;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  margin-left: auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.faq-q .plus::before,
.faq-q .plus::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 1px;
  background: var(--muted);
  transform: translate(-50%, -50%);
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.faq-q .plus::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.faq-item.open .faq-q .plus {
  border-color: rgba(var(--accent-rgb), 0.45);
}

.faq-item.open .faq-q .plus::before,
.faq-item.open .faq-q .plus::after {
  background: var(--accent);
}

.faq-item.open .faq-q .plus::after {
  transform: translate(-50%, -50%) rotate(0deg);
  opacity: 0;
}

.faq-a {
  display: none;
  padding: 0 16px 16px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.faq-a p {
  margin: 0;
}

.faq-a p + p {
  margin-top: 8px;
}

.faq-item.open .faq-a {
  display: block;
}

.faq-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.side-card {
  padding: 20px;
}

.side-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 11px;
  color: var(--accent);
  background: var(--accent-soft);
}

.side-icon svg {
  width: 17px;
  height: 17px;
}

.side-card h2,
.side-card h3 {
  margin: 0 0 7px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 650;
}

.side-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.side-card--muted p {
  margin-bottom: 0;
}

.empty-state {
  margin: 14px 0 0;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

/* Subscription */

.pricing-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.billing-toggle {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--inset);
}

.billing-toggle button {
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.billing-toggle button.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.balance-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 18px;
  padding: 16px 20px;
}

.balance-bar[hidden] {
  display: none;
}

.balance-info {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.balance-label {
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.balance-value {
  color: var(--text-strong);
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1;
}

.balance-note {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.billing-note {
  margin: 12px 0 0;
  color: var(--muted-2);
  font-size: 10px;
  text-align: right;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 22px;
}

.plan--popular {
  border-color: rgba(var(--accent-rgb), 0.42);
  background:
    radial-gradient(420px 220px at 50% 0%, rgba(var(--accent-rgb), 0.13), transparent 70%),
    linear-gradient(180deg, rgba(var(--panel-rgb), 0.92), rgba(var(--panel-deep-rgb), 0.94));
  box-shadow: 0 28px 80px rgba(var(--accent-rgb), 0.09);
}

.plan-badge {
  position: absolute;
  top: -10px;
  left: 20px;
  padding: 4px 9px;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 999px;
  color: var(--accent);
  background: var(--panel-2);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.plan-name {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
}

.plan-desc {
  min-height: 32px;
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.plan-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px 0 2px;
}

.price-value {
  color: var(--text-strong);
  font-family: var(--font-serif);
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.price-currency {
  color: var(--text-soft);
  font-size: 16px;
}

.plan-period {
  flex-basis: 100%;
  color: var(--muted-2);
  font-size: 9.5px;
}

.plan-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.plan-save {
  color: #e3bf45;
  font-weight: 650;
}

.plan-list li {
  display: flex;
  gap: 7px;
}

.plan-list li::before {
  content: "✓";
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 700;
}

.plan .btn {
  margin-top: auto;
}

.includes {
  margin-top: 18px;
  padding: 18px 20px;
}

.includes h2 {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.include-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.include {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.include-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-softer);
}

.include-icon svg {
  width: 14px;
  height: 14px;
}

.pricing-note {
  margin: 14px 0 0;
  color: var(--muted-2);
  font-size: 10px;
}

/* Account */

.account-grid {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 20px;
  text-align: center;
}

.avatar-xl {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 23px;
  color: var(--text-strong);
  background: linear-gradient(145deg, var(--panel-3), var(--panel));
  font-family: var(--font-serif);
  font-size: 30px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.profile-name {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 650;
}

.profile-email {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 11.5px;
}

.profile-since {
  margin: 12px 0 16px;
  color: var(--muted-2);
  font-size: 10px;
}

.profile-card .btn {
  align-self: stretch;
}

.account-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  padding: 17px 18px;
}

.stat-value {
  color: var(--text-strong);
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-value small {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0;
}

.stat-label {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.activity-card,
.sessions-card {
  padding: 20px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.card-head h2 {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
}

.card-head .chip {
  margin-left: auto;
}

.bars {
  height: 126px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 0 2px;
}

.bar {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.bar span {
  width: 100%;
  max-width: 26px;
  height: var(--h);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.75), rgba(var(--accent-rgb), 0.16));
}

.bar label {
  color: var(--muted-2);
  font-size: 8.5px;
}

.sessions {
  display: flex;
  flex-direction: column;
}

.session {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(var(--line-rgb), 0.08);
  color: inherit;
  text-decoration: none;
}

.session:hover .session-title {
  color: var(--accent);
}

.session:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.session-date {
  flex: 0 0 104px;
  color: var(--muted-2);
  font-size: 9.5px;
}

.session-title {
  flex: 1;
  min-width: 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.4;
}

.session .chip {
  flex: 0 0 auto;
  font-size: 8px;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

/* Settings */

.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 880px;
}

.settings-card {
  padding: 20px 22px;
}

.settings-head {
  margin-bottom: 4px;
}

.settings-head h2 {
  margin: 0 0 4px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 650;
}

.settings-head p {
  margin: 0;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.5;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(var(--line-rgb), 0.08);
}

.setting-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.setting-row:first-of-type {
  padding-top: 15px;
}

.setting-copy {
  min-width: 0;
  flex: 1;
}

.setting-label {
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 550;
}

.setting-desc {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.45;
}

.setting-control {
  flex: 0 0 auto;
  margin-left: auto;
}

.setting-buttons {
  display: flex;
  gap: 8px;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 25px;
  flex: 0 0 auto;
  cursor: pointer;
}

.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch .track {
  position: relative;
  width: 100%;
  height: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(var(--subtle-rgb), 0.05);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.18s ease, background 0.18s ease;
}

.switch input:checked + .track {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.3);
}

.switch input:checked + .track::after {
  background: var(--accent);
  transform: translateX(19px);
}

.switch input:focus-visible + .track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.select {
  min-width: 164px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-soft);
  background: var(--inset);
  font-size: 11.5px;
  outline: none;
}

.select:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.07);
}

.theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--inset);
  font-size: 11px;
}

.theme-swatch {
  width: 15px;
  height: 15px;
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  border-radius: 5px;
  background: linear-gradient(135deg, var(--bg-2), var(--accent));
}

.settings-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 0 0;
}

.settings-note {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 9.5px;
}

/* Footer */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 22px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10px;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--accent);
}

/* Toast */

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  max-width: min(370px, calc(100vw - 40px));
  padding: 11px 15px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-left: 3px solid var(--accent);
  border-radius: 11px;
  color: var(--text);
  background: var(--toast-bg);
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Animations */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 5px rgba(var(--accent-rgb), 0.09);
  }
  50% {
    box-shadow: 0 0 0 9px rgba(var(--accent-rgb), 0.035);
  }
}

@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 18px;
}

.typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .faq-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

.refresh-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin-left: 6px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.refresh-btn:hover {
  color: var(--accent);
  border-color: var(--line-strong);
}

.refresh-btn svg {
  width: 14px;
  height: 14px;
}

.map-toggle {
  display: none;
  margin-left: 8px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--panel-2);
  font: inherit;
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}

.sources-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--panel-2);
  font: inherit;
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}

.sources-btn:hover {
  color: var(--accent);
  border-color: var(--line-strong);
}

.sources-btn svg {
  width: 13px;
  height: 13px;
}

.sources-count {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  color: var(--accent-ink);
  background: var(--accent);
  font-size: 9px;
  font-weight: 750;
  line-height: 1;
}

.sources-count[hidden] {
  display: none;
}

@media (max-width: 960px) {
  .app--workspace {
    height: 100dvh;
    overflow: hidden;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    padding: 12px;
    gap: 10px;
  }

  .main-column {
    min-height: 0;
  }

  .ai-window {
    min-height: 0;
  }

  .map-panel {
    max-height: none;
  }

  .map-toggle {
    display: inline-flex;
    align-items: center;
  }

  .map-panel .map-goal,
  .map-panel .progress,
  .map-panel .map-list,
  .map-panel .map-foot {
    display: none;
  }

  .workspace:not(.map-open) .map-panel {
    display: none;
  }

  .workspace.map-open .map-panel {
    position: fixed;
    left: 0;
    right: 0;
    top: 166px;
    bottom: 0;
    z-index: 45;
    max-height: none;
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--panel);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.45);
  }

  .workspace.map-open .map-panel .map-list {
    overflow-y: auto;
    min-height: 0;
  }

  .workspace.map-open .map-panel .map-goal,
  .workspace.map-open .map-panel .progress {
    display: block;
  }

  .workspace.map-open .map-panel .map-list {
    display: block;
  }

  .workspace.map-open .map-panel .map-foot {
    display: block;
  }

  .faq-layout,
  .account-grid {
    grid-template-columns: 1fr;
  }

  .faq-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .plan-desc {
    min-height: 0;
  }

  .include-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    height: auto;
    min-height: 52px;
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .brand-sub {
    display: none;
  }

  .menu {
    order: 3;
    flex-basis: 100%;
    margin-left: 0;
    display: flex;
    gap: 14px;
    padding: 2px 0 0;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .menu::-webkit-scrollbar {
    display: none;
  }

  .menu a {
    flex: 0 0 auto;
    font-size: 11px;
  }

  .top-actions .status {
    display: none;
  }

  .workspace {
    padding: 12px;
    gap: 12px;
  }

  .page {
    padding: 30px 16px 54px;
  }

  .page-title {
    font-size: 34px;
  }

  .page-lede {
    font-size: 13.5px;
  }

  .chat {
    padding: 12px 12px 6px;
  }

  .msg {
    max-width: 100%;
    margin-bottom: 12px;
  }

  .msg--user .msg-bubble {
    max-width: 88vw;
  }

  .ai-head {
    padding: 9px 10px;
    gap: 7px;
  }

  .ai-head .sources-btn__label {
    display: none;
  }

  .ai-head #logBtn,
  .ai-head .refresh-btn {
    display: none;
  }

  .ai-head .sources-btn {
    padding: 5px 8px;
  }

  .ai-head .chip {
    display: none;
  }

  .ai-head > div {
    min-width: 0;
    flex: 1;
  }

  .ai-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .map-toggle {
    flex: 0 0 auto;
  }

  .main-column {
    gap: 0;
  }

  .main-column .ai-window {
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
    border-bottom-color: transparent;
  }

  .composer {
    padding: 7px 8px;
    border-top-right-radius: 0;
    border-top-left-radius: 0;
    box-shadow: none;
  }

  .composer textarea {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 13px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .send-btn {
    width: 40px;
    height: 38px;
  }

  .composer-hint {
    display: none;
  }

  .composer-hint:has(.file-chip.show),
  .composer-hint:has(.cooldown-hint:not([hidden])) {
    display: flex;
    padding: 5px 2px 0;
  }

  .send-btn {
    width: 43px;
    padding: 0;
  }

  .send-btn span {
    display: none;
  }

  .composer-hint span:last-child {
    display: none;
  }

  .faq-side {
    grid-template-columns: 1fr;
  }

  .pricing-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .billing-note {
    text-align: left;
  }

  .balance-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .session {
    flex-wrap: wrap;
    gap: 4px 10px;
  }

  .session-date {
    flex-basis: 100%;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 18px 16px;
  }
}

@media (max-width: 480px) {
  .brand-name {
    font-size: 19px;
  }

  .avatar {
    width: 32px;
    height: 32px;
  }

  .ai-head {
    padding: 12px 13px;
  }

  .goal-key {
    flex-basis: 64px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .include-list {
    grid-template-columns: 1fr;
  }

  .price-value {
    font-size: 32px;
  }

  .settings-card {
    padding: 17px;
  }

  .setting-row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .setting-control {
    margin-left: 0;
  }

  .select {
    min-width: 100%;
  }

  .settings-note {
    margin-left: 0;
    flex-basis: 100%;
  }
}


/* ============================================================
   Learning hub
   ============================================================ */

.hub-section {
  margin-top: 28px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.section-title {
  margin: 5px 0 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.section-count {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.new-course {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 22px 24px;
  color: var(--text);
  text-decoration: none;
  border-color: var(--line-strong);
  background:
    radial-gradient(620px 200px at 0% 0%, var(--accent-soft), transparent 68%),
    var(--panel);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.new-course:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 24px 60px rgba(var(--accent-rgb), 0.1);
}

.new-course__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 15px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 27px;
  font-weight: 300;
  line-height: 1;
}

.new-course__copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.new-course__eyebrow {
  color: var(--accent);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.new-course__title {
  color: var(--text);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.new-course__text {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.new-course__arrow {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--accent);
  font-size: 22px;
  transition: transform 0.18s ease;
}

.new-course:hover .new-course__arrow {
  transform: translateX(4px);
}

.new-course--upload {
  cursor: default;
}

.new-course--upload:hover {
  transform: none;
  border-color: var(--line-strong);
  box-shadow: none;
}

.new-course__button {
  flex: 0 0 auto;
  margin-left: auto;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.course-card {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 19px;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.course-card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 20px 55px rgba(var(--accent-rgb), 0.09);
}

.course-card__link {
  display: flex;
  flex-direction: column;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.course-delete {
  align-self: flex-end;
  margin-top: -2px;
  padding: 2px 0;
  border: 0;
  color: var(--muted-2);
  background: none;
  font: inherit;
  font-size: 9.5px;
  cursor: pointer;
}

.course-delete:hover {
  color: #e5484d;
}

.course-delete:disabled {
  opacity: 0.55;
  cursor: wait;
}

.course-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.course-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(var(--accent-rgb), 0.26);
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1;
}

.course-copy {
  min-width: 0;
  flex: 1;
}

.course-copy h3 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}

.course-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.course-head .chip {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 3px 7px;
  font-size: 8px;
}

.course-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-3);
}

.course-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.4;
}

.course-meta strong {
  color: var(--text-soft);
  font-weight: 600;
}

.course-stages {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0 1px;
}

.course-stage {
  width: 7px;
  height: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--panel-3);
}

.course-stage--done {
  border-color: var(--accent);
  background: var(--accent);
}

.course-stage--active {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.course-btn {
  width: 100%;
  margin-top: 3px;
  justify-content: center;
}

.hub-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  padding: 20px 22px;
}

.hub-note__copy {
  min-width: 0;
}

.hub-note__copy h2 {
  margin: 5px 0 5px;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.hub-note__copy p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

/* Empty map for a brand-new chat */

.map-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 8px 4px;
  padding: 24px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  text-align: center;
}

.map-empty__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 2px;
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: 13px;
  color: var(--accent);
  background: var(--accent-soft);
}

.map-empty__icon svg {
  width: 20px;
  height: 20px;
}

.map-empty__title {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.map-empty__text {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.map-empty__steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-top: 5px;
}

.map-empty__step {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-2);
  background: var(--panel-2);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.map-probe {
  display: grid;
  gap: 5px;
  width: 100%;
  margin-top: 6px;
  text-align: left;
}

.map-probe__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.map-probe__name {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-probe__state {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.map-probe__state--floor {
  color: var(--accent);
}

.map-probe__state--gap {
  color: #f87171;
}

.map-probe__state--unstable {
  color: #fbbf24;
}

.map-probe__state--strong,
.map-probe__state--edge {
  color: #4ade80;
}

[data-theme="light"] .map-probe__state--gap {
  color: #dc2626;
}

[data-theme="light"] .map-probe__state--unstable {
  color: #b45309;
}

[data-theme="light"] .map-probe__state--strong,
[data-theme="light"] .map-probe__state--edge {
  color: #15803d;
}

@media (max-width: 960px) {
  .course-grid {
    grid-template-columns: 1fr;
  }

  .hub-note {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .new-course {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 18px;
  }

  .new-course__copy {
    flex: 1 1 180px;
  }

  .new-course--upload {
    padding-right: 18px;
  }

  .new-course__button {
    width: 100%;
    margin: 10px 0 0;
  }

  .new-course__arrow {
    display: none;
  }

  .course-head {
    flex-wrap: wrap;
  }

  .course-head .chip {
    margin-left: 0;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}


@media (max-width: 720px) {
  .menu {
    flex-wrap: nowrap;
    overflow-x: auto;
    row-gap: 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .menu::-webkit-scrollbar {
    display: none;
  }

  .menu a {
    flex: 0 0 auto;
    padding: 4px 0;
    font-size: 11px;
    white-space: nowrap;
  }
}


.send-btn:disabled {
  cursor: wait;
  opacity: 0.6;
  transform: none;
  filter: none;
}

.send-btn:disabled:hover {
  transform: none;
  filter: none;
}


.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  filter: none;
}


/* ============================================================
   Dynamic learning graph
   ============================================================ */

.learning-graph {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.learning-graph .graph-edge {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1.5;
  stroke-dasharray: 4 5;
  opacity: 0.9;
}

.learning-graph .graph-node circle {
  fill: var(--panel);
  stroke: var(--line-strong);
  stroke-width: 1.5;
}

.learning-graph .graph-node text {
  fill: var(--muted);
  font-family: var(--font-sans);
}

.learning-graph .graph-node .graph-num {
  font-size: 10px;
  font-weight: 700;
  text-anchor: middle;
}

.learning-graph .graph-label {
  font-size: 9px;
  text-anchor: middle;
}

.learning-graph .graph-status {
  font-size: 7.5px;
  text-anchor: middle;
  opacity: 0.75;
}

.learning-graph .graph-glow {
  fill: var(--accent-soft);
}

.learning-graph .graph-node--active circle {
  fill: var(--accent);
  stroke: var(--accent);
}

.learning-graph .graph-node--active .graph-num {
  fill: var(--accent-ink);
}

.learning-graph .graph-node--active .graph-label {
  fill: var(--text);
}

.learning-graph .graph-node--active .graph-status {
  fill: var(--accent);
  opacity: 1;
}

.learning-graph .graph-node--idle {
  opacity: 0.75;
}


/* Карта-граф в чате: на всю ширину сообщения */
.msg--map {
  max-width: 100%;
}

.msg--map .msg-body {
  width: 100%;
}

.msg--map .msg-bubble {
  width: 100%;
  max-width: 100%;
}

.msg--map .rich-card {
  width: 100%;
}

.msg--map .chat-map-graph {
  width: 100%;
  height: auto;
}

.chat-map-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.chat-map-meta > span:first-child {
  color: var(--text-soft);
  font-weight: 650;
}

.chat-map-why {
  flex: 1 1 220px;
  min-width: 0;
}

.chat-map-plan {
  display: flex;
  gap: 8px;
  margin: 2px 0 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.chat-map-plan__label {
  flex: 0 0 auto;
  padding-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chat-map-compact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.18) transparent;
}

.chat-map-compact::-webkit-scrollbar {
  width: 6px;
}

.chat-map-compact::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.18);
  border-radius: 999px;
}

.chat-map-compact__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--inset);
}

.chat-map-compact__num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 9px;
  font-weight: 700;
}

.chat-map-compact__title {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.35;
}

.chat-map-compact__deps {
  flex: 0 0 auto;
  align-self: center;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}


/* Mermaid и Markdown-таблицы в чате */
.msg--visual {
  max-width: 100%;
}

.msg--visual .msg-body {
  width: 100%;
}

.msg--visual .msg-bubble {
  width: 100%;
  max-width: 100%;
}

.mermaid-card {
  margin-top: 10px;
  padding: 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--inset);
}

.mermaid-card pre.mermaid {
  margin: 0;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  white-space: pre;
}

.mermaid-card svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.mermaid-card--error {
  border-color: rgba(var(--accent-rgb), 0.35);
}

.markdown-table-wrap {
  margin-top: 10px;
}


/* Граф Cytoscape в чате */
.cyto-card {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--inset);
}

.cyto-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
}

.cyto-graph {
  width: 100%;
  min-height: 120px;
  padding: 8px;
  overflow-x: auto;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.cyto-graph svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}


/* Временная админка */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 720px;
  padding: 24px;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-field label {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 550;
}

.admin-input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--inset);
  font-size: 13px;
  outline: none;
}

.admin-input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.07);
}

.admin-textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.5;
}

.admin-note {
  margin: 0;
  color: var(--muted-2);
  font-size: 10px;
}

.admin-link {
  margin: 16px 0 0;
  font-size: 11px;
}

.admin-link a {
  color: var(--accent);
}


/* SVG-рисунок в чате */
.drawing-card {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--inset);
}

.drawing-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
}

.drawing-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawing-expand {
  flex: none;
}

.drawing-paper {
  padding: 14px;
  background: var(--panel-2);
  cursor: zoom-in;
}

.drawing-hint {
  padding: 5px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  background: var(--inset);
  font-size: 9.5px;
  line-height: 1.45;
  letter-spacing: 0.02em;
}

.media-lightbox__body--drawing .drawing-hint {
  border-color: rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
}

.drawing-paper:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.drawing-paper svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  margin: 0 auto;
}

.media-lightbox .media-lightbox__body--drawing {
  width: min(1500px, 96vw);
  max-width: 96vw;
  max-height: 92vh;
  align-items: stretch;
}

.drawing-lightbox__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #e8edf4;
}

.drawing-lightbox__title {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawing-lightbox__tools {
  display: flex;
  flex: none;
  gap: 6px;
}

.drawing-lightbox__zoom {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  color: #fff;
  background: rgba(20, 26, 36, 0.85);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.drawing-lightbox__zoom:hover {
  background: rgba(40, 50, 65, 0.95);
}

.drawing-lightbox__scale {
  width: 58px;
  font-size: 12px;
}

.media-lightbox__drawing {
  width: 100%;
  max-height: 80vh;
  overflow: auto;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
  overscroll-behavior: contain;
}

.media-lightbox__drawing svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  margin: 0 auto;
}

/* ============================================================
   Вход и регистрация
   ============================================================ */

.auth-wrap {
  max-width: 460px;
  margin: 26px auto 0;
}

.auth-card {
  padding: 22px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tab {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
}

.auth-tab.active {
  border-color: rgba(var(--accent-rgb), 0.55);
  color: var(--accent);
  background: var(--accent-soft);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.auth-error {
  min-height: 16px;
  margin: 0;
  color: #e5484d;
  font-size: 11.5px;
  line-height: 1.4;
}

.auth-submit {
  width: 100%;
}

.auth-note {
  margin: 14px 0 0;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.5;
  text-align: center;
}

.auth-note code {
  color: var(--muted);
}

.auth-consents {
  display: grid;
  gap: 9px;
  margin: 2px 0 0;
  padding: 13px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--accent-softer);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-consents.is-invalid {
  border-color: rgba(229, 72, 77, 0.65);
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.08);
}

.auth-consents legend {
  padding: 0 5px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.auth-consent {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
  cursor: pointer;
}

.auth-consent input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.auth-consent__link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.auth-consent__link:hover {
  color: var(--text);
}

.auth-consents__note {
  margin: 2px 0 0;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.45;
}

html.legal-modal-open,
html.legal-modal-open body {
  overflow: hidden;
}

.legal-modal {
  width: min(780px, calc(100vw - 28px));
  max-height: min(86dvh, 920px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.legal-modal[open] {
  display: flex;
  flex-direction: column;
}

.legal-modal::backdrop {
  background: rgba(3, 7, 14, 0.7);
  backdrop-filter: blur(3px);
}

.legal-modal__panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.legal-modal__head {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}

.legal-modal__heading {
  min-width: 0;
}

.legal-modal__eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.legal-modal__title {
  margin: 0;
  color: var(--text-strong);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.25;
}

.legal-modal__close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.legal-modal__close:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--inset);
}

.legal-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 22px 26px;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.6;
}

.legal-modal__status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.legal-modal__status a {
  color: var(--accent);
}

.legal-doc > h1 {
  margin: 0 0 4px;
  color: var(--text-strong);
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.legal-doc h2 {
  margin: 22px 0 8px;
  color: var(--text-strong);
  font-size: 14.5px;
  line-height: 1.3;
}

.legal-doc h3 {
  margin: 16px 0 6px;
  color: var(--text);
  font-size: 13px;
}

.legal-doc p {
  margin: 0 0 9px;
}

.legal-doc ul,
.legal-doc ol {
  margin: 0 0 10px;
  padding-left: 20px;
}

.legal-doc li {
  margin: 0 0 4px;
}

.legal-doc strong {
  color: var(--text);
  font-weight: 600;
}

.legal-doc a {
  color: var(--accent);
}

.legal-doc hr {
  margin: 16px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.legal-doc blockquote {
  margin: 12px 0;
  padding: 2px 0 2px 12px;
  border-left: 2px solid var(--line-strong);
  color: var(--muted);
}

.legal-doc code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--inset);
  color: var(--text-soft);
  font-size: 0.92em;
}

.legal-doc table {
  width: 100%;
  margin: 10px 0 14px;
  border-collapse: collapse;
  font-size: 11.5px;
}

.legal-doc th,
.legal-doc td {
  padding: 6px 8px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.legal-doc th {
  color: var(--text);
  background: var(--inset);
  font-weight: 600;
}

.legal-doc input[type="checkbox"] {
  accent-color: var(--accent);
}

.legal-doc .task-list {
  padding-left: 0;
  list-style: none;
}

.legal-doc .task-list li {
  padding-left: 0;
}

@media (max-width: 560px) {
  .legal-modal {
    width: calc(100vw - 16px);
    max-height: 92dvh;
    border-radius: 16px;
  }

  .legal-modal__head {
    padding: 13px 14px 11px;
  }

  .legal-modal__title {
    font-size: 15px;
  }

  .legal-modal__body {
    padding: 14px 15px 22px;
    font-size: 12px;
  }

  .auth-consents {
    padding: 12px;
  }
}

.sources-modal {
  width: min(860px, calc(100vw - 28px));
}

.sources-intro {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.sources-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--inset);
}

.sources-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.sources-legend__item .claim-badge {
  margin-left: 0;
}

.sources-material {
  display: grid;
  gap: 3px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 12px;
  background: var(--accent-softer);
}

.sources-material strong {
  color: var(--text-strong);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.sources-material span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.sources-group + .sources-group {
  margin-top: 22px;
}

.sources-group__title {
  margin: 0 0 4px;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.sources-group__query {
  margin: 0 0 10px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.sources-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.sources-table th,
.sources-table td {
  padding: 9px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.sources-table th {
  color: var(--muted-2);
  background: var(--inset);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sources-table th:nth-child(1),
.sources-table td:nth-child(1) {
  width: 46px;
  text-align: center;
  white-space: nowrap;
}

.sources-table th:nth-child(3),
.sources-table td:nth-child(3) {
  width: 22%;
}

.sources-table th:nth-child(4),
.sources-table td:nth-child(4) {
  width: 15%;
  white-space: nowrap;
}

.sources-link {
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  text-decoration: none;
  overflow-wrap: anywhere;
}

a.sources-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.sources-snippet {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.sources-domain {
  display: block;
  color: var(--text-soft);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.sources-provider {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sources-empty {
  padding: 26px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  text-align: center;
}

.sources-empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-strong);
  font-size: 13px;
}

.sources-empty p {
  max-width: 420px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .sources-btn {
    gap: 4px;
    padding: 6px 8px;
  }

  .sources-btn__label {
    display: none;
  }

  .sources-table thead {
    display: none;
  }

  .sources-table,
  .sources-table tbody,
  .sources-table tr,
  .sources-table td {
    display: block;
    width: 100%;
  }

  .sources-table tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
  }

  .sources-table tr + tr {
    margin-top: 8px;
  }

  .sources-table td,
  .sources-table td:nth-child(2),
  .sources-table td:nth-child(3) {
    width: auto;
    padding: 8px 10px;
    border: 0;
    border-top: 1px solid var(--line);
    white-space: normal;
  }

  .sources-table td:first-child {
    border-top: 0;
  }

  .sources-table td[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--muted-2);
    font-size: 9.5px;
    font-weight: 650;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }
}

.invite-key-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 17px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hub-empty {
  padding: 18px 20px;
}

.hub-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.materials {
  padding: 6px 20px;
}

.material-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(var(--line-rgb), 0.08);
}

.material-row:last-child {
  border-bottom: 0;
}

.material-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.material-info strong {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-info span {
  color: var(--muted-2);
  font-size: 9.5px;
}

.material-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.compact-map .map-node__sub,
.compact-map .map-node__status {
  display: none;
}

/* ============================================================
   Главная страница проекта
   ============================================================ */

.new-course--upload,
.landing-source {
  position: relative;
  overflow: hidden;
}

.new-course--upload {
  padding-right: 66px;
}

.landing-badge {
  position: absolute;
  top: 22px;
  right: -38px;
  z-index: 2;
  width: 158px;
  padding: 4px 0;
  transform: rotate(45deg);
  color: #2a2100;
  background: linear-gradient(135deg, #f9e88a 0%, #e3bf45 45%, #c79a1d 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.landing-hero {
  padding: 34px 30px;
  border-color: var(--line-strong);
  background:
    radial-gradient(720px 260px at 0% 0%, var(--accent-soft), transparent 70%),
    var(--panel);
}

.landing-hero h1 {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--text);
  font-size: clamp(28px, 4.2vw, 46px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.landing-lede {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.landing-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.landing-point {
  padding: 14px 16px;
  border: 1px solid rgba(var(--line-rgb), 0.18);
  border-radius: 14px;
  background: var(--inset);
}

.landing-point strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 650;
}

.landing-point span {
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.5;
}

.landing-section {
  margin-top: 26px;
  scroll-margin-top: 96px;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.landing-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.landing-step {
  padding: 16px 17px;
}

.landing-step__num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 650;
}

.landing-step h3 {
  margin: 10px 0 4px;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 650;
}

.landing-step p,
.landing-text p {
  margin: 0;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.55;
}

.landing-source {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 22px 24px;
}

.landing-source > div {
  min-width: 0;
  flex: 1;
}

.landing-source h2 {
  margin: 6px 0 6px;
  color: var(--text);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.landing-source p {
  margin: 0;
  max-width: 680px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.landing-source .btn {
  flex: 0 0 auto;
}

.landing-text {
  padding: 18px 20px;
}

.landing-text h3 {
  margin: 0 0 6px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
}

.landing-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

@media (max-width: 720px) {
  .landing-hero {
    padding: 22px;
  }

  .landing-points,
  .landing-grid,
  .landing-grid--two {
    grid-template-columns: 1fr;
  }

  .landing-source {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Видео-чекпоинт для практических навыков */
.video-card {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--inset);
}

.video-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

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

.video-row {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.video-row b {
  flex: 0 0 96px;
  color: var(--text-soft);
  font-weight: 600;
}

.video-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

@media (max-width: 480px) {
  .video-row {
    flex-direction: column;
    gap: 2px;
  }

  .video-row b {
    flex: none;
  }
}

/* Подборка открытых изображений */
.images-card {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--inset);
}

.images-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  padding: 12px;
}

.image-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: inherit;
  background: var(--panel-2);
  text-decoration: none;
}

.image-item:hover {
  border-color: var(--line-strong);
}

.image-item img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: #0b0f16;
}

.image-caption {
  padding: 0 8px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.image-meta {
  padding: 0 8px 8px;
  color: var(--muted-2);
  font-size: 8.5px;
  line-height: 1.3;
}

.image-item--broken img {
  display: none;
}

.image-item--broken::before {
  display: grid;
  place-items: center;
  height: 120px;
  color: var(--muted-2);
  font-size: 10px;
  content: "Изображение недоступно";
}

.images-note {
  grid-column: 1 / -1;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.5;
}

.images-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px 12px;
}


/* Крупные формулы */
.formula-card {
  margin: 10px 0;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--inset);
  text-align: center;
  cursor: zoom-in;
}

.formula-card:hover {
  border-color: var(--line-strong);
}

.formula-card mjx-container {
  margin: 0 !important;
  font-size: 1.3em !important;
}

/* Просмотр картинок и формул на весь экран */
.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(4, 7, 12, 0.9);
}

.media-lightbox__close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: #fff;
  background: rgba(20, 26, 36, 0.85);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.media-lightbox__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 94vw;
  max-height: 92vh;
}

.media-lightbox__image {
  max-width: 92vw;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
}

.media-lightbox__caption {
  color: #e8edf4;
  font-size: 13px;
  text-align: center;
}

.media-lightbox__meta {
  color: #94a3b8;
  font-size: 10px;
  text-align: center;
}

.media-lightbox__formula {
  max-width: 94vw;
  max-height: 86vh;
  overflow: auto;
  padding: 26px 32px;
  border-radius: 16px;
  background: var(--panel);
}

.media-lightbox__formula mjx-container {
  font-size: 2.4em !important;
  margin: 0 !important;
}

@media (max-width: 480px) {
  .images-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
  }

  .image-item img {
    height: 132px;
  }

  .image-caption {
    font-size: 9px;
  }

  .image-meta {
    display: none;
  }

  .media-lightbox {
    padding: 12px;
  }

  .media-lightbox__close {
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: calc(12px + env(safe-area-inset-right, 0px));
    width: 42px;
    height: 42px;
  }

  .media-lightbox__image {
    max-height: 72vh;
  }
}

/* Проблема и решение на главной */
.problem-lede {
  max-width: 780px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.problem-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px;
}

.problem-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.problem-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.model-graph {
  display: block;
  width: 100%;
  height: auto;
  margin: 2px 0 4px;
}

.model-graph .mg-node rect {
  fill: var(--panel-2);
  stroke: var(--line-strong);
  stroke-width: 1.1;
}

.model-graph .mg-node--accent rect {
  fill: var(--accent-soft);
  stroke: rgba(var(--accent-rgb), 0.65);
}

.model-graph text {
  fill: var(--text-soft);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  text-anchor: middle;
}

.model-graph .mg-caption {
  fill: var(--muted-2);
  font-size: 8.5px;
  font-weight: 500;
}

.model-graph .mg-caption--center {
  letter-spacing: 0.04em;
}

.model-graph .mg-line {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1.2;
}

.model-graph .mg-arrow {
  fill: var(--line-strong);
}

.problem-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.problem-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
}

.problem-item__num {
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.problem-item h3 {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
}

.problem-item p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.solution-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.solution-card {
  padding: 18px 20px;
  border-color: rgba(var(--accent-rgb), 0.25);
  background:
    linear-gradient(140deg, rgba(var(--accent-rgb), 0.06), transparent 60%),
    var(--panel);
}

.solution-card h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.solution-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

@media (max-width: 960px) {
  .problem-grid,
  .problem-list,
  .solution-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .landing-section {
    scroll-margin-top: 130px;
  }
}

/* Служебная панель */
.admin-page {
  max-width: 1500px;
}

.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.admin-stat {
  padding: 14px 16px;
}

.admin-stat strong {
  display: block;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.admin-stat span {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-section {
  margin-top: 14px;
  overflow: hidden;
}

.admin-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 15px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.admin-section-head h2 {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
}

.admin-section-head .chip {
  margin-left: auto;
}

.admin-access {
  padding: 0 18px 14px;
}

.admin-access .setting-row:first-of-type {
  padding-top: 14px;
}

.admin-access .setting-row:last-child {
  padding-bottom: 0;
}

.admin-access code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 9.5px;
}

.admin-kv {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 18px;
  padding: 14px 18px 16px;
}

.admin-kv__row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-kv__row span {
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-kv__row strong {
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
}

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

.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.admin-table th {
  padding: 9px 12px;
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.admin-table td {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  border-bottom: 1px solid rgba(var(--line-rgb), 0.08);
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table tr:hover td {
  background: rgba(var(--accent-rgb), 0.03);
}

.admin-table .admin-strong {
  color: var(--text-soft);
  font-weight: 600;
}

.admin-danger {
  padding: 4px 9px;
  border: 1px solid rgba(229, 72, 77, 0.35);
  border-radius: 8px;
  color: #e5484d;
  background: transparent;
  font: inherit;
  font-size: 9.5px;
  cursor: pointer;
}

.admin-danger:hover:not(:disabled) {
  background: rgba(229, 72, 77, 0.12);
}

.admin-danger:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.admin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.admin-credit {
  padding: 4px 9px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 8px;
  color: var(--accent);
  background: transparent;
  font: inherit;
  font-size: 9.5px;
  cursor: pointer;
}

.admin-credit:hover {
  background: var(--accent-soft);
}

@media (max-width: 960px) {
  .admin-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-kv {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-kv {
    grid-template-columns: 1fr;
  }
}

/* Расширенная служебная панель: вкладки, карточки, диалоги */
.admin-panel[hidden],
.admin-dialog__footer[hidden] {
  display: none;
}

.admin-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 720px) {
  .admin-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.admin-stat strong {
  font-size: 23px;
}

.admin-stat small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8.5px;
  line-height: 1.4;
}

.admin-section-head .admin-action,
.admin-section-head .btn {
  margin-left: auto;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
  overflow-x: auto;
  scrollbar-width: thin;
}

.admin-tab {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.admin-tab:hover {
  color: var(--text);
  background: var(--accent-softer);
}

.admin-tab.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.admin-tab__count {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--inset);
  font-size: 8.5px;
  font-weight: 700;
}

.admin-tab.is-active .admin-tab__count {
  color: var(--accent);
  background: var(--panel);
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-grid-2 .admin-section {
  margin-top: 0;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.admin-toolbar .admin-input {
  width: auto;
  min-width: 150px;
  max-width: 230px;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 11px;
}

.admin-toolbar .admin-search {
  flex: 1 1 220px;
  max-width: 360px;
}

.admin-toolbar .chip {
  margin-left: auto;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--inset);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.6;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-badge--ok {
  border-color: rgba(74, 222, 128, 0.35);
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
}

.admin-badge--warn {
  border-color: rgba(251, 191, 36, 0.35);
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
}

.admin-badge--danger {
  border-color: rgba(229, 72, 77, 0.4);
  color: #ff6b6b;
  background: rgba(229, 72, 77, 0.12);
}

.admin-badge--info {
  border-color: rgba(var(--accent-rgb), 0.4);
  color: var(--accent);
  background: var(--accent-soft);
}

[data-theme="light"] .admin-badge--ok {
  color: #1a7f37;
}

[data-theme="light"] .admin-badge--warn {
  color: #9a6700;
}

[data-theme="light"] .admin-badge--danger {
  color: #c62828;
}

.admin-badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.admin-user-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.admin-user-cell strong {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.admin-user-cell span {
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.admin-linkbtn {
  display: inline;
  max-width: 100%;
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.admin-linkbtn:hover {
  text-decoration: underline;
}

.admin-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: -0.01em;
}

.admin-muted {
  margin: 0;
  color: var(--muted-2);
  font-size: 9.5px;
}

.admin-action {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 9.5px;
  line-height: 1.45;
  white-space: nowrap;
  cursor: pointer;
}

.admin-action:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--inset);
}

.admin-action--accent {
  border-color: rgba(var(--accent-rgb), 0.35);
  color: var(--accent);
}

.admin-action--accent:hover:not(:disabled) {
  background: var(--accent-soft);
}

.admin-action:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.admin-actions {
  flex-wrap: wrap;
}

.admin-table td.admin-strong {
  color: var(--text-soft);
}

.admin-table td.admin-wrap {
  min-width: 220px;
  max-width: 420px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.admin-table--compact {
  min-width: 0;
}

.admin-table--compact th {
  padding: 7px 9px;
  font-size: 8px;
}

.admin-table--compact td {
  padding: 8px 9px;
  font-size: 10px;
}

.admin-table--compact .admin-user-cell strong,
.admin-table--compact .admin-linkbtn {
  font-size: 10px;
}

.admin-empty {
  padding: 22px 12px !important;
  color: var(--muted-2) !important;
  font-size: 10.5px !important;
  text-align: center;
  white-space: normal !important;
}

.admin-positive {
  color: #4ade80;
}

.admin-negative {
  color: #ff6b6b;
}

[data-theme="light"] .admin-positive {
  color: #1a7f37;
}

[data-theme="light"] .admin-negative {
  color: #c62828;
}

.admin-alert {
  display: flex;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text-soft);
  background: var(--panel-2);
  font-size: 11px;
  line-height: 1.55;
}

.admin-alert > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.admin-alert strong {
  color: var(--text);
  font-size: 11.5px;
}

.admin-alert p {
  margin: 0;
  color: var(--muted);
}

.admin-alert a {
  color: inherit;
  text-decoration: underline;
}

.admin-alert--danger {
  border-color: rgba(229, 72, 77, 0.35);
  background: rgba(229, 72, 77, 0.06);
}

.admin-alert--warn {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.06);
}

.admin-alert--info {
  border-color: rgba(var(--accent-rgb), 0.3);
  background: var(--accent-softer);
}

.admin-attention {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px;
}

.admin-attention__row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.45;
}

.admin-attention__text {
  flex: 1 1 auto;
  color: var(--text-soft);
}

.admin-attention__row .admin-action {
  flex: 0 0 auto;
}

.admin-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 16px;
}

.admin-quick--flat {
  padding: 0;
}

.admin-mini-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 18px 0;
}

.admin-mini {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--inset);
}

.admin-mini strong {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.1;
}

.admin-mini span {
  color: var(--muted-2);
  font-size: 8.5px;
  line-height: 1.4;
}

.admin-consent-alert {
  padding: 12px 18px 0;
}

.admin-consent-alert:empty {
  display: none;
}

.admin-consent-alert .admin-alert {
  margin: 0;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--inset);
}

.admin-summary__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-summary__item > span {
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-summary__item > strong,
.admin-summary__value {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.admin-summary__value .admin-user-cell strong {
  font-size: 11px;
}

.admin-subsection {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.admin-subsection-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.admin-subsection-head h3 {
  margin: 0;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 650;
}

.admin-subsection-head .admin-badge {
  margin-left: auto;
}

.admin-subsection-body {
  padding: 12px 13px;
}

.admin-subsection-body > .admin-note {
  margin-bottom: 8px;
}

.admin-subsection-body > .admin-table-wrap {
  margin: 0 -13px -12px;
}

.admin-details {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
}

.admin-details > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 0;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.admin-details > summary::-webkit-details-marker {
  display: none;
}

.admin-details > summary::after {
  content: "+";
  margin-left: auto;
  color: var(--muted-2);
  font-size: 14px;
  line-height: 1;
}

.admin-details[open] > summary::after {
  content: "−";
}

.admin-details__body {
  padding: 2px 0 12px;
}

.admin-details__body .admin-table-wrap {
  margin: 0 -14px;
}

.admin-details .admin-empty {
  border: 0;
}

.admin-user-hero {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 17px;
  font-weight: 700;
}

.admin-user-hero h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.admin-user-email {
  margin: 2px 0 6px;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.admin-order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-order-title {
  margin: 0 0 2px;
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 650;
}

.admin-order-total {
  margin-top: -2px;
  color: var(--text-soft);
  font-size: 11px;
}

.admin-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-dialog {
  width: min(780px, calc(100vw - 28px));
  max-height: min(90dvh, 980px);
}

.admin-dialog--wide {
  width: min(1120px, calc(100vw - 28px));
}

.admin-dialog__body {
  padding: 18px 20px 22px;
}

.admin-dialog__footer {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
}

.admin-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-form-grid .admin-field label {
  font-size: 11.5px;
}

.admin-form-grid .admin-input {
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12px;
}

.admin-form-grid textarea.admin-input {
  min-height: 64px;
  resize: vertical;
  line-height: 1.5;
}

.admin-field--full {
  grid-column: 1 / -1;
}

.admin-form-actions {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.admin-choice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--inset);
  font-size: 11px;
  line-height: 1.5;
  cursor: pointer;
}

.admin-choice input {
  flex: 0 0 auto;
  margin-top: 3px;
  accent-color: var(--accent);
}

.admin-choice span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-choice strong {
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.admin-choice em {
  color: var(--muted-2);
  font-size: 9.5px;
  font-style: normal;
  line-height: 1.45;
}

.admin-choice:has(input:checked) {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: var(--accent-softer);
}

.admin-refund {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(229, 72, 77, 0.3);
  border-radius: 16px;
  background: rgba(229, 72, 77, 0.045);
}

.admin-refund__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-refund__head h3 {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.admin-refund__head .admin-badge {
  margin-left: auto;
}

.admin-refund__label {
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-refund__amount {
  color: var(--text-strong);
  font-family: var(--font-serif);
  font-size: 25px;
  line-height: 1.15;
}

.admin-refund__hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.admin-refund__breakdown {
  margin-top: -2px;
}

.admin-refund .admin-details {
  background: var(--panel);
}

.admin-refund .admin-form-actions {
  padding-top: 0;
}

.admin-chat {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 46vh;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--inset);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.admin-chat__msg {
  max-width: 86%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text-soft);
  background: var(--panel);
  font-size: 11.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-chat__msg--user {
  align-self: flex-end;
  border-color: rgba(var(--accent-rgb), 0.3);
  background: var(--accent-softer);
}

.admin-chat__role {
  display: block;
  margin-bottom: 3px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-chat .admin-empty {
  padding: 18px 10px !important;
  text-align: center;
}

.admin-stage-list {
  max-height: 260px;
  margin: 0;
  padding: 0 0 0 22px;
  overflow-y: auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.admin-stage-list li.is-current {
  color: var(--accent);
  font-weight: 600;
}

.admin-pre {
  max-height: 260px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--inset);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow: auto;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .admin-stat strong {
    font-size: 21px;
  }
}

@media (max-width: 960px) {
  .admin-grid-2 {
    grid-template-columns: 1fr;
  }

  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-mini-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-toolbar .admin-input,
  .admin-toolbar .admin-search {
    max-width: none;
  }
}

@media (max-width: 600px) {
  .admin-mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px 14px 0;
  }

  .admin-dialog__body {
    padding: 14px;
  }

  .admin-dialog__footer {
    padding: 10px 14px;
  }

  .admin-user-hero {
    align-items: flex-start;
  }

  .admin-avatar {
    width: 40px;
    height: 40px;
    font-size: 15px;
  }

  .admin-chat__msg {
    max-width: 100%;
  }

  .admin-refund__amount {
    font-size: 22px;
  }

  .admin-toolbar {
    padding: 10px 12px;
  }

  .admin-toolbar .admin-input,
  .admin-toolbar .admin-search {
    flex: 1 1 100%;
    width: 100%;
  }
}

/* ============================================================
   Мультяшный стиль
   Отдельный слой поверх базовой темы: html[data-style="cartoon"].
   Классический стиль не затрагивается.
   ============================================================ */

@font-face {
  font-family: "MOH Comic";
  src: url("fonts/balsamiq-sans-cyrillic-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "MOH Comic";
  src: url("fonts/balsamiq-sans-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "MOH Comic";
  src: url("fonts/balsamiq-sans-cyrillic-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "MOH Comic";
  src: url("fonts/balsamiq-sans-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "MOH Rounded";
  src: url("fonts/nunito-cyrillic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "MOH Rounded";
  src: url("fonts/nunito-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html[data-style="cartoon"] {
  color-scheme: dark;
  --bg-0: #150733;
  --bg-1: #1d0a48;
  --bg-2: #2b0f66;
  --panel: #2a146c;
  --panel-2: #351b7e;
  --panel-3: #422394;
  --inset: #190840;
  --text: #fff9e8;
  --text-strong: #ffffff;
  --text-soft: #f4eaff;
  --muted: #cbbcf7;
  --muted-2: #a992ea;
  --accent: #ffd93d;
  --accent-2: #ff8a1f;
  --accent-rgb: 255, 217, 61;
  --accent-ink: #1b093d;
  --accent-soft: rgba(255, 217, 61, 0.2);
  --accent-softer: rgba(255, 217, 61, 0.09);
  --line-rgb: 255, 255, 255;
  --line: #5f43c2;
  --line-strong: #10042b;
  --ink: #10042b;
  --hairline: rgba(255, 255, 255, 0.17);
  --subtle-rgb: 255, 255, 255;
  --panel-rgb: 42, 20, 108;
  --panel-deep-rgb: 31, 13, 82;
  --topbar-rgb: 42, 20, 108;
  --toast-bg: #ffd93d;
  --graph-idle: #b9a4f2;
  --shadow: 7px 7px 0 var(--ink);
  --button-shadow: var(--ink);
  --bubble-ai: #351b7e;
  --bubble-user: #ffd93d;
  --subcard: #3a2088;
  --pop-pink: #ff4fa3;
  --pop-cyan: #45e6ff;
  --pop-yellow: #ffd93d;
  --pop-lime: #a8ff60;
  --pop-orange: #ff8a1f;
  --pop-red: #ff5468;
  --pop-ink: #1c0b33;
  --comic-radius: 24px 30px 22px 28px / 30px 22px 28px 24px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --font-sans: "MOH Rounded", "Nunito", "Trebuchet MS", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "MOH Comic", "Balsamiq Sans", "MOH Rounded", "Trebuchet MS", "Segoe UI", Georgia, "Times New Roman", serif;
}

html[data-style="cartoon"][data-theme="light"] {
  color-scheme: light;
  --bg-0: #fff7d6;
  --bg-1: #ffeeb8;
  --bg-2: #ffd9e8;
  --panel: #fffdf6;
  --panel-2: #fff3cf;
  --panel-3: #ffe3a3;
  --inset: #fff8e6;
  --text: #2a1748;
  --text-strong: #1e0d38;
  --text-soft: #40255f;
  --muted: #6a518d;
  --muted-2: #7c649c;
  --accent: #ff2e73;
  --accent-2: #ff9200;
  --accent-rgb: 255, 46, 115;
  --accent-ink: #220d3f;
  --accent-soft: rgba(255, 46, 115, 0.16);
  --accent-softer: rgba(255, 46, 115, 0.08);
  --line-rgb: 42, 18, 68;
  --line: #4a2f6b;
  --line-strong: #2a1244;
  --ink: #2a1244;
  --hairline: rgba(42, 18, 68, 0.2);
  --subtle-rgb: 42, 18, 68;
  --panel-rgb: 255, 253, 246;
  --panel-deep-rgb: 255, 247, 229;
  --topbar-rgb: 255, 253, 246;
  --toast-bg: #ffd93d;
  --graph-idle: #8a72a8;
  --shadow: 7px 7px 0 var(--ink);
  --button-shadow: var(--ink);
  --bubble-ai: #ffffff;
  --bubble-user: #ff2e73;
  --subcard: #fff3cf;
  --pop-pink: #ff2e73;
  --pop-cyan: #00b7d4;
  --pop-yellow: #ffb703;
  --pop-lime: #6fd943;
  --pop-orange: #ff9200;
  --pop-red: #ff3355;
  --pop-ink: #1c0b33;
}

html[data-style="cartoon"] body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0.004em;
  background-color: var(--bg-0);
  background-image:
    url("decor/star.svg"),
    url("decor/bolt.svg"),
    url("decor/star.svg"),
    radial-gradient(900px 560px at 88% 5%, rgba(69, 230, 255, 0.2), transparent 66%),
    radial-gradient(760px 520px at 4% 20%, rgba(168, 255, 96, 0.16), transparent 64%),
    radial-gradient(820px 540px at 96% 48%, rgba(255, 79, 163, 0.18), transparent 66%),
    radial-gradient(760px 520px at 2% 72%, rgba(255, 217, 61, 0.13), transparent 64%),
    radial-gradient(820px 500px at 82% 94%, rgba(255, 138, 31, 0.16), transparent 66%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1) 52%, var(--bg-2));
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  background-size: 40px 40px, 34px 50px, 24px 24px, auto, auto, auto, auto, auto, auto;
  background-position: left 2.5vw top 22vh, right 3vw top 14vh, right 7vw bottom 14vh, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
  background-attachment: fixed, fixed, fixed, scroll, scroll, scroll, scroll, scroll, scroll;
}

html[data-style="cartoon"][data-theme="light"] body {
  background-color: var(--bg-0);
  background-image:
    url("decor/star.svg"),
    url("decor/bolt.svg"),
    url("decor/star.svg"),
    radial-gradient(900px 560px at 88% 5%, rgba(0, 183, 212, 0.2), transparent 66%),
    radial-gradient(760px 520px at 4% 20%, rgba(111, 217, 67, 0.26), transparent 64%),
    radial-gradient(820px 540px at 96% 48%, rgba(255, 46, 115, 0.14), transparent 66%),
    radial-gradient(760px 520px at 2% 72%, rgba(255, 183, 3, 0.32), transparent 64%),
    radial-gradient(820px 500px at 82% 94%, rgba(255, 146, 0, 0.16), transparent 66%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1) 52%, var(--bg-2));
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  background-size: 40px 40px, 34px 50px, 24px 24px, auto, auto, auto, auto, auto, auto;
  background-position: left 2.5vw top 22vh, right 3vw top 14vh, right 7vw bottom 14vh, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
  background-attachment: fixed, fixed, fixed, scroll, scroll, scroll, scroll, scroll, scroll;
}

html[data-style="cartoon"] ::selection {
  color: var(--accent-ink);
  background: var(--accent);
}

html[data-style="cartoon"] :focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

html[data-style="cartoon"] h1,
html[data-style="cartoon"] h2,
html[data-style="cartoon"] h3,
html[data-style="cartoon"] h4,
html[data-style="cartoon"] .brand-name,
html[data-style="cartoon"] .btn,
html[data-style="cartoon"] .menu a,
html[data-style="cartoon"] .tab,
html[data-style="cartoon"] .chip,
html[data-style="cartoon"] .eyebrow,
html[data-style="cartoon"] .msg-meta,
html[data-style="cartoon"] .status,
html[data-style="cartoon"] .ai-title,
html[data-style="cartoon"] .map-title,
html[data-style="cartoon"] .map-node__title,
html[data-style="cartoon"] .faq-q,
html[data-style="cartoon"] .price-value,
html[data-style="cartoon"] .stat-value,
html[data-style="cartoon"] .plan-name {
  font-family: var(--font-serif);
}

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

html[data-style="cartoon"] .topbar {
  background: var(--panel);
  border-bottom: 4px solid var(--ink);
  box-shadow: 0 6px 0 var(--accent);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html[data-style="cartoon"] .brand-mark {
  border: 3px solid var(--ink);
  border-radius: 14px 18px 14px 18px;
  color: var(--ink);
  background: linear-gradient(145deg, var(--pop-yellow), var(--accent-2));
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-6deg);
  transition: transform 0.15s ease;
}

html[data-style="cartoon"] .brand:hover .brand-mark {
  transform: rotate(4deg) scale(1.04);
}

html[data-style="cartoon"] .brand-name {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.12em;
  text-shadow: 2px 2px 0 var(--accent-soft);
}

html[data-style="cartoon"] .brand-sub {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: 0.16em;
}

html[data-style="cartoon"] .menu a {
  padding: 8px 13px;
  border: 2px solid transparent;
  border-radius: 14px 18px 14px 18px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, color 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}

html[data-style="cartoon"] .menu a:hover {
  color: var(--text-strong);
  background: var(--panel-2);
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  transform: translateY(-1px);
}

html[data-style="cartoon"] .menu a.active {
  color: var(--accent-ink);
  background: var(--accent);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 700;
  transform: rotate(-2deg);
}

html[data-style="cartoon"] .avatar,
html[data-style="cartoon"] .theme-toggle {
  width: 38px;
  height: 38px;
  border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

html[data-style="cartoon"] .avatar {
  color: var(--accent-ink);
  background: linear-gradient(145deg, var(--pop-pink), var(--accent-2));
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 14px;
}

html[data-style="cartoon"] .theme-toggle {
  color: var(--ink);
  background: var(--pop-yellow);
}

html[data-style="cartoon"] .avatar:hover,
html[data-style="cartoon"] .theme-toggle:hover {
  color: var(--accent-ink);
  border-color: var(--ink);
  background-color: var(--pop-yellow);
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-6deg) translateY(-1px);
}

html[data-style="cartoon"] .status {
  padding: 5px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--text);
  background: var(--panel-2);
  box-shadow: 2px 2px 0 var(--ink);
  font-weight: 700;
  font-size: 11px;
}

html[data-style="cartoon"] .status-dot {
  width: 9px;
  height: 9px;
  border: 2px solid var(--ink);
  background: var(--pop-lime);
  box-shadow: none;
}

/* ------------------------------------------------------------
   Заголовки, метки, кнопки
   ------------------------------------------------------------ */

html[data-style="cartoon"] .page-title {
  font-size: clamp(38px, 4.2vw, 54px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-shadow: 3px 3px 0 var(--accent-soft);
}

html[data-style="cartoon"] .landing-hero h1 {
  font-size: clamp(30px, 4.4vw, 50px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-shadow: 3px 3px 0 var(--accent-soft);
}

html[data-style="cartoon"] .page-title::after,
html[data-style="cartoon"] .landing-hero h1::after {
  content: "";
  display: block;
  width: 92px;
  height: 9px;
  margin-top: 13px;
  border: 3px solid var(--ink);
  border-radius: 7px 11px 7px 11px;
  background: var(--accent);
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-2deg);
}

html[data-style="cartoon"] .landing-hero h1::after {
  width: 124px;
  background: var(--accent-2);
}

html[data-style="cartoon"] .page-lede,
html[data-style="cartoon"] .landing-lede {
  color: var(--text-soft);
  line-height: 1.65;
}

html[data-style="cartoon"] .section-title {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.005em;
}

html[data-style="cartoon"] .eyebrow {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border: 2.5px solid var(--ink);
  border-radius: 10px 14px 10px 14px;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  transform: rotate(-1.5deg);
}

html[data-style="cartoon"] .eyebrow::before {
  content: "★";
  font-size: 9px;
  line-height: 1;
}

html[data-style="cartoon"] .chip,
html[data-style="cartoon"] .section-count,
html[data-style="cartoon"] .map-empty__step,
html[data-style="cartoon"] .faq-q .q-badge {
  border: 2px solid var(--ink);
  border-radius: 9px 12px 9px 12px;
  color: var(--text-strong);
  background: var(--panel-2);
  box-shadow: 2px 2px 0 var(--ink);
  font-weight: 700;
  letter-spacing: 0.07em;
}

html[data-style="cartoon"] .section-count {
  color: var(--accent-ink);
  background: var(--accent);
}

html[data-style="cartoon"] .btn {
  padding: 9px 17px;
  border: 3px solid var(--ink);
  border-radius: 16px 20px 16px 20px;
  color: var(--text-strong);
  background: var(--panel-2);
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 700;
  font-size: 13px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

html[data-style="cartoon"] .btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
  filter: none;
}

html[data-style="cartoon"] .btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

html[data-style="cartoon"] .btn--primary {
  color: var(--accent-ink);
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 4px 4px 0 var(--ink), inset 0 -3px 0 rgba(0, 0, 0, 0.16);
}

html[data-style="cartoon"] .btn--primary:hover {
  filter: none;
  box-shadow: 6px 6px 0 var(--ink), inset 0 -3px 0 rgba(0, 0, 0, 0.16);
}

html[data-style="cartoon"] .btn--ghost {
  color: var(--text-strong);
  background: var(--panel);
  border-color: var(--ink);
}

html[data-style="cartoon"] .btn--ghost:hover {
  color: var(--text-strong);
  background: var(--panel-2);
  border-color: var(--ink);
}

html[data-style="cartoon"] .btn--small {
  padding: 6px 11px;
  border-width: 2px;
  border-radius: 12px 14px 12px 14px;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 11px;
}

html[data-style="cartoon"] .btn--small:hover {
  box-shadow: 4px 4px 0 var(--ink);
}

html[data-style="cartoon"] .btn:disabled,
html[data-style="cartoon"] .send-btn:disabled {
  opacity: 0.55;
  box-shadow: none;
  transform: none;
  filter: grayscale(0.2);
}

html[data-style="cartoon"] .billing-toggle {
  padding: 4px;
  border: 3px solid var(--ink);
  border-radius: 16px 20px 16px 20px;
  background: var(--panel);
  box-shadow: 3px 3px 0 var(--ink);
}

html[data-style="cartoon"] .billing-toggle button {
  border: 2px solid transparent;
  border-radius: 11px 14px 11px 14px;
  color: var(--muted);
  font-family: var(--font-serif);
  font-weight: 700;
}

html[data-style="cartoon"] .billing-toggle button.active,
html[data-style="cartoon"] .tab.active {
  color: var(--accent-ink);
  background: var(--accent);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

html[data-style="cartoon"] .tabs {
  border: 3px solid var(--ink);
  background: var(--panel);
  box-shadow: 3px 3px 0 var(--ink);
}

html[data-style="cartoon"] .tab {
  font-weight: 700;
}

html[data-style="cartoon"] .map-toggle {
  padding: 6px 12px;
  border: 2.5px solid var(--ink);
  border-radius: 12px 15px 12px 15px;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 700;
  font-size: 11px;
}

html[data-style="cartoon"] .sources-btn {
  padding: 6px 12px;
  border: 2.5px solid var(--ink);
  border-radius: 12px 15px 12px 15px;
  color: var(--text-soft);
  background: var(--panel-2);
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 700;
  font-size: 11px;
}

html[data-style="cartoon"] .sources-btn:hover {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-2deg) scale(1.03);
}

html[data-style="cartoon"] .sources-count {
  border: 2px solid var(--ink);
  font-weight: 700;
}

html[data-style="cartoon"] .refresh-btn,
html[data-style="cartoon"] .icon-btn {
  border: 3px solid var(--ink);
  border-radius: 13px 16px 13px 16px;
  color: var(--text-soft);
  background: var(--panel-2);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, color 0.12s ease, background-color 0.12s ease;
}

html[data-style="cartoon"] .refresh-btn:hover,
html[data-style="cartoon"] .icon-btn:hover {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-6deg) scale(1.04);
}

html[data-style="cartoon"] .admin-danger {
  border: 2px solid var(--ink);
  border-radius: 10px 13px 10px 13px;
  color: var(--ink);
  background: var(--pop-red);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--font-serif);
  font-weight: 700;
}

html[data-style="cartoon"] .admin-danger:hover:not(:disabled) {
  color: var(--ink);
  background: var(--pop-red);
  filter: brightness(1.07);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

/* ------------------------------------------------------------
   Карточки и панели
   ------------------------------------------------------------ */

html[data-style="cartoon"] .card,
html[data-style="cartoon"] .panel {
  border: 3px solid var(--ink);
  border-radius: var(--comic-radius);
  background-color: var(--panel);
  box-shadow: 7px 7px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.07);
}

html[data-style="cartoon"] .landing-hero.card,
html[data-style="cartoon"] .auth-card.card,
html[data-style="cartoon"] .plan--popular.card {
  box-shadow: 9px 9px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.08);
}

html[data-style="cartoon"] .new-course {
  border: 3px solid var(--ink);
  border-radius: 22px 26px 22px 26px;
  background-color: var(--panel);
  background-image: radial-gradient(620px 200px at 0% 0%, var(--accent-soft), transparent 68%);
  box-shadow: 6px 6px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.07);
}

html[data-style="cartoon"] .new-course:hover,
html[data-style="cartoon"] .course-card:hover {
  border-color: var(--ink);
  box-shadow: 9px 9px 0 var(--accent);
  transform: translate(-2px, -2px);
}

html[data-style="cartoon"] .new-course--upload:hover {
  box-shadow: 6px 6px 0 var(--ink);
  transform: none;
}

html[data-style="cartoon"] .new-course__title,
html[data-style="cartoon"] .new-course__eyebrow {
  font-family: var(--font-serif);
  font-weight: 700;
}

html[data-style="cartoon"] .new-course__title {
  font-size: 18px;
  letter-spacing: 0;
}

html[data-style="cartoon"] .new-course__text {
  font-size: 12px;
}

html[data-style="cartoon"] .new-course__icon,
html[data-style="cartoon"] .course-mark,
html[data-style="cartoon"] .map-icon,
html[data-style="cartoon"] .side-icon,
html[data-style="cartoon"] .include-icon,
html[data-style="cartoon"] .map-empty__icon,
html[data-style="cartoon"] .landing-step__num {
  border: 3px solid var(--ink);
  border-radius: 12px 15px 12px 15px;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 3px 3px 0 var(--ink);
}

html[data-style="cartoon"] .new-course__icon {
  transform: rotate(-4deg);
}

html[data-style="cartoon"] .new-course__arrow {
  color: var(--accent-ink);
  font-size: 24px;
  font-weight: 700;
}

/* ------------------------------------------------------------
   Настройки и формы
   ------------------------------------------------------------ */

html[data-style="cartoon"] .settings-card {
  border-top-width: 8px;
}

html[data-style="cartoon"] .settings-card:nth-of-type(4n + 1) {
  border-top-color: var(--pop-pink);
}

html[data-style="cartoon"] .settings-card:nth-of-type(4n + 2) {
  border-top-color: var(--pop-cyan);
}

html[data-style="cartoon"] .settings-card:nth-of-type(4n + 3) {
  border-top-color: var(--pop-yellow);
}

html[data-style="cartoon"] .settings-card:nth-of-type(4n + 4) {
  border-top-color: var(--pop-lime);
}

html[data-style="cartoon"] .settings-head h2 {
  font-size: 16px;
  font-weight: 700;
}

html[data-style="cartoon"] .settings-head p {
  color: var(--muted);
  font-size: 11px;
}

html[data-style="cartoon"] .setting-row,
html[data-style="cartoon"] .session,
html[data-style="cartoon"] .material-row {
  border-bottom: 2px dashed var(--hairline);
}

html[data-style="cartoon"] .setting-label {
  color: var(--text-strong);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 13px;
}

html[data-style="cartoon"] .setting-desc {
  color: var(--muted);
  font-size: 10.5px;
}

html[data-style="cartoon"] .select,
html[data-style="cartoon"] .admin-input,
html[data-style="cartoon"] .admin-textarea,
html[data-style="cartoon"] .faq-search input {
  border: 2.5px solid var(--ink);
  border-radius: 12px 15px 12px 15px;
  color: var(--text);
  background: var(--panel);
  box-shadow: 2px 2px 0 var(--ink);
  font-weight: 600;
}

html[data-style="cartoon"] .select:focus,
html[data-style="cartoon"] .admin-input:focus,
html[data-style="cartoon"] .admin-textarea:focus,
html[data-style="cartoon"] .faq-search input:focus {
  border-color: var(--accent);
  box-shadow: 3px 3px 0 var(--ink), 0 0 0 3px var(--accent-soft);
}

html[data-style="cartoon"] .switch {
  width: 50px;
  height: 28px;
}

html[data-style="cartoon"] .switch .track {
  border: 3px solid var(--ink);
  background: var(--panel-3);
  box-shadow: 2px 2px 0 var(--ink);
}

html[data-style="cartoon"] .switch input:checked + .track {
  border-color: var(--ink);
  background: var(--accent);
}

html[data-style="cartoon"] .switch .track::after {
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
  background: var(--panel);
}

html[data-style="cartoon"] .switch input:checked + .track::after {
  background: var(--accent-ink);
  transform: translateX(22px);
}

/* ------------------------------------------------------------
   Чат
   ------------------------------------------------------------ */

html[data-style="cartoon"] .ai-head {
  border-bottom: 3px solid var(--ink);
  background: var(--panel-2);
}

html[data-style="cartoon"] .ai-avatar {
  width: 36px;
  height: 36px;
  border: 3px solid var(--ink);
  border-radius: 10px 13px 10px 13px;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--font-serif);
  font-size: 10px;
  font-weight: 700;
  transform: rotate(-5deg);
}

html[data-style="cartoon"] .ai-title {
  font-size: 15px;
  font-weight: 700;
}

html[data-style="cartoon"] .ai-sub {
  font-size: 10.5px;
}

html[data-style="cartoon"] .chat {
  background-color: var(--inset);
  scrollbar-color: var(--accent) var(--inset);
}

html[data-style="cartoon"] .chat::-webkit-scrollbar {
  width: 10px;
}

html[data-style="cartoon"] .chat::-webkit-scrollbar-track {
  background: var(--inset);
}

html[data-style="cartoon"] .chat::-webkit-scrollbar-thumb {
  border: 2px solid var(--inset);
  border-radius: 999px;
  background: var(--accent);
}

html[data-style="cartoon"] .msg-avatar {
  width: 30px;
  height: 30px;
  border: 3px solid var(--ink);
  border-radius: 9px 12px 9px 12px;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--font-serif);
  font-weight: 700;
  transform: rotate(-4deg);
}

html[data-style="cartoon"] .msg--user .msg-avatar {
  border-radius: 50%;
  color: var(--accent-ink);
  background: var(--accent-2);
  transform: rotate(4deg);
}

html[data-style="cartoon"] .msg-meta {
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

html[data-style="cartoon"] .msg-bubble {
  position: relative;
  padding: 12px 15px;
  border: 3px solid var(--ink);
  border-radius: 20px 24px 20px 7px;
  color: var(--text);
  background: var(--bubble-ai);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 15px;
  line-height: 1.62;
}

html[data-style="cartoon"] .msg--ai .msg-bubble::after {
  content: "";
  position: absolute;
  left: -10px;
  bottom: 12px;
  width: 15px;
  height: 15px;
  border-bottom: 3px solid var(--ink);
  border-left: 3px solid var(--ink);
  background: var(--bubble-ai);
  transform: rotate(45deg);
}

html[data-style="cartoon"] .msg--user .msg-bubble {
  border-color: var(--ink);
  border-radius: 24px 20px 7px 20px;
  color: var(--accent-ink);
  background: var(--bubble-user);
  box-shadow: 4px 4px 0 var(--ink);
}

html[data-style="cartoon"] .msg--user .msg-bubble::after {
  content: "";
  position: absolute;
  right: -10px;
  bottom: 12px;
  width: 15px;
  height: 15px;
  border-top: 3px solid var(--ink);
  border-right: 3px solid var(--ink);
  background: var(--bubble-user);
  transform: rotate(45deg);
}

html[data-style="cartoon"] .msg--user .msg-bubble strong {
  color: var(--accent-ink);
}

html[data-style="cartoon"] .goal-card,
html[data-style="cartoon"] .rich-card,
html[data-style="cartoon"] .video-card,
html[data-style="cartoon"] .images-card,
html[data-style="cartoon"] .formula-card {
  border: 2.5px solid var(--ink);
  border-radius: 16px 20px 16px 20px;
  background: var(--subcard);
  box-shadow: 3px 3px 0 var(--ink);
}

html[data-style="cartoon"] .goal-head {
  color: var(--accent-2);
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 0.12em;
}

html[data-style="cartoon"] .goal-row {
  border-bottom: 2px dashed var(--hairline);
}

html[data-style="cartoon"] .goal-key {
  color: var(--muted);
  font-weight: 600;
}

html[data-style="cartoon"] .goal-val {
  color: var(--text-strong);
}

html[data-style="cartoon"] .rich-head,
html[data-style="cartoon"] .video-head,
html[data-style="cartoon"] .images-head {
  border-bottom: 2.5px solid var(--ink);
  background: var(--panel-2);
}

html[data-style="cartoon"] .rich-title {
  font-family: var(--font-serif);
  color: var(--text-strong);
  font-weight: 700;
}

html[data-style="cartoon"] .image-item {
  border: 2px solid var(--ink);
  border-radius: 12px 15px 12px 15px;
  box-shadow: 2px 2px 0 var(--ink);
}

html[data-style="cartoon"] .formula-card {
  color: var(--text-strong);
  box-shadow: 2px 2px 0 var(--ink);
}

html[data-style="cartoon"] .msg-actions .btn {
  background: var(--panel);
}

html[data-style="cartoon"] .composer {
  background-color: var(--panel);
  background-image: none;
  box-shadow: 6px 6px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.07);
}

html[data-style="cartoon"] .composer textarea {
  min-height: 43px;
  border: 2.5px solid var(--ink);
  border-radius: 13px 16px 13px 16px;
  color: var(--text);
  background: var(--inset);
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.09);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
}

html[data-style="cartoon"] .composer textarea:focus {
  border-color: var(--accent);
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.09), 0 0 0 3px var(--accent-soft);
}

html[data-style="cartoon"] .send-btn {
  height: 43px;
  border: 3px solid var(--ink);
  border-radius: 13px 16px 13px 16px;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--pop-pink), var(--accent-2));
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--font-serif);
  font-weight: 700;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

html[data-style="cartoon"] .send-btn:hover {
  filter: none;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}

html[data-style="cartoon"] .send-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

html[data-style="cartoon"] .composer-hint {
  color: var(--muted);
  font-size: 9.5px;
}

html[data-style="cartoon"] .file-chip {
  color: var(--accent);
  font-weight: 700;
}

/* ------------------------------------------------------------
   Карта обучения
   ------------------------------------------------------------ */

html[data-style="cartoon"] .map-head {
  border-bottom: 3px solid var(--ink);
  background: var(--panel-2);
}

html[data-style="cartoon"] .map-title {
  font-size: 14px;
  font-weight: 700;
}

html[data-style="cartoon"] .map-icon {
  width: 28px;
  height: 28px;
  transform: rotate(-5deg);
}

html[data-style="cartoon"] .map-count {
  padding: 2px 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--text-strong);
  background: var(--accent-soft);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--font-serif);
  font-weight: 700;
}

html[data-style="cartoon"] .map-goal {
  color: var(--text-soft);
  font-size: 11.5px;
}

html[data-style="cartoon"] .progress,
html[data-style="cartoon"] .course-progress {
  height: 13px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--panel-3);
  box-shadow: 2px 2px 0 var(--ink);
}

html[data-style="cartoon"] .progress span,
html[data-style="cartoon"] .course-progress span {
  background: repeating-linear-gradient(45deg, var(--accent) 0 10px, var(--accent-2) 10px 20px);
}

html[data-style="cartoon"] .course-stage {
  width: 10px;
  height: 10px;
  border: 2px solid var(--ink);
  box-shadow: 1px 1px 0 var(--ink);
}

html[data-style="cartoon"] .course-stage--done,
html[data-style="cartoon"] .course-stage--active {
  background: var(--accent);
}

html[data-style="cartoon"] .bar span {
  border: 2px solid var(--ink);
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

html[data-style="cartoon"] .map-empty {
  border: 3px dashed var(--ink);
  border-radius: 20px 24px 20px 24px;
  background: var(--accent-softer);
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-0.6deg);
}

html[data-style="cartoon"] .map-empty__icon {
  transform: rotate(-5deg);
}

html[data-style="cartoon"] .map-empty__title {
  font-family: var(--font-serif);
  font-weight: 700;
}

html[data-style="cartoon"] .map-empty__text {
  color: var(--muted);
}

html[data-style="cartoon"] .map-node {
  border: 2.5px solid transparent;
  border-radius: 16px 20px 16px 20px;
}

html[data-style="cartoon"] .map-node + .map-node::before {
  left: 19px;
  width: 4px;
  background: repeating-linear-gradient(to bottom, var(--ink) 0 6px, transparent 6px 11px);
}

html[data-style="cartoon"] .map-node--done + .map-node::before,
html[data-style="cartoon"] .map-node--active + .map-node::before {
  background: repeating-linear-gradient(to bottom, var(--accent) 0 6px, transparent 6px 11px);
}

html[data-style="cartoon"] .map-node__dot {
  width: 27px;
  height: 27px;
  border: 3px solid var(--ink);
  background: var(--panel-3);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--font-serif);
  font-weight: 700;
}

html[data-style="cartoon"] .map-node__title {
  font-size: 12px;
  font-weight: 700;
}

html[data-style="cartoon"] .map-node__sub {
  color: var(--muted);
}

html[data-style="cartoon"] .map-node__status {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 0.1em;
}

html[data-style="cartoon"] .map-node--done .map-node__dot {
  color: var(--pop-ink);
  border-color: var(--ink);
  background: var(--pop-lime);
}

html[data-style="cartoon"] .map-node--active {
  border: 3px solid var(--ink);
  background: var(--accent-soft);
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-0.7deg);
}

html[data-style="cartoon"] .map-node--active .map-node__dot {
  color: var(--accent-ink);
  border-color: var(--ink);
  background: var(--accent);
  box-shadow: 2px 2px 0 var(--ink), 0 0 0 4px var(--accent-soft);
  animation: cartoon-pulse 2.4s ease-in-out infinite;
}

@keyframes cartoon-pulse {
  0%,
  100% {
    box-shadow: 2px 2px 0 var(--ink), 0 0 0 4px var(--accent-soft);
  }
  50% {
    box-shadow: 2px 2px 0 var(--ink), 0 0 0 9px rgba(var(--accent-rgb), 0.06);
  }
}

html[data-style="cartoon"] .map-foot {
  border-top: 3px solid var(--ink);
}

html[data-style="cartoon"] .map-next {
  font-size: 10.5px;
}

html[data-style="cartoon"] .map-next strong {
  font-family: var(--font-serif);
  font-weight: 700;
}

/* ------------------------------------------------------------
   Цены
   ------------------------------------------------------------ */

html[data-style="cartoon"] .pricing-grid {
  gap: 16px;
}

html[data-style="cartoon"] .plan {
  padding: 24px;
  border: 3px solid var(--ink);
  border-top-width: 8px;
  background-color: var(--panel);
  box-shadow: 7px 7px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.07);
}

html[data-style="cartoon"] .pricing-grid .plan:nth-child(1) {
  border-top-color: var(--pop-yellow);
}

html[data-style="cartoon"] .pricing-grid .plan:nth-child(3) {
  border-top-color: var(--pop-cyan);
}

html[data-style="cartoon"] .plan--popular {
  border-color: var(--ink);
  border-top-color: var(--pop-pink);
  background-color: var(--panel);
  background-image: radial-gradient(420px 220px at 50% 0%, var(--accent-soft), transparent 70%);
  box-shadow: 10px 10px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.08);
  transform: rotate(-1.2deg);
  z-index: 1;
}

html[data-style="cartoon"] .plan-name {
  font-size: 18px;
  font-weight: 700;
}

html[data-style="cartoon"] .plan-desc {
  color: var(--muted);
  font-size: 11.5px;
}

html[data-style="cartoon"] .price-value {
  font-weight: 700;
  font-size: 42px;
  letter-spacing: -0.01em;
  text-shadow: 3px 3px 0 var(--accent-soft);
}

html[data-style="cartoon"] .plan-period {
  color: var(--muted);
  font-size: 10px;
}

html[data-style="cartoon"] .plan-list {
  color: var(--text-soft);
  font-size: 12px;
}

html[data-style="cartoon"] .plan-list li::before {
  color: var(--accent-2);
  font-weight: 700;
}

html[data-style="cartoon"] .plan-save {
  color: var(--accent);
  font-family: var(--font-serif);
  font-weight: 700;
}

html[data-style="cartoon"] .plan-badge {
  top: -14px;
  left: 18px;
  padding: 5px 11px;
  border: 2.5px solid var(--ink);
  border-radius: 10px 13px 10px 13px;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--font-serif);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  transform: rotate(-6deg);
}

html[data-style="cartoon"] .includes {
  border: 3px solid var(--ink);
}

html[data-style="cartoon"] .includes h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 14px;
}

html[data-style="cartoon"] .include {
  color: var(--text-soft);
  font-size: 11.5px;
}

html[data-style="cartoon"] .include-icon {
  border-radius: 9px 12px 9px 12px;
  transform: rotate(-4deg);
}

html[data-style="cartoon"] .pricing-note {
  color: var(--muted);
  font-size: 10.5px;
}

/* ------------------------------------------------------------
   Аккаунт, вход, FAQ
   ------------------------------------------------------------ */

html[data-style="cartoon"] .profile-card {
  border-top: 8px solid var(--pop-pink);
}

html[data-style="cartoon"] .avatar-xl {
  border: 4px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  transform: rotate(-3deg);
}

html[data-style="cartoon"] .profile-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 18px;
}

html[data-style="cartoon"] .profile-email,
html[data-style="cartoon"] .profile-since {
  color: var(--muted);
}

html[data-style="cartoon"] .stats-grid {
  gap: 12px;
}

html[data-style="cartoon"] .stat {
  border-top-width: 8px;
  padding: 16px;
}

html[data-style="cartoon"] .stats-grid .stat:nth-child(1) {
  border-top-color: var(--pop-yellow);
}

html[data-style="cartoon"] .stats-grid .stat:nth-child(2) {
  border-top-color: var(--pop-cyan);
}

html[data-style="cartoon"] .stats-grid .stat:nth-child(3) {
  border-top-color: var(--pop-lime);
}

html[data-style="cartoon"] .stat-value {
  font-size: 28px;
  font-weight: 700;
}

html[data-style="cartoon"] .stat-label {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

html[data-style="cartoon"] .sessions-card {
  border-top: 8px solid var(--pop-cyan);
}

html[data-style="cartoon"] .session-date,
html[data-style="cartoon"] .session-meta {
  color: var(--muted);
}

html[data-style="cartoon"] .auth-card {
  border-top-width: 8px;
  border-top-color: var(--pop-cyan);
}

html[data-style="cartoon"] .auth-card h1,
html[data-style="cartoon"] .auth-card h2 {
  font-weight: 700;
}

html[data-style="cartoon"] .auth-tabs {
  border: 3px solid var(--ink);
  border-radius: 16px 20px 16px 20px;
  background: var(--panel);
  box-shadow: 3px 3px 0 var(--ink);
}

html[data-style="cartoon"] .auth-tab {
  border: 2px solid transparent;
  border-radius: 11px 14px 11px 14px;
  color: var(--muted);
  background: transparent;
  font-family: var(--font-serif);
  font-weight: 700;
}

html[data-style="cartoon"] .auth-tab.active {
  border-color: var(--ink);
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 2px 2px 0 var(--ink);
}

html[data-style="cartoon"] .auth-error:empty {
  display: none;
}

html[data-style="cartoon"] .auth-error:not(:empty) {
  padding: 8px 12px;
  border: 2px solid var(--ink);
  border-radius: 12px 15px 12px 15px;
  color: var(--ink);
  background: var(--pop-red);
  box-shadow: 2px 2px 0 var(--ink);
  font-weight: 600;
}

html[data-style="cartoon"] .auth-note {
  color: var(--muted);
}

html[data-style="cartoon"] .faq-item {
  border: 3px solid var(--ink);
  border-radius: 18px 22px 18px 22px;
  background: var(--panel);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

html[data-style="cartoon"] .faq-item:hover {
  border-color: var(--ink);
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}

html[data-style="cartoon"] .faq-item.open {
  border-color: var(--accent);
  background: var(--panel);
  box-shadow: 4px 4px 0 var(--accent);
}

html[data-style="cartoon"] .faq-q {
  font-size: 13.5px;
  font-weight: 700;
}

html[data-style="cartoon"] .faq-q .q-badge {
  color: var(--text-soft);
  background: var(--accent-soft);
  font-family: var(--font-serif);
  font-size: 8px;
}

html[data-style="cartoon"] .faq-q .plus {
  border: 2.5px solid var(--ink);
  background: var(--panel-2);
  box-shadow: 2px 2px 0 var(--ink);
}

html[data-style="cartoon"] .faq-a {
  color: var(--muted);
  font-size: 12.5px;
}

html[data-style="cartoon"] .side-card {
  border-top: 8px solid var(--pop-yellow);
}

html[data-style="cartoon"] .side-card--muted {
  border-top-color: var(--pop-lime);
  background: var(--panel-2);
}

html[data-style="cartoon"] .side-card h2,
html[data-style="cartoon"] .side-card h3 {
  font-family: var(--font-serif);
  font-weight: 700;
}

html[data-style="cartoon"] .side-card p {
  color: var(--muted);
}

html[data-style="cartoon"] .empty-state {
  border: 3px dashed var(--ink);
  border-radius: 18px 22px 18px 22px;
  background: var(--panel-2);
  box-shadow: 3px 3px 0 var(--ink);
}

/* ------------------------------------------------------------
   Лендинг
   ------------------------------------------------------------ */

html[data-style="cartoon"] .landing-hero {
  position: relative;
  padding: 36px 32px;
  border-width: 4px;
  background-color: var(--panel);
  background-image: radial-gradient(circle at 90% 8%, var(--accent-soft), transparent 42%);
}

html[data-style="cartoon"] .landing-hero::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 36px;
  width: 104px;
  height: 27px;
  border: 2px solid var(--ink);
  background: repeating-linear-gradient(135deg, var(--pop-yellow) 0 9px, var(--accent-2) 9px 18px);
  box-shadow: 2px 2px 0 rgba(16, 4, 43, 0.35);
  transform: rotate(-4deg);
  pointer-events: none;
}

html[data-style="cartoon"] .landing-points {
  gap: 14px;
}

html[data-style="cartoon"] .landing-point {
  padding: 15px 17px;
  border: 2.5px solid var(--ink);
  border-radius: 16px 20px 16px 20px;
  background: var(--panel-2);
  box-shadow: 3px 3px 0 var(--ink);
}

html[data-style="cartoon"] .landing-point:nth-child(1) {
  transform: rotate(-0.8deg);
}

html[data-style="cartoon"] .landing-point:nth-child(2) {
  transform: rotate(0.6deg);
}

html[data-style="cartoon"] .landing-point:nth-child(3) {
  transform: rotate(-0.5deg);
}

html[data-style="cartoon"] .landing-point strong {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 13px;
}

html[data-style="cartoon"] .landing-point span {
  color: var(--muted);
  font-size: 11px;
}

html[data-style="cartoon"] .landing-step.card {
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
}

html[data-style="cartoon"] .landing-step__num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-family: var(--font-serif);
  font-weight: 700;
  transform: rotate(-6deg);
}

html[data-style="cartoon"] .landing-step h3 {
  font-size: 13.5px;
  font-weight: 700;
}

html[data-style="cartoon"] .landing-step p,
html[data-style="cartoon"] .landing-text p {
  color: var(--muted);
  font-size: 11px;
}

html[data-style="cartoon"] .landing-source h2 {
  font-size: 19px;
  font-weight: 700;
}

html[data-style="cartoon"] .landing-badge {
  border: 2px solid var(--ink);
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--pop-yellow), var(--accent-2));
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--font-serif);
  text-shadow: none;
}

html[data-style="cartoon"] .problem-card.card,
html[data-style="cartoon"] .problem-item.card,
html[data-style="cartoon"] .solution-card.card {
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}

html[data-style="cartoon"] .problem-card h3,
html[data-style="cartoon"] .problem-item h3,
html[data-style="cartoon"] .solution-card h3 {
  font-size: 15px;
  font-weight: 700;
}

html[data-style="cartoon"] .problem-card p,
html[data-style="cartoon"] .problem-item p,
html[data-style="cartoon"] .solution-card p {
  color: var(--muted);
  font-size: 12px;
}

html[data-style="cartoon"] .problem-item__num {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 3px;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--font-serif);
  font-size: 10px;
  font-weight: 700;
  transform: rotate(-6deg);
}

html[data-style="cartoon"] .solution-card {
  border-color: var(--accent);
}

html[data-style="cartoon"] .model-graph text {
  fill: var(--text-soft);
  font-family: var(--font-sans);
  font-weight: 700;
}

html[data-style="cartoon"] .model-graph .mg-node rect {
  fill: var(--panel-2);
  stroke: var(--ink);
  stroke-width: 3;
}

html[data-style="cartoon"] .model-graph .mg-node {
  filter: drop-shadow(3px 3px 0 var(--ink));
}

html[data-style="cartoon"] .model-graph .mg-node--accent rect {
  fill: var(--accent);
  stroke: var(--ink);
}

html[data-style="cartoon"] .model-graph .mg-node--accent text {
  fill: var(--accent-ink);
}

html[data-style="cartoon"] .model-graph .mg-node--accent .mg-caption {
  fill: var(--accent-ink);
  opacity: 0.72;
}

html[data-style="cartoon"] .model-graph .mg-caption {
  fill: var(--muted);
  font-family: var(--font-serif);
  font-size: 8.5px;
  font-weight: 400;
}

html[data-style="cartoon"] .model-graph .mg-line {
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 7 5;
}

html[data-style="cartoon"] .model-graph .mg-arrow {
  fill: var(--ink);
}

/* ------------------------------------------------------------
   Админка, уведомления, подвал
   ------------------------------------------------------------ */

html[data-style="cartoon"] .admin-stat {
  border-top-width: 8px;
  padding: 15px 16px;
}

html[data-style="cartoon"] .admin-stats .admin-stat:nth-child(1) {
  border-top-color: var(--pop-yellow);
}

html[data-style="cartoon"] .admin-stats .admin-stat:nth-child(2) {
  border-top-color: var(--pop-pink);
}

html[data-style="cartoon"] .admin-stats .admin-stat:nth-child(3) {
  border-top-color: var(--pop-cyan);
}

html[data-style="cartoon"] .admin-stats .admin-stat:nth-child(4) {
  border-top-color: var(--pop-lime);
}

html[data-style="cartoon"] .admin-stats .admin-stat:nth-child(5) {
  border-top-color: var(--accent-2);
}

html[data-style="cartoon"] .admin-stats .admin-stat:nth-child(6) {
  border-top-color: var(--pop-pink);
}

html[data-style="cartoon"] .admin-stat strong {
  font-weight: 700;
  font-size: 28px;
}

html[data-style="cartoon"] .admin-stat span {
  color: var(--muted);
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 0.08em;
}

html[data-style="cartoon"] .admin-section-head {
  border-bottom: 3px solid var(--ink);
  background: var(--panel-2);
}

html[data-style="cartoon"] .admin-section-head h2 {
  font-weight: 700;
}

html[data-style="cartoon"] .admin-table th,
html[data-style="cartoon"] .mini-table th {
  border-bottom: 3px solid var(--ink);
  color: var(--text-strong);
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 0.05em;
}

html[data-style="cartoon"] .admin-table td,
html[data-style="cartoon"] .mini-table td {
  border-bottom: 2px dashed var(--hairline);
  color: var(--text-soft);
}

html[data-style="cartoon"] .admin-table tbody tr:last-child td,
html[data-style="cartoon"] .mini-table tr:last-child td {
  border-bottom: 0;
}

html[data-style="cartoon"] .admin-kv__row {
  border-bottom: 2px dashed var(--hairline);
}

html[data-style="cartoon"] .admin-kv__row span {
  color: var(--muted);
}

html[data-style="cartoon"] .admin-kv__row strong {
  color: var(--text-strong);
  font-weight: 700;
}

html[data-style="cartoon"] .toast {
  border: 3px solid var(--ink);
  border-left: 9px solid var(--pop-pink);
  border-radius: 14px 18px 14px 18px;
  color: var(--ink);
  background: var(--toast-bg);
  box-shadow: 5px 5px 0 var(--ink);
  font-family: var(--font-serif);
  font-weight: 700;
}

html[data-style="cartoon"] .footer {
  border-top: 3px solid var(--ink);
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.02em;
  background: var(--panel);
}

html[data-style="cartoon"] .footer a {
  color: var(--text-soft);
  font-weight: 700;
}

html[data-style="cartoon"] .footer a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

html[data-style="cartoon"] .media-lightbox {
  background: rgba(16, 4, 43, 0.92);
}

html[data-style="cartoon"] .media-lightbox__close {
  border: 3px solid var(--ink);
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 3px 3px 0 var(--ink);
}

html[data-style="cartoon"] .composer textarea::placeholder,
html[data-style="cartoon"] .faq-search input::placeholder,
html[data-style="cartoon"] .admin-input::placeholder,
html[data-style="cartoon"] .admin-textarea::placeholder {
  color: var(--muted-2);
}

/* ------------------------------------------------------------
   Декор: мозг, лампочка, кот и цветные акценты
   ------------------------------------------------------------ */

html[data-style="cartoon"] body[data-nav-section="home"] .landing-hero::after {
  content: "";
  position: absolute;
  top: 30px;
  right: 36px;
  width: 134px;
  height: 99px;
  background: url("decor/brain.svg") center / contain no-repeat;
  filter: drop-shadow(4px 4px 0 rgba(16, 4, 43, 0.38));
  transform: rotate(7deg);
  pointer-events: none;
}

html[data-style="cartoon"] body[data-nav-section="home"] .landing-points {
  position: relative;
}

html[data-style="cartoon"] body[data-nav-section="home"] .landing-points::before {
  content: "";
  position: absolute;
  right: 16px;
  top: -92px;
  z-index: 2;
  width: 140px;
  height: 108px;
  background: url("decor/cat.svg?v=43") center bottom / contain no-repeat;
  filter: drop-shadow(3px 3px 0 rgba(16, 4, 43, 0.35));
  transform: rotate(-1deg);
  pointer-events: none;
}

html[data-style="cartoon"] .app--auth .auth-card {
  position: relative;
}

html[data-style="cartoon"] .app--auth .auth-card::before {
  content: "";
  position: absolute;
  top: -62px;
  right: -48px;
  z-index: 2;
  width: 118px;
  height: 91px;
  background: url("decor/cat.svg?v=43") center bottom / contain no-repeat;
  filter: drop-shadow(3px 3px 0 rgba(16, 4, 43, 0.35));
  transform: rotate(-1deg);
  pointer-events: none;
}

html[data-style="cartoon"] body[data-nav-section="subscription"] .page-head {
  position: relative;
}

html[data-style="cartoon"] body[data-nav-section="subscription"] .page-head::after {
  content: "";
  position: absolute;
  top: -14px;
  right: 26px;
  width: 64px;
  height: 91px;
  background: url("decor/bulb.svg") center top / contain no-repeat;
  filter: drop-shadow(3px 3px 0 rgba(16, 4, 43, 0.35));
  transform: rotate(6deg);
  pointer-events: none;
}

html[data-style="cartoon"] body[data-nav-section="subscription"] .page {
  position: relative;
}

html[data-style="cartoon"] body[data-nav-section="subscription"] .page::before {
  content: "";
  position: absolute;
  top: -10px;
  right: 26px;
  width: 140px;
  height: 220px;
  background: url("decor/cat-hang.svg?v=44") center top / contain no-repeat;
  filter: drop-shadow(3px 3px 0 rgba(16, 4, 43, 0.35));
  transform: rotate(2.5deg);
  transform-origin: 50% 0;
  pointer-events: none;
}

html[data-style="cartoon"] body[data-nav-section="home"] #solution .section-head {
  position: relative;
}

html[data-style="cartoon"] body[data-nav-section="home"] #solution .section-head::after {
  content: "";
  position: absolute;
  top: -18px;
  right: 26px;
  width: 64px;
  height: 91px;
  background: url("decor/bulb.svg") center top / contain no-repeat;
  filter: drop-shadow(3px 3px 0 rgba(16, 4, 43, 0.35));
  transform: rotate(7deg);
  pointer-events: none;
}

html[data-style="cartoon"] body[data-nav-section="learning"]:not(.app--workspace) .page-head {
  position: relative;
}

html[data-style="cartoon"] body[data-nav-section="learning"]:not(.app--workspace) .page-head::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 18px;
  width: 116px;
  height: 85px;
  background: url("decor/brain.svg") center / contain no-repeat;
  filter: drop-shadow(4px 4px 0 rgba(16, 4, 43, 0.36));
  transform: rotate(-6deg);
  pointer-events: none;
}

html[data-style="cartoon"] .chat {
  background-image: url("decor/bulb-faint.svg");
  background-repeat: no-repeat;
  background-position: right 28px bottom 20px;
  background-size: 148px 233px;
}

html[data-style="cartoon"] .landing-point:nth-child(1) {
  border-top: 4px solid var(--pop-yellow);
}

html[data-style="cartoon"] .landing-point:nth-child(2) {
  border-top: 4px solid var(--pop-pink);
}

html[data-style="cartoon"] .landing-point:nth-child(3) {
  border-top: 4px solid var(--pop-cyan);
}

html[data-style="cartoon"] .problem-card:nth-child(1) {
  border-top: 5px solid var(--pop-pink);
}

html[data-style="cartoon"] .problem-card:nth-child(2) {
  border-top: 5px solid var(--pop-cyan);
}

html[data-style="cartoon"] .problem-item:nth-child(1) .problem-item__num {
  background: var(--pop-yellow);
}

html[data-style="cartoon"] .problem-item:nth-child(2) .problem-item__num {
  background: var(--pop-pink);
}

html[data-style="cartoon"] .problem-item:nth-child(3) .problem-item__num {
  background: var(--pop-cyan);
}

html[data-style="cartoon"] .problem-item:nth-child(4) .problem-item__num {
  background: var(--pop-lime);
}

html[data-style="cartoon"] .solution-card:nth-child(1) {
  border-top: 5px solid var(--pop-yellow);
}

html[data-style="cartoon"] .solution-card:nth-child(2) {
  border-top: 5px solid var(--pop-pink);
}

html[data-style="cartoon"] .solution-card:nth-child(3) {
  border-top: 5px solid var(--pop-cyan);
}

html[data-style="cartoon"] .solution-card:nth-child(4) {
  border-top: 5px solid var(--pop-lime);
}

html[data-style="cartoon"] .landing-step:nth-child(1) .landing-step__num {
  background: var(--pop-yellow);
}

html[data-style="cartoon"] .landing-step:nth-child(2) .landing-step__num {
  background: var(--pop-pink);
}

html[data-style="cartoon"] .landing-step:nth-child(3) .landing-step__num {
  background: var(--pop-cyan);
}

html[data-style="cartoon"] .landing-step:nth-child(4) .landing-step__num {
  background: var(--pop-lime);
}

html[data-style="cartoon"] .landing-step:nth-child(5) .landing-step__num {
  background: var(--accent-2);
}

html[data-style="cartoon"] .landing-step:nth-child(6) .landing-step__num {
  background: var(--pop-pink);
}

html[data-style="cartoon"] .map-empty__step {
  color: var(--accent-ink);
}

html[data-style="cartoon"] .map-empty__step:nth-child(1) {
  background: var(--pop-yellow);
}

html[data-style="cartoon"] .map-empty__step:nth-child(2) {
  background: var(--pop-pink);
}

html[data-style="cartoon"] .map-empty__step:nth-child(3) {
  background: var(--pop-cyan);
}

@media (max-width: 1180px) {
  html[data-style="cartoon"] body[data-nav-section="home"] .landing-hero::after,
  html[data-style="cartoon"] body[data-nav-section="home"] .landing-points::before,
  html[data-style="cartoon"] body[data-nav-section="learning"]:not(.app--workspace) .page-head::after,
  html[data-style="cartoon"] body[data-nav-section="subscription"] .page::before {
    display: none;
  }
}

@media (max-width: 960px) {
  html[data-style="cartoon"] body[data-nav-section="home"] #solution .section-head::after,
  html[data-style="cartoon"] body[data-nav-section="subscription"] .page-head::after {
    display: none;
  }
}

/* ------------------------------------------------------------
   Мобильная раскладка
   ------------------------------------------------------------ */

@media (max-width: 960px) {
  html[data-style="cartoon"] .workspace {
    padding: 12px;
  }
}

@media (max-width: 760px) {
  html[data-style="cartoon"] .app--auth .auth-card::before {
    display: none;
  }
}

@media (max-width: 720px) {
  html[data-style="cartoon"] body,
  html[data-style="cartoon"][data-theme="light"] body {
    background-position:
      left -999px top -999px,
      left -999px top -999px,
      left -999px top -999px,
      0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
  }

  html[data-style="cartoon"] .topbar {
    border-bottom-width: 3px;
    box-shadow: 0 4px 0 var(--accent);
  }

  html[data-style="cartoon"] .main-column .ai-window {
    border-bottom-width: 0;
    border-radius: 22px 26px 0 0;
    box-shadow: none;
  }

  html[data-style="cartoon"] .composer {
    border-top-width: 0;
    border-radius: 0 0 22px 26px;
    box-shadow: 4px 4px 0 var(--ink);
  }

  html[data-style="cartoon"] .map-panel {
    border-radius: 20px 24px 20px 24px;
  }

  html[data-style="cartoon"] .plan--popular {
    transform: none;
  }

  html[data-style="cartoon"] .landing-hero {
    padding: 28px 20px;
  }

  html[data-style="cartoon"] .landing-hero::before {
    left: 20px;
    width: 88px;
    height: 23px;
  }

  html[data-style="cartoon"] .page-title::after {
    width: 76px;
    height: 8px;
  }

  html[data-style="cartoon"] .menu a.active {
    transform: none;
  }
}

/* ============================================================
   Проверка понимания, практика, цитаты, жалобы, интерактив
   ============================================================ */

.composer-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
  padding: 0 2px;
}

.composer-tools[hidden] {
  display: none;
}

.intent-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  background: rgba(var(--subtle-rgb), 0.03);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.intent-chip svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.intent-chip:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: var(--accent);
  background: var(--accent-softer);
}

.intent-chip:disabled {
  opacity: 0.45;
  cursor: default;
}

.source-ref {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  margin: 0 1px;
  padding: 1px 5px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 7px;
  color: var(--accent);
  background: var(--accent-softer);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  vertical-align: 1px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.source-ref:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.claim-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  padding: 1px 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 650;
  line-height: 1.45;
  vertical-align: 1px;
  white-space: nowrap;
}

.claim-badge--ok {
  border-color: rgba(74, 222, 128, 0.32);
  color: #4ade80;
  background: rgba(74, 222, 128, 0.09);
}

.claim-badge--warn {
  border-color: rgba(251, 191, 36, 0.38);
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
}

[data-theme="light"] .claim-badge--ok {
  color: #1a7f37;
}

[data-theme="light"] .claim-badge--warn {
  color: #9a6700;
}

.msg-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  padding-left: 2px;
}

.msg-report {
  padding: 3px 7px;
  border: 0;
  border-radius: 8px;
  color: var(--muted-2);
  background: transparent;
  font-size: 10px;
  line-height: 1.4;
  opacity: 0.68;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.msg-report:hover,
.msg-report:focus-visible {
  color: #ff8a8a;
  background: rgba(229, 72, 77, 0.1);
  opacity: 1;
}

.msg-report.is-sent {
  color: #4ade80;
  opacity: 1;
  cursor: default;
}

.msg--notice .msg-tools {
  display: none;
}

.sources-number {
  color: var(--muted-2);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.sources-table td {
  transition: background 0.25s ease;
}

.sources-row--target td {
  background: rgba(var(--accent-rgb), 0.12);
}

.sources-row--target .sources-number {
  color: var(--accent);
  font-weight: 700;
}

.drawing-node {
  cursor: pointer;
}

.drawing-node:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
  border-radius: 6px;
}

.drawing-node.is-active {
  filter: drop-shadow(0 0 6px rgba(37, 99, 235, 0.55));
}

.drawing-paper:has(.drawing-node) {
  cursor: default;
}

.drawing-explain {
  margin: 0;
  padding: 11px 14px 12px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
}

.drawing-explain[hidden] {
  display: none;
}

.drawing-explain__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.drawing-explain__title {
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 650;
}

.drawing-explain__close {
  padding: 0 2px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.drawing-explain__close:hover {
  color: var(--text);
}

.drawing-explain__text {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.55;
}

.media-lightbox .drawing-explain {
  border-top-color: rgba(255, 255, 255, 0.16);
  background: rgba(20, 26, 36, 0.92);
}

.media-lightbox .drawing-explain__title {
  color: #e8edf4;
}

.media-lightbox .drawing-explain__text {
  color: #cbd5e1;
}

.media-lightbox .drawing-explain__close {
  color: #94a3b8;
}

.report-modal {
  width: min(560px, calc(100vw - 24px));
}

.report-panel {
  margin: 0;
}

.report-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-intro {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.report-reasons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 6px;
}

.report-reason {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.35;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.report-reason:hover {
  border-color: var(--line-strong);
}

.report-reason:has(input:checked) {
  border-color: var(--accent);
  color: var(--text-strong);
  background: var(--accent-softer);
}

.report-reason input {
  accent-color: var(--accent);
  flex: none;
}

.report-comment-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.report-comment-label span {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 400;
}

.report-comment {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: var(--inset);
  font-size: 12.5px;
  line-height: 1.5;
  outline: none;
}

.report-comment:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.07);
}

.report-error {
  min-height: 14px;
  margin: 0;
  color: #ff6b6b;
  font-size: 11px;
  line-height: 1.4;
}

[data-theme="light"] .report-error {
  color: #c62828;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-row--new td {
  background: rgba(251, 191, 36, 0.055);
}

.admin-stack--tight {
  gap: 4px;
}

.admin-muted-text {
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.admin-report-block h3 {
  margin: 0 0 6px;
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 650;
}

.admin-report-block p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.admin-report-text {
  max-height: 300px;
  overflow: auto;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-soft);
  background: var(--inset);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-source-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.admin-source-item {
  display: grid;
  gap: 2px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--inset);
}

.admin-source-item--cited {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: var(--accent-softer);
}

.admin-source-item a {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.admin-source-item a:hover {
  color: var(--accent);
  text-decoration: underline;
}

html[data-style="cartoon"] .intent-chip,
html[data-style="cartoon"] .report-reason,
html[data-style="cartoon"] .source-ref {
  border-width: 2px;
}

html[data-style="cartoon"] .drawing-explain {
  border-top-width: 2px;
}

@media (max-width: 640px) {
  .composer-tools {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .intent-chip {
    flex: none;
  }

  .report-reasons {
    grid-template-columns: 1fr;
  }

  .sources-table td.sources-number {
    border-top: 0;
  }
}

/* Быстрый режим */

.quick-workspace {
  grid-template-columns: 300px minmax(0, 1fr);
}

.quick-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px;
}

.quick-history-toggle {
  display: none;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-soft);
  background: var(--panel-2);
  cursor: pointer;
}

.quick-history-toggle svg {
  width: 16px;
  height: 16px;
}

.quick-side-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-side-close {
  display: none;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-soft);
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.quick-side-backdrop {
  display: none;
}

.quick-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quick-list {
  flex: 1;
  min-height: 0;
  margin: 10px 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.quick-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.quick-item:hover {
  color: var(--text);
  background: var(--accent-softer);
}

.quick-item.active {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--accent-soft);
}

.quick-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10px;
}

.quick-list-empty {
  padding: 10px 4px;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.45;
}

.quick-side-foot {
  flex: 0 0 auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.45;
}

.quick-side-foot p {
  margin: 0 0 4px;
}

.quick-side-foot a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.quick-hero {
  max-width: 640px;
  margin: 0 auto;
  padding: 34px 18px 20px;
}

.quick-hero[hidden],
.quick-tools[hidden] {
  display: none;
}

.quick-hero h1 {
  margin: 8px 0 8px;
  font-size: clamp(24px, 3.4vw, 32px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.quick-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.quick-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.quick-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
}

.quick-tools .intent-chip[aria-pressed="true"] {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.5);
  background: var(--accent-soft);
}

.quick-tools .intent-chip:disabled {
  opacity: 0.5;
  cursor: default;
}

.quick-quiz {
  margin: 10px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  background: var(--panel-2);
}

.quick-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-color: rgba(var(--accent-rgb), 0.4);
}

.quick-confirm p {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.quick-confirm .btn {
  flex: 0 0 auto;
}

.quick-quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quick-quiz-status {
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
}

@media (max-width: 860px) {
  .quick-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
  }

  .quick-workspace .main-column {
    grid-row: 1;
  }

  .quick-history-toggle {
    display: inline-grid;
  }

  .quick-workspace .ai-avatar,
  .quick-workspace #quickQuotaChip,
  .quick-workspace #quickRefresh {
    display: none;
  }

  .quick-side {
    display: none;
  }

  body.quick-history-open .quick-side {
    display: flex;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, 320px);
    max-height: none;
    padding: 14px;
    z-index: 70;
    border-radius: 0 18px 18px 0;
    background: var(--panel);
    box-shadow: 18px 0 50px rgba(0, 0, 0, 0.45);
    overflow: hidden;
  }

  body.quick-history-open .quick-side .quick-list {
    flex: 1;
    min-height: 0;
    margin-top: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    gap: 3px;
  }

  body.quick-history-open .quick-side .quick-item {
    width: 100%;
    max-width: none;
    padding: 8px 10px;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  body.quick-history-open .quick-side .quick-item small {
    display: block;
  }

  body.quick-history-open .quick-side .quick-side-foot {
    display: block;
  }

  .quick-side-close {
    display: grid;
  }

  .quick-side-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 65;
    background: rgba(0, 0, 0, 0.55);
  }

  .quick-tools {
    flex-wrap: nowrap;
    gap: 6px;
    padding: 6px 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .quick-tools::-webkit-scrollbar {
    display: none;
  }

  .quick-tools .intent-chip {
    flex: 0 0 auto;
    padding: 5px 9px;
    font-size: 10px;
    white-space: nowrap;
  }

  .quick-hero {
    padding-top: 18px;
  }
}
