/* Все цвета и толщины линий карты — здесь (не внутри SVG-объектов). */
:root {
  --bg: #f6f6f4;
  --panel: #ffffff;
  --text: #1d1d1b;
  --muted: #6b6b66;
  --line: #dddcd6;
  --accent: #1b65a6;
  --ok: #1e8a4c;
  --acc: #b7791f;
  --bad: #c53030;
  --site: #111;
  --frontage: #d7263d;
  --entrance: #d7263d;
  --vehicle: #1b65a6;
  --parking: #1b65a6;
  --service: #7a4fa3;
  --cafe: #e07b00;
  --key-correct: #1e8a4c;
  --key-accept: #b7791f;
  --key-forbid: #c53030;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.4 system-ui, "Segoe UI", Arial, sans-serif; display: flex; flex-direction: column; }

header { display: flex; align-items: center; gap: 16px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
header h1 { font-size: 17px; margin: 0; }
header nav a { color: var(--accent); text-decoration: none; margin-inline-end: 12px; }
header nav a.current { color: var(--text); font-weight: 600; }
.spacer { flex: 1; }
.lang-btn { border: 1px solid var(--line); background: #fff; padding: 3px 8px; cursor: pointer; border-radius: 4px; margin-inline-start: 4px; }
.lang-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

main { flex: 1; display: flex; min-height: 0; }
aside { width: 380px; flex: none; overflow-y: auto; background: var(--panel); border-inline-end: 1px solid var(--line); padding: 12px 14px 40px; }
#mapwrap { flex: 1; position: relative; min-width: 0; }
#map { width: 100%; height: 100%; display: block; background: #fbfbf9; cursor: grab; user-select: none; touch-action: none; }
#map.panning { cursor: grabbing; }
#map.drawing { cursor: crosshair; }

h2 { font-size: 15px; margin: 18px 0 8px; }
h3 { font-size: 14px; margin: 0; }
.muted { color: var(--muted); font-size: 12.5px; }
button.btn { border: 1px solid var(--line); background: #fff; border-radius: 5px; padding: 5px 10px; cursor: pointer; font: inherit; }
button.btn:hover { border-color: var(--accent); }
button.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.btn:disabled { opacity: .45; cursor: default; }
.row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
input[type=text], input[type=number], textarea { font: inherit; border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; }
input[type=number] { width: 80px; }
textarea { width: 100%; min-height: 34px; resize: vertical; }

.file-btn { display: block; border: 1px dashed var(--line); border-radius: 6px; padding: 7px 10px; margin: 6px 0; cursor: pointer; }
.file-btn:hover { border-color: var(--accent); }
.file-btn input { display: none; }
.file-status { display: block; color: var(--muted); }
.file-status.ok { color: var(--ok); }

/* вопросы */
.q { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 10px 0; }
.q.active { border-color: var(--accent); box-shadow: 0 0 0 2px #1b65a622; }
.q-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.badge { font-size: 12px; padding: 1px 7px; border-radius: 10px; background: #eee; white-space: nowrap; }
.badge.correct { background: #dff3e6; color: var(--ok); }
.badge.acceptable { background: #fbefd9; color: var(--acc); }
.badge.revise { background: #fde2e2; color: var(--bad); }
.badge.no_key { background: #eee; color: var(--muted); }
.feedback { margin-top: 8px; padding: 8px 10px; border-radius: 5px; font-size: 15.5px; line-height: 1.5; }
.feedback.correct { background: #eef9f2; }
.feedback.acceptable { background: #fdf6ea; }
.feedback.revise { background: #fdf0f0; }
.feedback.no_key { background: #f2f2f2; }
.feedback .metrics { margin-top: 4px; font-size: 13px; color: var(--muted); direction: ltr; text-align: start; unicode-bidi: plaintext; }
.feedback .note { margin-top: 6px; font-size: 14.5px; line-height: 1.5; }
.q.inactive { opacity: .5; }
.variants { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0; font-size: 13px; }
.variants label { cursor: pointer; }
#relations .rel { padding: 7px 10px; border-radius: 5px; margin: 5px 0; font-size: 15px; line-height: 1.5; }
.rel.ok { background: #eef9f2; }
.rel.revise { background: #fdf0f0; }
.rel.info { background: #eef4fb; }

/* панель слоёв */
#layers { position: absolute; top: 10px; inset-inline-end: 10px; background: #fffffff0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; max-height: calc(100% - 20px); overflow-y: auto; }
#layers summary { cursor: pointer; font-weight: 600; }
/* страница студента (2026-10-15): карта вдвое уже — по медиде, колонка с текстом шире; на карте только кав биньян и граница участка */
body.student-page aside { width: 50%; }
/* основная карта студента — только медида (с отметками высот), граница участка и кав биньян; слои OSM не показываем
   (Катерина, 2026-10-15: «только медиду, её достаточно»); окружение — на схеме в окне «Участок и окружение» */
body.student-page #map .layer-roads, body.student-page #map .layer-buildings, body.student-page #map .layer-pedestrian,
body.student-page #map .layer-green, body.student-page #map .layer-bus_stops, body.student-page #map .layer-public_functions,
body.student-page #map .layer-commerce, body.student-page #map .layer-trees { display: none; }
body.student-page .f-building_line { stroke: var(--bad); stroke-width: 3; stroke-dasharray: 9 5; }
body.student-page .f-site { stroke: #1b65a6; stroke-width: 2.4; }
#layers .lg-row { display: flex; align-items: center; gap: 8px; padding: 1px 0; }
#layers .lg-row svg { flex: none; }
#layers label { display: flex; align-items: center; gap: 6px; padding: 1px 0; cursor: pointer; }
.swatch { width: 14px; height: 10px; border-radius: 2px; display: inline-block; border: 1px solid #0002; }
.sw-site { background: #fff; border: 2px solid var(--site); }
.sw-medida { background: #c9b28a; }
.sw-building_line { background: #fff; border: 2px dashed #1b65a6; }
.sw-levels { background: #6b4f1d; border-radius: 50%; }
.sw-buildings { background: #cfcfcf; }
.sw-roads { background: #e0a39b; }
.sw-pedestrian { background: #8fc68f; }
.sw-green { background: #cfe8c4; }
.sw-bus_stops { background: #3b6fd8; border-radius: 50%; }
.sw-public_functions { background: #c38ad6; }
.sw-commerce { background: #f2b649; }
.sw-trees { background: #2f7d32; border-radius: 50%; }
.sw-analysis { background: var(--frontage); }
#drawbar { position: absolute; top: 10px; inset-inline-start: 12px; max-width: min(520px, calc(100% - 260px)); background: #222e; color: #fff; padding: 6px 10px; border-radius: 8px; display: none; gap: 10px; align-items: center; font-size: 12.5px; pointer-events: auto; }
#drawbar.on { display: flex; }
#tz-msg { width: 100%; margin-top: 2px; }
#tz-msg.soft { color: var(--muted, #666); }
.tz-gate { margin: 10px 0; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; color: #555; }
/* выбор сторон фасада — подсказка заметнее, внизу карты (сверху — окно результата) */
#drawbar.pick { top: auto; bottom: 12px; inset-inline-start: auto; left: 50%; right: auto; transform: translateX(-50%); width: min(640px, calc(100% - 24px)); max-width: none; box-sizing: border-box; justify-content: space-between; background: #1b65a6; font-size: 13.5px; line-height: 1.35; padding: 8px 12px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
#drawbar.pick #draw-cancel { display: none; }
#drawbar button { background: #fff; color: #222; border: 0; border-radius: 4px; padding: 3px 10px; cursor: pointer; }
#coords { position: absolute; bottom: 6px; inset-inline-start: 8px; font-size: 11px; color: var(--muted); background: #fffc; padding: 1px 5px; border-radius: 3px; direction: ltr; }

/* карта: базовые слои (толщина — в экранных пикселях) */
#map path, #map polyline, #map circle { vector-effect: non-scaling-stroke; }
.f-buildings { fill: #dcdcdc; stroke: #b9b9b9; stroke-width: .6; }
.f-roads { fill: none; stroke: #e0a39b; stroke-width: 2.2; stroke-linecap: round; }
.f-pedestrian { fill: #d9ecd9; stroke: #6fb06f; stroke-width: 1.2; stroke-dasharray: 3 3; }
.f-green { fill: #d7ecce; stroke: #b6d8a8; stroke-width: .6; }
.f-bus_stops { fill: #3b6fd8; stroke: #fff; stroke-width: 1; }
.f-public_functions { fill: #c38ad6aa; stroke: #9a55b3; stroke-width: 1; }
.f-commerce { fill: #f2b649aa; stroke: #c78a12; stroke-width: 1; }
.f-trees { fill: #2f7d32; stroke: #fff; stroke-width: .5; }
.f-medida { fill: none; stroke: #9c7b45; stroke-width: .7; }
.f-building_line { fill: none; stroke: #1b65a6; stroke-width: 1.2; stroke-dasharray: 8 4; }
.f-levels { fill: #6b4f1d; stroke: none; }
.f-level-label { fill: #6b4f1d; paint-order: stroke; stroke: #fff; }
.f-site { fill: #ffffff55; stroke: var(--site); stroke-width: 2.2; }
.f-edge-label { fill: var(--site); font-weight: 600; paint-order: stroke; stroke: #fff; text-anchor: middle; dominant-baseline: central; }

/* ответы студента */
.a-frontage { fill: none; stroke: var(--frontage); stroke-width: 7; stroke-linecap: round; opacity: .85; }
.a-entrance { fill: var(--entrance); stroke: #fff; stroke-width: 2; }
.a-vehicle { fill: #1b65a622; stroke: var(--vehicle); stroke-width: 2; stroke-dasharray: 8 4; }
.a-vehicle-axis { fill: none; stroke: var(--vehicle); stroke-width: 1.5; }
.a-parking { fill: #1b65a633; stroke: var(--parking); stroke-width: 2; }
.a-service { fill: #7a4fa333; stroke: var(--service); stroke-width: 2; stroke-dasharray: 6 3; }
.a-ramp { fill: #55555555; stroke: #333; stroke-width: 1.5; }
.a-ramp-axis { fill: none; stroke: #333; stroke-width: 1; stroke-dasharray: 4 3; }
.a-storage { fill: #7a4fa3; stroke: #fff; stroke-width: 2; }
.a-walkway { fill: #ffffffaa; stroke: #222; stroke-width: 1.4; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.a-entrance2 { fill: #fff !important; }
.a-rooms { fill: none; stroke: #6a4c93; stroke-width: 5; stroke-dasharray: 3 4; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.a-path { fill: none; stroke: #7a4fa3; stroke-width: 3; stroke-dasharray: 2 4; stroke-linecap: round; }
.a-plaza { fill: #c2185b22; stroke: var(--entrance); stroke-width: 2; stroke-dasharray: 5 3; }
.a-cafe { fill: #e07b0033; stroke: var(--cafe); stroke-width: 2; }
.a-label { fill: var(--text); font-weight: 600; paint-order: stroke; stroke: #fff; }

/* рисование */
.temp-line { fill: none; stroke: #ff6a00; stroke-width: 2; stroke-dasharray: 5 3; }
.temp-fill { fill: #ff6a0022; stroke: none; }
.temp-vertex { fill: #ff6a00; stroke: #fff; stroke-width: 1; }
.temp-vertex.first { fill: #fff; stroke: #ff6a00; stroke-width: 2; }
.temp-cursor { fill: none; stroke: #ff6a00; stroke-width: 1.5; }
.edge-hover { fill: none; stroke: #ff6a00; stroke-width: 9; stroke-linecap: round; opacity: .7; }

/* эталон (только у преподавателя) */
.k-correct { fill: #1e8a4c33; stroke: var(--key-correct); stroke-width: 2; }
.k-acceptable { fill: #b7791f2a; stroke: var(--key-accept); stroke-width: 2; stroke-dasharray: 6 3; }
.k-forbidden { fill: #c5303033; stroke: var(--key-forbid); stroke-width: 2; }
.k-best { fill: #1e8a4c; stroke: #fff; stroke-width: 2; }
.k-best-zone { fill: #1e8a4c33; stroke: var(--key-correct); stroke-width: 1.5; stroke-dasharray: 4 3; }
.k-edge-correct { fill: none; stroke: var(--key-correct); stroke-width: 8; stroke-linecap: round; opacity: .8; }
.k-edge-acceptable { fill: none; stroke: var(--key-accept); stroke-width: 8; stroke-linecap: round; opacity: .7; stroke-dasharray: 8 6; }

/* рампа: высота этажа, подсказки, окно расчёта */
.ramp-extras { margin: 6px 0; font-size: 13px; }
.ramp-extras input { width: 80px; }
.input-error { color: var(--bad); font-size: 12.5px; margin-top: 3px; }
.ramp-extras .hint { background: #fff8e1; border-radius: 5px; padding: 4px 8px; margin-top: 5px; }
/* панель расчёта — сбоку, карта остаётся доступной (с неё читают высоты) */
#modal { display: none; position: absolute; top: 10px; inset-inline-end: 10px; width: min(440px, calc(100% - 20px)); max-height: calc(100% - 20px); overflow: auto; z-index: 20; }
#modal.on { display: block; }
/* результат проверки — всплывает над картой (замечание № 3) */
#result-pop { display: none; position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: min(460px, calc(100% - 28px));
  z-index: 25; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; box-shadow: 0 6px 24px #0003; }
#result-pop.on { display: block; }
#result-pop .pop-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
#result-pop.correct .pop-title { color: var(--ok); }
#result-pop.acceptable .pop-title { color: #b7791f; }
#result-pop.revise .pop-title, #result-pop.no_key .pop-title { color: var(--bad); }
#result-pop .feedback { margin: 0; }
#result-pop .pop-q { color: #666; font-size: 12.5px; margin-bottom: 2px; }
#result-pop .row { margin-top: 10px; justify-content: flex-end; }
/* окно «Участок и окружение» */
#intro-ov { position: fixed; inset: 0; z-index: 50; background: #0006; display: flex; align-items: center; justify-content: center; padding: 16px; }
#intro-ov .intro-box { background: #fff; border-radius: 12px; width: min(1200px, 100%); height: min(760px, 100%); display: flex; overflow: hidden; }
#intro-ov .intro-side { width: 360px; flex: none; overflow-y: auto; padding: 14px 16px; border-inline-end: 1px solid var(--line); }
#intro-ov .intro-side h2 { margin: 0 0 4px; font-size: 18px; }
#intro-ov .intro-mapwrap { flex: 1; position: relative; min-width: 0; }
#intro-ov .intro-map { width: 100%; height: 100%; display: block; background: #fbfbf8; }
#intro-ov .intro-north { position: absolute; top: 12px; inset-inline-end: 14px; }
#intro-ov .intro-step { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 10px 0; }
#intro-ov .intro-step.on { border-color: var(--accent); box-shadow: 0 0 0 2px #1b65a622; }
#intro-ov .intro-types { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
#intro-ov .intro-type.sel { outline: 2px solid var(--accent); }
#intro-ov .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 5px; vertical-align: -1px; }
#intro-ov .intro-list { font-size: 12.5px; color: #555; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
#intro-ov .intro-chip { display: inline-flex; align-items: center; gap: 4px; background: #f3f2ee; border-radius: 6px; padding: 1px 2px 1px 6px; }
#intro-ov .intro-chip .btn { padding: 0 6px; }
#intro-ov .intro-end { margin-top: 12px; }
#intro-ov .f-buildings { fill: #e4e3df; stroke: #cfcdc6; }
#intro-ov .f-roads { stroke: #c9c6bd; stroke-width: 5; }
#intro-ov .f-green { fill: #d9ead0; stroke: none; }
.intro-site { fill: none; stroke: #1b65a6; stroke-width: 2.4; }
.intro-kb { fill: none; stroke: #c53030; stroke-width: 2; stroke-dasharray: 7 4; }
.intro-promenade { fill: none; stroke: #0e8fa8; stroke-width: 11; stroke-linecap: round; opacity: .55; vector-effect: non-scaling-stroke; }
.intro-promenade-label { fill: #0a6a7d; font-weight: 700; text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.intro-road-label { fill: #444; font-weight: 600; text-anchor: middle; paint-order: stroke; stroke: #fff; }
.intro-road-hover { fill: none; stroke: #ff6a00; stroke-width: 8; stroke-linecap: round; opacity: .7; vector-effect: non-scaling-stroke; }
.intro-road-sel, .intro-road-correct { fill: none; stroke: #1e8a4c; stroke-width: 7; stroke-linecap: round; opacity: .75; vector-effect: non-scaling-stroke; }
.intro-road-acceptable { fill: none; stroke: #b7791f; stroke-width: 7; stroke-linecap: round; opacity: .7; stroke-dasharray: 10 6; vector-effect: non-scaling-stroke; }
.intro-road-secondary { fill: none; stroke: #534AB7; stroke-width: 6; stroke-linecap: round; opacity: .8; stroke-dasharray: 2 7; vector-effect: non-scaling-stroke; }
.intro-ped { fill: none; stroke: #0e8fa8; stroke-width: 3; stroke-linecap: round; opacity: .8; stroke-dasharray: 4 5; vector-effect: non-scaling-stroke; }
.intro-ped-sel { fill: none; stroke: #0e8fa8; stroke-width: 7; stroke-linecap: round; opacity: .9; stroke-dasharray: 10 5; vector-effect: non-scaling-stroke; }
.intro-arrow { fill: none; stroke-width: 3; vector-effect: non-scaling-stroke; }
.intro-arrow.temp { stroke-dasharray: 6 4; }
.intro-arrow-head { stroke: none; }
@media (max-width: 760px) { #intro-ov .intro-box { flex-direction: column; } #intro-ov .intro-side { width: 100%; max-height: 45%; border-inline-end: 0; } }
/* зона эталона, о которой сообщение, — мигает */
.a-hint-zone { fill: #ff6a0040; stroke: #ff6a00; stroke-width: 3; stroke-dasharray: 8 4; pointer-events: none; animation: hint-blink 0.9s ease-in-out infinite; }
.a-hint-zone.correct { fill: #1e8a4c33; stroke: var(--ok); }
.a-hint-blink { animation: hint-blink 0.9s ease-in-out infinite; }
@keyframes hint-blink { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }
@media (prefers-reduced-motion: reduce) { .a-hint-zone { animation: none; } }
.modal-win { background: #fff; border-radius: 10px; padding: 14px 16px; box-shadow: 0 8px 30px #0004; }
.calc-step { border-top: 1px solid var(--line); padding: 6px 0; }
.calc-step.solved { color: var(--muted); }
.calc-q { margin: 4px 0; font-weight: 600; }
.calc-step.solved .calc-q { font-weight: 400; }
.calc-ans { margin: 2px 0; color: var(--ok); }
.calc-given { margin: 4px 0; color: var(--accent); }
.calc-wrong { color: var(--bad); margin-top: 4px; font-size: 13px; }
.calc-step .hint { background: #fff8e1; border-radius: 5px; padding: 4px 8px; margin-top: 5px; font-size: 13px; }
.modal-win h2 { margin-top: 0; }
.modal-win p { margin: 6px 0; }
.modal-win .calc-ok { color: var(--ok); font-weight: 600; }
.modal-win .calc-bad { color: var(--bad); font-weight: 600; }
.ramp-section { display: block; margin: 10px 0; background: #fafafa; border: 1px solid var(--line); border-radius: 6px; }
.rs-street { stroke: #444; stroke-width: 3; }
.rs-floor { stroke: #444; stroke-width: 2; stroke-dasharray: 6 4; }
.rs-allowed { stroke: var(--ok); stroke-width: 2; stroke-dasharray: 6 4; }
.rs-ramp-ok { stroke: var(--ok); stroke-width: 4; }
.rs-ramp-bad { stroke: var(--bad); stroke-width: 4; }
.rs-dim { stroke: #888; stroke-width: 1; }
.rs-t { font: 12px sans-serif; fill: #333; }
.rs-tr { font-weight: 600; }
.rs-ta { fill: var(--ok); }
.rs-abstract { stroke: #999; stroke-width: 3; stroke-dasharray: 8 6; }
.rs-zero { stroke: #999; stroke-width: 1; stroke-dasharray: 3 3; }
.rt-slider { width: 100%; margin: 6px 0; }
.rt-info { font-size: 13px; }
.ramp-tool h3 { margin: 4px 0; font-size: 13.5px; }
.ramp-tool .rt-calc { white-space: pre-line; }
#modal.picking { opacity: .35; pointer-events: none; }
.rt-entry { fill: #ff6a00; stroke: #fff; stroke-width: 2; }
.rt-band { stroke: none; }
.rt-band.ok { fill: #1e8a4c22; }
.rt-band.bad { fill: #c5303022; }
.rt-axis { fill: none; stroke-width: 2.5; stroke-dasharray: 7 5; }
.rt-axis.ok { stroke: var(--ok); }
.rt-axis.bad { stroke: var(--bad); }
.rt-end.ok { fill: var(--ok); }
.rt-end.bad { fill: var(--bad); }
.rs-ok { fill: var(--ok); }
.rs-bad { fill: var(--bad); }
.rs-note { fill: #888; font-size: 11px; }

/* схема */
.gen-wrap { position: relative; display: inline-block; }
.gen-wrap #generate:disabled { pointer-events: none; }  /* наведение ловит обёртка */
.gen-tip { display: none; position: absolute; bottom: calc(100% + 6px); inset-inline-start: 0; z-index: 20; width: max-content; max-width: 420px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.15); padding: 8px 10px; font-size: 13px; line-height: 1.4; }
.gen-tip ul { margin: 4px 0 0; padding-inline-start: 18px; }
.gen-wrap.locked:hover .gen-tip { display: block; }
#diagram-panel { display: none; position: absolute; inset: 0; background: #fff; overflow: auto; padding: 14px; }
#diagram-panel.on { display: block; }
#diagram-panel .svgbox { border: 1px solid var(--line); max-width: 1000px; }
#diagram-panel .svgbox svg { width: 100%; height: auto; display: block; }

/* преподаватель */
.kq { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 10px 0; }
.kq .zone-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.kq .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.correct { background: var(--key-correct); } .dot.best { background: #fff; border: 3px solid var(--key-correct); width: 8px; height: 8px; } .dot.acceptable { background: var(--key-accept); } .dot.forbidden { background: var(--key-forbid); }
.fb-grid { display: grid; grid-template-columns: auto 1fr; gap: 4px 6px; align-items: start; margin-top: 6px; font-size: 12px; }
.kq .item-row { display: grid; grid-template-columns: 1fr auto; gap: 3px 6px; align-items: center; margin: 6px 0 0; margin-inline-start: 16px; padding: 3px; font-size: 13px; }
.kq .item-row .item-note { grid-column: 1 / -1; }
.kq .item-row .btn { padding: 1px 8px; }
.kq .item-row b { white-space: nowrap; font-weight: 600; }
.kq .item-row textarea.item-note { width: 100%; min-height: 26px; resize: vertical; font: inherit; font-size: 12.5px; }
.kq .item-row:hover { background: #fff3e0; border-radius: 5px; }
.dot.revise { background: #bbb; }
.k-hl { fill: #ff6a0055; stroke: #ff6a00; stroke-width: 3; }
.k-hl-edge { fill: none; stroke: #ff6a00; stroke-width: 12; stroke-linecap: round; opacity: .8; }
/* зоны соседнего вопроса — образец для разметки */
.k-ref { stroke-width: 3.5; stroke-dasharray: 6 4; }
.k-ref-correct { stroke: var(--key-correct); fill: #1e8a4c1f; } .k-ref-acceptable { stroke: var(--key-accept); fill: #b7791f1c; } .k-ref-forbidden { stroke: var(--key-forbid); fill: #c530301c; }
.k-ref-label { fill: #333; font-weight: 600; font-style: italic; text-anchor: middle; dominant-baseline: central; }
.k-kb-edge { fill: none; stroke: #666; stroke-width: 5; stroke-linecap: round; opacity: .35; }
.k-kb-label { fill: #333; font-weight: 600; text-anchor: middle; dominant-baseline: central; }
.kq .sub-head { margin-top: 10px; font-weight: 600; font-size: 13px; border-top: 1px solid var(--line); padding-top: 6px; }
.k-label { font-weight: 700; text-anchor: middle; dominant-baseline: central; }
.k-label-correct { fill: var(--key-correct); } .k-label-acceptable { fill: var(--key-accept); } .k-label-forbidden { fill: var(--key-forbid); }
details > summary { cursor: pointer; color: var(--accent); margin-top: 6px; font-size: 13px; }

@media (max-width: 760px) {
  main { flex-direction: column; }
  aside, body.student-page aside { width: 100%; max-height: 45vh; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  #mapwrap { min-height: 55vh; }
}
/* схема преподавателя «что можно и что нельзя» */
#help-ov { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
#help-ov .help-box { background: #fff; border-radius: 10px; width: min(960px, 100%); box-sizing: border-box; max-height: 100%; overflow: auto; padding: 14px 16px; box-shadow: 0 8px 28px rgba(0,0,0,.3); }
#help-ov .help-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 17px; margin-bottom: 10px; }
#help-ov .help-imgs { display: flex; flex-direction: column; gap: 22px; }
#help-ov .help-img { margin: 0; }
#help-ov .help-cap-text { margin: 8px 0 0; font-size: 15.5px; line-height: 1.55; }
#help-ov .help-img figcaption { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
#help-ov .help-img.ok figcaption { color: var(--ok); }
#help-ov .help-img.bad figcaption { color: var(--bad); }
#help-ov .help-img img { display: block; max-width: 100%; max-height: none; width: 100%; height: auto; margin: 0 auto; cursor: zoom-in; border: 2px solid var(--line); border-radius: 4px; }
#help-ov .help-img.ok img { border-color: #8fd1a8; }
#help-ov .help-img.bad img { border-color: #ef9a9a; }
#help-ov .help-img .muted { padding: 10px; background: #f6f6f6; border-radius: 6px; }
#help-ov .help-text { margin-top: 12px; font-size: 15.5px; line-height: 1.55; white-space: pre-line; }
.btn.pulse { border-color: #d9480f; color: #b23b0c; font-weight: 600; animation: help-pulse 1.1s ease-in-out infinite; }
@keyframes help-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(217,72,15,.55); background: #fff; } 50% { box-shadow: 0 0 0 7px rgba(217,72,15,0); background: #fff1e8; } }
@media (prefers-reduced-motion: reduce) { .btn.pulse { animation: none; background: #fff1e8; } }
