/* Full-screen AUTO: every control remains in the visible logical viewport. */
.modal:has(#auto-form){padding:0;align-items:stretch}
.modal:has(#auto-form)>.sheet{
  width:100%;height:100%;max-width:none;max-height:none;min-height:0;
  border:0;border-radius:0;overflow:hidden;container-type:size;
  padding:max(10px,var(--safe-t,0px)) max(12px,var(--safe-r,0px)) max(10px,var(--safe-b,0px)) max(12px,var(--safe-l,0px));
}
#auto-form{
  width:100%;height:100%;min-height:0;display:grid;
  grid-template-rows:auto auto minmax(0,1fr) auto auto;
  gap:clamp(4px,1.6cqh,12px);margin:0;
}
.auto-heading{position:relative;display:flex;align-items:center;justify-content:space-between;min-height:26px}
#auto-form h3{margin:0;font-size:18px;line-height:1.2}
.auto-help summary{cursor:pointer;list-style:none;color:var(--gold);font-size:22px;line-height:26px;text-align:center;width:36px}
.auto-help summary::-webkit-details-marker{display:none}
.auto-help>div{
  position:absolute;top:100%;right:0;z-index:3;width:min(400px,100%);
  padding:12px;background:#101626;border:1px solid var(--line);border-radius:10px;
  color:var(--ink);font-size:13px;line-height:1.5;box-shadow:0 8px 24px #0009;
}
.auto-options{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:16px}
#auto-form label{display:flex;flex-direction:column;gap:3px;min-width:0;font-size:12px;font-weight:600;line-height:1.25}
#auto-form :is(input[type=number],select){
  width:100%;min-width:0;min-height:38px;height:38px;margin:0;
  padding:6px 10px;border:1px solid var(--line);border-radius:7px;
  background:#101626;color:var(--ink);font:600 16px var(--sans);line-height:1.2;
}
#auto-form .auto-check{flex-direction:row;align-items:center;gap:8px;min-height:38px;white-space:nowrap}
#auto-form .auto-check input{width:20px;height:20px;margin:0;accent-color:var(--gold)}
.auto-fields{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));
  gap:clamp(6px,2cqh,16px) 16px;min-height:0;align-items:center;
}
#auto-form .auto-error{margin:0;color:#ffb2a8;font-size:12px;line-height:1.25}
#auto-form .auto-error:empty{display:none}
#auto-form .auto-warning{margin:0;color:var(--gold,#ffd270);font-size:11px;line-height:1.25;flex-shrink:0}
#auto-form .auto-warning:empty{display:none}
#auto-form>.row{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;margin:0}
#auto-form>.row .btn{min-width:0;min-height:42px;padding:8px 6px;font-size:12px;letter-spacing:.2px;white-space:nowrap}
@container (max-aspect-ratio: 1/1){
  .auto-fields{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr))}
  .auto-options{gap:10px}
  #auto-form>.row{gap:6px;grid-template-columns:1.2fr .7fr 1.1fr}
  #auto-form>.row .btn{font-size:11px}
}
@container (max-height:300px){
  #auto-form{gap:3px}
  #auto-form :is(input[type=number],select){height:32px;min-height:32px}
  #auto-form>.row .btn{min-height:34px}
}

#auto-form .auto-heading h3{margin-right:auto}
#auto-form .auto-close{width:36px;min-height:30px;background:none;color:var(--ink);font-size:20px;padding:0}
@container (max-aspect-ratio:1/1){#auto-form[data-active=true]>.row{grid-template-columns:1fr 1fr 1.2fr}#auto-form[data-active=true]>.row .btn{font-size:10px;white-space:normal;line-height:1.2;padding:6px 3px}}
