/* Тест миші */
.ms-top{flex-wrap:wrap}
.ms-note{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--mut);min-width:0}
.ms-note .ic{color:var(--acc)}

.ms-stage{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:12px}
.ms-zone{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-height:360px;padding:18px;border-radius:18px;background:var(--soft);border:2px dashed transparent;cursor:crosshair;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:manipulation;transition:border-color .15s}
.ms-zone:hover{border-color:#D5D8E4}
.ms-svg{width:auto;height:290px;max-width:100%;overflow:visible}
.ms-zone-t{font-size:13px;font-weight:500;color:var(--mut);text-align:center;max-width:38ch;line-height:1.45}

/* Схема миші: базові кольори й стани кнопок */
.ms-body{fill:#fff}
.ms-outline{fill:none;stroke:#C9CDDB;stroke-width:2}
.ms-cord{fill:none;stroke:#C9CDDB;stroke-width:3;stroke-linecap:round}
.ms-part{fill:#EEF0F7;transition:fill .12s}
.ms-side,.ms-wheel{stroke:#C9CDDB;stroke-width:1.5}
.ms-ridges{fill:none;stroke:#B7BBCB;stroke-width:1.6;stroke-linecap:round;pointer-events:none}
.ms-dir{fill:#C9CDDB;transition:fill .12s}
.ms-part.is-tested{fill:#DCFCE7}
.ms-side.is-tested,.ms-wheel.is-tested{stroke:#8FD3A8}
.ms-part.is-bad{fill:#FEE2E2}
.ms-side.is-bad,.ms-wheel.is-bad{stroke:#F2A7A7}
.ms-part.is-down{fill:var(--acc);stroke:var(--acc)}
.ms-wheel.is-down~.ms-ridges{stroke:rgba(255,255,255,.65)}
.ms-dir.is-tested{fill:var(--ok)}
.ms-dir.is-active{fill:var(--acc)}

/* Список кнопок */
.ms-list{list-style:none;display:flex;flex-direction:column;gap:2px;margin:0;padding:10px;border:1px solid var(--line);border-radius:18px;min-width:0}
.ms-row{display:grid;grid-template-columns:10px minmax(0,1fr) auto 40px;align-items:center;gap:10px;padding:7px 10px;border-radius:10px;font-size:14px;font-weight:500;transition:background .12s}
.ms-row span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ms-row i{width:10px;height:10px;border-radius:50%;background:#D5D8E4;transition:background .12s}
.ms-row code{font:500 12px ui-monospace,SFMono-Regular,Consolas,monospace;color:var(--mut);white-space:nowrap}
.ms-row b{text-align:right;font-variant-numeric:tabular-nums}
.ms-row.ms-head{padding-block:2px 6px;font-size:12px;color:var(--mut)}
.ms-head i{visibility:hidden}
.ms-head b{font-weight:500}
.ms-sep{height:1px;margin:4px 10px;background:var(--line)}
.ms-row.is-tested i{background:var(--ok)}
.ms-row.is-bad{background:#FEF0F0}
.ms-row.is-bad i{background:var(--bad)}
.ms-row.is-down,.ms-row.is-active{background:var(--acc-l)}
.ms-row.is-down i,.ms-row.is-active i{background:var(--acc)}

/* Остання подія */
.ms-last{display:flex;align-items:center;gap:18px;margin-top:12px;padding:12px 16px;border:1px solid var(--line);border-radius:16px}
.ms-codes{display:flex;flex-wrap:wrap;gap:8px 22px;margin:0;flex:1;min-width:0}
.ms-codes dt{font:500 12px ui-monospace,SFMono-Regular,Consolas,monospace;color:var(--mut)}
.ms-codes .ms-ev dt{font-family:inherit;font-weight:400}
.ms-codes dd{margin:2px 0 0;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
.ms-ev{min-width:190px}
.ms-reset{height:44px;padding:0 18px;flex:none}

.ms .tool-grid{grid-template-columns:1fr 1fr}
.ms .stats{display:grid;grid-template-columns:1fr 1fr}
.ms .stats div{min-width:0}
.ms.has-dbl .ms-stat-dbl{border-color:#F5B5B5;background:#FEF0F0}
.ms.has-dbl [data-ms-dbl]{color:var(--bad)}

/* Частота опитування й DPI */
.ms-panels{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}
.ms-card{display:flex;flex-direction:column;gap:10px;min-width:0;padding:16px;border:1px solid var(--line);border-radius:18px}
.ms-card-h{display:flex;align-items:center;gap:8px;font-size:15px;font-weight:600}
.ms-card-h .ic{color:var(--acc)}
.ms-card-p{font-size:13px;color:var(--mut);line-height:1.5}
.ms-card-note{font-size:12px;color:var(--mut);line-height:1.5;padding:8px 10px;border-radius:10px;background:var(--soft)}
.ms-card-note[hidden]{display:none}
.ms-big{display:flex;align-items:baseline;gap:6px;margin-top:auto}
.ms-big b{font-size:34px;line-height:1;font-weight:700;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.ms-big span{font-size:14px;font-weight:600;color:var(--mut)}
.ms-mini{display:flex;flex-wrap:wrap;gap:6px 20px;margin:0}
.ms-mini dt{font-size:12px;color:var(--mut)}
.ms-mini dd{margin:2px 0 0;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
.ms-dpi-row{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
.ms-dist{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:500;color:var(--mut)}
.ms-dist input{width:84px;height:36px;padding:0 10px;border:1px solid var(--line);border-radius:10px;background:#fff;font:inherit;font-size:15px;font-weight:600;color:var(--ink)}
.ms-dist input:focus{border-color:var(--acc);outline:0;box-shadow:0 0 0 3px var(--acc-l)}
.ms-strip{position:relative;display:grid;place-items:center;height:58px;border-radius:12px;overflow:hidden;cursor:ew-resize;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:none;
  background:repeating-linear-gradient(90deg,#C9CDDB 0 1px,transparent 1px 10px) left bottom/100% 9px no-repeat,repeating-linear-gradient(90deg,#B7BBCB 0 1px,transparent 1px 50px) left bottom/100% 16px no-repeat,var(--soft)}
.ms-strip-fill{position:absolute;top:0;bottom:0;left:0;width:0;background:var(--acc-l);border-inline:2px solid var(--acc);opacity:0;transition:opacity .2s}
.ms.is-dragging .ms-strip-fill{opacity:1;transition:none}
.ms-strip-t{position:relative;padding:0 12px;font-size:13px;font-weight:600;color:var(--mut);text-align:center;line-height:1.35}
.ms.is-dragging .ms-strip-t{color:var(--acc);font-variant-numeric:tabular-nums}

/* Стан «хибний подвійний клік» */
.tool[data-state=double] .diag{background:#FEF0F0}
.tool[data-state=double] .diag-ic{color:var(--bad)}
.tool[data-state=double] .status i{background:var(--bad)}

@media (max-width:760px){
  .ms-stage{grid-template-columns:1fr}
  .ms-zone{min-height:300px;padding:14px}
  .ms-svg{height:230px}
  .ms .tool-grid{grid-template-columns:1fr}
  .ms .stats div{padding:10px 12px}
  .ms-last{flex-wrap:wrap;gap:12px}
  .ms-ev{min-width:0;width:100%}
  .ms-reset{width:100%}
  .ms-panels{grid-template-columns:1fr}
}
