/* Append after existing dialog/mobile rules. Scoped to the event form only. */
dialog:has(#event-form){max-width:640px;width:calc(100% - 24px);max-height:calc(100dvh - 32px);overflow:hidden}
#event-form{display:flex;flex-direction:column;max-height:calc(100dvh - 34px);min-height:0}
#event-form .dialog-head{position:static;flex:none;padding:14px 18px;gap:12px}
#event-form .dialog-head h2{font-size:19px;line-height:1.3}
#event-form .dialog-head .icon-button{min-height:34px;width:34px}
#event-form .dialog-body{padding:12px 18px 14px;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-color:#8b98a1 #f3f5f6;scrollbar-width:thin}
#event-form .editor-required-note{margin:0 0 10px;color:var(--muted);font-size:12px}
#event-form .form-grid{gap:10px 14px;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
#event-form .form-field{gap:4px;font-size:13px;min-width:0}
#event-form .form-field small{font-size:12px}
#event-form .form-field>small{margin-top:-3px}
#event-form .form-field input,#event-form .form-field select{min-height:36px;padding:7px 9px;font-size:14px;min-width:0}
#event-form .form-field textarea{min-height:36px;height:36px;max-height:150px;resize:vertical;padding:7px 9px;font-size:14px;line-height:20px}
#event-form input::placeholder,#event-form textarea::placeholder{color:#656e76;opacity:1}
#event-form .editor-trip-fields{margin-top:12px}
#event-form .editor-route-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 6px}
#event-form .editor-route-head h3{font-size:14px}
#event-form .editor-route-head button{min-height:30px;padding:4px 6px;font-size:13px;color:var(--blue)}
#event-form .stop-row{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr) 34px;gap:10px;align-items:start;margin:0 0 10px}
#event-form .stop-row .icon-button{width:34px;min-height:36px;margin-top:23px}
#event-form .editor-purpose{margin-top:2px}
#event-form .editor-transport{border:0;margin:12px 0 0;padding:0;min-width:0}
#event-form .editor-transport legend{padding:0;font-size:13px}
#event-form #transport-hint{margin:2px 0 6px;font-size:12px;color:var(--muted)}
#event-form .check-group{gap:8px}
#event-form .check-group label{padding:7px 10px;font-size:13px;min-height:36px;gap:7px}
#event-form .check-group input{min-height:0;width:16px;height:16px;margin:0;padding:0}
#event-form .editor-details{margin-top:12px;border-top:1px solid var(--line);font-size:13px}
#event-form .editor-details summary{cursor:pointer;padding:10px 0 2px;color:var(--blue);min-height:32px}
#event-form .editor-details summary:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
#event-form .editor-detail-fields{display:grid;gap:12px;padding-top:10px}
#event-form .dialog-foot{position:static;flex:none;display:grid;grid-template-columns:minmax(130px,1fr) auto;align-items:end;gap:10px 14px;padding:12px 18px}
#event-form .editor-status{display:flex;flex-direction:column;gap:4px;font-size:12px;max-width:174px;min-width:0}
#event-form .editor-status select{min-height:38px;width:100%;font-size:14px;padding:7px 9px}
#event-form .editor-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;align-items:center}
#event-form .editor-actions button{min-height:38px;padding:8px 11px;font-size:14px}
#event-form .editor-actions .danger{margin:0}
#event-form .form-error{grid-column:1/-1;margin:0;max-height:110px;overflow-y:auto;font-size:13px;line-height:1.4;padding:8px 10px;overflow-wrap:anywhere}
#event-form .form-error:empty{display:none}
#event-form .form-error:focus{outline:2px solid var(--danger);outline-offset:2px}
#event-form .discard-warning{margin-bottom:12px!important;font-size:13px}
.editor-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:760px){
  #event-form .stop-row .form-field:first-child{grid-column:auto}
}
@media(max-width:520px){
  dialog:has(#event-form){width:calc(100% - 16px);max-height:calc(100dvh - 16px)}
  #event-form{max-height:calc(100dvh - 18px)}
  #event-form .dialog-head{padding:12px 14px}
  #event-form .dialog-body{padding:10px 14px 12px}
  #event-form .form-grid{gap:10px}
  #event-form .form-field input,#event-form .form-field select,#event-form .form-field textarea{font-size:16px}
  #event-form .stop-row{grid-template-columns:minmax(0,1fr) 34px;gap:7px;margin-bottom:12px}
  #event-form .stop-row .form-field:first-child{grid-column:1/-1}
  #event-form .check-group{gap:6px}
  #event-form .check-group label{font-size:12px;padding:7px 8px;gap:6px}
  #event-form .dialog-foot{padding:10px 14px;gap:8px;grid-template-columns:minmax(105px,1fr) auto}
  #event-form .editor-actions{gap:6px;max-width:218px}
  #event-form .editor-actions button{padding:8px 9px;font-size:13px}
  #event-form .editor-status select{font-size:14px}
  #event-form [data-trip-optional]{grid-template-columns:1fr}
}
