/* The six-step editor owns its layout on desktop, tablet and phone. Keep these
   rules scoped: other dialogs and customer pages use their own form layouts. */
#modal.admin-ticket-editor{
  width:min(1120px,calc(100vw - 32px));
  max-width:1120px;
  max-height:calc(100dvh - 32px);
  padding:28px;
  overflow:auto;
  overscroll-behavior:contain;
}
#modal.admin-ticket-editor #modal-body,
#modal.admin-ticket-editor #dialog-form,
#modal.admin-ticket-editor .admin-editor-layout,
#modal.admin-ticket-editor .admin-editor-layout>*{min-width:0;max-width:100%}
#modal.admin-ticket-editor #dialog-form{display:grid;grid-template-columns:minmax(0,1fr)}
#modal.admin-ticket-editor .admin-editor-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:18px 0 0;
  padding:0 0 14px;
  border-bottom:1px solid var(--line,#dce6ec);
  overflow:visible;
}
#modal.admin-ticket-editor .admin-editor-tabs button{
  display:flex;
  align-items:center;
  gap:7px;
  min-width:0;
  min-height:40px;
  padding:8px 10px;
  font-size:13px;
  white-space:normal;
  line-height:1.45;
}
#modal.admin-ticket-editor .admin-editor-tabs button>span{flex-shrink:0}
#modal.admin-ticket-editor .admin-editor-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(230px,270px);
  grid-template-areas:"fields preview";
  align-items:start;
  gap:24px;
  margin-top:22px;
}
/* Explicit areas prevent an added hint or legacy decoration from pushing the
   entire form into the narrow preview column. */
