.study-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.study-section h4, .study-details h4 {
  margin: 0 0 .65rem;
  font-size: 1.04rem;
}
.study-details > summary {
  color: var(--deep);
  cursor: pointer;
  font-weight: 700;
  font-size: 1.08rem;
}
.study-field, .study-checks {
  min-width: 0;
  margin: .9rem 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .55rem .7rem;
}
.study-field legend, .study-checks legend {
  color: var(--deep);
  font-size: .83rem;
  font-weight: 650;
}
.study-field-grid, .study-sliders {
  display: grid;
  gap: .55rem;
}
.study-field-grid {
  grid-template-columns: repeat(auto-fit,minmax(76px,1fr));
}
.study-field-grid label, .study-sliders label {
  display: grid;
  min-width: 0;
  gap: .25rem;
  color: var(--muted);
  font-size: .83rem;
}
.study-field input[type=number], .study-matrix-input input {
  width: 100%;
  min-width: 0;
  padding: .4rem;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 6px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.study-sliders {
  margin: .8rem 0;
}
.study-sliders label {
  grid-template-columns: 1fr auto;
}
.study-sliders input[type=range] {
  grid-column: 1 / -1;
  padding: 0;
  width: 100%;
  accent-color: var(--teal);
}
.study-toolbar, .study-pair {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1rem;
  align-items: center;
  margin: .7rem 0;
}
.study-toolbar select, .study-details select {
  border: 1px solid var(--line);
  padding: .4rem .55rem;
  border-radius: 6px;
  color: var(--ink);
  background: var(--white);
  max-width: 100%;
}
.study-toolbar button[aria-pressed=true], #model-offset[aria-pressed=true] {
  background: var(--deep);
  border-color: var(--deep);
  color: var(--white);
}
.study-matrix {
  display: inline-block;
  position: relative;
  max-width: 100%;
  padding: 0 .32rem;
  vertical-align: middle;
  overflow: auto;
  font-variant-numeric: tabular-nums;
}
.study-matrix::before, .study-matrix::after {
  content: '';
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: .3rem;
  border: solid var(--teal);
  border-width: 1px 0;
  pointer-events: none;
}
.study-matrix::before {left: 0; border-left-width: 1px;}
.study-matrix::after {right: 0; border-right-width: 1px;}
.study-matrix table {border-spacing: 3px;}
.study-matrix td {
  min-width: 2rem;
  padding: .25rem .4rem;
  text-align: center;
  border-radius: 4px;
  background: #f3f6f0;
}
.study-matrix .study-hit {background: #d0ebce; color: #183f34;}
.study-matrix .study-pending {background: #f5e3cd;}
.study-terms {margin: .85rem 0; padding-left: 1.45rem;}
.study-terms small {color: var(--muted);}
.study-checks {margin: 0;}
.study-checks label {margin-right: .35rem;}
.study-table-wrap {overflow-x: auto; max-width: 100%;}
.study-table-wrap th {min-width: 5rem;}
.study-plane {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: #f3f6ef;
  font-size: 12px;
}
.study-plane text {font-variant-numeric: tabular-nums;}
.drag-plane {touch-action: none;}
.drag-plane circle[data-vector] {cursor: grab;}
.drag-plane circle[data-vector]:focus {stroke: #273e5a; stroke-width: 4px;}
.sarrus-plane {max-width: 420px;}
.sarrus-plane[data-layout=rows] {max-width: 280px;}
.sarrus-symbol {fill: var(--muted);}
.volume-plane {max-width: 260px;}
.study-readings {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(145px,1fr));
  gap: .6rem;
}
.study-readings div {
  min-width: 0;
  padding: .65rem;
  border-radius: 8px;
  background: var(--soft);
}
.study-readings dt {font-size: .81rem; color: var(--muted);}
.study-readings dd {margin: 0; font-weight: 650; overflow-wrap: anywhere;}
.cramer-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,155px),1fr));
  gap: .8rem;
  margin: .8rem 0;
}
.cramer-columns > div {min-width: 0;}
@media (max-width: 900px) {
  #lab-nav {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
  #lab-nav a {min-width: 0;}
}
@media (max-width: 420px) {
  #lab-nav {grid-template-columns: repeat(2,minmax(0,1fr));}
  .study-matrix td {min-width: 1.65rem; padding: .2rem .28rem;}
  .study-toolbar {gap: .5rem;}
}
