/* ============================================================
   📐 SCHEMOS LAPAS (js/schema-sheet.js + js/schema-symbol.js)
   Lapas visada BALTAS (kaip tikras brėžinys) — nepriklausomai nuo temos.
   ============================================================ */

.sch-overlay {
    display: none;
    align-items: stretch;
    justify-content: stretch;
    padding: 18px;
}

.sch-dialog {
    /* Absoliučiai pozicionuotas, kad panel-move.js leistų keisti dydį už kraštų
       (Domantas 2026-09-02) — įprastai užima visą ekraną kaip ir anksčiau. */
    position: absolute;
    inset: 18px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

/* ---------------------------------------------------------------- antraštė */

.sch-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    flex-wrap: wrap;
}

.sch-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-bright);
    white-space: nowrap;
}

.sch-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

/* Mygtukų GRUPĖ — vientisas blokas. Vyniojantis juostai grupė keliasi VISA, o ne
   lūžta per vidurį; be to iš karto matyti, kurie mygtukai priklauso vienas kitam. */
.sch-grp {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 9px;
}
.sch-grp .sch-btn {
    border: none;
    background: transparent;
    border-radius: 7px;
    padding: 5px 9px;
}
.sch-grp .sch-btn:hover { background: var(--bg-hover); }
.sch-grp .sch-btn-primary { background: var(--primary); color: #fff; }
.sch-grp .sch-btn-primary:hover { background: var(--primary-dark); }
.sch-grp .sch-btn.is-on { background: var(--primary); color: #fff; }
.sch-grp .sch-btn.is-done { color: var(--primary); font-weight: 600; }
.sch-grp .sch-btn.is-done:hover { background: var(--primary); color: #fff; }
.sch-grp .sch-btn-danger:hover { background: var(--accent-red); color: #fff; }
/* „Baigti" grupė nustumiama į dešinį kraštą — pabaigos veiksmai atskirai nuo darbo */
.sch-tarpas { flex: 1 1 12px; min-width: 0; }

/* 👁 Rodyti — varnelių meniu po mygtuku */
.sch-menu { position: relative; display: inline-flex; }
.sch-menu-pop {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
    min-width: 210px; padding: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
    display: flex; flex-direction: column; gap: 1px;
}
.sch-menu-pop[hidden] { display: none; }
.sch-menu-pop .sch-chk { padding: 6px 8px; border-radius: 6px; color: var(--text); }
.sch-menu-pop .sch-chk:hover { background: var(--bg-hover); }

.sch-btn {
    background: var(--bg-panel);
    color: var(--text);
    border: 1px solid var(--border-light);
    border-radius: var(--r-sm);
    padding: 5px 10px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    height: 28px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.sch-btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.sch-btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.sch-btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.sch-btn-danger:hover { background: var(--accent-red); border-color: var(--accent-red); color: #fff; }
/* ✅ Baigta — pagrindinis „sutvarkyk lapą" veiksmas, todėl išsiskiria */
.sch-btn.is-done { border-color: var(--primary); color: var(--primary); font-weight: 600; }
.sch-btn.is-done:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

.sch-sep { width: 1px; height: 20px; background: var(--border); margin: 0 2px; }

.sch-chk {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-dim);
    cursor: pointer;
    user-select: none;
}

.sch-zoom {
    font-family: var(--font-mono, monospace);
    font-size: 12px;
    color: var(--text-dim);
    min-width: 44px;
    text-align: center;
}

/* ---------------------------------------------------------------- kūnas */

.sch-body {
    flex: 1;
    display: flex;
    min-height: 0;
}

/* ---- biblioteka (kairė) ---- */

.sch-lib {
    width: 268px;
    flex: 0 0 268px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: var(--bg-panel);
    min-height: 0;
}

.sch-search {
    margin: 8px;
    padding: 7px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
}
.sch-search:focus { outline: none; border-color: var(--primary); }

.sch-lib-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 4px 12px;
}

.schl-bar {
    display: flex;
    gap: 6px;
    padding: 2px 4px 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}
.schl-groups {
    flex: 1;
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border-light);
    border-radius: var(--r-sm);
    padding: 6px 8px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
}
.schl-groups:hover { background: var(--bg-hover); border-color: var(--primary); }

.sch-lib-empty, .schl-more {
    padding: 14px 10px;
    color: var(--text-soft);
    font-size: 12px;
    text-align: center;
}

.schl-h {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: var(--r-xs);
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    user-select: none;
}
.schl-h:hover { background: var(--bg-hover); }
.schl-h2 { font-weight: 500; padding-left: 16px; color: var(--text-dim); }
.schl-ar { width: 10px; color: var(--text-soft); font-size: 10px; }
.schl-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schl-n {
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    color: var(--text-soft);
    background: var(--bg-card);
    border-radius: 8px;
    padding: 1px 6px;
}
.schl-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }

.schl-items { padding-left: 16px; }

.schl-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 8px;
    border-radius: var(--r-xs);
    cursor: grab;
    font-size: 12px;
    color: var(--text-dim);
}
.schl-item:hover { background: var(--bg-hover); color: var(--text); }
.schl-item:active { cursor: grabbing; }
.schl-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sch-prev {
    flex: 0 0 28px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 3px;
}
.sch-prev .sch-l, .sch-prev .sch-leg { fill: none; stroke: #111; stroke-width: 2.4; }
.sch-prev .sch-b { fill: #fff; stroke: #111; stroke-width: 2.4; }
.sch-prev .sch-f { fill: #111; stroke: #111; stroke-width: 1.6; }
.sch-prev .sch-t { fill: none; stroke: #111; stroke-width: 4; }
.sch-prev .sch-gl { fill: #111; text-anchor: middle; font-family: inherit; }

/* ---- lapas (dešinė) ---- */

.sch-canvas-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
    background: #6b6b66;
    overflow: hidden;
}

.sch-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: default;
    touch-action: none;
    user-select: none;
}

.sch-status {
    position: absolute;
    left: 10px;
    bottom: 10px;
    max-width: calc(100% - 20px);
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    font-size: 12px;
    border-radius: var(--r-sm);
    pointer-events: none;
}

/* ---------------------------------------------------------------- 📋 specifikacijos langelis
   Tėtis 2026-08-18: „ne ant lapo lentelės, o kad atidarytų viršuj dešinėj — ten rodytų
   viską, galima įvesti skaičių, kad pasižiūrėti pavadinimą." */

.sch-spec {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 344px;
    max-width: calc(100% - 20px);
    max-height: calc(100% - 20px);
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border: 1px solid var(--border-strong, var(--border));
    border-radius: 10px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.42);
    overflow: hidden;
    z-index: 4;
}

.sch-spec-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 8px 11px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}
.sch-spec-title { font-size: 13px; font-weight: 600; color: var(--text-bright); }

/* Dvi kortelės viename langelyje: specifikacija ir 🩺 patikra */
.sch-spec-tabb {
    background: none;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    color: var(--text-soft);
    font-family: inherit;
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
    white-space: nowrap;
}
.sch-spec-tabb:hover { color: var(--text-bright); }
.sch-spec-tabb.is-on { background: var(--bg-hover); border-color: var(--border); color: var(--text-bright); font-weight: 600; }
.sch-spec-head .sch-spec-count { flex: 1; text-align: right; }

/* 🩺 Patikros eilutė: priežastis + abi jungties pusės */
.sch-chk-row {
    padding: 9px 11px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    font-size: 12px;
    line-height: 1.45;
}
.sch-chk-row:hover { background: var(--bg-hover); }
.sch-chk-why { color: #E0A100; font-weight: 600; margin-bottom: 4px; }
/* ℹ Perėjimas tarp sistemų — ne klaida, todėl ramesnė spalva ir jokio punktyro lape */
.sch-chk-row.is-info .sch-chk-why { color: var(--text-soft); font-weight: 500; }
.sch-chk-s { color: var(--text); }
.sch-chk-p { display: block; font-size: 11px; color: var(--text-soft); }
.sch-spec-count { flex: 1; font-size: 11px; color: var(--text-soft); }
.sch-spec-x {
    background: none;
    border: none;
    color: var(--text-soft);
    font-size: 19px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
}
.sch-spec-x:hover { color: var(--text-bright); }

.sch-spec-find { padding: 8px; }
.sch-spec-find input {
    width: 100%;
    padding: 7px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
}
.sch-spec-find input:focus { outline: none; border-color: var(--primary); }

.sch-spec-hit {
    margin: 0 8px 8px;
    padding: 8px 10px;
    background: var(--bg-card);
    border-left: 3px solid var(--primary);
    border-radius: var(--r-sm);
    font-size: 13px;
    color: var(--text-bright);
    line-height: 1.4;
}
.sch-spec-hit b { font-size: 15px; margin-right: 4px; }
.sch-spec-code { display: block; font-size: 11px; color: var(--text-soft); margin-top: 2px; }

.sch-spec-list { flex: 1; overflow-y: auto; min-height: 0; }
.sch-spec-empty { padding: 16px 12px; text-align: center; font-size: 12px; color: var(--text-soft); line-height: 1.6; }
.sch-spec-empty .sch-btn { margin-top: 8px; }

.sch-spec-tab { width: 100%; border-collapse: collapse; font-size: 12px; }
.sch-spec-tab th {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    color: var(--text-dim);
    font-weight: 600;
    font-size: 11px;
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
}
.sch-spec-tab td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: top;
}
.sch-spec-tab tr { cursor: pointer; }
.sch-spec-tab tbody tr:hover td { background: var(--bg-hover); }
.sch-spec-tab tr.is-hi td { background: rgba(232, 93, 42, 0.18); }
.sch-spec-cn { width: 30px; text-align: center; font-weight: 700; color: var(--text-bright); }
.sch-spec-cd { width: 52px; text-align: center; color: var(--text-dim); }
.sch-spec-cq { width: 44px; text-align: center; color: var(--text-dim); }

.sch-btn.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------------------------------------------------------------- ženklai lape */

#sch-paper { filter: drop-shadow(0 3px 12px rgba(0, 0, 0, 0.35)); }

.sch-node { cursor: move; }
.sch-node .sch-l, .sch-node .sch-leg { fill: none; stroke: #111; stroke-width: 1.8; stroke-linecap: round; }
.sch-node .sch-b { fill: #fff; stroke: #111; stroke-width: 1.8; }
.sch-node .sch-f { fill: #111; stroke: #111; stroke-width: 1.2; }
.sch-node .sch-t { fill: none; stroke: #111; stroke-width: 3; }
.sch-node .sch-gl { fill: #111; text-anchor: middle; font-family: inherit; }
.sch-node .sch-dn { fill: #7a7a72; font-size: 10px; text-anchor: middle; font-family: inherit; }
.sch-node .sch-name { fill: #2a2a28; font-size: 11px; font-family: inherit; }

.sch-node.is-sel .sch-l, .sch-node.is-sel .sch-leg,
.sch-node.is-sel .sch-b, .sch-node.is-sel .sch-t { stroke: #E85D2A; }
.sch-node.is-sel .sch-f { fill: #E85D2A; stroke: #E85D2A; }
.sch-node.is-sel .sch-name { fill: #E85D2A; font-weight: 600; }

/* Pozicijos numeris prie detalės + specifikacijos lentelė (brėžinio tvarka) */
/* Numerio burbuliukas — piešinys, pelę gaudo tik nematomas `.sch-nr-hit`.
   Be `pointer-events: none` paspaudimas pakliūdavo į baltą apskritimą, o iš jo
   keliaudavo detalės grupei — ir vietoj numerio judėdavo visa detalė. */
.sch-node .sch-nr-lead { stroke: #9a9a92; stroke-width: 0.9; pointer-events: none; }
.sch-node .sch-nr-bg { fill: #fff; stroke: #111; stroke-width: 1.4; pointer-events: none; }
.sch-node .sch-nr { fill: #111; font-size: 11px; font-weight: 700; font-family: inherit; pointer-events: none; }
.sch-node .sch-nr-hit { fill: transparent; stroke: none; pointer-events: all; cursor: grab; }
.sch-node.is-sel .sch-nr-bg { stroke: #E85D2A; }
.sch-node.is-sel .sch-nr { fill: #E85D2A; }

#sch-legend-g .sch-leg-title { fill: #2a2a28; font-size: 12px; font-weight: 700; letter-spacing: .06em; font-family: inherit; }
#sch-legend-g .sch-leg-bg { fill: #fff; stroke: none; }
#sch-legend-g .sch-leg-head { fill: #f0efe9; stroke: none; }
#sch-legend-g .sch-leg-frame { fill: none; stroke: #111; stroke-width: 1.4; }
#sch-legend-g .sch-leg-line { stroke: #9a9a92; stroke-width: 0.7; }
#sch-legend-g .sch-leg-h { fill: #2a2a28; font-size: 10.5px; font-weight: 700; font-family: inherit; }
#sch-legend-g .sch-leg-nr { fill: #111; font-size: 11px; font-weight: 700; font-family: inherit; }
#sch-legend-g .sch-leg-t { fill: #2a2a28; font-size: 10.5px; font-family: inherit; }

.sch-node.is-missing rect { fill: #ffe8e4; stroke: #DC2626; stroke-width: 1.6; }
.sch-node.is-missing text { fill: #DC2626; font-size: 16px; font-family: inherit; }

.sch-dot {
    fill: #fff;
    stroke: #2563EB;
    stroke-width: 1.8;
    cursor: pointer;
}
.sch-dot:hover { fill: #2563EB; }
/* Sujungta = pilnas juodas mazgas ant linijos (du sutampantys atrodo kaip vienas) */
.sch-dot.is-linked { fill: #111; stroke: none; }
.sch-dot.is-linked:hover { fill: #E85D2A; }
/* ✥ Paspaustas ir laikomas taškiukas — paryškinamas TIK jis, kad matytum, ką „paėmei" */
.sch-dot.is-held { r: 8; fill: #E85D2A; stroke: #fff; stroke-width: 2.5; }

.sch-link {
    fill: none;
    stroke: #111;
    stroke-linejoin: round;
    stroke-linecap: round;
    pointer-events: none;
}
.sch-link.is-warn { stroke: #C47B00; stroke-dasharray: 7 4; }
.sch-link.is-sel { stroke: #E85D2A; }
.sch-link-hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; }

.sch-len { fill: #6b6b62; font-size: 11px; font-family: inherit; pointer-events: none; }
.sch-box { fill: rgba(232, 93, 42, 0.10); stroke: #E85D2A; stroke-width: 1.4; stroke-dasharray: 6 4; }

/* Pažymėtos grupės rėmelis — jį galima paimti bet kurioje vietoje ir stumti visas kartu */
.sch-selframe {
    fill: rgba(232, 93, 42, 0.06);
    stroke: #E85D2A;
    stroke-width: 1.2;
    stroke-dasharray: 9 5;
    cursor: move;
}
.sch-selframe:hover { fill: rgba(232, 93, 42, 0.13); }
.sch-selframe-t { fill: #E85D2A; font-size: 11px; font-weight: 600; font-family: inherit; pointer-events: none; }

/* 📋 Iš specifikacijos nuvesta detalė — pulsuojantis žiedas, kad iškart matytum, kur ji */
.sch-found {
    fill: none;
    stroke: #E85D2A;
    stroke-width: 2.4;
    pointer-events: none;
    animation: sch-found-pulse 1.4s ease-out infinite;
}
@keyframes sch-found-pulse {
    0%   { opacity: 1;   stroke-width: 2.4; }
    70%  { opacity: .25; stroke-width: 6; }
    100% { opacity: 1;   stroke-width: 2.4; }
}

/* ▣ Grupė įjungta — tempimas žymi, todėl ir žymeklis kitoks */
.sch-canvas.is-group { cursor: crosshair; }
/* ▭ / T laukiam, kur dėti užrašą */
.sch-canvas.is-note { cursor: crosshair; }

/* ✍️ Užrašai ant lapo: rėmelis (apibrėžta sritis) ir tekstas */
.sch-note-r {
    fill: none;
    stroke: #6b6b62;
    stroke-width: 1.2;
    stroke-dasharray: 10 6;
    pointer-events: visibleStroke;
    cursor: move;
}
.sch-note-t { fill: #111; font-family: inherit; font-weight: 600; cursor: move; }
.sch-note.is-sel .sch-note-r { stroke: #E85D2A; stroke-dasharray: none; }
.sch-note.is-sel .sch-note-t { fill: #E85D2A; }
.sch-note-h { fill: #fff; stroke: #E85D2A; stroke-width: 1.6; cursor: nwse-resize; }

/* Rėmelis aplink užrašą + linija (nuoroda) į detalę ar vietą */
.sch-note-b { fill: #fffdf7; stroke: #6b6b62; stroke-width: 1; cursor: move; }
.sch-note.is-sel .sch-note-b { stroke: #E85D2A; stroke-width: 1.4; }
.sch-note-l { stroke: #6b6b62; stroke-width: 1; }
.sch-note.is-sel .sch-note-l { stroke: #E85D2A; stroke-width: 1.4; }
.sch-note-ld { fill: #6b6b62; }
.sch-note.is-sel .sch-note-ld { fill: #E85D2A; }
.sch-note-lh { fill: #fff; stroke: #E85D2A; stroke-width: 1.6; cursor: crosshair; }

.sch-rubber { stroke: #2563EB; stroke-width: 1.6; stroke-dasharray: 5 4; fill: none; }
.sch-rubber.is-on { stroke: #16A34A; stroke-width: 2.4; stroke-dasharray: none; }
.sch-snap { fill: none; stroke: #16A34A; stroke-width: 2.4; }
/* Sulygiavimo linija tempiant (rodo, kad jungtis atsistojo tiesiai) */
.sch-guide { stroke: #16A34A; stroke-width: 1; stroke-dasharray: 6 4; opacity: .9; }

/* ---------------------------------------------------------------- patvirtinimas */

.sch-ask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.sch-ask-box {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    max-width: 460px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.sch-hist-box { max-width: 560px; width: 560px; }
.sch-hist-list { max-height: 46vh; overflow-y: auto; margin-bottom: 14px; }
.sch-hist-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text);
}
.sch-hist-row:hover { background: var(--bg-hover); }
.sch-hist-when { font-family: var(--font-mono, monospace); color: var(--text-dim); }
.sch-hist-n { flex: 1; color: var(--text-dim); }
.sch-hist-empty { padding: 18px; text-align: center; color: var(--text-soft); font-size: 13px; }

/* Nematoma pagriebimo zona ant ženklo (kad detalę būtų lengva paspausti/tempti) */
.sch-hit { fill: transparent; stroke: transparent; stroke-width: 13; pointer-events: all; }
/* Nematomas taškiuko taikinys — didesnis už patį taškiuką, kad pataikytum ir
   neprataikęs kelių pikselių (žr. schema-sheet.js paaiškinimą). */
.sch-dot-hit { fill: transparent; stroke: none; pointer-events: all; cursor: grab; }

/* Toli atitolinus dideliame lape — vietoj ženklo tik vietos dėžutė (žr. schema-sheet lod) */
.sch-lod { fill: #dfe3e8; stroke: #9aa3ad; stroke-width: 1.5; pointer-events: all; cursor: pointer; }
.sch-lod.is-sel { fill: #E85D2A; stroke: #E85D2A; }

/* 📋 lentelėje paspaustas numeris — ta detalė lape paryškinama */
.sch-node.is-found .sch-nr-bg { fill: #E85D2A; stroke: #E85D2A; }
.sch-node.is-found .sch-nr { fill: #fff; }
.sch-node.is-found .sch-b { fill: #ffe4d8; }
.sch-node.is-found .sch-nr-lead { stroke: #E85D2A; }

.sch-ask-title { font-size: 15px; font-weight: 600; color: var(--text-bright); margin-bottom: 8px; }
.sch-ask-text { font-size: 13px; color: var(--text-dim); line-height: 1.5; margin-bottom: 16px; }
.sch-ask-btns { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------------------------------------------------------------- siauras ekranas */

@media (max-width: 900px) {
    .sch-lib { width: 190px; flex: 0 0 190px; }
    .sch-dialog { inset: 6px; }
}

/* ── „✅ Baigti" vedlys: išvaizdos pasirinkimas + atsisiuntimas ────────────── */
.sch-body.no-lib .sch-lib { display: none; }

/* Vedlys prilipdytas prie apačios ir NEUŽTAMSINA lapo — kad iškart matytum, kaip atrodo */
#sch-fin { align-items: flex-end; background: transparent; pointer-events: none; }
#sch-fin .sch-ask-box, #sch-fin .sch-ask-box * { pointer-events: auto; }
#sch-fin .sch-ask-box {
    margin-bottom: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
    max-height: calc(100% - 24px);
    overflow-y: auto;
}
/* Pasirinkimų juostelė — kad iškart matytųsi, jog čia RENKIESI vieną iš trijų */
.sch-seg { display: inline-flex; border: 1px solid var(--border-light); border-radius: var(--r-sm); overflow: hidden; }
.sch-seg .sch-btn { border: none; border-right: 1px solid var(--border-light); border-radius: 0; padding: 7px 14px; }
.sch-seg .sch-btn:last-child { border-right: none; }
.sch-fin-box { max-width: 760px; width: min(94vw, 760px); }
.sch-fin-styles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 4px 0 14px;
}
.sch-fin-st {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 8px;
    background: var(--bg-panel);
    border: 2px solid var(--border-light);
    border-radius: var(--r-md, 10px);
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    text-align: left;
}
.sch-fin-st:hover { border-color: var(--border-strong); }
.sch-fin-st.is-on { border-color: var(--primary); }
.sch-fin-st svg { width: 100%; height: auto; border-radius: 4px; }
.sch-fin-styles { grid-template-columns: repeat(4, 1fr); }
.sch-fin-st b { font-size: 13px; }
.sch-fin-st span { font-size: 11px; color: var(--text-soft); line-height: 1.3; }
.sch-fin-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.sch-fin-lbl { font-size: 12px; color: var(--text-soft); margin-right: 6px; }
.sch-fin-dl { padding: 9px 14px; font-size: 13px; }
.sch-fin-note { font-size: 11px; color: var(--text-soft); line-height: 1.4; }
.sch-fin-trows { display: flex; flex-direction: column; gap: 6px; margin: -4px 0 10px; }
.sch-tr { display: flex; gap: 6px; align-items: center; }
.sch-tr input {
    flex: 1;
    min-width: 0;
    background: var(--bg-input, var(--bg-panel));
    border: 1px solid var(--border-light);
    border-radius: var(--r-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 12px;
    padding: 6px 8px;
}
.sch-tr input:focus { outline: none; border-color: var(--primary); }
.sch-tr .sch-btn { padding: 6px 9px; }