#modal.admin-ticket-editor .admin-editor-layout>.admin-editor-pane-list{
  grid-area:fields;
  display:block;
  width:100%;
  margin:0;
}
#modal.admin-ticket-editor .admin-editor-layout>.admin-editor-preview{grid-area:preview}
#modal.admin-ticket-editor .admin-editor-layout>.sub{grid-column:1/-1}
#modal.admin-ticket-editor .admin-editor-pane{width:100%;min-width:0}
#modal.admin-ticket-editor [hidden]{display:none!important}
#modal.admin-ticket-editor .admin-editor-pane h3{font-size:18px!important;line-height:1.5;margin:0 0 8px!important}
#modal.admin-ticket-editor .admin-editor-hint{font-size:13px!important;line-height:1.7!important;color:var(--muted,#677c8e)}
#modal.admin-ticket-editor .admin-editor-fields{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px 20px;
  margin-top:20px;
  min-width:0;
}
#modal.admin-ticket-editor .admin-editor-fields>*{min-width:0;max-width:100%}
#modal.admin-ticket-editor .admin-editor-fields>label{font-size:14px;line-height:1.65}
#modal.admin-ticket-editor .admin-editor-fields>.full,
#modal.admin-ticket-editor .admin-description-templates,
#modal.admin-ticket-editor .admin-price-difference,
#modal.admin-ticket-editor .admin-editor-readonly,
#modal.admin-ticket-editor .admin-editor-sites,
#modal.admin-ticket-editor .admin-editor-scope,
#modal.admin-ticket-editor .admin-editor-review,
#modal.admin-ticket-editor .admin-editor-fields>.admin-editor-hint{grid-column:1/-1}
#modal.admin-ticket-editor .admin-editor-fields input:not([type=checkbox]),
#modal.admin-ticket-editor .admin-editor-fields select,
#modal.admin-ticket-editor .admin-editor-fields textarea{
  width:100%;
  min-width:0;
  max-width:100%;
  font-size:15px;
  line-height:1.5;
  padding:10px 12px;
}
#modal.admin-ticket-editor .admin-editor-fields textarea{min-height:180px;resize:vertical}
#modal.admin-ticket-editor .admin-description-templates{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
#modal.admin-ticket-editor .admin-description-templates>span{flex-basis:100%;font-size:13px;color:var(--muted,#677c8e)}
#modal.admin-ticket-editor .admin-description-templates button{font-size:13px;min-height:38px;padding:7px 11px;white-space:normal}
#modal.admin-ticket-editor .admin-editor-preview{border-left:1px solid var(--line,#dce6ec);padding-left:20px;overflow-wrap:anywhere}
#modal.admin-ticket-editor .admin-preview-card{padding:18px;border:1px solid var(--line,#dce6ec);border-radius:10px;background:#fafcfd}
#modal.admin-ticket-editor .admin-preview-card h3{font-size:18px!important;line-height:1.5;margin:12px 0!important}
#modal.admin-ticket-editor .admin-preview-card>strong{font-size:28px;color:#b85d21}
#modal.admin-ticket-editor .admin-preview-card strong small{font-size:13px;font-weight:400;color:var(--muted,#677c8e)}
#modal.admin-ticket-editor .admin-preview-card p{font-size:13px!important;line-height:1.6;overflow-wrap:anywhere}
#modal.admin-ticket-editor .admin-editor-sites{margin:0;padding:14px 16px;border:1px solid var(--line,#dce6ec);border-radius:10px}
#modal.admin-ticket-editor .admin-editor-sites .check{font-size:14px!important;min-height:44px;gap:9px;align-items:center}
#modal.admin-ticket-editor .admin-editor-sites input{flex:0 0 auto}
#modal.admin-ticket-editor .admin-editor-scope{padding:16px;border:1px solid #d2e5df;border-radius:10px;background:#f5faf7;overflow-wrap:anywhere}
#modal.admin-ticket-editor .admin-editor-review dl{display:grid;grid-template-columns:minmax(110px,.7fr) minmax(0,1.3fr);margin:0}
#modal.admin-ticket-editor .admin-editor-review dt,
#modal.admin-ticket-editor .admin-editor-review dd{margin:0;padding:12px 0;font-size:14px;overflow-wrap:anywhere;border-bottom:1px solid var(--line,#dce6ec)}
#modal.admin-ticket-editor .admin-description{white-space:pre-wrap;overflow-wrap:anywhere}
#modal.admin-ticket-editor .form-actions{grid-column:1/-1;min-width:0;flex-wrap:wrap;gap:10px}
#modal.admin-ticket-editor .form-actions .admin-editor-save-note{flex:1 1 100%;font-size:12px;line-height:1.6}
#modal.admin-ticket-editor .form-actions button{min-height:42px;min-width:80px}
#modal.admin-ticket-editor .admin-ticket-common-limits{grid-column:1/-1;min-width:0;max-width:100%;padding:16px;border:1px solid #c9e1e8;border-radius:12px;background:#f5fafc}
#modal.admin-ticket-editor .admin-ticket-common-limits legend{font-size:16px;font-weight:700;padding:0 6px;color:#174457}
#modal.admin-ticket-editor .admin-ticket-common-limits>p{font-size:13px;line-height:1.7;margin:7px 0 14px;color:#526d7d}
#modal.admin-ticket-editor .admin-ticket-common-limit-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}
#modal.admin-ticket-editor .admin-ticket-common-limit-fields>label{min-width:0}
@media(max-width:980px){
  #modal.admin-ticket-editor .admin-editor-layout{grid-template-columns:minmax(0,1fr);grid-template-areas:"fields" "preview"}
  #modal.admin-ticket-editor .admin-editor-preview{border-left:0;border-top:1px solid var(--line,#dce6ec);padding:18px 0 0}
}
@media(max-width:600px){
  #modal.admin-ticket-editor{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:24px 16px 16px;border-radius:14px}
  #modal.admin-ticket-editor h2{font-size:22px;line-height:1.5;margin-right:30px}
  #modal.admin-ticket-editor .admin-editor-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  #modal.admin-ticket-editor .admin-editor-tabs button{width:100%;font-size:14px;min-height:44px;justify-content:flex-start}
  #modal.admin-ticket-editor .admin-editor-fields{grid-template-columns:minmax(0,1fr);gap:16px}
  #modal.admin-ticket-editor .admin-ticket-common-limit-fields{grid-template-columns:minmax(0,1fr)}
  #modal.admin-ticket-editor .admin-editor-fields input:not([type=checkbox]),
  #modal.admin-ticket-editor .admin-editor-fields select,
  #modal.admin-ticket-editor .admin-editor-fields textarea{font-size:16px;min-height:46px}
  #modal.admin-ticket-editor .admin-editor-fields textarea{min-height:180px}
  #modal.admin-ticket-editor .admin-editor-review dl{grid-template-columns:minmax(0,1fr)}
  #modal.admin-ticket-editor .admin-editor-review dt{padding:12px 0 0;border-bottom:0;color:var(--muted,#677c8e)}
  #modal.admin-ticket-editor .admin-editor-review dd{padding:5px 0 12px}
  #modal.admin-ticket-editor .form-actions button{flex:1 1 calc(50% - 10px);min-width:0}
}
