@layer t2.module {
/* Path: T2Editor/js/utils/modal.css */
/* Path: T2Editor/js/utils/modal.css */
:root {
  --t2-modal-radius: 4px;
  --t2-modal-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t2-modal-shadow:
    0 1px 1px rgba(15, 23, 42, 0.03),
    0 8px 24px -8px rgba(15, 23, 42, 0.16),
    0 24px 64px -12px rgba(15, 35, 60, 0.22);
}

body.t2-modal-open {
  overscroll-behavior: contain;
}

.t2-plugin-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: var(--t2-s4);
  overflow: auto;
  opacity: 1;
  transition: none;
}


.t2-plugin-modal-overlay *,
.t2-plugin-modal-overlay *::before,
.t2-plugin-modal-overlay *::after {
  box-sizing: border-box;
}

.t2-plugin-modal-overlay[data-t2-modal-suspended="true"] {
  display: none !important;
}

.t2-modal-surface {
  position: static;
  margin: auto;
  outline: 0;
  transform: translateY(0) scale(1);
  transform-origin: center;
  transition: none;
}

.t2-modal-surface-default {
  width: min(94vw, 480px);
  max-width: 100%;
  max-height: 90vh;
  max-height: 90dvh;
  overflow: auto;
  border: 1px solid var(--t2-line, var(--t2-line));
  border-radius: var(--t2-modal-radius);
  padding: var(--t2-s6);
  color: var(--t2-ink, var(--t2-ink));
  background: var(--t2-floating, #FFFFFF);
  box-shadow: var(--t2-shadow-modal, var(--t2-modal-shadow));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.t2-modal-surface-fullscreen {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  overflow: hidden;
  border-radius: 0;
}

.t2-modal-surface-default > :first-child {
  margin-top: 0;
}

.t2-modal-surface-default > :last-child {
  margin-bottom: 0;
}

.t2-modal-sheet-handle {
  display: none;
}

.t2-modal-closing {
  pointer-events: none;
}

.t2-modal-closing.t2-modal-close-active {
  opacity: 0;
}

.t2-modal-close-active .t2-modal-surface-basic,
.t2-modal-close-active .t2-modal-surface-adaptive {
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
}

.t2-modal-sheet-dragging {
  transition: none;
}

.t2-modal-sheet-snapback {
  transition: transform 0.2s var(--t2-modal-ease);
}

html[data-t2editor-theme="dark"] .t2-plugin-modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

html[data-t2editor-theme="dark"] .t2-modal-surface-default {
  color: var(--t2-ink, var(--t2-product-wash));
  background: var(--t2-floating, var(--t2-ink));
  border-color: var(--t2-line, var(--t2-ink-muted));
  box-shadow: var(--t2-shadow-modal, 0 18px 46px rgba(0,0,0,.48));
}

@media (max-width: 760px) {
  .t2-modal-overlay-adaptive {
    align-items: flex-end;
    padding: 0;
    overflow: hidden;
  }

  .t2-modal-surface-adaptive {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: none;
    max-height: 92vh;
    max-height: 92dvh;
    margin: 0;
    border-radius: var(--t2-modal-radius) var(--t2-modal-radius) 0 0;
    transform-origin: bottom center;
  }

  .t2-modal-surface-adaptive.t2-modal-surface-default {
    padding: var(--t2-s4);
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .t2-modal-surface-adaptive .t2-modal-sheet-handle {
    display: flex;
    flex-shrink: 0;
    justify-content: center;
    margin: -18px -18px var(--t2-s2);
    padding: 14px 0 var(--t2-s1);
    cursor: grab;
    touch-action: none;
  }

  .t2-modal-surface-adaptive .t2-modal-sheet-handle > span {
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: var(--t2-line);
  }

  .t2-modal-close-active .t2-modal-surface-adaptive {
    opacity: 1;
    transform: translateY(110%);
  }
}

@media (max-width: 360px) {
  .t2-modal-surface-basic.t2-modal-surface-default {
    width: calc(100vw - 24px);
    padding: var(--t2-s4);
  }

  .t2-modal-surface-adaptive.t2-modal-surface-default {
    padding: 14px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .t2-modal-surface-adaptive .t2-modal-sheet-handle {
    margin: -14px -14px var(--t2-s2);
  }
}

@media (max-height: 480px) {
  .t2-modal-surface-default:not(.t2-modal-surface-fullscreen) {
    max-height: 96vh;
    max-height: 96dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .t2-plugin-modal-overlay,
  .t2-modal-surface,
  .t2-modal-sheet-snapback {
    transition: none;
  }
}

@media (prefers-contrast: high) {
  .t2-modal-surface-default {
    border: 1px solid currentColor;
  }
}

@media print {
  .t2-plugin-modal-overlay,
  [data-t2-modal-companion] {
    display: none !important;
  }
}

/* T2Editor visual law — common modal primitive is normalized at source above. */
@media(max-width:760px),(pointer:coarse){
  .t2-modal-overlay-adaptive{padding-top:max(8px,env(safe-area-inset-top));padding-right:env(safe-area-inset-right);padding-bottom:env(safe-area-inset-bottom);padding-left:env(safe-area-inset-left)}
  .t2-modal-surface-default:not(.t2-modal-surface-fullscreen){max-height:min(92dvh,calc(var(--t2-modal-vv-height,100dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px))}
  .t2-modal-surface-adaptive{border-radius:var(--t2-modal-radius) var(--t2-modal-radius) 0 0;border-bottom:0}
  .t2-modal-surface-adaptive .t2-modal-sheet-handle>span{width:42px;height:4px;background:var(--t2-line-strong,var(--t2-line-strong))}
}

/* T2Editor /law 706 — modal scroll ownership */
.t2-plugin-modal-overlay {
  overflow-x: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y pinch-zoom;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.t2-modal-surface-default {
  max-width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  overscroll-behavior-y: contain;
  touch-action: pan-y pinch-zoom;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.t2-plugin-modal-overlay::-webkit-scrollbar,
.t2-modal-surface-default::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
/* Custom drag surfaces own pointer movement and must not trigger native text/image selection. */
:where([data-t2-drag-surface], [draggable="true"], input[type="range"], [role="slider"],
  [class*="drag-handle"], [class*="resize-handle"], [class*="resizer"],
  [class*="crop-handle"], [class*="trim-handle"], [class*="seek-bar"],
  [class*="slider-thumb"], [class*="range-thumb"]) {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
:where([data-t2-drag-surface], [draggable="true"], input[type="range"], [role="slider"],
  [class*="drag-handle"], [class*="resize-handle"], [class*="resizer"],
  [class*="crop-handle"], [class*="trim-handle"], [class*="seek-bar"],
  [class*="slider-thumb"], [class*="range-thumb"]) img {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}
html.t2-drag-selection-active, html.t2-drag-selection-active body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

}
