/* wizard.css -- spray-entry wizard shell. Reuses existing tokens
   (--tx --tm --br --sf --rs --gm --gd) so it inherits the app's look.
   Loaded AFTER app.css. */

/* Wider sheet than .msheet (480px) because the wizard hosts the whole form */
.wsheet {
  background: var(--sf);
  border-radius: 16px;
  width: calc(100% - 16px);     /* 8px margin each side */
  max-width: 720px;
  height: calc(100dvh - 16px);  /* fixed: takes the full available height */
  margin: 8px auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;             /* the body scrolls, not the sheet */
}
@media (min-width: 760px) {
  .wsheet {
    border-radius: 16px;
    max-width: 720px;
    height: calc(100dvh - 16px);
  }
}

/* Header */
.whdr {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--br);
  flex-shrink: 0;
}
.whdr h3 {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: var(--tx);
}
.whdr .wsave {
  font-size: 12px;
  color: var(--tm);
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}
.whdr .wclose {
  background: none;
  border: none;
  color: var(--tm);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--rs);
}
.whdr .wclose:hover { background: rgba(0,0,0,.05); color: var(--tx); }

/* Progress bar -- 4 clickable segments */
.wprog {
  display: flex;
  gap: 6px;
  padding: 10px 16px 12px;
  border-bottom: 1px solid var(--br);
  flex-shrink: 0;
  background: #fafaf7;
}
.wprog-seg {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 6px 4px 8px;
  border-radius: var(--rs);
  cursor: pointer;
  color: var(--tm);
  font-size: 12px;
  font-weight: 600;
  position: relative;
  transition: background .15s;
}
.wprog-seg:hover { background: rgba(0,0,0,.04); }
.wprog-seg .wprog-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--br);
  color: var(--tm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: background .15s, color .15s;
}
.wprog-seg.is-active .wprog-num { background: var(--gm); color: #fff; }
.wprog-seg.is-active { color: var(--tx); }
.wprog-seg.is-complete .wprog-num { background: var(--gd); color: #fff; }
.wprog-seg.is-complete { color: var(--gd); }
.wprog-seg .wprog-label { letter-spacing: .3px; }

/* Body */
.wbody {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}
.wstep h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--tx);
}
.wstep .wstep-hint {
  font-size: 13px;
  color: var(--tm);
  margin-bottom: 16px;
  line-height: 1.45;
}
.wstep-placeholder {
  border: 2px dashed var(--br);
  border-radius: var(--rs);
  padding: 32px 16px;
  text-align: center;
  color: var(--tm);
  font-size: 13px;
}

/* Footer */
.wftr {
  display: flex;
  gap: 8px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--br);
  flex-shrink: 0;
  background: var(--sf);
}
.wftr .bcancel { flex: 1; }
.wftr .bconfirm { flex: 2; }
.wftr .wdiscard {
  background: none;
  border: none;
  color: var(--tm);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  text-decoration: underline;
  align-self: center;
}
.wftr .wdiscard:hover { color: #b34a4a; }



/* --- step 3 v4: legacy-style block picker (Where step, standard growers) --- */
#wizard-blocks-standard, #wizard-blocks-pro {
  border: 1px solid var(--br);
  border-radius: var(--rs);
  padding: 14px;
  background: var(--sf);
}

