:root {
  --navy: #15364f;
  --navy-2: #0e293e;
  --blue: #1769aa;
  --blue-2: #0f82c7;
  --blue-soft: #eaf5fc;
  --green: #3e9b35;
  --amber: #b97013;
  --red: #a84343;
  --ink: #1d2f3c;
  --muted: #687985;
  --line: #dce5ea;
  --page: #f4f7f9;
  --white: #fff;
  --shadow: 0 14px 40px rgba(19, 52, 74, .10);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--page); color: var(--ink); font-family: Inter, "Segoe UI", Arial, sans-serif; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar { position: sticky; z-index: 40; top: 0; display: grid; grid-template-columns: minmax(220px, 1fr) auto minmax(280px, 1fr); align-items: center; min-height: 68px; padding: 0 32px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.95); box-shadow: 0 3px 18px rgba(20,51,72,.05); backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 11px; width: max-content; color: var(--navy); text-decoration: none; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.brand strong { font-size: 17px; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: linear-gradient(135deg, var(--blue), #32a8c7); box-shadow: 0 8px 18px rgba(23,105,170,.23); color: white; font-size: 21px; font-weight: 900; }
.topnav { display: flex; align-items: stretch; height: 68px; gap: 8px; }
.topnav a { display: grid; place-items: center; padding: 0 15px; border-bottom: 3px solid transparent; color: #526671; font-size: 14px; font-weight: 700; text-decoration: none; }
.topnav a:hover { border-bottom-color: var(--blue); color: var(--blue); }
.account { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.account-badge { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-weight: 900; }
.account-name { display: flex; flex-direction: column; min-width: 90px; font-size: 13px; font-weight: 750; }
.account-name small { color: var(--muted); font-size: 10px; font-weight: 500; }
.link-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.link-button:hover { color: var(--red); }

.page-shell { width: min(1480px, calc(100% - 48px)); margin: 0 auto; padding: 38px 0 70px; }
.hero-row, .process-header, .editor-header, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; color: var(--navy); font-size: clamp(28px, 4vw, 46px); line-height: 1.08; letter-spacing: -.03em; }
h2 { margin: 0; color: var(--navy); }
.eyebrow { margin: 0 0 9px; color: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.lead { max-width: 800px; margin: 13px 0 0; color: var(--muted); font-size: 16px; line-height: 1.55; }
.muted { color: var(--muted); }
.padded { padding: 16px; }
.hidden { display: none; }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 0 17px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 800; text-decoration: none; transition: .16s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--blue); box-shadow: 0 8px 20px rgba(23,105,170,.20); color: white; }
.button-primary:hover { background: #12598f; }
.button-secondary { border-color: #bed3df; background: #fff; color: var(--blue); }
.button-secondary:hover { border-color: var(--blue); background: var(--blue-soft); }
.button-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.button-ghost:hover { background: #eaf0f3; color: var(--navy); }
.button-wide { width: 100%; }

.filters { display: flex; align-items: center; gap: 10px; margin: 30px 0 16px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 8px 30px rgba(20,52,75,.05); }
.filters select, .form-field select, .form-field input, .form-field textarea { min-height: 43px; padding: 9px 12px; border: 1px solid #cad7de; border-radius: 9px; outline: none; background: white; color: var(--ink); }
.filters select { min-width: 220px; }
.search-field { position: relative; flex: 1; }
.search-field span { position: absolute; top: 7px; left: 13px; color: var(--blue); font-size: 23px; line-height: 1; transform: rotate(-15deg); }
.search-field input { width: 100%; min-height: 43px; padding: 9px 12px 9px 42px; border: 1px solid #cad7de; border-radius: 9px; outline: none; }
.filters input:focus, .filters select:focus, .form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,105,170,.12); }
.result-line { margin: 22px 0 12px; color: var(--muted); font-size: 13px; }
.result-line strong { color: var(--navy); }

.process-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.process-card { position: relative; min-height: 250px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 8px 28px rgba(22,52,72,.06); transition: .18s ease; }
.process-card:hover { transform: translateY(-3px); border-color: #abc9da; box-shadow: var(--shadow); }
.card-topline, .meta-row, .card-footer { display: flex; align-items: center; gap: 9px; }
.card-topline { justify-content: space-between; }
.process-code { color: var(--blue); font-size: 14px; font-weight: 900; }
.status, .version-pill { display: inline-flex; align-items: center; min-height: 27px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 850; }
.status-approved { background: #e7f6e5; color: #377c30; }
.status-draft { background: #fff2dd; color: #9a6014; }
.status-archived { background: #edf0f2; color: #64737c; }
.version-pill { background: var(--blue-soft); color: var(--blue); }
.card-category { margin: 20px 0 8px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.process-card h2 { margin: 0 0 11px; font-size: 20px; line-height: 1.25; }
.process-card h2 a { text-decoration: none; }
.card-summary { color: var(--muted); font-size: 13px; line-height: 1.55; }
.card-footer { position: absolute; right: 22px; bottom: 18px; left: 22px; justify-content: space-between; padding-top: 13px; border-top: 1px solid #eef2f4; color: #80909a; font-size: 11px; }
.card-link { position: absolute; inset: 0; }
.process-card h2 a, .process-card .status { position: relative; z-index: 2; }
.empty-state { grid-column: 1/-1; padding: 70px 24px; border: 1px dashed #cbd8df; border-radius: var(--radius); background: white; text-align: center; }
.empty-state p { color: var(--muted); }
.empty-icon { color: var(--blue); font-size: 40px; }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 25px; color: var(--muted); font-size: 12px; }
.breadcrumbs a { color: var(--blue); text-decoration: none; }
.process-header { align-items: center; margin-bottom: 28px; }
.process-header h1 { max-width: 1020px; margin-top: 13px; font-size: clamp(28px, 3.4vw, 43px); }
.header-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.diagram-section, .process-info, .form-card { margin-top: 22px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 10px 32px rgba(18,48,68,.06); }
.section-heading { align-items: center; margin-bottom: 18px; }
.section-heading h2 { font-size: 23px; }
.diagram-toolbar { display: flex; flex-wrap: wrap; gap: 7px; }
.diagram-toolbar button { min-height: 36px; padding: 0 12px; border: 1px solid #c8d7df; border-radius: 8px; background: white; color: var(--navy); cursor: pointer; font-size: 12px; font-weight: 800; }
.diagram-toolbar button:hover { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.diagram-hint { max-width: 760px; margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.diagram-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; min-height: 780px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.diagram-canvas { position: relative; min-width: 0; min-height: 780px; overflow: hidden; background-color: #f8fafb; background-image: radial-gradient(#d5e0e5 1px, transparent 1px); background-size: 20px 20px; cursor: default; touch-action: none; }
.diagram-canvas.dragging { cursor: grabbing; }
.diagram-canvas object { position: absolute; top: 50%; left: 50%; display: block; max-width: none; border: 0; backface-visibility: hidden; transform: translate(-50%, -50%) scale(1); transform-origin: center; user-select: none; will-change: transform; }
.diagram-canvas:fullscreen { width: 100vw; height: 100vh; background-color: white; }
.diagram-placeholder { position: absolute; inset: 0; display: grid; place-content: center; gap: 7px; color: var(--muted); text-align: center; }
.diagram-placeholder strong { color: var(--navy); font-size: 21px; }
.steps-nav { overflow-y: auto; border-left: 1px solid var(--line); background: white; }
.steps-nav-title { position: sticky; z-index: 2; top: 0; display: flex; justify-content: space-between; padding: 18px; border-bottom: 1px solid var(--line); background: white; color: var(--navy); font-weight: 850; }
.steps-nav-title small { display: grid; width: 24px; height: 24px; place-content: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); }
.step-nav-button { display: grid; grid-template-columns: 82px 1fr; width: 100%; padding: 15px 17px; border: 0; border-bottom: 1px solid #edf1f3; background: white; color: var(--ink); cursor: pointer; text-align: left; }
.step-nav-button:hover { background: var(--blue-soft); }
.step-nav-button strong { color: var(--blue); font-size: 12px; }
.step-nav-button span { font-size: 12px; font-weight: 700; line-height: 1.35; }
.step-detail-panel { position: relative; min-width: 0; height: 780px; overflow-y: auto; border-left: 1px solid var(--line); background: white; }
.step-panel-empty { position: absolute; inset: 0; display: grid; place-content: center; padding: 42px; color: var(--muted); text-align: center; }
.step-panel-empty[hidden] { display: none; }
.step-panel-empty h3 { margin: 20px 0 8px; color: var(--navy); font-size: 19px; }
.step-panel-empty p { margin: 0; font-size: 12px; line-height: 1.55; }
.step-panel-icon { position: relative; width: 70px; height: 70px; margin: 0 auto; border: 2px solid #c6dce8; border-radius: 18px; background: var(--blue-soft); }
.step-panel-icon::before, .step-panel-icon::after, .step-panel-icon span { content: ""; position: absolute; height: 4px; border-radius: 4px; background: var(--blue); }
.step-panel-icon::before { top: 20px; right: 15px; left: 15px; }
.step-panel-icon::after { top: 33px; right: 23px; left: 15px; opacity: .7; }
.step-panel-icon span { top: 46px; right: 31px; left: 15px; opacity: .45; }
.step-panel-content { display: none; padding: 28px; }
.step-panel-content.active { display: block; animation: panel-in .2s ease; }
.step-panel-content h2 { margin: 0 0 20px; color: var(--navy); font-size: 24px; line-height: 1.2; }

.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.info-card { padding: 20px; border: 1px solid #e2e9ed; border-radius: 12px; background: #fbfcfd; }
.info-card-wide { grid-column: 1/-1; }
.info-card h3, .drawer-section h3 { margin: 0 0 11px; color: var(--navy); font-size: 14px; }
.rich-output { color: #445965; font-size: 13px; line-height: 1.62; }
.rich-output > :first-child { margin-top: 0; }
.rich-output > :last-child { margin-bottom: 0; }
.rich-output ul, .rich-output ol { padding-left: 21px; }
.rich-output a { color: var(--blue); }

.step-drawer { position: fixed; z-index: 80; top: 0; right: 0; width: min(520px, 92vw); height: 100vh; padding: 38px; overflow-y: auto; background: white; box-shadow: -18px 0 55px rgba(12,35,50,.2); transform: translateX(105%); transition: transform .25s ease; }
.step-drawer.open { transform: translateX(0); }
.drawer-overlay { position: fixed; z-index: 70; inset: 0; visibility: hidden; background: rgba(10,30,43,.36); opacity: 0; transition: .22s ease; }
.drawer-overlay.open { visibility: visible; opacity: 1; }
.drawer-close { position: absolute; top: 16px; right: 18px; display: grid; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 50%; background: #eef3f6; color: var(--navy); cursor: pointer; font-size: 25px; }
.step-drawer h2 { margin: 0 40px 20px 0; font-size: 27px; line-height: 1.2; }
.owner-line { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 20px 0; padding: 13px 15px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-size: 12px; }
.drawer-section { padding: 19px 0; border-top: 1px solid var(--line); }
.result-block { margin-top: 6px; padding: 17px; border: 0; border-radius: 11px; background: #ecf7e9; }

.toast-stack { position: fixed; z-index: 100; top: 82px; right: 20px; display: grid; gap: 8px; }
.toast { max-width: 380px; padding: 13px 16px; border: 1px solid #b8dcb4; border-radius: 10px; background: #eef9ec; box-shadow: var(--shadow); color: #377b31; font-size: 13px; font-weight: 700; }
.form-error { margin: 10px 0 18px; padding: 12px 14px; border: 1px solid #efc5c5; border-radius: 9px; background: #fff1f1; color: var(--red); font-size: 13px; }

.editor-header { align-items: center; margin-bottom: 20px; }
.editor-header h1 { font-size: 34px; }
.editor-form { display: grid; gap: 0; }
.form-card h2 { margin-bottom: 20px; font-size: 20px; }
.form-grid { display: grid; gap: 16px; }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: 1/-1; }
.form-stack { display: grid; gap: 22px; }
.form-field { display: grid; gap: 7px; }
.form-field label { color: #405662; font-size: 12px; font-weight: 800; }
.form-field input, .form-field select, .form-field textarea { width: 100%; }
.form-field textarea { min-height: 120px; resize: vertical; }
.form-field.has-error input, .form-field.has-error textarea { border-color: var(--red); }
.field-error { color: var(--red); font-size: 11px; }
.sticky-actions { position: sticky; z-index: 25; bottom: 14px; display: flex; width: max-content; gap: 8px; margin: 20px auto 0; padding: 8px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.94); box-shadow: 0 12px 34px rgba(15,42,59,.16); backdrop-filter: blur(10px); }
.steps-admin { margin-top: 32px; }
.admin-step-list { display: grid; gap: 8px; }
.admin-step-list a { display: grid; grid-template-columns: 100px minmax(0,1fr) 260px auto; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.admin-step-list a:hover { border-color: #a8c8da; background: var(--blue-soft); }
.admin-step-list strong { color: var(--blue); }
.admin-step-list small { color: var(--muted); }
.admin-step-list b { color: var(--blue); font-size: 12px; }
.narrow-form { max-width: 1050px; }

.rich-editor { overflow: hidden; border: 1px solid #cad7de; border-radius: 10px; background: white; }
.rich-editor:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,105,170,.12); }
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 7px; border-bottom: 1px solid #dde6eb; background: #f7f9fa; }
.rich-toolbar button { min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--navy); cursor: pointer; font-size: 12px; font-weight: 800; }
.rich-toolbar button:hover { border-color: #c5d6df; background: white; color: var(--blue); }
.rich-surface { min-height: 130px; padding: 13px; outline: none; color: var(--ink); font-size: 13px; line-height: 1.55; }
.rich-surface:empty::before { content: "Введите текст…"; color: #97a5ad; }
.rich-text-source.enhanced { display: none; }

.revision-list { display: grid; gap: 9px; margin-top: 24px; }
.revision-list article { display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 16px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.revision-list p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.revision-list small { color: var(--muted); }

.login-page { overflow: hidden; }
.login-layout { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(420px,.8fr); min-height: 100vh; }
.login-visual { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 54px 7vw; background: radial-gradient(circle at 80% 20%, rgba(40,153,192,.28), transparent 30%), linear-gradient(145deg, #102d42, #1769aa); color: white; }
.login-visual::after { content: ""; position: absolute; right: -120px; bottom: -220px; width: 580px; height: 580px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.02); }
.login-brand { display: flex; align-items: center; gap: 13px; font-size: 22px; font-weight: 900; }
.brand-mark-large { width: 47px; height: 47px; background: white; color: var(--blue); }
.login-visual h1 { color: white; font-size: clamp(42px, 5vw, 74px); }
.login-visual p:not(.eyebrow) { max-width: 600px; color: rgba(255,255,255,.74); font-size: 17px; line-height: 1.6; }
.eyebrow-light { color: #88d8f2; }
.visual-flow { position: relative; z-index: 2; display: flex; align-items: center; width: min(600px, 90%); }
.visual-flow span { width: 18px; height: 18px; border: 4px solid #7bd4f1; border-radius: 50%; background: #174f78; box-shadow: 0 0 0 8px rgba(123,212,241,.1); }
.visual-flow i { flex: 1; height: 2px; background: linear-gradient(90deg, #7bd4f1, rgba(123,212,241,.25)); }
.login-panel { display: grid; place-items: center; padding: 34px; background: #f7f9fa; }
.login-card { width: min(410px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow); }
.login-card h2 { margin-bottom: 9px; font-size: 29px; }
.login-card > .muted { margin: 0 0 25px; font-size: 13px; line-height: 1.5; }
.login-card label { display: block; margin: 15px 0 6px; color: #415661; font-size: 12px; font-weight: 800; }
.login-card input { width: 100%; height: 46px; padding: 0 12px; border: 1px solid #c9d6dd; border-radius: 9px; outline: none; }
.login-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,105,170,.12); }
.login-card .button { margin-top: 23px; height: 48px; }

.diagram-editor-page { height: calc(100vh - 68px); background: white; }
.diagram-editor-head { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 20px; height: 74px; padding: 10px 22px; border-bottom: 1px solid var(--line); }
.diagram-editor-head h1 { max-width: 760px; overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.diagram-editor-head .eyebrow { margin-bottom: 3px; }
.editor-status { color: var(--muted); font-size: 12px; font-weight: 700; }
.editor-status.success { color: var(--green); }
.editor-status.error { color: var(--red); }
.drawio-frame { display: block; width: 100%; height: calc(100vh - 142px); border: 0; }

/* Карта процессов */
.map-page { background: #f1f6f8; }
.map-page .page-shell { width: min(1580px, calc(100% - 38px)); }
.map-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
.map-hero h1 { font-size: clamp(34px, 4vw, 54px); }
.map-stats { display: flex; overflow: hidden; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.82); box-shadow: 0 8px 25px rgba(20,52,74,.05); }
.map-stats span { display: flex; min-width: 105px; flex-direction: column; padding: 12px 18px; border-left: 1px solid var(--line); color: var(--muted); font-size: 10px; text-transform: uppercase; }
.map-stats span:first-child { border-left: 0; }
.map-stats strong { margin-bottom: 2px; color: var(--navy); font-size: 20px; }
.mindmap { position: relative; display: grid; grid-template-columns: 210px 350px minmax(480px,1fr); gap: 72px; min-height: 660px; padding: 28px; overflow: hidden; border: 1px solid #d8e3e8; border-radius: 24px; background-color: #f9fbfc; background-image: radial-gradient(#dfe8ec 1px, transparent 1px), linear-gradient(135deg, rgba(255,255,255,.8), rgba(235,244,247,.3)); background-size: 24px 24px, 100% 100%; box-shadow: 0 18px 52px rgba(17,48,68,.09); }
.mindmap-lines { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mindmap-lines path { fill: none; stroke: #bdd0da; stroke-linecap: round; stroke-width: 3; }
.mindmap-lines path:nth-child(1) { stroke: #ef7f45; }
.mindmap-lines path:nth-child(2) { stroke: #4777d1; }
.mindmap-lines path:nth-child(3) { stroke: #38a779; }
.mindmap-lines .active-branch-line { stroke-dasharray: 9 9; stroke-width: 4; animation: map-line-flow 1.3s linear infinite; }
@keyframes map-line-flow { to { stroke-dashoffset: -36; } }
.mindmap-root { position: relative; z-index: 2; align-self: center; display: flex; width: 190px; height: 190px; align-items: center; justify-content: center; flex-direction: column; border: 1px solid rgba(23,105,170,.16); border-radius: 50%; background: radial-gradient(circle at 35% 28%, #fff, #e5f3fa 72%); box-shadow: 0 20px 50px rgba(20,86,126,.17), inset 0 0 0 9px rgba(255,255,255,.68); text-align: center; }
.mindmap-root .brand-mark { position: absolute; top: -13px; }
.mindmap-root strong { margin-top: 13px; color: var(--navy); font-size: 20px; line-height: 1.16; }
.mindmap-root small { margin-top: 7px; color: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.root-orbit { position: absolute; border: 1px solid rgba(23,105,170,.13); border-radius: 50%; pointer-events: none; }
.root-orbit-one { inset: -16px; }
.root-orbit-two { inset: -31px; opacity: .55; }
.mindmap-groups { position: relative; z-index: 2; align-self: center; display: grid; gap: 28px; }
.mindmap-group { position: relative; display: grid; grid-template-columns: 48px minmax(0,1fr) 28px; min-height: 112px; align-items: center; gap: 12px; padding: 16px; border: 1px solid #d8e3e8; border-left: 6px solid var(--group-accent); border-radius: 16px; outline: 0; background: rgba(255,255,255,.95); box-shadow: 0 11px 30px rgba(22,51,70,.08); color: var(--ink); cursor: pointer; text-align: left; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.mindmap-group::before { content: ""; position: absolute; top: 50%; left: -13px; width: 14px; height: 14px; border: 3px solid white; border-radius: 50%; background: var(--group-accent); box-shadow: 0 0 0 2px var(--group-accent); transform: translateY(-50%); }
.mindmap-group:hover, .mindmap-group.active { transform: translateX(6px); border-color: color-mix(in srgb, var(--group-accent) 55%, white); box-shadow: 0 16px 40px color-mix(in srgb, var(--group-accent) 18%, transparent); }
.mindmap-group.active { background: color-mix(in srgb, var(--group-accent) 7%, white); }
.group-number { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: color-mix(in srgb, var(--group-accent) 13%, white); color: var(--group-accent); font-size: 18px; font-weight: 950; }
.group-copy { display: flex; flex-direction: column; }
.group-copy strong { color: var(--navy); font-size: 15px; line-height: 1.28; }
.group-copy small { margin-top: 7px; color: var(--muted); font-size: 11px; }
.group-arrow { color: var(--group-accent); font-size: 22px; font-weight: 900; transition: transform .18s ease; }
.mindmap-group.active .group-arrow { transform: translateX(4px); }
.mindmap-detail { position: relative; z-index: 2; align-self: stretch; min-width: 0; overflow: hidden; border: 1px solid #d7e3e9; border-radius: 19px; background: rgba(255,255,255,.96); box-shadow: 0 13px 36px rgba(17,48,67,.08); }
.map-welcome { position: absolute; inset: 0; display: grid; place-content: center; padding: 50px; color: var(--muted); text-align: center; }
.map-welcome[hidden] { display: none; }
.map-welcome h2 { margin: 22px 0 8px; font-size: 23px; }
.map-welcome p { max-width: 380px; margin: 0; line-height: 1.55; }
.map-welcome-icon { display: flex; align-items: center; justify-content: center; gap: 20px; }
.map-welcome-icon span { width: 23px; height: 23px; border: 5px solid white; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px var(--blue), 0 7px 16px rgba(23,105,170,.2); }
.map-welcome-icon span:nth-child(2) { background: #ef7f45; box-shadow: 0 0 0 2px #ef7f45, 0 7px 16px rgba(239,127,69,.2); }
.map-welcome-icon span:nth-child(3) { background: #38a779; box-shadow: 0 0 0 2px #38a779, 0 7px 16px rgba(56,167,121,.2); }
.group-panel { display: none; height: 100%; overflow-y: auto; }
.group-panel.active { display: block; animation: panel-in .24s ease; }
@keyframes panel-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }
.group-panel-header { position: sticky; z-index: 3; top: 0; display: flex; align-items: center; gap: 16px; padding: 22px 24px; border-bottom: 1px solid #e2e9ed; background: color-mix(in srgb, var(--group-accent) 7%, white); }
.group-panel-code { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 14px; background: var(--group-accent); box-shadow: 0 8px 18px color-mix(in srgb, var(--group-accent) 26%, transparent); color: white; font-size: 20px; font-weight: 950; }
.group-panel-header p { margin: 0 0 3px; color: var(--group-accent); font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.group-panel-header h2 { font-size: 20px; line-height: 1.22; }
.category-accordion { padding: 12px; }
.category-item { overflow: hidden; margin-bottom: 8px; border: 1px solid #e0e8ec; border-radius: 12px; background: white; transition: border-color .18s ease, box-shadow .18s ease; }
.category-item.open { border-color: color-mix(in srgb, var(--group-accent) 45%, white); box-shadow: 0 7px 22px color-mix(in srgb, var(--group-accent) 10%, transparent); }
.category-toggle { display: grid; grid-template-columns: 64px minmax(0,1fr) 30px 24px; width: 100%; min-height: 62px; align-items: center; gap: 9px; padding: 10px 14px; border: 0; background: white; color: var(--ink); cursor: pointer; text-align: left; }
.category-toggle:hover { background: #fafcfd; }
.category-code { color: var(--group-accent); font-size: 13px; font-weight: 950; }
.category-name { color: var(--navy); font-size: 13px; font-weight: 800; line-height: 1.3; }
.category-count { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: #edf3f6; color: var(--muted); font-size: 10px; font-weight: 900; }
.category-chevron { color: var(--group-accent); font-size: 19px; font-weight: 900; transition: transform .2s ease; }
.category-item.open .category-chevron { transform: rotate(180deg); }
.category-processes { display: grid; grid-template-rows: 0fr; background: #f8fafb; transition: grid-template-rows .22s ease; }
.category-item.open .category-processes { grid-template-rows: 1fr; }
.process-branch { position: relative; min-height: 0; overflow: hidden; padding: 0 14px 0 42px; }
.category-item.open .process-branch { padding-top: 5px; padding-bottom: 13px; }
.process-branch::before { content: ""; position: absolute; top: 0; bottom: 18px; left: 25px; width: 2px; border-radius: 2px; background: color-mix(in srgb, var(--group-accent) 33%, white); }
.map-process-link { position: relative; display: grid; grid-template-columns: 62px minmax(0,1fr) 20px; align-items: center; gap: 8px; min-height: 48px; padding: 7px 10px; border-bottom: 1px solid #e5ecef; color: var(--ink); text-decoration: none; }
.map-process-link:last-child { border-bottom: 0; }
.map-process-link::before { content: ""; position: absolute; top: 50%; left: -17px; width: 17px; height: 2px; background: color-mix(in srgb, var(--group-accent) 33%, white); }
.map-process-link::after { content: ""; position: absolute; top: calc(50% - 4px); left: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--group-accent); }
.map-process-link:hover { border-radius: 8px; background: color-mix(in srgb, var(--group-accent) 8%, white); }
.map-process-link span { color: var(--group-accent); font-size: 11px; font-weight: 950; }
.map-process-link strong { font-size: 12px; line-height: 1.3; }
.map-process-link i { color: var(--group-accent); font-style: normal; font-weight: 900; }
.map-process-empty { padding: 16px 4px; color: var(--muted); font-size: 12px; }
.map-footer-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }

/* Полностью раскрытая нейронная карта */
.neural-map { position: relative; isolation: isolate; min-height: 760px; padding: 44px 30px 38px; overflow: hidden; border: 1px solid rgba(96,180,222,.24); border-radius: 26px; background: radial-gradient(circle at 50% 4%, rgba(37,128,179,.28), transparent 28%), radial-gradient(circle at 8% 42%, rgba(239,127,69,.12), transparent 24%), radial-gradient(circle at 91% 50%, rgba(56,167,121,.14), transparent 26%), linear-gradient(155deg, #07111f 0%, #091a2d 48%, #06121f 100%); box-shadow: 0 24px 70px rgba(3,16,28,.28), inset 0 0 70px rgba(33,118,167,.08); }
.neural-map::before { content: ""; position: absolute; z-index: -1; inset: 0; background-image: linear-gradient(rgba(100,178,216,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(100,178,216,.025) 1px, transparent 1px); background-size: 38px 38px; mask-image: radial-gradient(circle at center, black, transparent 92%); }
.space-stars { position: absolute; z-index: -1; inset: 0; pointer-events: none; }
.space-stars-one { background-image: radial-gradient(circle, rgba(157,222,255,.75) 0 1px, transparent 1.5px), radial-gradient(circle, rgba(255,255,255,.55) 0 1px, transparent 1.5px); background-position: 0 0, 29px 41px; background-size: 83px 83px, 127px 127px; opacity: .36; }
.space-stars-two { background-image: radial-gradient(circle, rgba(69,183,237,.9) 0 1.5px, transparent 2px), radial-gradient(circle, rgba(119,222,190,.75) 0 1px, transparent 2px); background-position: 17px 11px, 70px 100px; background-size: 211px 211px, 263px 263px; opacity: .25; animation: stars-drift 38s linear infinite; }
@keyframes stars-drift { to { transform: translate3d(22px, 34px, 0); } }
.neural-lines { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.neural-link { fill: none; stroke: var(--link-color); stroke-linecap: round; opacity: .34; filter: url(#neuralGlow); transition: opacity .16s ease, stroke-width .16s ease; }
.neural-link-group { stroke-width: 3.4; stroke-dasharray: 10 8; animation: neural-flow 3s linear infinite; }
.neural-link-category { stroke-width: 2.2; }
.neural-link-process { stroke-width: 1.25; opacity: .22; }
.neural-link-focus { stroke-width: 4.2; opacity: 1; }
@keyframes neural-flow { to { stroke-dashoffset: -36; } }
.neural-core { position: relative; z-index: 3; display: flex; width: min(440px, calc(100% - 40px)); min-height: 116px; align-items: center; justify-content: center; gap: 18px; margin: 0 auto 34px; padding: 19px 30px; border: 1px solid rgba(103,208,255,.42); border-radius: 58px; background: linear-gradient(135deg, rgba(15,54,80,.92), rgba(9,29,48,.94)); box-shadow: 0 0 0 7px rgba(55,166,216,.05), 0 0 38px rgba(53,175,227,.24), inset 0 0 28px rgba(63,183,232,.09); color: white; }
.core-logo { display: grid; width: 62px; height: 62px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(255,255,255,.48); border-radius: 19px; background: linear-gradient(145deg, #38b5e7, #1769aa); box-shadow: 0 0 26px rgba(69,192,241,.46); font-size: 31px; font-weight: 950; }
.neural-core > div:last-child { display: flex; flex-direction: column; }
.neural-core small { color: #73cef3; font-size: 9px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.neural-core strong { margin: 4px 0 2px; font-size: 23px; line-height: 1.1; }
.neural-core > div:last-child span { color: rgba(224,245,255,.6); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.core-orbit { position: absolute; border: 1px solid rgba(89,195,240,.2); border-radius: inherit; pointer-events: none; }
.core-orbit-one { inset: -9px; }
.core-orbit-two { inset: -19px; opacity: .45; }
.core-pulse { position: absolute; top: 50%; right: -6px; width: 11px; height: 11px; border-radius: 50%; background: #79dcff; box-shadow: 0 0 0 8px rgba(121,220,255,.08), 0 0 24px #79dcff; animation: neural-pulse 2.2s ease-in-out infinite; }
@keyframes neural-pulse { 50% { box-shadow: 0 0 0 15px rgba(121,220,255,0), 0 0 32px #79dcff; } }
.neural-map-legend { position: relative; z-index: 3; display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin: 0 auto 30px; color: rgba(198,226,239,.62); font-size: 10px; }
.neural-map-legend span { display: flex; align-items: center; gap: 7px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-group { background: #70d3ff; box-shadow: 0 0 10px #70d3ff; }
.legend-category { border: 2px solid #70d3ff; }
.legend-process { width: 6px; height: 6px; background: #fff; box-shadow: 0 0 8px rgba(255,255,255,.8); }
.neural-groups { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); align-items: start; gap: 22px; }
.neural-group { position: relative; min-width: 0; }
.neural-group-head { position: relative; display: grid; grid-template-columns: 54px minmax(0,1fr) 16px; min-height: 112px; align-items: center; gap: 13px; padding: 17px; border: 1px solid color-mix(in srgb, var(--group-accent) 58%, transparent); border-radius: 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--group-accent) 18%, rgba(6,21,36,.96)), rgba(5,20,34,.96)); box-shadow: 0 0 28px color-mix(in srgb, var(--group-accent) 14%, transparent), inset 0 0 25px color-mix(in srgb, var(--group-accent) 5%, transparent); color: white; transition: transform .18s ease, box-shadow .18s ease; }
.neural-group-head.neural-focus { transform: translateY(-3px); box-shadow: 0 0 42px color-mix(in srgb, var(--group-accent) 29%, transparent); }
.neural-group-number { display: grid; width: 50px; height: 50px; place-items: center; border: 1px solid color-mix(in srgb, var(--group-accent) 76%, white); border-radius: 15px; background: color-mix(in srgb, var(--group-accent) 34%, transparent); box-shadow: 0 0 22px color-mix(in srgb, var(--group-accent) 32%, transparent); color: white; font-size: 20px; font-weight: 950; }
.neural-group-head small { color: color-mix(in srgb, var(--group-accent) 60%, white); font-size: 8px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.neural-group-head h2 { margin: 4px 0; color: white; font-size: 16px; line-height: 1.22; }
.neural-group-head p { margin: 0; color: rgba(211,234,244,.55); font-size: 10px; }
.node-signal { width: 9px; height: 9px; border-radius: 50%; background: var(--group-accent); box-shadow: 0 0 14px var(--group-accent); }
.neural-categories { display: grid; gap: 16px; padding-top: 28px; }
.neural-category { position: relative; min-width: 0; padding: 14px; border: 1px solid color-mix(in srgb, var(--group-accent) 25%, rgba(134,184,209,.18)); border-radius: 16px; background: rgba(5,20,34,.82); box-shadow: 0 10px 26px rgba(0,0,0,.12), inset 0 0 24px rgba(70,150,190,.025); backdrop-filter: blur(7px); transition: border-color .17s ease, box-shadow .17s ease; }
.neural-category.neural-focus { border-color: color-mix(in srgb, var(--group-accent) 68%, white); box-shadow: 0 0 26px color-mix(in srgb, var(--group-accent) 19%, transparent); }
.neural-category-head { display: grid; grid-template-columns: 58px minmax(0,1fr) 10px; align-items: center; gap: 10px; min-height: 54px; padding-bottom: 12px; border-bottom: 1px solid rgba(135,185,208,.14); }
.neural-category-head > span { display: grid; height: 30px; place-items: center; border: 1px solid color-mix(in srgb, var(--group-accent) 48%, transparent); border-radius: 9px; background: color-mix(in srgb, var(--group-accent) 12%, transparent); color: color-mix(in srgb, var(--group-accent) 57%, white); font-size: 11px; font-weight: 950; }
.neural-category-head h3 { margin: 0 0 4px; color: #e4f2f8; font-size: 12px; line-height: 1.28; }
.neural-category-head small { color: rgba(192,220,233,.46); font-size: 9px; }
.neural-category-head > i { width: 7px; height: 7px; border-radius: 50%; background: var(--group-accent); box-shadow: 0 0 11px var(--group-accent); }
.neural-processes { position: relative; display: grid; gap: 7px; padding: 12px 0 0 13px; }
.neural-processes::before { content: ""; position: absolute; top: 7px; bottom: 23px; left: 3px; width: 1px; background: linear-gradient(to bottom, transparent, var(--group-accent) 12%, var(--group-accent) 88%, transparent); box-shadow: 0 0 7px color-mix(in srgb, var(--group-accent) 48%, transparent); opacity: .54; }
.neural-process { position: relative; display: grid; grid-template-columns: 10px 55px minmax(0,1fr) 14px; min-height: 46px; align-items: center; gap: 7px; padding: 7px 8px; border: 1px solid rgba(126,184,210,.12); border-radius: 10px; background: rgba(13,39,58,.72); color: #d6e9f2; text-decoration: none; transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.neural-process::before { content: ""; position: absolute; top: 50%; left: -10px; width: 10px; height: 1px; background: var(--group-accent); box-shadow: 0 0 7px var(--group-accent); opacity: .48; }
.neural-process:hover, .neural-process.neural-focus { z-index: 3; transform: translateX(4px); border-color: color-mix(in srgb, var(--group-accent) 58%, white); background: color-mix(in srgb, var(--group-accent) 13%, rgba(10,34,53,.94)); box-shadow: 0 0 18px color-mix(in srgb, var(--group-accent) 17%, transparent); }
.process-neuron { width: 7px; height: 7px; border-radius: 50%; background: var(--group-accent); box-shadow: 0 0 9px var(--group-accent); }
.neural-process > span { color: color-mix(in srgb, var(--group-accent) 57%, white); font-size: 9px; font-weight: 950; }
.neural-process strong { font-size: 10px; font-weight: 700; line-height: 1.28; }
.neural-process b { color: var(--group-accent); font-size: 14px; }
.neural-empty { display: flex; align-items: center; gap: 8px; min-height: 42px; color: rgba(191,218,231,.42); font-size: 10px; }
.neural-empty i { width: 7px; height: 7px; border: 1px solid var(--group-accent); border-radius: 50%; }
.map-page .map-footer-actions .button-secondary { border-color: #abcbdc; }

/* Просмотр документа Битрикс24 поверх схемы */
html.document-open { overflow: hidden; }
.document-modal { width: min(1500px, 96vw); height: 94vh; max-width: none; max-height: none; padding: 0; overflow: hidden; border: 1px solid rgba(120,154,174,.55); border-radius: 18px; background: #fff; box-shadow: 0 28px 90px rgba(4,20,31,.36); }
.document-modal::backdrop { background: rgba(5,20,31,.68); backdrop-filter: blur(5px); }
.document-modal[open] { display: grid; grid-template-rows: auto minmax(0,1fr); animation: document-in .18s ease-out; }
@keyframes document-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.document-modal-toolbar { position: relative; z-index: 2; display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 14px 12px 22px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.98); box-shadow: 0 6px 18px rgba(18,48,68,.08); }
.document-modal-heading { display: flex; min-width: 0; flex-direction: column; }
.document-modal-heading span { color: var(--blue); font-size: 9px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.document-modal-heading strong { max-width: 760px; overflow: hidden; margin-top: 3px; color: var(--navy); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.document-modal-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; }
.document-modal-close { display: grid; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 12px; background: #edf2f5; color: var(--navy); cursor: pointer; font-size: 28px; line-height: 1; }
.document-modal-close:hover { background: #e3edf2; color: var(--red); }
.document-modal-body { position: relative; min-height: 0; overflow: hidden; background: #eef3f6; }
.document-modal-body iframe { display: block; width: 100%; height: 100%; border: 0; background: white; }
.diagram-editor-tip { max-width: 780px; margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }

/* Редактор структуры карты */
.map-edit-button { margin-top: 18px; }
.map-editor-header { align-items: center; }
.map-editor-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 14px; }
.map-editor-stats span { min-width: 130px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--muted); font-size: 11px; }
.map-editor-stats strong { margin-right: 5px; color: var(--navy); font-size: 17px; }
.map-editor-groups { display: grid; gap: 18px; }
.map-editor-group { overflow: hidden; border: 1px solid color-mix(in srgb, var(--editor-accent) 32%, var(--line)); border-radius: 18px; background: white; box-shadow: 0 10px 30px rgba(18,48,68,.06); }
.map-editor-group-head { display: grid; grid-template-columns: 56px minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(100deg, color-mix(in srgb, var(--editor-accent) 10%, white), white 65%); }
.map-editor-code { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 14px; background: var(--editor-accent); box-shadow: 0 8px 18px color-mix(in srgb, var(--editor-accent) 26%, transparent); color: white; font-size: 19px; font-weight: 950; }
.map-editor-group-head small { color: var(--editor-accent); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.map-editor-group-head h2 { margin-top: 4px; font-size: 20px; }
.map-editor-categories { display: grid; gap: 10px; padding: 14px; }
.map-editor-category { overflow: hidden; border: 1px solid #dfe8ed; border-radius: 12px; background: #fafcfd; }
.map-editor-category > header { display: grid; grid-template-columns: 72px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 12px 14px; border-bottom: 1px solid #e4ebef; background: white; }
.map-editor-category > header > span { color: var(--editor-accent); font-size: 12px; font-weight: 950; }
.map-editor-category h3 { margin: 0 0 3px; color: var(--navy); font-size: 14px; }
.map-editor-category small { color: var(--muted); font-size: 10px; }
.map-editor-row-actions { display: flex; gap: 12px; align-items: center; }
.map-editor-row-actions a { color: var(--blue); font-size: 11px; font-weight: 850; text-decoration: none; }
.danger-link { color: #bd3145 !important; font-size: 10px; font-weight: 850; text-decoration: none; }
.map-editor-processes { display: grid; padding: 6px 12px 10px 34px; }
.map-editor-process-row { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; border-bottom: 1px solid #e7edef; }
.map-editor-process-row::before { content: ""; position: absolute; left: -15px; width: 7px; height: 7px; border-radius: 50%; background: var(--editor-accent); box-shadow: 0 0 8px var(--editor-accent); }
.map-editor-process-row:last-child { border-bottom: 0; }
.map-editor-process-row > a:first-child { display: grid; grid-template-columns: 75px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 45px; padding: 7px 10px; color: var(--ink); text-decoration: none; }
.map-editor-process-row:hover { border-radius: 8px; background: color-mix(in srgb, var(--editor-accent) 8%, white); }
.map-editor-process-row > .danger-link { padding: 12px 10px; }
.map-editor-processes span { color: var(--editor-accent); font-size: 11px; font-weight: 950; }
.map-editor-processes strong { font-size: 12px; }
.map-editor-processes i { color: var(--blue); font-size: 10px; font-style: normal; font-weight: 800; }
.map-editor-processes p, .map-editor-empty { margin: 0; padding: 18px; color: var(--muted); font-size: 12px; }
.map-editor-add { display: grid; min-height: 43px; place-items: center; border: 1px dashed color-mix(in srgb, var(--editor-accent) 50%, #cbd8df); border-radius: 10px; color: var(--editor-accent); font-size: 11px; font-weight: 850; text-decoration: none; }
.map-editor-add:hover { background: color-mix(in srgb, var(--editor-accent) 7%, white); }

@media (max-width: 1080px) {
  .topbar { grid-template-columns: auto 1fr auto; padding: 0 18px; }
  .brand small, .account-name { display: none; }
  .process-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .diagram-layout { grid-template-columns: minmax(0,1fr) 340px; }
  .form-grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .span-3, .span-4 { grid-column: 1/-1; }
  .admin-step-list a { grid-template-columns: 90px 1fr auto; }
  .admin-step-list small { display: none; }
  .mindmap { grid-template-columns: 170px 300px minmax(420px,1fr); gap: 42px; padding: 20px; }
  .mindmap-root { width: 155px; height: 155px; }
  .mindmap-group { min-height: 104px; }
  .neural-map { padding-right: 18px; padding-left: 18px; }
  .neural-groups { gap: 14px; }
  .neural-group-head { grid-template-columns: 45px minmax(0,1fr) 10px; padding: 13px; }
  .neural-group-number { width: 42px; height: 42px; }
  .neural-process { grid-template-columns: 8px 48px minmax(0,1fr) 10px; padding-right: 5px; padding-left: 5px; }
}

@media (max-width: 760px) {
  .page-shell { width: min(100% - 24px, 1480px); padding-top: 24px; }
  .topbar { grid-template-columns: 1fr auto; min-height: 60px; }
  .topnav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 50; height: 58px; justify-content: flex-start; overflow-x: auto; border-top: 1px solid var(--line); background: white; }
  .topnav a { min-width: max-content; padding: 0 12px; border-top: 3px solid transparent; border-bottom: 0; font-size: 11px; }
  .account .link-button { display: none; }
  .hero-row, .process-header, .editor-header, .section-heading { align-items: stretch; flex-direction: column; }
  .filters { align-items: stretch; flex-direction: column; }
  .filters select { width: 100%; }
  .process-grid, .info-grid { grid-template-columns: 1fr; }
  .info-card-wide { grid-column: auto; }
  .process-card { min-height: 245px; }
  .diagram-section, .process-info, .form-card { padding: 15px; border-radius: 13px; }
  .diagram-layout { grid-template-columns: 1fr; }
  .diagram-canvas { min-height: 560px; }
  .step-detail-panel { height: auto; min-height: 430px; border-top: 1px solid var(--line); border-left: 0; }
  .steps-nav { max-height: 340px; border-top: 1px solid var(--line); border-left: 0; }
  .form-grid-4 { grid-template-columns: 1fr; }
  .span-2, .span-3, .span-4 { grid-column: auto; }
  .admin-step-list a { grid-template-columns: 78px 1fr; }
  .admin-step-list b { display: none; }
  .login-layout { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 18px; }
  .login-card { padding: 28px 22px; }
  .diagram-editor-page { height: calc(100vh - 60px); }
  .diagram-editor-head { grid-template-columns: 1fr auto; height: 80px; }
  .editor-status { display: none; }
  .drawio-frame { height: calc(100vh - 140px); }
  .revision-list article { grid-template-columns: 80px 1fr; }
  .revision-list small { display: none; }
  body:not(.login-page) { padding-bottom: 58px; }
  .map-page .page-shell { width: min(100% - 20px, 1580px); }
  .map-hero { align-items: stretch; flex-direction: column; }
  .map-stats { width: 100%; }
  .map-stats span { min-width: 0; flex: 1; padding: 10px; }
  .mindmap { display: block; min-height: 0; padding: 14px; }
  .mindmap-lines { display: none; }
  .mindmap-root { width: 140px; height: 140px; margin: 18px auto 35px; }
  .mindmap-groups { gap: 12px; }
  .mindmap-group { min-height: 86px; }
  .mindmap-group:hover, .mindmap-group.active { transform: translateY(-2px); }
  .mindmap-detail { min-height: 460px; margin-top: 18px; }
  .map-welcome { position: static; min-height: 440px; }
  .group-panel { max-height: 620px; }
  .map-footer-actions { align-items: stretch; flex-direction: column; }
  .neural-map { padding: 32px 12px 20px; border-radius: 18px; }
  .neural-core { min-height: 100px; padding: 16px 20px; }
  .core-logo { width: 52px; height: 52px; }
  .neural-core strong { font-size: 18px; }
  .neural-map-legend { gap: 9px 14px; }
  .neural-groups { grid-template-columns: 1fr; gap: 30px; }
  .neural-group-head { min-height: 96px; }
  .neural-categories { padding-top: 20px; }
  .neural-process strong { font-size: 11px; }
  .document-modal { width: 100vw; height: 100vh; border: 0; border-radius: 0; }
  .document-modal-toolbar { min-height: 66px; padding: 9px 10px 9px 14px; }
  .document-modal-heading strong { max-width: 44vw; font-size: 13px; }
  .document-modal-actions .button { display: none; }
  .map-editor-group-head { grid-template-columns: 48px minmax(0,1fr); padding: 14px; }
  .map-editor-group-head .button { grid-column: 1/-1; }
  .map-editor-category > header { grid-template-columns: 58px minmax(0,1fr); }
  .map-editor-row-actions { grid-column: 1/-1; }
  .map-editor-processes { padding-left: 20px; }
  .map-editor-process-row > a:first-child { grid-template-columns: 60px minmax(0,1fr); }
  .map-editor-processes i { display: none; }
}
.button-danger { border-color: #bd3145; background: #bd3145; color: #fff; }
.delete-confirm-card { max-width: 680px; margin: 42px auto; }
.revision-header { align-items: center; }
.revision-section { margin: 22px 0; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(18,48,68,.05); }
.revision-section > h2 { margin: 0 0 16px; color: var(--navy); font-size: 20px; }
.revision-diagram { overflow: auto; height: 680px; border: 1px solid #dce7ed; border-radius: 12px; background: #f8fbfc; }
.revision-diagram object { width: 100%; height: 100%; }
.revision-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.revision-fields article { padding: 14px; border: 1px solid #e4ecef; border-radius: 10px; }
.revision-fields span, .revision-steps dt { color: var(--blue); font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.revision-fields p, .revision-fields article > div { margin: 7px 0 0; color: var(--ink); font-size: 13px; line-height: 1.55; }
.revision-steps { display: grid; gap: 12px; }
.revision-steps article { padding: 16px; border: 1px solid #e0e9ed; border-radius: 12px; }
.revision-steps header { display: flex; gap: 12px; align-items: baseline; margin-bottom: 12px; }
.revision-steps header strong { color: var(--blue); }
.revision-steps h3 { margin: 0; font-size: 16px; }
.revision-steps dl { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 8px 14px; margin: 0; }
.revision-steps dd { margin: 0; font-size: 13px; line-height: 1.5; }
.notice-card { margin: 20px 0; padding: 16px; border: 1px solid #d7e4ea; border-radius: 12px; background: #f5fafc; color: var(--muted); }
.process-comment { display: grid; grid-template-columns: minmax(240px,.7fr) minmax(360px,1.3fr); gap: 28px; margin: 24px 0 42px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(18,48,68,.05); }
.process-comment h2 { margin: 4px 0 8px; color: var(--navy); }
.process-comment p { color: var(--muted); font-size: 13px; }
.process-comment form { display: grid; gap: 10px; }
.process-comment label { color: var(--navy); font-size: 12px; font-weight: 850; }
.process-comment textarea { box-sizing: border-box; width: 100%; resize: vertical; border: 1px solid #cbdbe3; border-radius: 10px; padding: 12px; font: inherit; }
.process-comment .button { justify-self: start; }
.comment-status { min-height: 20px; font-size: 12px; font-weight: 800; }
.comment-status.pending { color: var(--muted); }
.comment-status.success { color: #198754; }
.comment-status.error { color: #bd3145; }
.process-comment button:disabled { cursor: wait; opacity: .65; }

@media (max-width: 760px) {
  .revision-fields { grid-template-columns: 1fr; }
  .revision-steps dl { grid-template-columns: 1fr; }
  .process-comment { grid-template-columns: 1fr; }
}

@media print {
  .topbar, .no-print, .page-footer { display: none !important; }
  .page-shell { max-width: none; padding: 0; }
  .revision-section { break-inside: avoid; box-shadow: none; }
  .revision-diagram { height: 700px; }
}
