:root{
    --bg:#07111c;
    --panel:#0c1723;
    --panel2:#101f2e;
    --border:#263b50;
    --text:#e7eef5;
    --muted:#9db0c0;
    --blue:#38bdf8;
    --green:#34d399;
    --yellow:#facc15;
    --orange:#fb923c;
    --red:#fb7185;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
    margin:0;
    background:var(--bg);
    color:var(--text);
    font-family:Inter,Segoe UI,Arial,sans-serif;
    line-height:1.58;
}
a{color:#7dd3fc}
.sarg-header{
    position:sticky;
    top:0;
    z-index:20;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    min-height:64px;
    padding:10px 18px;
    border-bottom:1px solid var(--border);
    background:rgba(7,17,28,.96);
    backdrop-filter:blur(8px);
}
.sarg-brand{
    color:#fff;
    text-decoration:none;
    font-weight:900;
    white-space:nowrap;
}
.sarg-brand span{color:var(--blue)}
.sarg-header-title{min-width:0;flex:1}
.sarg-header-title strong,
.sarg-header-title span{display:block}
.sarg-header-title strong{font-size:14px}
.sarg-header-title span{color:var(--muted);font-size:11px}
.sarg-actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:7px;
    flex-wrap:wrap;
}
.sarg-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    min-height:34px;
    padding:7px 10px;
    border:1px solid #35506a;
    border-radius:8px;
    background:#0e1d2b;
    color:#dce9f3;
    text-decoration:none;
    font-size:11px;
    font-weight:800;
    cursor:pointer;
}
.sarg-btn:hover{border-color:var(--blue);background:#102b3d}
.sarg-btn.primary{border-color:#0ea5e9;background:#075985;color:#fff}
.sarg-layout{
    width:min(1420px,100%);
    margin:0 auto;
    display:grid;
    grid-template-columns:260px minmax(0,1fr);
    gap:18px;
    padding:18px;
}
.sarg-toc{
    position:sticky;
    top:82px;
    align-self:start;
    max-height:calc(100vh - 100px);
    overflow:auto;
    padding:14px;
    border:1px solid var(--border);
    border-radius:12px;
    background:var(--panel);
}
.sarg-toc h2{margin:0 0 10px;font-size:14px}
.sarg-toc a{
    display:block;
    padding:5px 7px;
    border-radius:6px;
    color:#abc0d1;
    text-decoration:none;
    font-size:11px;
}
.sarg-toc a:hover{background:#10283a;color:#fff}
.sarg-main{min-width:0}
.sarg-hero,.sarg-section{
    margin-bottom:14px;
    padding:20px;
    border:1px solid var(--border);
    border-radius:13px;
    background:var(--panel);
    box-shadow:0 12px 30px rgba(0,0,0,.13);
}
.sarg-hero{
    background:
        radial-gradient(circle at 85% 20%,rgba(56,189,248,.13),transparent 33%),
        var(--panel);
}
.sarg-kicker{
    color:var(--blue);
    font-size:11px;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.08em;
}
.sarg-hero h1{margin:4px 0 8px;font-size:28px;line-height:1.15}
.sarg-hero p{max-width:900px;margin:0;color:#b6c7d4}
.sarg-section h2{margin:0 0 9px;font-size:20px}
.sarg-section h3{margin:18px 0 7px;font-size:15px;color:#edf6fc}
.sarg-section p{margin:7px 0;color:#c3d1dc}
.sarg-lead{font-size:14px}
.sarg-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
    margin-top:12px;
}
.sarg-card{
    padding:13px;
    border:1px solid #30465d;
    border-radius:10px;
    background:var(--panel2);
}
.sarg-card h3{margin:0 0 5px;font-size:13px}
.sarg-card p{margin:0;font-size:12px;color:#adc0cf}
.sarg-steps{
    counter-reset:sarg-step;
    display:grid;
    gap:9px;
    margin:12px 0;
}
.sarg-step{
    position:relative;
    min-height:48px;
    padding:10px 12px 10px 48px;
    border:1px solid #2e4358;
    border-radius:9px;
    background:#0b1723;
}
.sarg-step::before{
    counter-increment:sarg-step;
    content:counter(sarg-step);
    position:absolute;
    left:11px;
    top:10px;
    width:26px;
    height:26px;
    display:grid;
    place-items:center;
    border-radius:50%;
    background:#075985;
    color:#fff;
    font-size:11px;
    font-weight:900;
}
.sarg-step strong{color:#fff}
.sarg-note,.sarg-warning,.sarg-success{
    margin:12px 0;
    padding:11px 13px;
    border-left:4px solid var(--blue);
    border-radius:7px;
    background:#0b1d2a;
    color:#c7d7e2;
}
.sarg-warning{border-left-color:var(--yellow);background:#26220b}
.sarg-success{border-left-color:var(--green);background:#0b251e}
code,.sarg-code{
    color:#d9f4ff;
    font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
.sarg-equation{
    margin:10px 0;
    padding:11px;
    border:1px solid #334b62;
    border-radius:8px;
    background:#07131e;
    text-align:center;
    color:#fff;
    font:800 14px ui-monospace,SFMono-Regular,Menlo,monospace;
}
.sarg-table-wrap{overflow:auto;margin:10px 0}
.sarg-table{
    width:100%;
    border-collapse:collapse;
    font-size:12px;
}
.sarg-table th,.sarg-table td{
    padding:8px 9px;
    border:1px solid #30465d;
    text-align:left;
    vertical-align:top;
}
.sarg-table th{background:#10283a;color:#eaf6fd}
.sarg-table td{color:#bdccd8}
.sarg-flow{
    margin:12px 0;
    padding:14px;
    overflow:auto;
    border:1px solid #2c4359;
    border-radius:9px;
    background:#07131e;
    color:#dceaf4;
    white-space:pre;
    font:700 12px/1.45 ui-monospace,SFMono-Regular,Menlo,monospace;
}
.sarg-figure{
    margin:14px 0 18px;
    padding:10px;
    border:1px solid #30465d;
    border-radius:11px;
    background:#f8fafc;
}
.sarg-figure img{
    display:block;
    width:100%;
    height:auto;
    max-height:720px;
    object-fit:contain;
    margin:0 auto;
}
.sarg-figure figcaption{
    margin-top:8px;
    color:#60758a;
    font-size:10.5px;
    line-height:1.4;
    text-align:center;
}
.sarg-checklist{
    margin:8px 0;
    padding-left:22px;
    color:#c2d0db;
}
.sarg-checklist li{margin:5px 0}
.sarg-module-tag{
    display:inline-block;
    margin-right:5px;
    padding:2px 7px;
    border:1px solid #35506a;
    border-radius:999px;
    color:#bdeaff;
    font-size:10px;
    font-weight:900;
}
.sarg-top{
    display:inline-block;
    margin-top:10px;
    color:#8cb5ce;
    font-size:10px;
    text-decoration:none;
}
.sarg-footer{
    padding:18px;
    border-top:1px solid var(--border);
    color:#72899c;
    text-align:center;
    font-size:10px;
}
@media(max-width:900px){
    .sarg-layout{grid-template-columns:1fr;padding:10px}
    .sarg-toc{position:relative;top:auto;max-height:none}
    .sarg-grid{grid-template-columns:1fr}
    .sarg-header{align-items:flex-start;flex-wrap:wrap}
    .sarg-header-title{order:3;flex-basis:100%}
}
@media print{
    body{background:#fff;color:#111;font-family:Arial,sans-serif}
    .sarg-header,.sarg-toc,.sarg-footer,.sarg-top{display:none!important}
    .sarg-layout{display:block;width:auto;margin:0;padding:0}
    .sarg-hero,.sarg-section{
        margin:0 0 10mm;
        padding:0;
        border:0;
        box-shadow:none;
        background:#fff;
        break-inside:auto;
    }
    .sarg-hero h1,.sarg-section h2,.sarg-section h3{color:#111}
    .sarg-hero p,.sarg-section p,.sarg-card p,.sarg-table td,.sarg-checklist{color:#222}
    .sarg-card,.sarg-step,.sarg-note,.sarg-warning,.sarg-success,.sarg-flow,.sarg-equation,.sarg-figure{
        border:1px solid #999;
        background:#fff;
        color:#111;
        break-inside:avoid;
    }
    .sarg-table th{background:#eee;color:#111}
    .sarg-table th,.sarg-table td{border-color:#999}
    .sarg-figure{padding:0;border:0;background:#fff}
    .sarg-figure figcaption{color:#333}
    a{color:#111;text-decoration:none}
    @page{size:A4;margin:16mm}
}

.sarg-admin-mode{
    display:inline-flex;
    align-items:center;
    min-height:34px;
    padding:6px 9px;
    border:1px solid #d97706;
    border-radius:8px;
    background:#3b2507;
    color:#fde68a;
    font-size:10px;
    font-weight:900;
    white-space:nowrap;
}
.sarg-editor-actions{
    margin:7px 0 10px;
}
.sarg-scheme-actions{
    margin:10px 0 0;
    padding-top:9px;
    border-top:1px dashed #35506a;
}
@media print{
    .trainer-admin-actions,.sarg-admin-mode{display:none!important}
}

.sarg-scene-host{
    width:100%;
    min-height:180px;
    overflow:hidden;
}
.sarg-scene-host>svg{
    display:block;
    width:100%;
    height:auto;
    max-height:760px;
    margin:0 auto;
}
@media print{
    .sarg-scene-host{min-height:0}
    .sarg-scene-host>svg{max-height:none}
}
