/* Shapes (js/shapes.js): the drawn geometry behind a text box's text, the draw overlay, the gallery. */
.udoc-textbox.udoc-shape { border-width: 0; border-color: transparent; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
.udoc-textbox.udoc-shape:hover { box-shadow: none; }
.udoc-textbox.udoc-shape > svg.udoc-shape-bg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 0; }
.udoc-textbox.udoc-shape > .tbox-content { position: relative; z-index: 1; background: transparent; }
.udoc-textbox.udoc-shape.tbox-selected { outline: 1px dashed #5b8def; outline-offset: 1px; }
@media print { .udoc-textbox.udoc-shape.tbox-selected { outline: none; } }

.udoc-shape-draw { position: fixed; inset: 0; z-index: 9000; cursor: crosshair; touch-action: none; }
.udoc-shape-rubber { position: fixed; display: none; box-sizing: border-box; border: 1px dashed #2f6fd6; background: rgba(47, 111, 214, .08); pointer-events: none; }

.udoc-shape-gallery { position: fixed; z-index: 9500; width: 300px; max-height: 70vh; overflow: auto; padding: 8px 10px 10px; border: .5px solid var(--ui-line, #c8c8cc);
  border-radius: 10px; background: var(--ui-bg, #fff); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); font: 12px/1.4 var(--ui-sheet-font, system-ui, sans-serif); color: var(--ui-ink, #1d1d1f); }
.udoc-shape-gallery .usg-title { margin: 0 2px 4px; font-weight: 600; font-size: 13px; }
.udoc-shape-gallery .usg-group { margin: 6px 2px 4px; color: var(--ui-ink-2, #555); }
.udoc-shape-gallery .usg-grid { display: grid; grid-template-columns: repeat(10, 26px); gap: 2px; }
.udoc-shape-gallery button { width: 26px; height: 26px; padding: 2px; border: 0; border-radius: 5px; background: none; color: var(--ui-ink, #1d1d1f); cursor: pointer; }
.udoc-shape-gallery button:hover, .udoc-shape-gallery button:focus-visible { background: var(--ui-hover, rgba(0, 122, 255, .1)); outline: none; }
.udoc-shape-gallery button svg { width: 100%; height: 100%; display: block; }

:where(#ui-pack-chrome) .uip-gallery-shapeStyles .uip-tile { width: 54px; }
:where(#ui-pack-chrome) .uip-gallery-shapeStyles .uip-tile-preview { width: 40px; height: 26px; margin: 4px auto 2px; border-radius: 3px; box-sizing: border-box; font: 600 13px/24px system-ui, sans-serif; text-align: center; }
:where(#ui-pack-chrome) .uip-gallery-shapeStyles .uip-tile-preview i { display: none; }
