/* OntoTutor 5 — дашборд-стиль (светло-серая рамка, скруглённые карточки, лавандовый акцент).
   Без внешних шрифтов и библиотек. Расположение блоков не менялось. */
:root {
  font-family: "Plus Jakarta Sans", Manrope, Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #1d1b33;
  font-synthesis: none;
  --ink: #1d1b33;
  --ink-2: #3a3855;
  --muted: #8a8aa0;
  --page: #e8e8ee;
  --panel: #f5f5f8;
  --surface: #fff;
  --border: #ebebf2;

  /* лавандовая шкала */
  --p900: #2a2170;
  --p800: #3b3094;
  --p700: #4b3fb3;
  --p600: #5b50cc;
  --p500: #7468e0;
  --p400: #a097ef;
  --p300: #c6c0f8;
  --p200: #e1ddfc;
  --p100: #efedff;
  --p50:  #f8f7ff;

  --purple: var(--p600);
  --purple-dark: var(--p800);
  --purple-light: var(--p100);

  --grad-dark: linear-gradient(135deg, #2f2582 0%, #4b3fb3 52%, #7568e6 100%);
  --hatch: repeating-linear-gradient(135deg, rgb(91 80 204 / .30) 0 1.6px, transparent 1.6px 6px);
  --swirl: repeating-radial-gradient(circle at 88% 125%, transparent 0 10px, rgb(255 255 255 / .075) 10px 11px);
  --radius: 22px;
  --shadow: 0 1px 2px rgb(30 25 80 / 3%);
}
*{box-sizing:border-box}
html{background:var(--page)}
body{
  margin:0; min-width:320px; padding:16px;
  background:
    radial-gradient(1100px 520px at 12% -10%, #f6f5fb 0, transparent 70%),
    linear-gradient(180deg,#ececf2,#e3e3ea);
}
button,input,select,textarea{font:inherit}
button{cursor:pointer; transition:background .17s ease,box-shadow .17s ease,transform .17s ease,border-color .17s ease,color .17s ease}
button:disabled{cursor:not-allowed;opacity:.5}
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid var(--p300);outline-offset:2px}
button:active:not(:disabled){transform:translateY(1px)}

/* ───────── Внешняя «рамка» приложения ───────── */
.shell{
  display:grid; grid-template-columns:300px minmax(0,1fr); gap:14px;
  height:calc(100dvh - 32px); max-width:1850px; margin:0 auto; padding:14px;
  background:#fff; border-radius:34px;
  box-shadow:0 24px 60px rgb(40 36 90 / 9%), 0 2px 6px rgb(40 36 90 / 4%);
}

/* ───────── Сайдбар ───────── */
.sidebar{
  position:relative; height:100%; min-height:0; display:flex; flex-direction:column;
  background:var(--panel); border-radius:26px; min-width:0; z-index:2; overflow:hidden;
}
.brand{display:flex;gap:11px;align-items:center;padding:24px 24px 14px}
.brand-mark{
  width:40px;height:40px;flex:none;border-radius:50%;
  background:transparent; color:var(--p700);
  display:grid;place-items:center;font-size:44px;line-height:1;font-weight:400;box-shadow:none;
}
.brand strong{display:block;font-size:21px;letter-spacing:-.6px;font-weight:700;color:var(--ink)}
.brand span{display:block;margin-top:2px;font-size:11px;color:var(--muted)}
.sidebar-scroll{overflow-y:auto;min-height:0;padding:10px 20px 18px;scrollbar-width:thin;scrollbar-color:#d4d3e4 transparent;flex:1}
.sidebar-header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:22px 0 10px}
.eyebrow{font-size:11px;font-weight:600;letter-spacing:.9px;color:var(--muted)}
.lock-label{font-size:10px;font-weight:700;color:var(--p700);border-radius:100px;padding:5px 10px;background:var(--p100);white-space:nowrap}
.lock-label.locked{color:#8f6a2f;background:#fff1d9}
.sidebar h2{font-size:21px;letter-spacing:-.5px;margin:0 0 6px;font-weight:700}
.hint{font-size:12px;color:var(--muted);line-height:1.6;margin:0 0 18px}
.hint.small{font-size:11px;margin-top:9px;margin-bottom:16px}
.field-label{display:block;font-size:12px;font-weight:650;color:var(--ink-2);margin:0 0 8px}
select{color:var(--ink);background:#fff;border:1px solid var(--border);border-radius:14px}
.ontology-picker{border-bottom:1px solid #e9e9f1;padding-bottom:18px}
#ontologySelect{width:100%;height:44px;padding:8px 12px;font-size:12px}
.ontology-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:10px 0}
.upload-button{font-size:12px;font-weight:650;color:var(--p800);background:#fff;border:1.5px solid var(--p700);border-radius:100px;padding:8px 14px}
.upload-button:hover:not(:disabled){background:var(--p100)}
.upload-limit{font-size:11px;color:#a3a3b8;white-space:nowrap}
.ontology-info{color:var(--muted);font-size:11px;line-height:1.55;margin:6px 0 0}
.relation-settings{border-radius:16px;background:#fff;margin-top:14px;padding:12px 13px}
.relation-settings summary{font-size:12px;font-weight:650;color:var(--p700);cursor:pointer;line-height:1.5}
.relation-settings summary span{color:#ad7548}
.relation-settings .hint.small{margin:10px 0}
.relation-map{display:flex;flex-direction:column;gap:9px;max-height:215px;overflow-y:auto;padding:6px 0 10px}
.relation-entry{display:flex;flex-direction:column;gap:4px;font-size:11px;color:var(--ink-2);font-weight:600}
.relation-entry span{overflow-wrap:anywhere}
.relation-role{width:100%;padding:7px;font-size:11px}
.mapping-save{width:100%;padding:10px 8px;border:0;border-radius:100px;background:var(--p100);color:var(--p800);font-size:11px;font-weight:700}
.mapping-save:hover{background:var(--p200)}
.search-wrap{display:flex;align-items:center;gap:8px;background:#fff;border-radius:100px;padding:0 16px;min-height:44px;border:1px solid transparent}
.search-wrap:focus-within{border-color:var(--p400);box-shadow:0 0 0 3px rgb(116 104 224 / .14)}
.search-wrap span{color:#8d8da6;font-size:22px}
.search-wrap input{border:0;outline:0;background:transparent;width:100%;min-width:0;font-size:13px;color:var(--ink)}
.search-wrap input::placeholder{color:#aaaabd}
.topic-actions{display:flex;gap:10px;align-items:center;margin:13px 0 10px}
.topic-actions span{margin-left:auto;font-size:10px;color:var(--muted);white-space:nowrap}
.text-action{border:0;background:transparent;font-size:11px;color:var(--p700);font-weight:700;padding:2px 0}
.text-action:hover:not(:disabled){text-decoration:underline}
.topic-list{display:flex;flex-direction:column;gap:3px;max-height:min(29vh,310px);overflow-y:auto;padding-right:4px;scrollbar-width:thin;scrollbar-color:#d4d3e4 transparent}
.topic{position:relative;display:flex;align-items:center;gap:11px;padding:10px 12px 10px 14px;border-radius:14px;color:#6c6c86;cursor:pointer;font-size:12.5px;line-height:1.4}
.topic:hover{background:rgb(255 255 255 / .75)}
.topic:has(input:checked){background:#fff;color:var(--ink);font-weight:650}
.topic:has(input:checked)::before{content:"";position:absolute;left:0;top:22%;bottom:22%;width:3.5px;border-radius:4px;background:var(--p700)}
.topic input{margin:0;accent-color:var(--p700);width:16px;height:16px;flex:none}
.topic span{flex:1;min-width:0;overflow-wrap:anywhere}
.topic small{color:#a3a3b8;white-space:nowrap;font-size:10px}
.no-topics{color:#9b9fb0;font-size:12px;padding:10px}
.divider{height:1px;background:#e9e9f1;margin:19px 0}
.number-wrap{display:flex;align-items:center;justify-content:space-between;background:#fff;border-radius:16px;padding:0 16px;height:52px}
.number-wrap input{border:0;outline:0;background:transparent;width:70px;font-size:22px;font-weight:700;color:var(--ink)}
.number-wrap span{color:var(--muted);font-size:12px}
.primary-button{
  display:flex;align-items:center;justify-content:space-between;gap:15px;border:0;border-radius:100px;
  background:var(--grad-dark);color:#fff;padding:13px 20px;font-size:13px;font-weight:650;
  box-shadow:0 10px 22px rgb(75 63 179 / .28);
}
.primary-button:hover:not(:disabled){box-shadow:0 14px 28px rgb(75 63 179 / .4);filter:brightness(1.06)}
.primary-button.full{width:100%}

/* нижняя тёмная карточка сайдбара (как «Download our Mobile App») */
.sidebar-footer{
  position:relative; overflow:hidden; display:flex; align-items:flex-end; gap:9px; flex-wrap:wrap;
  min-height:92px; margin:0 14px 14px; padding:16px 18px;
  color:#e4e1ff; font-size:12px; border-radius:22px;
  background:var(--swirl), radial-gradient(circle at 18% 0%, rgb(160 151 239 / .35), transparent 55%), linear-gradient(145deg,#231a63,#3b3094 70%,#4b3fb3);
}
.status-dot{width:9px;height:9px;background:#b7aefc;border-radius:50%;box-shadow:0 0 0 4px rgb(183 174 252 / .22);flex:none;align-self:center}
.sidebar-footer #graphStats{color:#fff;font-weight:600}
.error{font-size:12px;color:#b73c51;line-height:1.5;margin:9px 0 0}
.error:empty{display:none}

/* ───────── Рабочая область ───────── */
.workspace{
  height:100%; min-height:0; overflow:hidden; display:flex; flex-direction:column; gap:10px;
  padding:16px clamp(16px,2vw,24px) 14px; min-width:0;
  background:var(--panel); border-radius:26px;
}
.topbar{display:flex;justify-content:space-between;align-items:flex-start;gap:25px;flex:none}
.top-title{min-width:0;flex:1}
.top-title .eyebrow{display:block;font-size:11px;letter-spacing:.6px;color:var(--muted);font-weight:500}
.top-title h1{font-size:clamp(15px,1.3vw,20px);line-height:1.25;letter-spacing:-.4px;color:var(--ink);margin:2px 0 0;max-width:none;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top-title p{margin:0;color:var(--muted);font-size:13px}
.top-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;padding-top:0}
.top-tool{
  display:inline-flex;align-items:center;justify-content:center;border:1.5px solid var(--p800);border-radius:100px;
  background:transparent;color:var(--p900);padding:8px 18px;font-size:12.5px;font-weight:600;white-space:nowrap;
}
.top-tool:hover{background:#fff}
#helpButton{background:var(--grad-dark);border-color:transparent;color:#fff;box-shadow:0 8px 18px rgb(75 63 179 / .25)}
#helpButton:hover{filter:brightness(1.08);background:var(--grad-dark)}
.session-badge{background:#fff;color:var(--muted);border-radius:100px;font-size:12px;font-weight:650;padding:9px 14px;white-space:nowrap}
.session-badge.active{background:var(--p100);color:var(--p800)}
.live-status{
  display:flex;align-items:center;flex-wrap:wrap;gap:7px 22px;flex:none;background:#fff;border-radius:100px;
  padding:7px 18px;box-shadow:var(--shadow);font-size:12px;color:var(--muted);
}
.live-status b{color:var(--ink-2);font-weight:650}
.live-status-action{margin-left:auto;color:var(--p700);font-weight:650}

/* карточки обзора: тёмная лавандовая + белая */
.overview{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(245px,.92fr);gap:10px;flex:none}
.current-card,.progress-card{min-width:0;background:#fff;border-radius:var(--radius);padding:12px 20px;box-shadow:var(--shadow);min-height:0;position:relative}
.current-card{
  overflow:hidden; color:#fff; padding-right:200px;
  background:radial-gradient(120% 120% at 92% 0%, rgb(167 157 245 / .55) 0, transparent 55%), linear-gradient(135deg,#2c2280 0%,#4b3fb3 55%,#6c5fe0 100%);
}
.current-card::after{content:"";position:absolute;inset:0;background:var(--swirl);pointer-events:none}
.current-card > *{position:relative;z-index:1}
.section-caption{display:flex;align-items:center;gap:8px;color:var(--ink-2);font-size:13px;font-weight:600;letter-spacing:0}
.current-card .section-caption{color:#fff}
.card-icon{font-size:17px;color:var(--p300)}
.right-soft{margin-left:auto;color:#b4b4c8}
.current-card .right-soft{color:#1f1760;background:#fff;border-radius:100px;padding:3px 11px;font-size:11px;font-weight:700;min-width:32px;text-align:center}
.current-card h2{font-size:19px;font-weight:650;letter-spacing:-.4px;line-height:1.25;margin:4px 0 1px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.current-card p{font-size:11.5px;color:#d9d5ff;margin:0;line-height:1.4;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lesson-path{display:flex;align-items:center;flex-wrap:nowrap;gap:6px;margin-top:7px;overflow:hidden}
.path-chip{font-size:10.5px;flex:none;color:#fff;background:rgb(255 255 255 / .17);border:1px solid rgb(255 255 255 / .2);border-radius:100px;padding:4px 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:40%}
.path-chip.next-chip{background:transparent;color:#d9d5ff;border-color:rgb(255 255 255 / .3);max-width:52%}
.graph-launch{
  display:inline-flex;align-items:center;gap:10px;border:0;border-radius:100px;background:#fff;color:var(--p900);
  font-weight:650;font-size:12px;position:absolute;right:16px;bottom:14px;margin:0;padding:5px 5px 5px 14px;z-index:2;
}
.graph-launch::after{content:"↗";display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--p800);color:#fff;font-size:13px}
.graph-launch:hover{background:var(--p100)}
.progress-row{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin:6px 0 8px}
.progress-row strong{font-size:30px;line-height:1;font-weight:600;letter-spacing:-1.5px;color:var(--ink)}
.progress-row span{font-size:12px;color:var(--muted)}
/* полоса прогресса: штрихованный «остаток» + плотная заливка */
.progress-track{width:100%;height:12px;border-radius:100px;background:var(--p50);background-image:var(--hatch);overflow:hidden}
.progress-fill{height:100%;border-radius:100px;background:linear-gradient(90deg,#6c5fe0,#3b3094);width:0%;transition:width .3s}
.progress-card p{font-size:11.5px;color:var(--muted);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin:6px 0}
.footer-buttons{display:flex;align-items:center;gap:9px;justify-content:space-between}
.secondary-button{border:1.5px solid var(--p800);border-radius:100px;background:transparent;color:var(--p900);font-size:12px;font-weight:650;padding:4px 14px}
.secondary-button:hover:not(:disabled){background:var(--p100)}
.danger-link{border:0;background:transparent;color:#b0606c;font-size:11px;font-weight:650;padding:4px 0}

/* ───────── Чат ───────── */
.chat-panel{display:flex;flex-direction:column;min-height:0;flex:1 1 0;background:#fff;border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow)}
.chat-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding:10px 20px;border-bottom:1px solid #f0f0f6}
.chat-title{display:flex;align-items:center;gap:12px}
.chat-symbol{width:34px;height:34px;border-radius:50%;background:var(--p100);color:var(--p700);display:grid;place-items:center;font-size:21px}
.chat-title strong{display:block;font-size:15px;font-weight:650;color:var(--ink)}
.chat-title small{display:block;margin-top:2px;color:var(--muted);font-size:11px}
.chat-mode{font-size:11px;font-weight:600;color:var(--p800);background:var(--p100);border-radius:100px;padding:8px 14px;white-space:nowrap}
.messages{display:flex;flex-direction:column;gap:19px;padding:20px 26px;overflow-y:auto;min-height:0;flex:1 1 0;scrollbar-color:#dcdbea transparent;scrollbar-width:thin}
.empty-state{text-align:center;max-width:350px;color:var(--muted);margin:auto}
.empty-icon{width:92px;height:92px;margin:0 auto 8px;border-radius:50%;display:grid;place-items:center;font-size:38px;color:var(--p700);background:var(--hatch),var(--p50);border:1px solid var(--p200)}
.empty-state h3{font-size:20px;font-weight:650;color:var(--ink);margin:8px 0 5px}
.empty-state p{font-size:13px;line-height:1.55}
.chat-message{display:flex;flex-direction:column;gap:7px;max-width:min(86%,770px)}
.chat-message.me{align-self:flex-end}
.chat-message.bot{align-self:flex-start}
.message-caption{color:#9a9ab0;font-size:11px;font-weight:650}
.chat-message.me .message-caption{text-align:right}
.message-bubble{white-space:pre-line;overflow-wrap:anywhere;background:var(--panel);color:#35334f;font-size:14px;line-height:1.65;border-radius:20px 20px 20px 6px;padding:14px 18px}
.chat-message.me .message-bubble{background:var(--grad-dark);color:#fff;border-radius:20px 20px 6px 20px}
.chat-message.notice .message-bubble{background:#fff4e0;color:#80592f}
.graph-answer-link{align-self:flex-start;padding:7px 14px;border:1.5px solid var(--p700);background:#fff;border-radius:100px;color:var(--p800);font-size:11px;font-weight:650}
.graph-answer-link:hover{background:var(--p100)}
.composer-zone{flex:none;background:#fff;border-top:1px solid #f0f0f6;padding:12px 18px 13px}
.suggestions{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.suggestions:empty{display:none}
.suggestion{background:var(--p100);border:0;color:var(--p800);border-radius:100px;font-size:11.5px;font-weight:600;padding:7px 13px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.suggestion:hover{background:var(--p200)}
.composer{display:flex;align-items:center;gap:8px;background:var(--panel);border:1px solid transparent;border-radius:26px;padding:6px 6px 6px 10px;transition:border-color .2s,background .2s}
.composer:focus-within{border-color:var(--p400);background:#fff;box-shadow:0 0 0 3px rgb(116 104 224 / .13)}
.composer textarea{min-height:40px;max-height:120px;flex:1;border:0;outline:0;resize:vertical;background:transparent;color:var(--ink);font-size:13px;line-height:1.5;padding:10px 12px;min-width:0}
.composer textarea::placeholder{color:#a5a5ba}
.composer button{flex:none;border:0;border-radius:50%;background:var(--grad-dark);color:#fff;width:44px;height:44px;font-size:18px;box-shadow:0 6px 14px rgb(75 63 179 / .3)}
.composer button:hover:not(:disabled){filter:brightness(1.1)}
.compose-footer{display:flex;gap:12px;justify-content:space-between;flex-wrap:wrap;margin:8px 4px 0;color:#a5a5ba;font-size:10px}

/* ───────── Модальные окна ───────── */
.modal{color:var(--ink);background:#fff;border:0;border-radius:30px;padding:26px;box-shadow:0 30px 90px rgb(25 20 70 / .35);max-width:calc(100vw - 28px);max-height:calc(100dvh - 32px);overflow-y:auto;width:min(690px,calc(100vw - 28px))}
.modal::backdrop{background:rgb(28 24 66 / .6);backdrop-filter:blur(5px)}
.modal-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;border-bottom:1px solid #f0f0f6;padding-bottom:17px}
.modal-head h2{font-size:24px;font-weight:650;letter-spacing:-.7px;margin:7px 0 8px;line-height:1.25;overflow-wrap:anywhere}
.modal-head p{font-size:13px;line-height:1.5;color:var(--muted);margin:0}
.modal-close{flex:none;border:0;background:var(--panel);width:38px;height:38px;border-radius:50%;font-size:24px;line-height:1;color:var(--ink-2)}
.modal-close:hover{background:var(--p100);color:var(--p800)}
.graph-modal{width:min(1360px,calc(100vw - 28px));padding:22px 24px}
.graph-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:12px 0;font-size:12px;color:var(--muted)}
.graph-toolbar label{font-weight:650;color:var(--ink-2)}
.graph-toolbar select{padding:8px 10px;font-size:12px;margin-left:7px;border-radius:100px}
.graph-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:14px;align-items:stretch}
.graph-canvas{height:min(70vh,660px);min-height:300px;min-width:0;overflow:hidden;display:flex;align-items:center;justify-content:center;border-radius:22px;background-color:var(--panel);background-image:radial-gradient(#d9d8ea 1.1px, transparent 1.1px);background-size:19px 19px}
#graphSvg{display:block;width:100%;height:100%;flex:none;cursor:grab;touch-action:none;user-select:none}
#graphSvg.panning{cursor:grabbing}
.graph-zoom{display:inline-flex;gap:4px}
.graph-zoom button{width:32px;height:32px;border:0;border-radius:50%;background:var(--panel);color:var(--p800);font-size:17px;line-height:1;font-weight:700}
.graph-zoom button:hover{background:var(--p100)}
.graph-edge{fill:none;stroke-width:2.2;stroke-linecap:round;opacity:.85;transition:opacity .15s ease,stroke-width .15s ease}
.graph-edge.active,.graph-edge.related{stroke-width:3;opacity:1}
.graph-edge-label{pointer-events:none;transition:opacity .15s ease}
.graph-edge-label rect{fill:#fff;stroke-width:1.2;opacity:.96}
.graph-edge-label text{text-anchor:middle;font-size:12.5px;font-weight:700;letter-spacing:.1px}
.graph-node{cursor:pointer;outline:0;transition:opacity .15s ease}
.graph-node ellipse{fill:#fff;stroke:var(--p400);stroke-width:2;filter:drop-shadow(0 4px 8px rgb(39 30 100 / .13));transition:fill .15s,stroke .15s,stroke-width .15s}
.graph-node.outer ellipse{fill:var(--p50);stroke:var(--p300)}
.graph-node.center ellipse{fill:url(#graph-center-fill);stroke:var(--p900);stroke-width:2.5;filter:drop-shadow(0 8px 16px rgb(59 48 148 / .35))}
.graph-node.active ellipse,.graph-node:focus ellipse,.graph-node:hover ellipse{stroke:#ed9b5f;stroke-width:3.4;filter:drop-shadow(0 6px 12px rgb(54 48 135 / .25))}
.graph-node.related:not(.active) ellipse{stroke:var(--p600);stroke-width:2.8}
.graph-node text{font-size:14px;font-weight:700;text-anchor:middle;fill:#2f2d4d;pointer-events:none}
.graph-node.center text{fill:#fff;font-size:15px}
/* При наведении приглушаем всё, кроме связей выбранного овала */
#graphSvg.hovering .graph-edge:not(.related){opacity:.1}
#graphSvg.hovering .graph-edge-label:not(.related){opacity:.08}
#graphSvg.hovering .graph-node:not(.related){opacity:.35}
#graphLegend{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center}
.legend-item{display:inline-flex;align-items:center;gap:6px;font-weight:650;color:var(--ink-2)}
.legend-item i,.detail-rels i{display:inline-block;width:18px;height:4px;border-radius:4px;flex:none}
.graph-detail{border-radius:22px;background:var(--p50);padding:20px 20px;color:#45506c;overflow-y:auto;max-height:min(70vh,660px);min-height:0}
.detail-kicker{font-size:11px;letter-spacing:.9px;color:var(--p700);font-weight:700}
.graph-detail h3{font-size:19px;letter-spacing:-.4px;color:var(--ink);margin:13px 0 10px;line-height:1.4;overflow-wrap:anywhere}
.graph-detail p{font-size:13.5px;line-height:1.7;margin:0;color:#55536f;white-space:pre-wrap;overflow-wrap:anywhere}
.detail-rel-title{margin:18px 0 8px;font-size:11px;letter-spacing:.9px;font-weight:700;color:var(--p700);text-transform:uppercase}
.detail-rels{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.detail-rels li{display:flex;align-items:center;gap:8px;background:#fff;border-radius:12px;padding:8px 11px;font-size:12px;line-height:1.35}
.detail-rels b{font-weight:700;color:var(--ink-2);flex:none}
.detail-rels span{color:#6a6985;overflow-wrap:anywhere;min-width:0}
.graph-recenter{margin-top:16px;width:100%;background:#fff;color:var(--p800);border:1.5px solid var(--p700);border-radius:100px;padding:10px 16px;font-size:12px;font-weight:650;text-align:left}
.graph-recenter:hover{background:var(--p100)}
.help-steps{padding-left:24px;display:grid;gap:13px;margin:18px 0;font-size:14px;line-height:1.6;color:#454363}
.help-steps li::marker{color:var(--p700);font-weight:800}
.help-note{background:var(--panel);color:#6a6985;padding:14px 16px;border-radius:18px;font-size:12px;line-height:1.6}
.quality-content{display:grid;gap:10px;margin:18px 0}
.quality-item{background:var(--panel);border-radius:18px;padding:13px 16px;line-height:1.55;font-size:13px}
.quality-item strong{display:block;font-size:12px;color:var(--ink-2);margin-bottom:3px}
.quality-item span{color:#737390;white-space:pre-line;overflow-wrap:anywhere}
.quality-item.warning{background:#fff4e0}

/* ───────── Адаптивность ───────── */
@media(max-width:1210px){
  .shell{grid-template-columns:272px minmax(0,1fr)}
  .sidebar-scroll{padding:8px 16px 16px}
  .workspace{padding:20px 18px 16px;gap:12px}
  .topbar{flex-wrap:wrap;gap:10px}
  .top-actions{justify-content:flex-start;padding:0}
  .overview{grid-template-columns:minmax(0,1.3fr) minmax(220px,.9fr)}
  .current-card,.progress-card{padding:16px 18px}
  .graph-layout{grid-template-columns:minmax(0,1.4fr) minmax(230px,.85fr)}
}
@media(max-width:900px){
  .overview{grid-template-columns:1fr;gap:9px}
  .current-card,.progress-card{min-height:0;padding:13px 16px}
  .current-card h2{font-size:19px;margin:7px 0 3px}
  .current-card p{display:none}
  .lesson-path{display:none}
  .current-card{padding-right:16px}
  .graph-launch{position:static;margin-top:7px}
  .progress-row{margin:7px 0 8px}
  .progress-row strong{font-size:30px}
  .progress-card p{margin:6px 0}
  .live-status{border-radius:20px}
  .live-status-action{margin-left:0}
  .graph-layout{grid-template-columns:1fr}
  .graph-canvas{height:340px}
  .graph-detail{max-height:220px;padding:13px}
}
@media(max-width:700px){
  body{padding:8px}
  .shell{display:block;height:auto;padding:8px;border-radius:26px}
  .sidebar{position:static;height:auto;min-height:0;max-height:none;margin-bottom:8px;overflow:visible}
  .brand{padding:16px 18px 6px}
  .sidebar-scroll{padding:10px 16px}
  .sidebar-footer{min-height:0;margin:0 12px 12px}
  .topic-list{max-height:190px}
  .workspace{height:auto;min-height:0;overflow:visible;padding:18px 12px 20px;gap:12px}
  .top-title h1{font-size:21px}
  .chat-panel{height:68vh;min-height:490px;flex:none}
  .chat-message{max-width:96%}
  .messages{padding:15px}
  .message-bubble{font-size:13px}
  .chat-header{padding:12px}
  .chat-mode{font-size:10px}
  .live-status{font-size:11px}
  .modal,.graph-modal{padding:16px}
  .modal-head h2{font-size:19px}
  .graph-toolbar{font-size:11px}
  .graph-canvas{height:320px;min-height:260px}
  .graph-detail{max-height:240px}
}
@media(max-height:760px) and (min-width:701px){
  body{padding:8px}
  .shell{height:calc(100dvh - 16px);padding:10px;gap:10px}
  .workspace{padding-top:14px;padding-bottom:12px;gap:8px}
  .top-title h1{font-size:20px;margin:3px 0}
  .topbar .eyebrow{font-size:10px}
  .current-card,.progress-card{padding:11px 16px;min-height:0}
  .current-card h2{font-size:18px;margin:5px 0 2px}
  .lesson-path,.current-card p{display:none}
  .graph-launch{bottom:8px}
  .progress-row{margin:5px 0 7px}
  .progress-row strong{font-size:28px}
  .progress-card p{margin:5px 0}
  .chat-header{padding:9px 16px}
  .composer-zone{padding:8px 14px}
  .sidebar-footer{min-height:64px;padding:12px 16px}
  .modal{max-height:calc(100dvh - 20px)}
  .graph-canvas{height:min(60vh,420px)}
  .graph-detail{max-height:min(60vh,420px)}
}
