/* Marked-up screenshots (GitHub issue 515; docs/adr/0277-marked-up-screenshots.md): the editor's dialog, and
   "Mark up a screenshot" beside Attach files (ticket-files.js) and Attach in the reply box (workflow.js). On a phone the
   editor fills the screen and its controls are at least 44 px; drawing on the picture never scrolls the page. */
.modal-backdrop.sm-backdrop { padding:var(--space-250); place-items:center; overscroll-behavior:contain; }
.sm-backdrop.sm-capturing { visibility:hidden; }
.sm-modal { box-sizing:border-box; display:flex; flex-direction:column; gap:var(--space-150); width:min(1120px, 100%); max-width:none; height:min(880px, calc(100dvh - 2 * var(--space-250))); margin:0; overflow:hidden; }
.sm-head { display:flex; align-items:center; justify-content:space-between; gap:var(--space-150); }
.sm-head h2 { margin:0; font-size:var(--text-lg); overflow-wrap:anywhere; }
.sm-modal .sm-close { position:static; flex:none; }
.sm-pick, .sm-edit { display:flex; flex:1 1 auto; flex-direction:column; gap:var(--space-150); min-height:0; }
.sm-pick[hidden], .sm-edit[hidden], .sm-words[hidden] { display:none; }
.sm-drop { display:grid; flex:1 1 auto; align-content:center; justify-items:center; gap:var(--space-200); padding:var(--space-400) var(--space-250); border:var(--control-border-width) dashed var(--control-border); border-radius:var(--radius-lg); background:var(--surface-2); color:var(--ink-2); text-align:center; }
.sm-drop.is-drop-target { border-color:var(--spruce); background:var(--spruce-pale); }
.sm-drop-title { margin:0; color:var(--ink); font-size:var(--text-md); font-weight:var(--weight-semibold); overflow-wrap:anywhere; }
.sm-drop small { max-width:52ch; color:var(--muted); font-size:var(--text-sm); overflow-wrap:anywhere; }
.sm-pick-buttons { display:flex; flex-wrap:wrap; justify-content:center; gap:var(--space-100); }
.sm-tools { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-75); }
.sm-tool { min-height:var(--control-height); padding:0 var(--space-150); border:var(--control-border-width) solid var(--control-border); border-radius:var(--radius-md); background:var(--surface); color:var(--ink-2); font:inherit; font-size:var(--text-sm); font-weight:var(--weight-semibold); cursor:pointer; }
.sm-tool:hover { border-color:var(--control-hover); color:var(--ink); }
.sm-tool[aria-pressed="true"] { border-color:var(--spruce); background:var(--spruce-pale); color:var(--ink); box-shadow:inset 0 0 0 1px var(--spruce); }
.sm-tool:focus-visible, .sm-undo:focus-visible { outline:0; box-shadow:0 0 0 var(--focus-ring-width) var(--control-focus); }
.sm-undo { margin-left:auto; min-height:var(--control-height); font-size:var(--text-sm); }
.sm-words { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-100); color:var(--ink-2); font-size:var(--text-sm); font-weight:var(--weight-semibold); }
.sm-words input { flex:1 1 220px; min-width:0; min-height:var(--control-height); }
.sm-stage { display:grid; flex:1 1 auto; place-items:center; min-height:0; overflow:hidden; border-radius:var(--radius-lg); background:var(--surface-2); }
.sm-canvas { display:block; max-width:100%; max-height:100%; touch-action:none; cursor:crosshair; user-select:none; -webkit-user-select:none; }
.sm-hint { min-height:1.4em; margin:0; color:var(--ink-2); font-size:var(--text-sm); overflow-wrap:anywhere; }
.sm-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:var(--space-100); }

/* Beside Attach files, and beside Attach in the reply box. */
.raise-files-row .sm-open-button .vis-icon, .comment-composer .sm-open-button .vis-icon { width:14px; height:14px; flex:none; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.raise-files-row .sm-open-button { display:inline-flex; align-items:center; gap:var(--space-75); }
.comment-composer .composer-footer .sm-open-button { display:inline-flex; align-items:center; gap:var(--space-75); }

@media (max-width:700px) {
  .modal-backdrop.sm-backdrop { padding:0; }
  .sm-modal { position:fixed; inset:0; width:100%; height:100%; border:0; border-radius:0; padding:var(--space-150); }
  .sm-dialog button, .sm-dialog input[type="text"] { min-height:44px; }
  .sm-dialog .sm-close { min-width:44px; }
  .sm-tool { flex:1 1 auto; }
  .sm-undo { margin-left:0; flex:1 1 auto; }
  .sm-actions > button { flex:1 1 0; }
  .raise-files-row .sm-open-button, .comment-composer .sm-open-button { min-height:44px; }
}
