/* Local request states. Page styling remains unchanged outside the explicit error exception below. */
dialog#dialog.request-state-dialog {
  width: min(680px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 28px;
  border: 1px solid #dce4d8;
  border-radius: 18px;
  color: #202b25;
  background: #fff;
  overflow: auto;
  scrollbar-gutter: stable;
}
dialog#dialog.request-state-dialog #dialog-content { min-width: 0; }
dialog#dialog.request-state-dialog > .dialog-close { z-index: 2; }
.form-state { min-width: 0; font: inherit; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.form-state *, .form-state *::before, .form-state *::after { box-sizing: border-box; }
.form-state [hidden] { display: none !important; }
.form-state h2 { margin: 0 34px 12px 0; font-size: 27px; line-height: 1.18; font-weight: 600; letter-spacing: -.5px; }
.form-state h3 { margin: 0 0 12px; font-size: 17px; line-height: 1.35; font-weight: 600; }
.form-state p { margin: 0; }
.form-state .fs-intro { color: #59665c; margin-bottom: 22px; max-width: 520px; }
.form-state .fs-group { padding: 20px 0 0; margin: 0 0 22px; min-width: 0; border: 0; border-top: 1px solid #dce4d8; }
.form-state .fs-group > legend { padding: 0 10px 0 0; color: #202b25; font-size: 16px; font-weight: 600; }
.form-state .fs-field { min-width: 0; margin: 0 0 15px; }
.form-state .fs-field > label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 500; line-height: 1.45; }
.form-state input:not([type="radio"]), .form-state select, .form-state textarea {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  color: #202b25;
  background: #fff;
  border: 1px solid #b6c3b6;
  border-radius: 8px;
  box-shadow: none;
  font: inherit;
  line-height: 1.5;
}
.form-state select { padding-right: 28px; }
.form-state textarea { min-height: 100px; resize: vertical; }
.form-state input[aria-invalid="true"], .form-state select[aria-invalid="true"], .form-state textarea[aria-invalid="true"] { border-color: #9f392d; }
.form-state :focus-visible { outline: 3px solid #24833f; outline-offset: 3px; }
.form-state h2:focus { outline: none; }
.form-state .fs-dimensions { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-top: 17px; }
.form-state .fs-dimensions .fs-field { margin: 0; }
.form-state .fs-hint, .form-state .fs-optional { color: #617064; font-size: 12px; font-weight: 400; line-height: 1.5; }
.form-state .fs-hint { display: block; margin-top: 8px; }
.form-state .fs-model { display: grid; gap: 3px; padding: 12px 14px; margin: 14px 0 0; border-radius: 8px; background: #f5f0e7; }
.form-state .fs-model span { color: #617064; font-size: 12px; }
.form-state .fs-model strong { font-size: 14px; font-weight: 500; }
.form-state .fs-notes-field { margin-bottom: 25px; }
.form-state .fs-contact-method { display: flex; flex-wrap: wrap; gap: 9px 18px; min-width: 0; border: 0; padding: 0; margin: 2px 0 17px; }
.form-state .fs-contact-method legend { font-size: 13px; font-weight: 500; padding: 0; margin-bottom: 8px; }
.form-state .fs-contact-method label { display: inline-flex; align-items: center; gap: 8px; margin: 0; min-height: 40px; cursor: pointer; font-size: 14px; }
.form-state .fs-contact-method input { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: #24833f; }
.form-state .fs-error { display: block; margin-top: 6px; color: #9f392d; font-size: 12px; line-height: 1.45; }
.form-state .fs-error-summary { color: #9f392d; margin: -5px 0 14px; font-weight: 500; }
.form-state .fs-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin: 22px 0 0; }
.form-state .fs-actions .button, .form-state > .button { min-height: 44px; padding: 11px 18px; border-radius: 10px; font: inherit; font-size: 14px; line-height: 1.45; text-align: center; white-space: normal; }
.form-state .fs-primary { background: #24833f; color: #fff; border: 1px solid #24833f; }
.form-state .button.secondary { color: #255d36; background: #fff; border: 1px solid #c6d5bd; }
.form-state button:disabled, .form-state select:disabled { opacity: .65; cursor: wait; }
.form-state .fs-local-note { margin-top: 17px; padding-top: 15px; border-top: 1px solid #dce4d8; color: #617064; font-size: 12px; line-height: 1.55; }
.form-state .fs-summary { margin: 0; padding: 0; }
.form-state .fs-summary > div { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 12px; padding: 13px 0; border-bottom: 1px solid #e6ebe2; }
.form-state .fs-summary dt { color: #617064; font-size: 13px; }
.form-state .fs-summary dd { margin: 0; min-width: 0; color: #202b25; font-weight: 500; }
.form-state .fs-notes { white-space: pre-wrap; }
.form-state .fs-status { padding: 16px 18px; margin: 0 0 20px; border-radius: 10px; background: #f5f0e7; }
.form-state .fs-status > strong { display: block; margin-bottom: 6px; font-size: 16px; line-height: 1.4; font-weight: 600; }
.form-state .fs-status p { font-size: 13px; line-height: 1.55; }
.form-state .fs-ready { background: #f0f5eb; border: 1px solid #dce4d8; }
.form-state .fs-failed { background: #fff4ef; border: 1px solid #e8c6bc; }
.form-state .fs-failed > strong { color: #9f392d; }
.form-state .fs-order { margin: 0 0 22px; }
.form-state .fs-order-list { margin: 0; padding: 0; list-style: none; }
.form-state .fs-order-list li { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid #dce4d8; }
.form-state .fs-order-list strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.45; }
.form-state .fs-order-list span { display: block; margin-top: 4px; color: #617064; font-size: 12px; }
.form-state .fs-order-list b { font-weight: 600; font-size: 14px; }
.form-state .fs-total { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; background: #f0f5eb; padding: 13px 15px; border-radius: 8px; margin-top: 15px; }
.form-state .fs-total strong { font-size: 18px; }
.form-state .fs-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 22px 0 0; padding: 12px; border: 1px dashed #b6c3b6; border-radius: 8px; background: #f8faf6; }
.form-state .fs-preview label, .form-state .fs-preview small { font-size: 12px; color: #617064; }
.form-state .fs-preview select { width: auto; min-width: 120px; font-size: 13px; min-height: 40px; padding-block: 7px; }
.form-state .fs-preview small { flex-basis: 100%; }
@media (max-width: 500px) {
  dialog#dialog.request-state-dialog { padding: 23px 16px 20px; border-radius: 14px; scrollbar-gutter: auto; }
  .form-state h2 { font-size: 24px; }
  .form-state .fs-dimensions { gap: 8px; }
  .form-state .fs-dimensions input { padding-inline: 8px; }
  .form-state .fs-dimensions label { font-size: 12px; }
  .form-state .fs-summary > div { grid-template-columns: 1fr; gap: 4px; }
  .form-state .fs-actions { display: grid; grid-template-columns: 1fr; }
  .form-state .fs-actions .button { width: 100%; }
  .form-state .fs-order-list li { grid-template-columns: minmax(0,1fr); gap: 5px; }
  .form-state .fs-status { padding: 14px; }
}
@media (forced-colors: active) {
  .form-state input[aria-invalid="true"] { outline: 2px solid Highlight; }
}
/* Approved homepage: error-only exception; idle layout is untouched. */
.custom-form input[aria-invalid="true"] { border-color: #9f392d; }
.custom-form .entry-field-error { display: block; color: #9f392d; font-size: 11px; line-height: 1.4; margin-top: 6px; }
.custom-form .entry-field-error[hidden] { display: none; }

/* Keep error messages readable on narrow phones without widening the form. */
@media (max-width:420px) {
  .form-state .fs-dimensions { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .form-state .fs-dimensions .fs-field { display: grid; grid-template-columns: 100px minmax(0,1fr); align-items: center; gap: 0 10px; }
  .form-state .fs-dimensions .fs-field > label { margin: 0; }
  .form-state .fs-dimensions .fs-error { grid-column: 1/-1; }
}

dialog#dialog.request-state-dialog > .dialog-close,
dialog#dialog.cart-state-dialog > .dialog-close {
  position: sticky; top: 0; right: auto; float: right;
  margin: -14px -14px -20px 0; z-index: 3;
}
/* Cart inquiry: reuse approved form styles; consent is an explicit unchecked field. */
.form-state .fs-consent { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; line-height: 1.55; }
.form-state .fs-consent input[type="checkbox"] { display: block; flex: 0 0 19px; width: 19px; min-width: 19px; height: 19px; min-height: 19px; padding: 0; margin-top: 2px; accent-color: #24833f; }
.form-state .fs-consent a { color: #255d36; text-decoration: underline; text-underline-offset: 3px; }
/* Shared native dialog shell for the two copied, scoped form components. */
dialog#dialog.request-state-dialog, dialog#dialog.cart-state-dialog {
  box-sizing: border-box; width: min(760px, calc(100vw - 24px)); max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px); margin: auto; padding: 28px; overflow: auto;
  color: #202b25; background: #fff; border: 1px solid #dce4d8; border-radius: 18px; scrollbar-gutter: stable;
}
dialog#dialog.request-state-dialog { width: min(680px, calc(100vw - 24px)); }
dialog#dialog::backdrop { background: rgb(21 32 24 / .48); }
dialog#dialog > .dialog-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; color: #31583a; background: #f0f5eb; cursor: pointer; font-size: 25px; line-height: 1; }
dialog#dialog #dialog-content { min-width: 0; }
dialog#dialog.cart-state-dialog button { font: inherit; cursor: pointer; }
dialog#dialog.cart-state-dialog .cs-quantity button { border: 0; background: transparent; }
dialog#dialog.cart-state-dialog .cs-remove { border: 0; background: transparent; }
@media (max-width: 500px) { dialog#dialog.request-state-dialog, dialog#dialog.cart-state-dialog { padding: 23px 16px 20px; border-radius: 14px; scrollbar-gutter: auto; } }
