/* Image markup editor (iw-markup.js): shared by the interactive workflow, the image tool and the AI assistant. */
html.mk-open, html.mk-open body { overflow: hidden; }
.mk-backdrop { position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(6, 8, 10, .78); font: 13px/1.5 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; color: #e8ecef; }
.mk-dialog { display: flex; flex-direction: column; width: min(1400px, 100%); height: min(920px, 100%); background: #15181b;
  border: 1px solid #2c3338; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); overflow: hidden; }
.mk-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #262c31; }
.mk-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-close { width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: #aab4bb; font-size: 22px; line-height: 1; cursor: pointer; }
.mk-close:hover { background: #262c31; color: #fff; }
.mk-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-bottom: 1px solid #262c31; }
.mk-tool { min-width: 52px; height: 30px; padding: 0 12px; border: 1px solid #39424a; border-radius: 6px; background: #1d2226; color: #dbe2e7; cursor: pointer; font: inherit; }
.mk-tool:hover:not(:disabled) { border-color: #5d6b75; }
.mk-tool.is-on { background: #1f6f5c; border-color: #2fa184; color: #fff; }
.mk-tool:disabled { opacity: .45; cursor: default; }
.mk-sep { width: 1px; height: 20px; margin: 0 4px; background: #39424a; }
.mk-hint { margin-left: 8px; color: #8d99a2; font-size: 12px; }
.mk-body { flex: 1; min-height: 0; display: flex; }
.mk-stage { flex: 1; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; background: #0d0f11;
  background-image: linear-gradient(45deg, #121518 25%, transparent 25%), linear-gradient(-45deg, #121518 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #121518 75%), linear-gradient(-45deg, transparent 75%, #121518 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
.mk-frame { position: relative; flex: none; box-shadow: 0 0 0 1px #2c3338; }
.mk-image { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.mk-canvas { position: absolute; inset: 0; touch-action: none; cursor: crosshair; }
.mk-side { width: 340px; flex: none; display: flex; flex-direction: column; border-left: 1px solid #262c31; overflow-y: auto; }
.mk-list { margin: 0; padding: 10px; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.mk-item { padding: 8px; border: 1px solid #2c3338; border-radius: 8px; background: #1a1e22; }
.mk-item.is-selected { border-color: #2fa184; }
.mk-item-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mk-badge { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; color: #000; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center; }
.mk-label { flex: 1; min-width: 0; color: #aab4bb; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-remove { flex: none; width: 24px; height: 24px; border: 0; border-radius: 5px; background: transparent; color: #8d99a2; font-size: 17px; cursor: pointer; }
.mk-remove:hover { background: #3a2226; color: #ff8a80; }
.mk-input { display: block; width: 100%; box-sizing: border-box; resize: vertical; min-height: 44px; padding: 6px 8px; border: 1px solid #39424a;
  border-radius: 6px; background: #111417; color: #e8ecef; font: inherit; }
.mk-input:focus { outline: none; border-color: #2fa184; }
.mk-empty { margin: 16px; color: #8d99a2; }
.mk-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid #262c31; }
.mk-status { flex: 1; color: #f5c26b; font-size: 12px; }
.mk-button { height: 34px; padding: 0 18px; border: 1px solid #39424a; border-radius: 7px; background: #1d2226; color: #dbe2e7; cursor: pointer; font: inherit; }
.mk-button:hover:not(:disabled) { border-color: #5d6b75; }
.mk-primary { background: #1f8a6f; border-color: #1f8a6f; color: #fff; font-weight: 600; }
.mk-primary:hover:not(:disabled) { background: #23a081; }
.mk-button:disabled { opacity: .45; cursor: default; }
@media (max-width: 760px) {
  .mk-backdrop { padding: 0; }
  .mk-dialog { width: 100%; height: 100%; border-radius: 0; border: 0; }
  .mk-hint { display: none; }
  .mk-body { flex-direction: column; }
  .mk-stage { flex: 1 1 55%; }
  .mk-side { width: auto; flex: 1 1 45%; border-left: 0; border-top: 1px solid #262c31; }
}
/* Read-only list of marks shown by the page that opened the editor (IwMarkup.summary). */
.mk-summary { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; min-width: 0; overflow-x: hidden; white-space: normal; font-size: 12px; line-height: 1.45; }
.mk-summary li { display: flex; align-items: flex-start; gap: 6px; }
.mk-summary .mk-badge { width: 18px; height: 18px; font-size: 11px; border-width: 1.5px; margin-top: 1px; }
.mk-summary-text { flex: 1; min-width: 0; overflow-wrap: anywhere; white-space: normal; }
