/* Creation stays within the customer selector, with its own compact height. */
#modal.pdv-customer-create-mode[open]:has(.pdv-customer-picker) {
  width: min(620px, calc(100vw - 40px));
  height: fit-content;
  max-height: calc(100dvh - 40px);
}
#modal.pdv-customer-create-mode > .modal-body { flex: 0 1 auto; }
#modal [data-customer-picker-panel][hidden],
#modal [data-customer-create-panel][hidden] { display: none; }
#modal [data-customer-picker-panel],
#modal [data-customer-create-panel] {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
#modal [data-customer-create-panel] { flex: 0 1 auto; width: 100%; }
#modal .pdv-customer-scopes [data-customer-new] {
  margin-left: auto;
  color: var(--accent-bright);
  font-weight: 500;
}
#modal #pdv-customer-create-form {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  margin: 0;
  font: 13px "IBM Plex Sans", "Segoe UI", sans-serif;
}
#modal .pdv-customer-create-body {
  min-height: 0;
  padding: 23px 24px 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
#modal .pdv-customer-create-field { min-width: 0; margin: 0 0 19px; }
#modal .pdv-customer-create-field label {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
#modal .pdv-customer-create-field input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface-input);
  color: var(--text);
  box-shadow: none;
  font: inherit;
}
#modal .pdv-customer-create-name input { height: 46px; font-size: 17px; }
#modal .pdv-customer-create-field input:focus {
  outline: 1px solid var(--accent-bright);
  outline-offset: 0;
  border-color: var(--accent-bright);
}
#modal .pdv-customer-create-more { margin: 0 0 15px; border-top: 1px solid var(--border); }
#modal .pdv-customer-create-more summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  list-style: none;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}
#modal .pdv-customer-create-more summary::-webkit-details-marker { display: none; }
#modal .pdv-customer-create-more summary::after { content: "+"; color: var(--muted); font-size: 18px; }
#modal .pdv-customer-create-more[open] summary::after { content: "−"; }
#modal .pdv-customer-create-extra-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
#modal .pdv-customer-create-phone { grid-column: 1 / -1; }
#modal .pdv-customer-create-extra-fields .field { margin-bottom: 15px; }
#modal .pdv-customer-create-footer {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 10px;
  padding: 15px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
#modal .pdv-customer-create-actions { display: flex; justify-content: flex-end; gap: 10px; }
#modal .pdv-customer-create-actions button { min-height: 39px; padding: 10px 15px; font-size: 12px; }
#modal [data-customer-create-status] { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
#modal [data-customer-create-status]:empty { display: none; }
#modal [data-customer-create-status][data-error="true"],
#modal [data-customer-create-error] { color: var(--red); }
#modal [data-customer-create-error] { display: block; margin-top: 6px; font-size: 11px; line-height: 1.5; }
#modal [data-customer-create-error]:empty { display: none; }
#modal .pdv-customer-create-field [aria-invalid="true"] { border-color: var(--red); }
#modal #pdv-customer-create-form [hidden] { display: none; }
#modal #pdv-customer-create-form :is(button, summary):focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; }
@media (max-width: 600px) {
  #modal.pdv-customer-create-mode[open]:has(.pdv-customer-picker) { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  #modal .pdv-customer-create-body { padding-inline: 16px; }
  #modal .pdv-customer-create-footer { padding: 12px 16px; }
}
@media (max-width: 420px) {
  #modal .pdv-customer-create-extra-fields { grid-template-columns: 1fr; }
  #modal .pdv-customer-create-actions { flex-wrap: wrap; }
}