/* Farm dropdown row */
.wsl-farm-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.wsl-farm-row label {
  font-size: 12px;
  color: var(--tm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.wsl-farm-row select {
  padding: 10px 12px;
  border: 1px solid var(--br);
  border-radius: var(--rs);
  font-size: 15px;
  background: var(--sf);
  color: var(--tx);
}

/* Crop pills */
.wsl-crop-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}
.wsl-crop-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  background: #f1f1f1;
  color: #5f6368;
  border: 2px solid transparent;
  transition: filter .15s, border-color .15s;
  user-select: none;
}
.wsl-crop-pill:hover { filter: brightness(0.96); }
.wsl-crop-pill.on { border-color: var(--gd); }
.wsl-crop-pill .wsl-cp-count {
  opacity: .6;
  font-weight: 400;
  margin-left: 4px;
  font-size: 11px;
}
.wsl-crop-pill.wsl-cp-apple     { background: #fdeaea; color: #c0392b; }
.wsl-crop-pill.wsl-cp-blueberry { background: #e3f2fd; color: #1565c0; }
.wsl-crop-pill.wsl-cp-stone     { background: #fff3e0; color: #e65100; }
.wsl-crop-pill.wsl-cp-pear      { background: #e0f2f1; color: #00695c; }
.wsl-crop-pill.wsl-cp-grape     { background: #f3e5f5; color: #6a1b9a; }
.wsl-crop-pill.wsl-cp-field     { background: #f1f8e9; color: #558b2f; }
.wsl-crop-pill.wsl-cp-other     { background: #eceff1; color: #455a64; }

/* Block selector row (appears after a crop pill is clicked) */
.wsl-block-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.wsl-block-row select {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--br);
  border-radius: var(--rs);
  font-size: 14px;
  background: var(--sf);
  color: var(--tx);
}
.wsl-add-all {
  padding: 10px 14px;
  background: var(--sf);
  color: var(--gd);
  border: 1px solid var(--gd);
  border-radius: var(--rs);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.wsl-add-all:hover:not(:disabled) { background: var(--gl, #f0f7f1); }
.wsl-add-all:disabled { opacity: .4; cursor: not-allowed; }

/* Set-all-middles bulk row */
.wsl-bulk-middles {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 4px;
  font-size: 13px;
  color: var(--tm);
}
.wsl-bm-lbl { font-weight: 600; }
.wsl-bm-seg {
  display: flex;
  gap: 0;
  border: 1px solid var(--br);
  border-radius: var(--rs);
  overflow: hidden;
}
.wsl-bm-seg button {
  background: var(--sf);
  border: none;
  border-right: 1px solid var(--br);
  padding: 6px 12px;
  font-size: 12px;
  color: var(--tx);
  cursor: pointer;
  font-weight: 600;
}
.wsl-bm-seg button:last-child { border-right: none; }
.wsl-bm-seg button:hover { background: rgba(0,0,0,.04); }

/* Added blocks list */
.wsl-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.wsl-empty {
  padding: 18px;
  color: var(--tm);
  text-align: center;
  font-size: 13px;
  border: 1px dashed var(--br);
  border-radius: var(--rs);
}
.wsl-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px 8px 12px;
  background: #fafaf7;
  border: 1px solid var(--br);
  border-left-width: 4px;
  border-radius: var(--rs);
}
/* Left-edge color matches the crop family */
.wsl-row.wsl-cp-apple-edge     { border-left-color: #c0392b; }
.wsl-row.wsl-cp-blueberry-edge { border-left-color: #1565c0; }
.wsl-row.wsl-cp-stone-edge     { border-left-color: #e65100; }
.wsl-row.wsl-cp-pear-edge      { border-left-color: #00695c; }
.wsl-row.wsl-cp-grape-edge     { border-left-color: #6a1b9a; }
.wsl-row.wsl-cp-field-edge     { border-left-color: #558b2f; }
.wsl-row.wsl-cp-other-edge     { border-left-color: #b0b0b0; }

.wsl-row-name { font-size: 14px; color: var(--tx); line-height: 1.45; }
.wsl-row-farm { color: var(--tm); font-weight: normal; font-size: 12px; }
.wsl-row-acres { color: var(--tm); font-size: 12px; }
.wsl-row-crop { color: var(--tm); font-size: 12px; }
.wsl-row-middles {
  padding: 6px 8px;
  border: 1px solid var(--br);
  border-radius: var(--rs);
  background: var(--sf);
  font-size: 13px;
  min-width: 90px;
}
.wsl-row-remove {
  background: none;
  border: none;
  color: var(--tm);
  font-size: 20px;
  line-height: 1;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
}
.wsl-row-remove:hover { background: rgba(0,0,0,.06); color: #b34a4a; }

.wsl-summary-pill {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(26, 58, 42, 0.08);
  color: var(--gd);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 560px) {
  .wsl-block-row { flex-direction: column; align-items: stretch; }
  .wsl-add-all { width: 100%; }
  .wsl-row { grid-template-columns: 1fr auto; }
  .wsl-row-middles { grid-column: 1 / 2; justify-self: start; }
  .wsl-row-remove { grid-row: 1 / 2; grid-column: 2; }
  .wsl-bulk-middles { flex-wrap: wrap; }
}


/* --- v4.2: force the BlockPicker dropdown to ALWAYS open downward inside
   the wizard. The picker's auto up/down heuristic ("bp-results-up") picks
   up when there's not enough room below, but inside our modal there's
   never enough room ABOVE either, and "up" gets clipped invisibly by the
   modal's overflow. Down-only is the legacy-equivalent behavior on a
   constrained sheet. --- */
#wizard-blocks-pro .bp-results-up.bp-open {
  top: 42px !important;        /* anchor to bottom of search input */
  bottom: auto !important;     /* override the up-anchor */
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}


/* --- step 4: What step (products / tank mixes) --- */
#wstep-what {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ww-mix-toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: stretch;
  padding: 10px;
  background: #fafaf7;
  border: 1px solid var(--br);
  border-radius: var(--rs);
}
.ww-mix-toolbar select {
  padding: 8px 10px;
  border: 1px solid var(--br);
  border-radius: var(--rs);
  font-size: 14px;
  background: var(--sf);
  color: var(--tx);
}
.ww-mix-toolbar button {
  padding: 8px 14px;
  border: 1px solid var(--br);
  background: var(--sf);
  border-radius: var(--rs);
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
  cursor: pointer;
  white-space: nowrap;
}
.ww-mix-toolbar .ww-mix-load { color: var(--gd); border-color: var(--gd); }
.ww-mix-toolbar .ww-mix-save { color: var(--gm); border-color: var(--gm); }
.ww-mix-toolbar button:disabled { opacity: .4; cursor: not-allowed; }
.ww-mix-toolbar button:hover:not(:disabled) { background: rgba(0,0,0,.03); }

/* Pesticide rows */
.ww-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ww-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: var(--sf);
  border: 1px solid var(--br);
  border-radius: var(--rs);
}
.ww-row-main { min-width: 0; }
.ww-row-name { font-size: 15px; font-weight: 700; color: var(--tx); }
.ww-row-meta { font-size: 12px; color: var(--tm); margin-top: 2px; }
.ww-row-cause { font-size: 12px; color: var(--gd); margin-top: 2px; font-weight: 600; }
.ww-row-rate {
  font-size: 14px;
  color: var(--tx);
  font-weight: 600;
  padding: 4px 10px;
  background: rgba(26, 58, 42, 0.06);
  border-radius: 12px;
  white-space: nowrap;
}
.ww-row-remove {
  background: none;
  border: none;
  color: var(--tm);
  font-size: 20px;
  line-height: 1;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
}
.ww-row-remove:hover { background: rgba(0,0,0,.06); color: #b34a4a; }

/* Add product shell -- v11.3: solid button styling + sticky to bottom */
.ww-add-shell {
  /* sticky inside the wizard step body so the button stays visible
     even with many products in the list above */
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: 4px;
  padding: 8px 0 0;
  background: linear-gradient(to bottom, transparent 0, var(--sf) 12px);
}
.ww-add-toggle {
  width: 100%;
  padding: 13px 16px;
  background: var(--gm);
  border: none;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--rs);
  box-shadow: 0 2px 8px rgba(26,58,42,.18);
  transition: filter .12s, transform .05s;
}
.ww-add-toggle:hover  { filter: brightness(1.08); }
.ww-add-toggle:active { transform: translateY(1px); }
/* When the inline add-form is open, the shell becomes the form container --
   restore a normal (non-sticky) layout. */
.ww-add-shell:has(.ww-add-form[style*="display: none"]) {
  /* dummy rule -- :has() ensures the form-open case isn't sticky */
}
.ww-add-shell:has(.ww-add-form:not([style*="none"])) {
  position: static;
  background: none;
  padding: 0;
}
.ww-add-form { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.ww-field { display: flex; flex-direction: column; gap: 4px; }
.ww-field label {
  font-size: 12px;
  color: var(--tm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.ww-field input, .ww-field select {
  padding: 9px 10px;
  border: 1px solid var(--br);
  border-radius: var(--rs);
  font-size: 14px;
  background: var(--sf);
  color: var(--tx);
}
.ww-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.ww-ac-wrap { position: relative; }
.ww-ac-list {
  /* Positioning is set inline via JS (positionFloatingDropdown) so the
     dropdown can escape overflow:hidden ancestors (modal body, edit panel). */
  max-height: 260px;
  overflow-y: auto;
  background: var(--sf);
  border: 1px solid var(--br);
  border-radius: var(--rs);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.ww-ac-item {
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  color: var(--tx);
  border-bottom: 1px solid #f3f3ef;
}
.ww-ac-item:last-child { border-bottom: none; }
.ww-ac-item:hover { background: rgba(26,58,42,.06); }
.ww-ac-meta {
  font-size: 11px;
  color: var(--tm);
  margin-left: 8px;
}

.ww-info {
  font-size: 12px;
  color: var(--tm);
  padding: 8px 10px;
  background: #f5f5f0;
  border-radius: var(--rs);
  line-height: 1.5;
}
.ww-info-link { color: var(--gm); font-weight: 600; text-decoration: none; }
.ww-info-link:hover { text-decoration: underline; }

.ww-add-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }
.ww-add-actions button {
  padding: 9px 16px;
  border-radius: var(--rs);
  border: 1px solid var(--br);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ww-add-cancel  { background: var(--sf); color: var(--tx); }
.ww-add-confirm { background: var(--gm); color: #fff; border-color: var(--gm); }
.ww-add-confirm:hover { filter: brightness(1.08); }

@media (max-width: 560px) {
  .ww-mix-toolbar { grid-template-columns: 1fr; }
  .ww-row { grid-template-columns: 1fr auto; }
  .ww-row-rate { grid-column: 1 / 2; justify-self: start; }
  .ww-row-remove { grid-row: 1 / 2; grid-column: 2; align-self: start; }
}


/* --- step 5: Conditions step --- */
#wstep-conditions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.wc-section {
  background: var(--sf);
  border: 1px solid var(--br);
  border-radius: var(--rs);
  padding: 12px 14px 14px;
}
.wc-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--tm);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
}
.wc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wc-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.wc-field { display: flex; flex-direction: column; gap: 4px; }
.wc-field-full { grid-column: 1 / -1; }
.wc-field label {
  font-size: 12px;
  color: var(--tm);
  font-weight: 600;
}
.wc-field input,
.wc-field select,
.wc-field textarea {
  padding: 9px 10px;
  border: 1px solid var(--br);
  border-radius: var(--rs);
  font-size: 14px;
  background: var(--sf);
  color: var(--tx);
  font-family: inherit;
}
.wc-field textarea {
  min-height: 70px;
  resize: vertical;
}



@media (max-width: 560px) {
  .wc-grid-2 { grid-template-columns: 1fr; }
  .wc-grid-3 { grid-template-columns: 1fr 1fr; }
  .wc-grid-3 .wc-field:nth-child(3) { grid-column: 1 / -1; }
}


/* --- step 6: Review step --- */
#wstep-review {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wr-banner {
  background: #fdecea;
  border: 1px solid #e0a4a4;
  color: #8a2a2a;
  padding: 10px 14px;
  border-radius: var(--rs);
  font-size: 13px;
  line-height: 1.5;
}
.wr-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wr-section {
  border: 1px solid var(--br);
  border-radius: var(--rs);
  background: var(--sf);
  overflow: hidden;
}
.wr-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #fafaf7;
  border-bottom: 1px solid var(--br);
}
.wr-section-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--tx);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.wr-edit {
  background: none;
  border: 1px solid var(--gd);
  color: var(--gd);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.wr-edit:hover { background: rgba(26,58,42,.06); }

.wr-section-body { padding: 12px 14px; }
.wr-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.wr-list li {
  padding: 4px 0;
  font-size: 14px;
  color: var(--tx);
  line-height: 1.5;
}
.wr-list li + li { border-top: 1px solid #f3f3ef; }
.wr-dim { color: var(--tm); font-weight: normal; font-size: 13px; }
.wr-meta {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f3f3ef;
  font-size: 12px;
  color: var(--tm);
}
.wr-empty {
  font-size: 13px;
  color: var(--tm);
  font-style: italic;
}

.wr-kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
}
.wr-kv {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px solid #f3f3ef;
}
.wr-kv > span:first-child { color: var(--tm); font-weight: 600; }
.wr-kv > span:last-child  { color: var(--tx); text-align: right; }

.wr-notes {
  margin-top: 10px;
  padding: 8px 10px;
  background: #fafaf7;
  border-radius: var(--rs);
  font-size: 13px;
  color: var(--tx);
  line-height: 1.5;
}

.wr-final-hint {
  font-size: 12px;
  color: var(--tm);
  padding: 8px 4px;
  text-align: center;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .wr-kv-grid { grid-template-columns: 1fr; }
}


/* --- v8: per-block detail panel (standard list selector) --- */
.wsl-row {
  position: relative;
  align-items: start;     /* allow row to grow when detail panel opens */
}
.wsl-row-subline { margin-top: 4px; }
.wsl-partial-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #c62828;
  background: #fdecea;
  padding: 2px 8px;
  border-radius: 10px;
}
.wsl-row-detail {
  background: none;
  border: 1px solid var(--br);
  color: var(--tm);
  font-size: 13px;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.wsl-row-detail:hover { background: rgba(0,0,0,.04); color: var(--tx); }
.wsl-row-detail.has-detail { border-color: var(--gd); color: var(--gd); background: rgba(26,58,42,.06); }

.wsl-detail {
  grid-column: 1 / -1;     /* span the full row */
  margin-top: 8px;
  padding: 10px 12px;
  background: #fafaf7;
  border: 1px solid var(--br);
  border-radius: var(--rs);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wsl-detail-row { display: flex; flex-direction: column; gap: 6px; }
.wsl-detail-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--tx);
  cursor: pointer;
  font-weight: 600;
}
.wsl-detail-partial { display: flex; align-items: center; gap: 8px; }
.wsl-detail-partial input {
  width: 100px;
  padding: 6px 10px;
  border: 1px solid var(--br);
  border-radius: var(--rs);
  font-size: 13px;
  background: var(--sf);
}
.wsl-detail-hint { font-size: 12px; color: var(--tm); }
.wsl-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.wsl-detail-grid label {
  font-size: 11px;
  color: var(--tm);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}
.wsl-detail-grid input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--br);
  border-radius: var(--rs);
  font-size: 13px;
  background: var(--sf);
  color: var(--tx);
}
@media (max-width: 560px) {
  .wsl-detail-grid { grid-template-columns: 1fr; }
}


/* --- v9: preference toggle (Settings + chooser quick-switch) --- */
.pref-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--br);
  border-radius: var(--rs);
  overflow: hidden;
}
.pref-toggle button {
  flex: 1;
  background: var(--sf);
  border: none;
  border-right: 1px solid var(--br);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
  cursor: pointer;
  text-align: center;
}
.pref-toggle button:last-child { border-right: none; }
.pref-toggle button:hover { background: rgba(0,0,0,.04); }
.pref-toggle button.is-active {
  background: var(--gd);
  color: #fff;
}

.spray-tile-switch {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--tm);
  padding: 4px 6px 0;
}
.spray-tile-switch a {
  color: var(--gm);
  text-decoration: underline;
  font-weight: 600;
}
.spray-tile-switch a:hover { color: var(--gd); }

/* --- v9: Review partial-acres styling --- */
.wr-partial {
  color: #c62828;
  font-weight: 600;
}

/* --- v9: Where row layout fix for the pencil + remove buttons stacking --- */
.wsl-row {
  /* Now: name | middles | pencil | remove. Bumped from 3 cols to 4. */
  grid-template-columns: 1fr auto auto auto;
}
@media (max-width: 560px) {
  .wsl-row {
    grid-template-columns: 1fr auto auto;
  }
  .wsl-row-middles {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .wsl-row-detail {
    grid-row: 1; grid-column: 2;
  }
  .wsl-row-remove {
    grid-row: 1; grid-column: 3;
  }
}


/* --- v10: variety subset in detail panel --- */
.wsl-detail-section-label {
  font-size: 11px;
  color: var(--tm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 6px;
}
.wsl-variety-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--tx);
  cursor: pointer;
  padding: 4px 0;
}
.wsl-variety-row input[type="checkbox"] {
  width: 16px; height: 16px;
  cursor: pointer;
}
.wsl-variety-all {
  padding-bottom: 6px;
  border-bottom: 1px solid var(--br);
  margin-bottom: 4px;
}


/* --- v11: What-row inline rate edit + expandable edit panel --- */
.ww-row-clickable {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  padding: 10px 12px;
  /* Pull the original .ww-row padding off and put it here instead, so the
     panel below sits flush. */
}
.ww-row {
  padding: 0 !important;
  display: block !important;
  overflow: hidden;
  transition: box-shadow .15s;
}
.ww-row:hover { box-shadow: 0 0 0 1px var(--gd) inset; }

.ww-row-rate-clickable {
  cursor: pointer;
  transition: filter .15s;
  border: 1px dashed transparent;
}
.ww-row-rate-clickable:hover {
  filter: brightness(0.92);
  border-color: var(--gd);
}

.ww-rate-editing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--sf);
  border: 1.5px solid var(--gm);
  border-radius: 12px;
}
.ww-rate-input {
  width: 60px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--tx);
  padding: 2px 0;
  outline: none;
  text-align: right;
}
.ww-rate-input:focus { outline: none; }
.ww-rate-unit {
  font-size: 13px;
  color: var(--tm);
  font-weight: 600;
}

/* Edit panel — slides under the row */
.ww-row-panel {
  background: #fafaf7;
  border-top: 1px solid var(--br);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ww-row-panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ww-row-panel-grid .ww-field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--tm);
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}
.ww-row-panel-grid select,
.ww-row-panel-grid input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--br);
  border-radius: var(--rs);
  font-size: 14px;
  background: var(--sf);
  color: var(--tx);
}
.ww-row-panel-actions {
  display: flex;
  justify-content: flex-end;
}
.ww-row-panel-done {
  padding: 8px 18px;
  background: var(--gm);
  color: #fff;
  border: none;
  border-radius: var(--rs);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ww-row-panel-done:hover { filter: brightness(1.08); }

@media (max-width: 560px) {
  .ww-row-panel-grid { grid-template-columns: 1fr; }
}


/* --- v11.4: Review REI/PHI bar (prominent, top of Review) --- */
.wr-rei {
  background: rgba(26,58,42,0.07);
  border: 1px solid rgba(26,58,42,0.25);
  border-radius: var(--rs);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}
.wr-rei-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
}
.wr-rei-label { color: var(--tm); font-weight: 600; }
.wr-rei-val   { color: var(--tx); font-weight: 600; text-align: right; }
.wr-rei-strong {
  color: var(--gd);
  font-weight: 700;
  font-size: 15px;
}


/* v11.7: stronger visual break between product list and the open add-form */
.ww-add-shell .ww-add-form {
  border-top: 2px solid var(--gd);
  margin-top: 8px;
  padding-top: 12px;
}


/* --- v11.8: Product picker modal (nested over the wizard) --- */
/* v11.8d: prevent horizontal overflow in Conditions (and any) step.
   Grid items default to min-content width, which lets number/time inputs
   force the container wider than its grid cell on mobile. */
.wbody { overflow-x: hidden; }
.wc-field { min-width: 0; }
.wc-field input,
.wc-field select,
.wc-field textarea { max-width: 100%; box-sizing: border-box; }





/* === v12: chip-style product rows (replaces card style on What step) === */
.ww-chip {
  display: flex;
  align-items: center;
  background: #e3f2fd;          /* matches legacy --bl */
  border: 1px solid #90caf9;    /* matches legacy --bb */
  color: #1565c0;               /* matches legacy --bt */
  border-radius: var(--rs);
  padding: 0;
  margin-bottom: 6px;
  transition: filter .12s, box-shadow .12s;
}
.ww-chip:hover { filter: brightness(0.97); }

.ww-chip-body {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  color: #1565c0;
  font-weight: 600;
  cursor: pointer;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ww-chip-remove {
  background: none;
  border: none;
  color: #1565c0;
  opacity: .6;
  font-size: 20px;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  margin-right: 4px;
}
.ww-chip-remove:hover { background: rgba(0,0,0,.06); color: #b34a4a; }

/* Expanded edit mode */
.ww-chip-expanded {
  flex-direction: column;
  align-items: stretch;
  background: #f0f7ff;          /* light blue work surface */
  border: 1.5px solid #1565c0;
  box-shadow: 0 2px 8px rgba(21,101,192,.12);
  padding: 4px 0;
}
.ww-chip-head {
  display: flex;
  align-items: center;
  padding: 8px 14px 4px;
  cursor: pointer;
}
.ww-chip-name {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: #1565c0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ww-chip-meta {
  font-size: 12px;
  color: var(--tm);
  padding: 0 14px 8px;
  font-weight: 600;
}
.ww-chip-edit {
  padding: 4px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ww-chip-edit .ww-field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  font-weight: 600;
  color: var(--tm);
  display: block;
  margin-bottom: 4px;
}
.ww-chip-edit input,
.ww-chip-edit select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--br);
  border-radius: var(--rs);
  font-size: 14px;
  background: var(--sf);
  color: var(--tx);
  box-sizing: border-box;
}
.ww-chip-actions {
  display: flex;
  justify-content: flex-end;
}
.ww-chip-done {
  padding: 8px 18px;
  background: var(--gm);
  color: #fff;
  border: none;
  border-radius: var(--rs);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.ww-chip-done:hover { filter: brightness(1.08); }


/* === v13: Review's Products section chips container === */
.wr-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wr-chips .ww-chip { margin-bottom: 0; }


