:root {
  --dry-green: var(--atlas-accent, #3a7d30);
  --dry-green-dark: var(--atlas-accent-dark, #2e6325);
  --dry-green-soft: var(--atlas-accent-soft, rgba(58, 125, 48, 0.08));
  --dry-card: var(--atlas-card, #fff);
  --dry-border: var(--atlas-border, #e0ebd5);
  --dry-input-border: var(--atlas-input-border, #c8dbbf);
  --dry-ink: var(--atlas-text, #1a2d18);
  --dry-muted: var(--atlas-muted, #5e7854);
  --dry-muted-light: var(--atlas-muted-light, #8fa882);
  --dry-shadow: var(--atlas-shadow, 0 1px 4px rgba(52, 100, 38, 0.07));
}

html,
body {
  color: var(--dry-ink);
  background: var(--atlas-bg, #f5f8f2);
}

body {
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.drying-shell {
  padding-bottom: 104px;
}

.drying-panel {
  display: none;
}

.drying-panel.is-active {
  display: block;
  animation: drying-panel-in 180ms ease both;
}

@keyframes drying-panel-in {
  from { opacity: 0; transform: translateY(4px); }
}

#batch-form {
  display: grid;
  gap: 16px;
}

.drying-card {
  margin: 0;
}

.drying-basics-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.drying-basics-grid .setup-row {
  grid-template-columns: 36px minmax(0, 1fr);
}

.drying-basics-grid .setup-row + .setup-row {
  border-top: 1px solid var(--dry-border);
}

.drying-basics-grid .setup-row:nth-child(2) {
  border-top: 1px solid var(--dry-border);
}

.field-label small {
  color: var(--dry-muted-light);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: lowercase;
}

.inline-unit-input {
  display: flex;
  align-items: center;
  min-width: 0;
}

.inline-unit-input input {
  min-width: 0;
}

.inline-unit-input b {
  flex: 0 0 auto;
  padding-left: 8px;
  color: var(--dry-green);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.drying-card-head-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.button-compact {
  display: inline-flex;
  width: auto;
  min-height: 36px;
  gap: 5px;
  align-items: center;
  padding: 0 12px;
  font-size: 11px;
}

.recipe-context-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  padding: 18px 20px 0;
}

.drying-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.drying-field > span {
  color: var(--dry-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.drying-field small {
  color: var(--dry-muted-light);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: lowercase;
}

.drying-field input,
.drying-field select,
.drying-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--dry-ink);
  border: 1px solid var(--dry-input-border);
  border-radius: 9px;
  outline: 0;
  background: #fbfdf9;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.drying-field textarea {
  min-height: 70px;
  resize: vertical;
}

.drying-field input:focus,
.drying-field select:focus,
.drying-field textarea:focus {
  border-color: var(--dry-green);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(58, 125, 48, 0.1);
}

.drying-field-wide {
  grid-column: 1 / -1;
}

.stage-list {
  display: grid;
  gap: 12px;
  padding: 14px 20px 18px;
}

.stage-card {
  overflow: hidden;
  border: 1px solid var(--dry-border);
  border-radius: 11px;
  background: #fbfdf9;
}

.stage-head {
  display: flex;
  min-height: 45px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 11px;
  border-bottom: 1px solid var(--dry-border);
  background: rgba(58, 125, 48, 0.045);
}

.stage-head > div {
  display: flex;
  gap: 8px;
  align-items: center;
}

.stage-head-tools {
  min-width: 0;
  justify-content: flex-end;
  margin-left: auto;
}

.stage-delay-control {
  display: flex;
  min-height: 31px;
  gap: 6px;
  align-items: center;
  padding: 3px 5px 3px 7px;
  color: var(--dry-muted);
  border: 1px solid var(--dry-border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.82);
}

.stage-delay-copy {
  display: flex;
  gap: 5px;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.stage-delay-copy i {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--dry-green);
  font-size: 10px;
  font-style: normal;
  border-radius: 6px;
  background: var(--dry-green-soft);
}

.stage-delay-control input {
  width: 52px;
  min-height: 25px;
  padding: 2px 4px;
  color: var(--dry-ink);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  border: 1px solid var(--dry-input-border);
  border-radius: 6px;
  outline: 0;
  background: #fff;
}

.stage-delay-control input:focus {
  border-color: var(--dry-green);
  box-shadow: 0 0 0 2px rgba(58, 125, 48, 0.1);
}

.stage-delay-control > b {
  padding-right: 2px;
  font-size: 9px;
  font-weight: 700;
}

.stage-head strong {
  font-size: 12px;
  font-weight: 750;
}

.stage-index,
.batch-stage-index {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: var(--dry-green);
  font-size: 10px;
  font-weight: 850;
  border: 1px solid rgba(58, 125, 48, 0.16);
  border-radius: 8px;
  background: var(--dry-green-soft);
}

.stage-remove,
.dialog-close {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  color: #899784;
  font-size: 19px;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.stage-remove:hover,
.dialog-close:hover {
  color: #bd4f45;
  background: #fff1ef;
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.stage-card:first-child .stage-delay-control {
  display: none;
}

.parameter-card {
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--dry-border);
  border-radius: 10px;
  background: #fff;
}

.parameter-card > .parameter-title {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--dry-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.parameter-title i {
  display: grid;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  place-items: center;
  color: var(--dry-green);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  border-radius: 8px;
  background: var(--dry-green-soft);
}

.parameter-temperature {
  --parameter-accent: #bd5b3b;
  --parameter-soft: #fff0e9;
  --parameter-ring: rgba(189, 91, 59, 0.13);
}

.parameter-humidity {
  --parameter-accent: #3479a8;
  --parameter-soft: #eaf5fb;
  --parameter-ring: rgba(52, 121, 168, 0.13);
}

.parameter-time {
  --parameter-accent: #9b712c;
  --parameter-soft: #fff6df;
  --parameter-ring: rgba(155, 113, 44, 0.13);
}

.parameter-temperature > .parameter-title,
.parameter-humidity > .parameter-title,
.parameter-time > .parameter-title,
.active-stage-field.parameter-temperature > span,
.active-stage-field.parameter-humidity > span,
.active-stage-field.parameter-time > span {
  color: var(--parameter-accent);
}

.parameter-temperature .parameter-title i,
.parameter-humidity .parameter-title i,
.parameter-time .parameter-title i {
  color: var(--parameter-accent);
  background: var(--parameter-soft);
}

.parameter-card.parameter-temperature input:focus,
.parameter-card.parameter-humidity input:focus,
.parameter-card.parameter-time input:focus,
.active-stage-field.parameter-temperature input:focus,
.active-stage-field.parameter-humidity input:focus,
.active-stage-field.parameter-time input:focus {
  border-color: var(--parameter-accent);
  box-shadow: 0 0 0 2px var(--parameter-ring);
}

.parameter-card input {
  min-height: 39px;
  padding: 5px 9px;
  color: var(--dry-ink);
  font-size: 17px;
  font-weight: 750;
  border-radius: 8px;
  background: #fbfdf9;
}

.mode-toggle {
  position: relative;
  display: block;
  min-width: 0;
}

.stage-modes {
  display: flex;
  grid-column: 1 / -1;
  gap: 8px;
  flex-wrap: wrap;
}

.stage-modes .mode-toggle {
  width: min(180px, 100%);
  min-height: 44px;
  flex: 0 1 180px;
}

.stage-modes .mode-toggle span {
  min-height: 44px;
  padding: 7px 48px 7px 11px;
  border-radius: 8px;
}

.stage-modes .mode-toggle span::before {
  right: 10px;
  width: 28px;
  height: 16px;
}

.stage-modes .mode-toggle span::after {
  right: 24px;
  width: 12px;
  height: 12px;
}

.stage-modes .mode-toggle input:checked + span::after {
  right: 12px;
}

.mode-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-toggle span {
  position: relative;
  display: grid;
  min-height: 100%;
  align-content: center;
  padding: 12px 54px 12px 13px;
  color: var(--dry-muted);
  border: 1px solid var(--dry-border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.mode-toggle span::before {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 31px;
  height: 18px;
  content: "";
  border-radius: 999px;
  background: #dce6d7;
  transform: translateY(-50%);
  transition: background 150ms ease;
}

.mode-toggle span::after {
  position: absolute;
  top: 50%;
  right: 27px;
  width: 14px;
  height: 14px;
  content: "";
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(33, 59, 28, 0.24);
  transform: translateY(-50%);
  transition: right 150ms ease;
}

.mode-toggle b {
  color: var(--dry-ink);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.mode-toggle small {
  margin-top: 2px;
  font-size: 10px;
}

.mode-toggle input:focus-visible + span {
  outline: 3px solid rgba(58, 125, 48, 0.2);
  outline-offset: 2px;
}

.mode-toggle input:checked + span {
  color: var(--dry-green);
  border-color: rgba(58, 125, 48, 0.3);
  background: var(--dry-green-soft);
  box-shadow: 0 0 0 2px rgba(58, 125, 48, 0.05);
}

.mode-toggle input:checked + span::before {
  background: var(--dry-green);
}

.mode-toggle input:checked + span::after {
  right: 14px;
}

.recipe-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 20px 20px;
}

.recipe-summary div {
  padding: 12px 13px;
  border: 1px solid rgba(58, 125, 48, 0.16);
  border-radius: 10px;
  background: var(--dry-green-soft);
}

.recipe-summary span {
  display: block;
  color: var(--dry-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.recipe-summary strong {
  display: block;
  margin-top: 3px;
  color: var(--dry-green);
  font-size: 15px;
}

.safety-note {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 13px 15px;
  color: var(--dry-muted);
  border: 1px solid rgba(58, 125, 48, 0.16);
  border-radius: 11px;
  background: var(--dry-green-soft);
}

.safety-note > span {
  display: grid;
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  place-items: center;
  color: var(--dry-green);
  font-family: Georgia, serif;
  font-weight: 800;
  border: 1px solid rgba(58, 125, 48, 0.16);
  border-radius: 9px;
  background: #fff;
}

.safety-note p {
  display: grid;
  gap: 2px;
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}

.safety-note strong {
  color: var(--dry-ink);
  font-size: 12px;
}

.drying-submit {
  display: flex;
  width: 100%;
  min-height: 50px;
  justify-content: space-between;
  padding: 0 18px;
}

.form-message {
  min-height: 18px;
  margin: -8px 0 0;
  color: #bd4f45;
  font-size: 11px;
  font-weight: 650;
}

.drying-nav b {
  color: var(--dry-green);
  background: #fff;
  border: 1px solid rgba(58, 125, 48, 0.22);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  margin: 0 0 14px;
}

.panel-heading h2 {
  margin: 4px 0 0;
  font-size: 24px;
  letter-spacing: -0.025em;
}

.batch-list {
  display: grid;
  gap: 14px;
}

.batch-card {
  overflow: hidden;
  border: 1px solid var(--dry-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--dry-shadow);
}

.batch-top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 17px 19px 14px;
  border-bottom: 1px solid #edf3e8;
}

.batch-title {
  margin: 0;
  font-size: 15px;
}

.batch-subtitle {
  margin: 4px 0 0;
  color: var(--dry-muted);
  font-size: 11px;
}

.batch-status {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 9px;
  color: var(--dry-green);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  border-radius: 999px;
  background: var(--dry-green-soft);
}

.batch-status::before {
  width: 6px;
  height: 6px;
  content: "";
  border-radius: 50%;
  background: #48a33f;
}

.batch-status.is-complete {
  color: #61705c;
  background: #eef2eb;
}

.batch-status.is-complete::before {
  background: #82917d;
}

.batch-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 18px 4px;
}

.batch-metric {
  padding: 11px 12px;
  border: 1px solid var(--dry-border);
  border-radius: 9px;
  background: #fbfdf9;
}

.batch-metric span {
  display: block;
  color: var(--dry-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.batch-metric strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.batch-metric small {
  display: block;
  margin-top: 3px;
  color: var(--dry-muted);
  font-size: 10px;
  font-weight: 600;
}

.batch-stages {
  display: grid;
  gap: 8px;
  padding: 14px 18px;
}

.batch-stages.has-editors {
  gap: 12px;
}

.active-stage-editor {
  overflow: hidden;
  border: 1px solid var(--dry-border);
  border-radius: 10px;
  background: #fbfdf9;
}

.active-stage-head {
  display: flex;
  min-height: 43px;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--dry-border);
  background: rgba(58, 125, 48, 0.045);
}

.active-stage-head > div:first-child {
  display: flex;
  gap: 8px;
  align-items: center;
}

.active-stage-head strong {
  font-size: 13px;
}

.active-stage-head time {
  color: var(--dry-muted);
  font-size: 11px;
  white-space: nowrap;
}

.active-stage-head-actions {
  display: flex;
  min-width: 0;
  gap: 9px;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

.active-stage-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  padding: 10px;
}

.active-stage-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.active-stage-field > span {
  overflow: hidden;
  color: var(--dry-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.035em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.active-stage-field input {
  width: 100%;
  min-width: 0;
  min-height: 39px;
  padding: 6px 8px;
  color: var(--dry-ink);
  font-size: 16px;
  font-weight: 750;
  border: 1px solid var(--dry-input-border);
  border-radius: 8px;
  outline: 0;
  background: #fff;
}

.active-stage-field input:focus {
  border-color: var(--dry-green);
  box-shadow: 0 0 0 2px rgba(58, 125, 48, 0.1);
}

.active-stage-toggle {
  position: relative;
  display: block;
  min-width: 0;
  padding-top: 17px;
}

.active-stage-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.active-stage-toggle > span {
  position: relative;
  display: grid;
  min-height: 39px;
  align-content: center;
  padding: 5px 37px 5px 9px;
  color: var(--dry-muted);
  border: 1px solid var(--dry-border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.active-stage-toggle > span::before {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 24px;
  height: 14px;
  content: "";
  border-radius: 999px;
  background: #dce6d7;
  transform: translateY(-50%);
}

.active-stage-toggle > span::after {
  position: absolute;
  top: 50%;
  right: 19px;
  width: 10px;
  height: 10px;
  content: "";
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(33, 59, 28, 0.25);
  transform: translateY(-50%);
  transition: right 150ms ease;
}

.active-stage-toggle strong {
  color: var(--dry-ink);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.active-stage-toggle small {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-stage-toggle input:checked + span {
  color: var(--dry-green);
  border-color: rgba(58, 125, 48, 0.28);
  background: var(--dry-green-soft);
}

.active-stage-toggle input:checked + span::before {
  background: var(--dry-green);
}

.active-stage-toggle input:checked + span::after {
  right: 10px;
}

.active-stage-toggle input:focus-visible + span {
  outline: 3px solid rgba(58, 125, 48, 0.2);
  outline-offset: 2px;
}

.active-stage-save {
  display: inline-flex;
  min-height: 30px;
  gap: 5px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: #fff;
  font-size: 11px;
  font-weight: 750;
  border: 0;
  border-radius: 8px;
  background: var(--dry-green);
  cursor: pointer;
  animation: stage-save-in 180ms ease both;
}

.active-stage-save:hover {
  background: var(--dry-green-dark);
}

.active-stage-save:disabled {
  cursor: wait;
  opacity: 0.65;
}

.active-stage-save svg {
  width: 13px;
  height: 13px;
}

.active-stage-editor:not(.is-dirty) .active-stage-save {
  display: none;
}

.stage-edit-message {
  overflow: hidden;
  color: #bd4f45;
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes stage-save-in {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.batch-stage {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--dry-border);
  border-radius: 9px;
  background: #fff;
}

.batch-stage-copy strong {
  display: block;
  font-size: 12px;
}

.batch-stage-copy small,
.batch-stage-time {
  color: var(--dry-muted);
  font-size: 10px;
}

.batch-stage-time {
  text-align: right;
}

.batch-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 13px 18px;
  border-top: 1px solid #edf3e8;
  background: #fbfdf9;
}

.batch-actions .button {
  width: auto;
  min-height: 38px;
  padding: 0 14px;
  font-size: 11px;
}

.button-danger-soft {
  color: #b84b41;
  border-color: rgba(184, 75, 65, 0.26);
  background: #fff8f7;
}

.button-danger-soft:hover {
  color: #9f3e36;
  border-color: rgba(184, 75, 65, 0.42);
  background: #fff0ee;
}

.recipe-library {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.recipe-card {
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--dry-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--dry-shadow);
}

.recipe-card-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 15px 16px 12px;
  border-bottom: 1px solid var(--dry-border);
  background: #fbfdf9;
}

.recipe-card-head h3 {
  margin: 0;
  color: var(--dry-ink);
  font-size: 14px;
}

.recipe-card-head p {
  margin: 4px 0 0;
  color: var(--dry-muted);
  font-size: 11px;
}

.recipe-rating {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: var(--dry-green);
  font-size: 11px;
  font-weight: 750;
  border: 1px solid rgba(58, 125, 48, 0.18);
  border-radius: 999px;
  background: var(--dry-green-soft);
}

.recipe-program {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 12px 16px;
}

.recipe-program span {
  padding: 6px 8px;
  color: var(--dry-muted);
  font-size: 10px;
  font-weight: 650;
  border: 1px solid var(--dry-border);
  border-radius: 8px;
  background: #fbfdf9;
}

.recipe-result {
  display: flex;
  gap: 10px;
  padding: 0 16px 12px;
  color: var(--dry-muted);
  font-size: 10px;
}

.recipe-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 11px 16px;
  border-top: 1px solid var(--dry-border);
  background: #fbfdf9;
}

.recipe-actions .button {
  width: auto;
  min-height: 36px;
  padding: 0 12px;
  font-size: 11px;
}

.drying-nav .nav-item {
  width: min(128px, 24vw);
}

.batch-outcome {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 15px;
}

.batch-outcome span {
  padding: 6px 9px;
  color: var(--dry-muted);
  font-size: 11px;
  border: 1px solid var(--dry-border);
  border-radius: 999px;
  background: #f7faf5;
}

.empty-batches {
  padding: 54px 20px;
  color: var(--dry-muted);
  text-align: center;
  border: 1px dashed var(--dry-input-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.empty-batches strong {
  display: block;
  color: var(--dry-ink);
  font-size: 15px;
}

.empty-batches span {
  display: block;
  margin-top: 5px;
  font-size: 11px;
}

.drying-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.drying-dialog {
  width: min(720px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: auto;
  color: var(--dry-ink);
  border: 1px solid var(--dry-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(26, 45, 24, 0.22);
}

.drying-dialog::backdrop {
  background: rgba(26, 45, 24, 0.46);
  backdrop-filter: blur(3px);
}

.drying-dialog form {
  padding: 20px;
}

.dialog-head {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 17px;
}

.dialog-head h2 {
  margin: 3px 0 0;
  font-size: 21px;
}

.dialog-actions {
  display: flex;
  grid-template-columns: none;
  gap: 9px;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #edf3e8;
}

.dialog-actions .button {
  width: auto;
  min-height: 44px;
}

#stage-dialog-fields .stage-card {
  border: 0;
  background: #fff;
}

#stage-dialog-fields .stage-head {
  display: flex;
  min-height: 0;
  padding: 0 0 12px;
  border: 0;
  background: transparent;
}

#stage-dialog-fields .stage-head-title,
#stage-dialog-fields .stage-remove {
  display: none;
}

#stage-dialog-fields .stage-head-tools {
  width: 100%;
  justify-content: flex-start;
  margin-left: 0;
}

#stage-dialog-fields .stage-delay-control {
  display: flex;
}

#stage-dialog-fields .stage-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0;
}

.drying-toast {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 84px;
  max-width: min(380px, calc(100% - 40px));
  padding: 12px 16px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
  background: var(--dry-green-dark);
  box-shadow: 0 12px 32px rgba(26, 45, 24, 0.22);
}

.drying-toast[data-kind="error"] {
  background: #b84b41;
}

@media (min-width: 961px) {
  .drying-shell {
    width: auto;
    max-width: 1240px;
    padding: 26px 32px 56px;
    margin: 0 0 0 var(--atlas-sidebar-width);
  }

  .drying-nav b {
    position: static;
    width: 19px;
    height: 19px;
    margin-left: auto;
  }

  .drying-nav .nav-item {
    width: 100%;
  }
}

@media (max-width: 960px) {
  .drying-shell {
    width: min(780px, calc(100% - 28px));
    padding-top: 6px;
    margin: 0 auto;
  }

  .panel-heading {
    margin-top: 10px;
  }

  .active-stage-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .stage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .drying-basics-grid,
  .recipe-context-grid,
  .drying-form-grid,
  .stage-grid,
  #stage-dialog-fields .stage-grid {
    grid-template-columns: 1fr;
  }

  .drying-basics-grid .setup-row:nth-child(2) {
    border-top: 1px solid var(--dry-border);
  }

  .recipe-context-grid {
    padding: 14px 14px 0;
  }

  .drying-card-head-actions {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .drying-card-head-actions .button {
    grid-column: 1 / -1;
    justify-content: center;
    margin-top: 2px;
  }

  .stage-list {
    padding: 12px 14px 14px;
  }

  .recipe-summary {
    grid-template-columns: 1fr 1fr;
    padding: 0 14px 14px;
  }

  .recipe-summary div:last-child {
    grid-column: 1 / -1;
  }

  .batch-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .active-stage-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-stage {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .batch-stage-time {
    grid-column: 2;
    text-align: left;
  }

  .batch-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-actions .button {
    width: 100%;
  }

  .stage-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .stage-modes .mode-toggle {
    width: 100%;
  }

  .recipe-library {
    grid-template-columns: 1fr;
  }

  .recipe-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .recipe-actions .button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .stage-delay-copy > span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .batch-top {
    padding: 15px 14px 12px;
  }

  .batch-metrics,
  .batch-stages,
  .batch-actions,
  .batch-outcome {
    padding-right: 14px;
    padding-left: 14px;
  }

  .dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .dialog-actions .button {
    width: 100%;
  }
}
