/* Ticket creation uses the available workspace, with a stacked mobile layout. */
main:has(#ticket-form) .topbar{padding-bottom:12px;margin-bottom:18px}
.ticket-create-card{width:100%;max-width:none;padding:18px;margin-bottom:0}
.ticket-create-layout{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(280px,1fr);gap:24px;align-items:start}
.ticket-create-main,.ticket-create-properties{display:flex;flex-direction:column;gap:8px;min-width:0}
.ticket-create-properties{padding-left:24px;border-left:1px solid var(--border-soft)}
.ticket-create-main .request-field-description{display:flex;flex-direction:column;flex:1}
.request-field label,.request-create-files>.field-label-text{display:block;margin-bottom:8px}
.ticket-create-card .request-field label,.ticket-create-card .request-create-files>.field-label-text{margin-bottom:4px}
.ticket-create-card .request-create-files>.field-label-text{font-size:12px;font-weight:600}
.ticket-create-card .request-field small,.ticket-create-card .request-create-files>small{margin:4px 0 0;font-size:10px;line-height:1.4}
.ticket-create-card .request-create-files{margin:0}.ticket-create-card .request-create-files .file-drop{min-height:56px;padding:8px 12px;margin:0;gap:2px 10px}
.ticket-create-card .form-actions{justify-content:flex-end;padding-top:10px;border-top:1px solid var(--border-soft);margin-top:12px;background:var(--surface);position:sticky;bottom:0;z-index:2}
.ticket-create-card .request-field input:not([type=hidden]),.ticket-create-card .ui-select-trigger{width:100%;height:38px;min-height:38px;padding:7px 12px}
.ticket-create-card .deadline-clear{height:38px;min-height:38px}
.ticket-create-card .selected-files{max-height:100px;overflow:auto}
.ticket-create-card .file-drop{align-content:center}.ticket-create-card .file-drop>.icon{grid-column:1;grid-row:1/3}.ticket-create-card .file-drop>strong{grid-row:1}.ticket-create-card .file-drop>span{grid-row:2}
.inline-editor{min-width:0;border:1px solid var(--border);border-radius:11px;overflow:hidden;background:var(--input)}
.inline-editor:focus-within{border-color:var(--accent-edge);box-shadow:0 0 0 3px var(--accent-soft)}
.inline-editor-toolbar{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:10px 12px;background:var(--surface-raised);border-bottom:1px solid var(--border-soft)}
.inline-editor-toolbar button{min-height:34px;padding:6px 10px;font-size:11px}.inline-editor-toolbar small{margin:0;font-size:10px;flex:1 1 160px}
.inline-editor-surface{padding:14px;min-height:125px;max-height:650px;overflow:auto;outline:none;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.65;color:var(--text);cursor:text}
.ticket-create-main .inline-editor-toolbar{padding:6px 10px;gap:8px}
.ticket-create-main .inline-editor-surface{min-height:200px;height:clamp(200px,calc(100dvh - 450px),380px);max-height:none;padding:12px}
.inline-editor-surface.is-empty:before{content:attr(data-placeholder);color:var(--muted);pointer-events:none}
.inline-editor-image{display:block;position:relative;width:fit-content;max-width:100%;margin:10px 0;padding:5px;border:1px solid var(--border);border-radius:9px;background:var(--surface)}
.inline-editor-image img{display:block;max-width:100%;max-height:320px;object-fit:contain;border-radius:5px}
.inline-editor-image button{position:absolute;top:7px;right:7px;min-height:30px;width:30px;padding:0;border:1px solid var(--border);background:var(--surface);color:var(--text)}
.inline-editor>.file-error{padding:0 12px}.inline-editor-surface.is-drop-target{box-shadow:inset 0 0 0 2px var(--accent)}
.inline-image{display:block;width:fit-content;max-width:100%;margin:12px 0;border:1px solid var(--border);border-radius:9px;overflow:hidden;background:var(--surface-raised)}
.inline-image img{display:block;max-width:100%;max-height:360px;object-fit:contain}
.inline-image-missing{display:block;color:var(--muted);margin:8px 0;font-size:12px}
.description-image-upload{margin-top:12px}.comment-body{overflow-wrap:anywhere}.comment-files .comment-file-image{display:block;max-width:100%}.comment-file-image img{display:block;max-width:100%;max-height:180px;border-radius:8px;margin-bottom:6px}
/* Keep the actions outside the scrolling fields on short desktop windows. */
@media(min-width:761px){
  .ticket-create-card{display:flex;flex-direction:column;max-height:calc(100dvh - 120px)}
  #ticket-form{display:flex;flex-direction:column;min-height:0}
  .ticket-create-layout{min-height:0;overflow:auto;padding:4px;scroll-padding:12px}
  #ticket-form>.form-actions{flex-shrink:0}
}
@media(min-width:761px) and (max-height:760px){main:has(#ticket-form){padding-top:14px}main:has(#ticket-form) .topbar{margin-bottom:12px;padding-bottom:8px}.ticket-create-card{max-height:calc(100dvh - 100px);padding:14px}.ticket-create-main,.ticket-create-properties{gap:6px}}
@media(min-width:761px) and (max-height:700px){
  .ticket-create-main,.ticket-create-properties{gap:4px}
  .ticket-create-card .request-field label{margin-bottom:3px}
  .ticket-create-card .request-field input:not([type=hidden]),.ticket-create-card .ui-select-trigger,.ticket-create-card .deadline-clear{height:32px;min-height:32px;padding-top:4px;padding-bottom:4px}
  .ticket-create-card .request-create-files .file-drop{min-height:48px;padding:5px 10px}
  .ticket-create-main .inline-editor-surface{min-height:150px}
}
@media(max-width:1000px){.ticket-create-layout{grid-template-columns:minmax(0,1.2fr) minmax(240px,1fr);gap:18px}.ticket-create-properties{padding-left:16px}}
@media(max-width:760px){.ticket-create-layout{grid-template-columns:minmax(0,1fr);gap:20px}.ticket-create-properties{padding:18px 0 0;border-left:0;border-top:1px solid var(--border-soft)}.ticket-create-main .inline-editor-surface{height:230px}.ticket-create-card{padding:14px}.ticket-create-card .form-actions{flex-wrap:wrap;padding-bottom:8px}.inline-editor-toolbar{gap:8px}}
