/* CENTRAL · Form/dropdown polish.
   Consistent control heights, restrained chevrons and clear high-contrast menus.
   Keep native select behaviour on touch devices and wherever progressive enhancement is unavailable. */

/* Prevent grid stretch: a tall photo-status panel must never make an adjacent select gigantic. */
.formgrid > .field,
.formgrid > label.field {align-self:start;min-width:0}
.formgrid > .field select.fieldctl,
.formgrid > label.field select.fieldctl {width:100%}
.field{min-width:0}
.field:focus-within{color:#f5e7dc}

/* Native select: reliable across browsers, on touch, and as a JS-free fallback. */
select.fieldctl:not([multiple]):not([size]),
select.ct-field-select{
  -webkit-appearance:none;
  appearance:none;
  min-width:0;
  min-height:46px;
  height:46px;
  max-height:46px;
  box-sizing:border-box;
  padding:10px 42px 10px 14px;
  border:1px solid #62574f;
  border-radius:10px;
  background-color:#292522;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ceb9a9' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 13px center;
  background-size:19px 19px;
  font-size:15px;
  font-weight:550;
  line-height:1.35;
  letter-spacing:0;
  color:#f5eee8;
  cursor:pointer;
  white-space:nowrap;
  text-overflow:ellipsis;
  transition:border-color .14s ease,background-color .14s ease,box-shadow .14s ease;
}
select.fieldctl:not([multiple]):not([size]):hover{background-color:#342d28;border-color:#897365}
select.fieldctl:not([multiple]):not([size]):focus-visible{
  border-color:#db8054;
  box-shadow:0 0 0 2px rgba(223,112,72,.17);
  outline:0;
}
select.fieldctl:not([multiple]):not([size]):disabled{opacity:.52;cursor:not-allowed;filter:saturate(.65)}
select.fieldctl option,
select.fieldctl optgroup{background:#292522;color:#f5eee8;font-size:15px;font-weight:500}
select.fieldctl optgroup{font-weight:760}
select.fieldctl option:disabled{color:#8f8278}
dialog .formgrid input.fieldctl:not([type=checkbox]):not([type=radio]):not([type=hidden]){
  min-height:46px;border-radius:10px;padding:10px 13px;
  background-color:#24201d;border-color:#62574f;
  color:#f5eee8;
}
dialog .formgrid textarea.fieldctl{padding:12px 13px;line-height:1.5;border-radius:10px;background:#24201d;border-color:#62574f}
dialog .formgrid .field{gap:7px}
dialog .formgrid .field>strong{font-size:11px;line-height:1.4}
dialog .formgrid .field:focus-within > select,
dialog .formgrid .field:focus-within > input{border-color:#d58a61}

/* Prep photography is information, not a form select: keep it compact and full-width. */
#kitDialog .kit-prep-status-field{
  padding:12px 14px;
  border:1px solid #4b4038;
  border-radius:10px;
  background:#25201d;
  gap:8px;
}
#kitDialog .kit-prep-status-field .dr-prep-edit{
  display:flex;align-items:center;justify-content:space-between;
  gap:10px;flex-wrap:wrap;
  padding:0;margin:0;
  border:0;background:transparent;
}
#kitDialog .kit-prep-status-field .dr-prep-edit label{
  display:inline-flex;align-items:center;gap:8px;
  padding:7px 10px;
  border:1px solid #58483f;
  border-radius:8px;
  background:#342b26;
  font-size:12px;
  color:#f0ddcf;
  cursor:pointer;
}
#kitDialog .kit-prep-status-field .dr-prep-edit label:hover{border-color:#886b58}
#kitDialog .kit-prep-status-field .dr-prep-edit input[type=checkbox]{flex:none}
#kitDialog .kit-prep-status-field .hint{font-size:11px;line-height:1.45;opacity:.85}

/* Enhanced desktop popover dropdowns; the original select remains the form's source of truth. */
.central-select-wrap{position:relative;display:inline-flex;vertical-align:middle;min-width:0;max-width:100%}
.field > .central-select-wrap,
.formgrid .field .central-select-wrap{display:flex;width:100%}
.central-select-wrap .central-select-native{
  position:absolute!important;top:0;left:0;
  width:1px!important;height:1px!important;min-height:1px!important;max-height:1px!important;
  opacity:0!important;pointer-events:none!important;clip-path:inset(50%);padding:0!important;
}
.central-select-trigger{
  display:flex;align-items:center;gap:11px;min-width:0;min-height:46px;width:100%;
  background:#292522;border:1px solid #62574f;border-radius:10px;
  padding:10px 13px 10px 14px;
  color:#f5eee8;text-align:left;font-size:15px;font-weight:550;line-height:1.35;letter-spacing:0;
  cursor:pointer;transition:background .14s,border-color .14s,box-shadow .14s;
}
.central-select-trigger:hover{background:#342d28;border-color:#897365}
.central-select-trigger:focus-visible,
.central-select-trigger[aria-expanded=true]{
  outline:0;border-color:#df8053;
  box-shadow:0 0 0 2px rgba(223,112,72,.16);
}
.central-select-trigger[aria-invalid=true]{border-color:#df8053;box-shadow:0 0 0 2px rgba(223,112,72,.20)}
.central-select-trigger:disabled{opacity:.52;cursor:not-allowed}
.central-select-trigger .central-select-value{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.central-select-trigger .central-select-caret{
  display:block;flex:none;width:17px;height:17px;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ceb9a9' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") center/contain no-repeat;
  transition:transform .15s ease;
}
.central-select-trigger[aria-expanded=true] .central-select-caret{transform:rotate(180deg)}
.central-select-menu{
  position:fixed;inset:auto;margin:0;padding:7px;
  width:var(--central-select-width,280px);
  max-width:calc(100vw - 16px);
  max-height:min(350px,65vh);
  overflow:auto;overscroll-behavior:contain;
  color:#f5eee8;
  background:#292521;
  border:1px solid #806a5d;
  border-radius:12px;
  box-shadow:0 18px 55px rgba(0,0,0,.57),0 0 0 1px rgba(255,255,255,.03);
  z-index:9999;
}
.central-select-menu:popover-open{display:flex;flex-direction:column;gap:3px}
.central-select-search{
  display:block;width:100%;min-height:42px;flex:none;
  padding:9px 11px;margin-bottom:5px;
  border:1px solid #554a42;border-radius:8px;
  background:#1b1917;color:#f4e9dd;font-size:15px;
}
.central-select-search:focus-visible{outline:2px solid #ce744c;outline-offset:0}
.central-select-options{overflow:auto;overscroll-behavior:contain;min-height:0;max-height:285px}
.central-select-choice{
  display:flex;align-items:center;gap:9px;
  width:100%;min-height:43px;
  padding:10px 11px;margin:1px 0;
  border:1px solid transparent;border-radius:8px;
  background:transparent;color:#f3eae0;
  font:inherit;font-size:15px;font-weight:520;
  line-height:1.35;text-align:left;white-space:normal;overflow-wrap:anywhere;
  cursor:pointer;
}
.central-select-choice:hover,
.central-select-choice:focus-visible{
  background:#45392f;border-color:#71533e;outline:0;
}
.central-select-choice[aria-selected=true]{
  background:#4d3529;
  border-color:#915738;
  color:#ffd8bc;
}
.central-select-choice[aria-selected=true]::before{content:'✓';color:#f0a17c;font-weight:850}
.central-select-choice:disabled{opacity:.4;cursor:not-allowed}
.central-select-group{
  padding:9px 9px 4px;
  font-size:10px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;
  color:#b8a08f;
}
.central-select-empty{padding:12px 10px;font-size:12px;color:#c1ada0}
.central-select-menu[hidden]{display:none!important}
@media(max-width:760px){
  select.fieldctl:not([multiple]):not([size]){font-size:16px;min-height:46px;height:46px}
  select.fieldctl option{font-size:16px}
  dialog .formgrid input.fieldctl:not([type=checkbox]):not([type=radio]):not([type=hidden]){font-size:16px}
  #kitDialog .kit-prep-status-field{padding:11px}
  #kitDialog .kit-prep-status-field .dr-prep-edit{justify-content:flex-start}
}
@media(prefers-reduced-motion:reduce){
 select.fieldctl,.central-select-trigger,.central-select-trigger .central-select-caret{transition:none}
}
