/* w-matrix.css — layout for the "matrix" widget: one large pane and a side panel. */
.w-matrix-body { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, 1fr); gap: 1px; background: var(--line); }
@media (max-width: 860px) { .w-matrix-body { grid-template-columns: minmax(0, 1fr); } }
.w-matrix-pane { min-width: 0; }
.w-matrix-panel { background: var(--panel-solid); padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.w-matrix-h { margin: 0 0 6px; font-family: var(--mono); font-size: 0.64rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.w-matrix-table { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 22px; padding: 6px 18px 8px; }
.w-matrix-table::before, .w-matrix-table::after {
  content: ""; position: absolute; top: 22px; bottom: 2px; width: 9px;
  border: 2px solid var(--line-strong);
}
.w-matrix-table::before { left: 0; border-right: 0; border-radius: 4px 0 0 4px; }
.w-matrix-table::after { right: 0; border-left: 0; border-radius: 0 4px 4px 0; }
.w-matrix-colhead { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; color: var(--gold); text-align: center; }
.w-matrix-table .hml-control { min-width: 0; max-width: none; }
.w-matrix-table .hml-control__label { align-items: baseline; }
.w-matrix-table .hml-control__label span { font-family: var(--mono); color: var(--quiet); }
.w-matrix-table .hml-control__label output { font-size: 1.5rem; font-weight: 500; color: var(--text); line-height: 1.1; }
.w-matrix-block--two .w-matrix-colhead { color: var(--muted); }
.w-matrix-math {
  margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: rgba(3, 11, 18, 0.7);
  font-family: var(--mono); font-size: 0.82rem; line-height: 1.75; color: var(--soft); white-space: pre-wrap;
}
.w-matrix-math code { color: var(--hml-sig); font-size: 1em; }
.w-matrix-math b { color: var(--gold); font-weight: 600; }
.w-matrix-second { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.w-matrix-second[hidden] { display: none; }
.w-matrix-comb { padding: 10px 12px; border: 1px solid rgba(255, 215, 106, 0.4); border-radius: var(--r-s); background: rgba(255, 215, 106, 0.05); }
.w-matrix-comb__say { margin: 0 0 6px; color: var(--text); font-size: 0.86rem; font-weight: 650; }
.w-matrix-comb__grid { display: grid; grid-template-columns: repeat(2, auto); justify-content: start; gap: 2px 26px; font-family: var(--mono); font-size: 1.1rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.w-matrix-presets .hml-btn { padding: 8px 13px; }
.hml-readout[hidden] { display: none; }
.hml-handle[hidden] { display: none; }
@media (max-width: 520px) { .w-matrix-math { font-size: 0.72rem; white-space: pre; overflow-x: auto; } .w-matrix-panel { padding: 12px 14px 14px; } }
.w-matrix-key { margin: auto 0 0; padding: 0; list-style: none; display: grid; gap: 6px; color: var(--muted); font-size: 0.8rem; }
.w-matrix-key li { margin: 0; display: flex; align-items: center; gap: 10px; }
.w-matrix-key__mark { flex: none; width: 20px; height: 12px; }
.w-matrix-key__mark--before { border-top: 1px solid rgba(160, 214, 230, 0.35); border-bottom: 1px solid rgba(160, 214, 230, 0.35); height: 8px; }
.w-matrix-key__mark--after { border-top: 2px solid rgba(92, 232, 241, 0.8); border-bottom: 2px solid rgba(92, 232, 241, 0.8); height: 9px; }
.w-matrix-key__mark--square { background: rgba(41, 212, 227, 0.3); border-radius: 2px; }
.w-matrix-key__mark--arrow { height: 3px; background: var(--gold); border-radius: 2px; }
.w-matrix-key__mark--probe { width: 12px; height: 12px; margin: 0 4px; border: 2px solid var(--gold); border-radius: 50%; }
@media (max-width: 860px) { .w-matrix-key { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.w-matrix-key__mark--cut { height: 0; border-top: 2px dashed rgba(237, 248, 251, 0.75); }
.w-matrix-pane { display: flex; flex-direction: column; justify-content: center; }
.w-matrix-canvas { position: relative; width: 100%; }
