.brew-lab {
  margin-top: 1.25rem;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid #4a3b2e;
  border-radius: 1rem;
  background: #211b16;
  color: #f8efe2;
  color-scheme: dark;
}
.brew-lab-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(1rem, 2.5vw, 2rem); align-items: start; }
.brew-lab-layout > div { min-width: 0; }
.brew-lab label { display: block; font-weight: 650; }
.brew-lab label span { color: #d8cbbd; font-weight: 400; }
.brew-lab :is(input, select, textarea) {
  display: block;
  width: 100%;
  margin-top: .3rem;
  padding: .55rem;
  border: 1px solid #786653;
  border-radius: .35rem;
  background: #211b16;
  color: inherit;
  font: inherit;
}
.brew-lab textarea[hidden] { display: none; }
.brew-lab :is(input, select) { min-height: 2.75rem; }
.brew-lab textarea { resize: vertical; }
.brew-lab :focus-visible { outline-color: #e9c883; }
.brew-lab-toolbar, .brew-lab-pair { display: grid; gap: .85rem; }
.brew-lab-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.brew-lab-toolbar { max-width: 38rem; margin-bottom: 1rem; }
.brew-lab-card { min-width: 0; margin: 0; padding: .8rem; border: 1px solid #574837; border-radius: .6rem; background: #302721; }
.brew-lab-card legend { padding-inline: .35rem; font-size: 1.15rem; font-weight: 700; }
.brew-lab-card:first-child legend { color: #efd395; }
.brew-lab-card:last-child legend { color: #bce3cb; }
.brew-lab-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; align-items: end; }
.brew-lab-tasting, .brew-lab-result { margin-top: .75rem; }
.brew-lab-result { color: #e7d6bf; font-weight: 600; }
.brew-lab-summary { margin-bottom: 1rem; }
.brew-lab-summary > p { margin-bottom: .55rem; color: #e7d6bf; }
.brew-lab-summary dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; margin: 0; }
.brew-lab-summary dl > div { padding: .65rem; border-radius: .55rem; background: #382e25; }
.brew-lab-summary dl > div:first-child { background: #4c3b25; }
.brew-lab-summary dt { color: #e7d6bf; font-size: .875rem; line-height: 1.2; }
.brew-lab-summary dd { margin: .3rem 0 0; color: #fff4dc; font: clamp(1.25rem, 3vw, 2.3rem)/1 Georgia, serif; }
.brew-lab-plot { padding: clamp(.6rem, 2vw, 1.05rem); border-radius: .65rem; background: #2b231d; }
.brew-lab-plot svg { display: block; width: 100%; height: auto; margin-top: .45rem; color: #e4d7c7; font: 11px system-ui, sans-serif; }
#lab-chart-key { margin-top: .4rem; color: #ebdfd0; font-size: .9rem; }
.brew-lab-zones { display: grid; gap: .35rem; margin: .35rem 0 .65rem; padding: 0; list-style: none; }
.brew-lab-zones:empty { display: none; }
.brew-lab-zones li { display: flex; align-items: baseline; gap: .45rem; color: #f8efe2; font-size: .875rem; }
.brew-lab-zones li::before { content: ""; width: .55rem; height: .55rem; flex: 0 0 .55rem; border-radius: 50%; background: #efd395; }
.brew-lab-zones li[data-brew="B"]::before { background: #bce3cb; border-radius: .1rem; }
.brew-lab-comparison:not(:empty) { margin-top: .85rem; padding: .65rem .8rem; border-radius: .3rem; background: #304338; }
.brew-lab .shift-secondary { border-color: #786653; }
.brew-lab button:disabled { opacity: .52; cursor: default; }
#lab-status:not(:empty), #lab-share-text:not([hidden]) { margin-top: .65rem; }
.brew-lab-note { margin-top: .85rem; color: var(--muted); }
.recipe-grid [data-brew-preset] { margin-top: .55rem; }
.brew-lab-chart-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem; }
.brew-lab-tabs { display: flex; flex-wrap: wrap; gap: .25rem; }
.brew-lab-tabs[hidden] { display: none; }
.brew-lab-tabs button, .lab-step-controls button {
  border: 1px solid #786653;
  border-radius: .4rem;
  background: #382e25;
  color: #f8efe2;
  min-height: 2.25rem;
  font: inherit;
  font-size: .88rem;
  cursor: pointer;
}
.brew-lab-tabs button { padding: .35rem .55rem; }
.brew-lab-tabs button[aria-pressed="true"] { background: #e9c883; color: #211b16; border-color: #e9c883; }
.lab-field-title { display: block; font-size: .88rem; font-weight: 650; }
.lab-step-controls { display: flex; align-items: center; gap: .25rem; margin-top: .3rem; }
.lab-step-controls input { min-width: 0; margin-top: 0; padding-inline: .28rem; text-align: center; appearance: textfield; }
.lab-step-controls input::-webkit-inner-spin-button { appearance: none; }
.lab-step-controls button { width: 1.65rem; flex: 0 0 1.65rem; padding: 0; }
.brew-lab-inputs input[type="range"] { min-height: 1.5rem; padding: 0; margin-top: .15rem; accent-color: #e9c883; background: transparent; }
.brew-lab-method-note:not(:empty) { color: #e7d6bf; margin: -.3rem 0 .65rem; }
.brew-lab-print-report { display: none; }
@media (max-width: 58rem) {
  .brew-lab-layout { grid-template-columns: 1fr; }
}
@media (max-width: 32rem) {
  .brew-lab-toolbar { grid-template-columns: 1fr; }
  .brew-lab-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  .printing-brew-lab > :not(main),
  .printing-brew-lab main > :not(#brew-lab),
  .printing-brew-lab :is(.brew-lab-controls, .brew-lab-tabs, .brew-lab-note) { display: none !important; }
  .printing-brew-lab #brew-lab { padding: 0; width: 100%; }
  .printing-brew-lab #brew-lab header p { display: none; }
  .printing-brew-lab .brew-lab { padding: .65rem; print-color-adjust: exact; }
  .printing-brew-lab .brew-lab-layout { display: block; }
  .printing-brew-lab .brew-lab-plot svg { max-width: 23rem; }
  .printing-brew-lab .brew-lab-print-report { display: block; white-space: pre-wrap; overflow-wrap: anywhere; font: .9rem/1.4 system-ui, sans-serif; }
}
