.aqueous-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(310px, 1fr);
  align-items: stretch;
  gap: 18px;
}
.stockroom { padding: 20px; min-width: 0; }
.stock-heading, .reagent-heading { display: flex; align-items: center; gap: 12px; }
.stock-heading { justify-content: space-between; margin-bottom: 16px; }
.stock-heading .stock-heading { margin: 0; flex-wrap: wrap; justify-content: flex-end; }
#all-stock[aria-pressed=true] { background: #e2ecd8; }
.stock-key { font-size: .8rem; color: var(--muted); }
.stock-key::before {
  content: ''; display: inline-block; width: 9px; height: 9px;
  background: #cadeb6; margin-right: 6px; border-radius: 2px;
}
.table-scroll, .notebook-scroll, .archive-details { overflow-x: auto; }
#elements { display: grid; grid-template-columns: repeat(18, minmax(0, 1fr)); gap: 3px; min-width: 470px; }
.element {
  display: flex; flex-direction: column; justify-content: center; padding: 2px 3px;
  border: 1px solid #dfe3d9; border-radius: 3px; color: #647368; background: #f1f3eb;
  text-align: left; min-height: 29px; line-height: 1.05;
}
.element small { font: 8px/1 ui-monospace, monospace; }
.element b { font-size: clamp(11px, 1.1vw, 16px); }
button.element.in-stock { background: #dcecc9; border-color: #a4bd92; color: #203e30; }
button.element:hover { border-color: #4d714e; }
button.element[aria-pressed=true] { color: white; background: #265447; border-color: #19382e; }
.element.range { font: 9px/1.1 ui-monospace, monospace; background: transparent; align-items: center; border: 0; padding: 0; }
#dose-form { margin-top: 17px; border-top: 1px solid var(--line); padding-top: 15px; }
#element-tile {
  display: grid; place-items: center; background: #e1eed4; color: #264f3a;
  width: 42px; height: 42px; border-radius: 5px; font-size: 22px;
}
.reagent-heading h3 { margin: 0; font-size: 1rem; }
.reagent-heading small, .solution-metrics small { color: var(--muted); font-size: .78rem; }
#dose-controls { display: grid; grid-template-columns: minmax(0,2fr) minmax(90px,1fr) auto; gap: 10px; align-items: end; margin-top: 12px; }
.beaker-card { overflow: hidden; display: flex; flex-direction: column; }
.beaker-card .viewport-top { color: #f3f8ee; }
.beaker-card .viewport-top span { font: .77rem ui-monospace, monospace; letter-spacing: .08em; color: #c3deb5; }
.beaker-stage {
  position: relative;
  flex: 1; min-height: 140px; display: grid; place-items: center;
  background-color: #303638;
  background-image: linear-gradient(#dbeddd0c 1px, transparent 1px), linear-gradient(90deg, #dbeddd0c 1px, transparent 1px),
    radial-gradient(ellipse at center, #626c70, transparent 72%);
  background-size: 20px 20px, 20px 20px, auto;
}
.glass {
  position: relative; width: 108px; height: 107px; border: 2px solid #c6d3d7;
  border-radius: 3px 3px 17px 17px / 5px 5px 11px 11px;
  background: linear-gradient(90deg,#ffffff26,transparent 16%,transparent 83%,#ffffff26);
  box-shadow: 0 10px 10px -5px #142f27;
}
.glass::before { content: ''; position: absolute; left: -6px; right: -2px; top: -4px; height: 5px; border-radius: 50%; background: #707a7f; border: 1px solid #d1dce0; }
.liquid { position: absolute; inset: 34% 2px 2px; background: linear-gradient(90deg,#cbd9df2b,#e8eff345 25%,#b8c9d138); border-radius: 0 0 12px 12px / 0 0 8px 8px; }
.liquid::before { content: ''; position: absolute; inset: -3px 0 auto; height: 6px; border-radius: 50%; background: #ebf3f54d; }
.precipitate { position: absolute; left: 8%; right: 8%; bottom: 0; height: 5px; border-radius: 50% 50% 7px 7px; background: radial-gradient(ellipse at center,#fffdf2 0 35%,#d8d1ba 72%,#b8af98); box-shadow: 0 -1px 3px #ffffff88; }
.precipitate[hidden] { display: none; }
.graduations { position: absolute; inset: 13% 10px 12% auto; width: 17px; background: repeating-linear-gradient(0deg, transparent 0 9px,#eff5f8bb 9px 10px); }
.beaker-stage { padding: 36px 0; }
#solution-color, .backdrop-control {
  position: absolute; color: #eef4ef; font-size: .76rem; line-height: 1.2;
}
#solution-color { top: 10px; left: 14px; }
.backdrop-control { right: 12px; bottom: 8px; display: flex; align-items: center; gap: 6px; }
.backdrop-control select { width: auto; padding: 2px 20px 2px 6px; margin: 0; min-height: 24px; font-size: .75rem; }
.beaker-stage[data-backdrop=white] { background: #fafaf8; }
.beaker-stage[data-backdrop=white] :is(#solution-color, .backdrop-control) { color: #414944; }
.beaker-stage[data-backdrop=white] .glass { border-color: #8f9795; box-shadow: 0 10px 12px -9px #69736d; }
.beaker-stage[data-backdrop=white] .liquid { background: linear-gradient(90deg,#a3aaa722,#fff5,#a3aaa722); }
.beaker-stage[data-backdrop=white] .liquid::before { background: #7f888539; }
.beaker-stage[data-backdrop=white] .graduations { background: repeating-linear-gradient(0deg, transparent 0 9px,#87938c 9px 10px); }
.inventory-groups { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,230px),1fr)); gap: 20px; }
.inventory-groups h4 { margin: 4px 0; font-size: .9rem; }
.quantity-list {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 3px 12px;
  font-size: .87rem; margin: 6px 0 10px; max-width: 570px;
}
.quantity-list dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.species-inventory { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; }
.species-inventory summary { cursor: pointer; font-weight: 650; }
.species-inventory p { font-size: .875rem; color: var(--muted); }
.solution-metrics { display: grid; grid-template-columns: .9fr .9fr 1.4fr; background: #21473c; color: white; }
.solution-metrics div { padding: 9px 12px; }
.solution-metrics div + div { border-left: 1px solid #49685e; }
.solution-metrics small { display: block; color: #d4e3d6; }
.solution-metrics strong { font: 650 1.12rem ui-monospace, monospace; }
.bench-controls { padding: 16px 18px; }
.bench-controls fieldset { display: flex; align-items: end; gap: 12px; }
.bench-controls fieldset label { min-width: 0; flex: 1; }
.bench-controls fieldset button { min-width: 132px; }
#water-form { margin-top: 10px; }
#titration-controls { display: flex; align-items: end; gap: 12px; }
#titration-controls label { width: 140px; }
#titration-controls button { flex: 0 0 auto; }
.dose-curve { margin: 22px 0 0; max-width: 660px; }
.dose-curve figcaption { font-weight: 650; }
.dose-curve svg { display: block; width: 100%; margin-top: 8px; }
.dose-curve text { font: 12px system-ui, sans-serif; fill: var(--muted); }
.notebook, .archive-run { margin-top: 18px; }
.notebook { padding: 18px 20px; }
.notebook h2 { margin-bottom: 12px; }
table { width: 100%; font-size: .875rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .78rem; font-weight: 600; }
td:nth-child(-n+2), th:nth-child(-n+2) { text-align: left; }
tbody tr:last-child td { border: 0; }
.archive-run { margin: 0 0 12px; }
.archive-details { padding: 0 20px 14px; font-size: .875rem; }
.archive-details summary { cursor: pointer; font-weight: 650; }
.archive-details table { margin-top: 10px; }
.verify-result { margin: 0 20px 10px; color: #315c45; }
.verify-result:empty { display: none; }
@media(max-width: 940px) { .aqueous-layout { grid-template-columns: 1fr; } }
@media(max-width: 600px) {
  .top-inner { flex-wrap: wrap; padding-top: 10px; padding-bottom: 8px; }
  .top nav { gap: 2px; }
  .stockroom, .notebook { padding: 14px; }
  #dose-controls { grid-template-columns: 1fr 85px; }
  #dose-controls button { grid-column: span 2; }
  .notebook table { min-width: 465px; }
}
