.compat-field-tintpro_window_masks .field,
.attachment-compat .tintpro-window-mask-editor {
  width: 100%;
}

.tintpro-mask-summary {
  margin: 0 0 10px;
  color: #50575e;
}

body.tintpro-mask-modal-open {
  overflow: hidden;
}

.tintpro-mask-modal[hidden] {
  display: none;
}

.tintpro-mask-modal {
  position: fixed;
  inset: 0;
  z-index: 160000;
}

.tintpro-mask-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.72);
}

.tintpro-mask-modal-dialog {
  position: absolute;
  inset: 32px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

.tintpro-mask-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid #dcdcde;
}

.tintpro-mask-modal-header strong {
  display: block;
  font-size: 18px;
}

.tintpro-mask-modal-header p {
  margin: 5px 0 0;
  color: #50575e;
}

.tintpro-mask-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  min-height: 0;
}

.tintpro-mask-stage-wrap {
  min-width: 0;
  min-height: 0;
  padding: 18px;
  overflow: auto;
  text-align: center;
  background:
    linear-gradient(45deg, #f0f0f1 25%, transparent 25%, transparent 75%, #f0f0f1 75%, #f0f0f1),
    linear-gradient(45deg, #f0f0f1 25%, transparent 25%, transparent 75%, #f0f0f1 75%, #f0f0f1);
  background-position: 0 0, 12px 12px;
  background-size: 24px 24px;
}

.tintpro-mask-stage {
  position: relative;
  display: inline-block;
  width: min(100%, 1180px);
  margin: 0 auto;
  border: 1px solid #c3c4c7;
  background: #111827;
  line-height: 0;
  cursor: none;
}

.tintpro-mask-image {
  display: block;
  width: 100%;
  height: auto;
}

.tintpro-mask-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: none;
}

.tintpro-mask-loupe {
  position: absolute;
  left: 0;
  top: 0;
  width: 128px;
  height: 128px;
  margin-left: -64px;
  margin-top: -64px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 0 1px rgba(17, 24, 39, 0.85),
    0 16px 32px rgba(0, 0, 0, 0.4);
  background-repeat: no-repeat;
  background-color: #111827;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 4;
}

.tintpro-mask-loupe::before,
.tintpro-mask-loupe::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
}

.tintpro-mask-loupe::before {
  left: 50%;
  top: 18px;
  width: 1px;
  height: calc(100% - 36px);
  transform: translateX(-50%);
}

.tintpro-mask-loupe::after {
  top: 50%;
  left: 18px;
  height: 1px;
  width: calc(100% - 36px);
  transform: translateY(-50%);
}

.tintpro-mask-loupe.is-visible {
  opacity: 1;
  transform: scale(1);
}

.tintpro-mask-loupe-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.tintpro-mask-loupe-polygon {
  fill: rgba(34, 113, 177, 0.28);
  stroke: #f4c534;
  stroke-width: 1.6;
  stroke-dasharray: 6 4;
}

.tintpro-mask-loupe-line {
  fill: none;
  stroke: #f4c534;
  stroke-width: 1.6;
  stroke-dasharray: 6 4;
}

.tintpro-mask-loupe-point {
  fill: #2271b1;
  stroke: #fff;
  stroke-width: 1.2;
}

.tintpro-mask-polygon {
  fill: rgba(15, 23, 42, 0.36);
  stroke: rgba(219, 166, 23, 0.9);
  stroke-width: 0.35;
  stroke-dasharray: 1.3 0.9;
}

.tintpro-mask-polygon.is-active {
  fill: rgba(34, 113, 177, 0.22);
  stroke: #dba617;
}

.tintpro-mask-line {
  fill: none;
  stroke: rgba(219, 166, 23, 0.9);
  stroke-width: 0.35;
  stroke-dasharray: 1.3 0.9;
}

.tintpro-mask-point {
  fill: #2271b1;
  stroke: #fff;
  stroke-width: 0.35;
  opacity: 0.7;
  cursor: move;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.35));
}

.tintpro-mask-point:hover {
  fill: #dba617;
  opacity: 0.85;
}

.tintpro-mask-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 18px;
  border-left: 1px solid #dcdcde;
  overflow: auto;
}

.tintpro-mask-field span {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.tintpro-mask-option {
  width: 100%;
}

.tintpro-mask-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tintpro-mask-status,
.tintpro-mask-save-state {
  margin: 0;
  color: #50575e;
}

.tintpro-mask-save-state.is-pending {
  color: #a15c00;
}

.tintpro-mask-save-state.is-success {
  color: #008a20;
}

.tintpro-mask-save-state.is-error {
  color: #d63638;
}

@media (max-width: 900px) {
  .tintpro-mask-modal-dialog {
    inset: 12px;
  }

  .tintpro-mask-layout {
    grid-template-columns: 1fr;
  }

  .tintpro-mask-sidebar {
    border-top: 1px solid #dcdcde;
    border-left: 0;
  }
}
