/* KSK Designer 1.1.23 -- category drawer sizing and native touch scrolling */
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-ready-home[hidden],
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-ready-detail[hidden],
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-ready-shapes[hidden],
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-ready-loading[hidden],
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-ready-results[hidden],
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-move-zone[hidden],
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-print-toolbar[hidden] {display:none!important}
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-ready-category-grid {
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:9px!important;margin:0!important;padding:3px 1px 10px!important;
  align-content:start!important;max-width:100%!important;
}
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-ready-category {
  appearance:none!important;box-sizing:border-box!important;display:flex!important;min-width:0!important;
  flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;
  margin:0!important;padding:6px!important;min-height:116px!important;height:auto!important;
  border:1px solid #e1e8f0!important;background:#fff!important;border-radius:9px!important;
  color:#344256!important;box-shadow:none!important;text-transform:none!important;cursor:pointer!important;
}
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-ready-category:hover,:is(.kskd-shell,.kskd-mobile-sheet) .kskd-ready-category:focus-visible {
  border-color:#1769c2!important;background:#f5f9ff!important;
}
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-ready-category-visual {
  height:92px!important;width:100%!important;max-width:100%!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
  overflow:hidden!important;border-radius:6px!important;background:#f3f6fa!important;
}
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-ready-category-visual img{display:block!important;width:100%!important;height:100%!important;object-fit:contain!important}
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-ready-category-visual>span{font-size:37px!important;line-height:1!important;white-space:nowrap!important}
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-ready-category-name{
  display:block!important;text-align:center!important;font-size:11px!important;font-weight:650!important;
  line-height:1.3!important;padding:7px 2px 2px!important;overflow-wrap:anywhere!important;
}
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-ready-back {
  background:#eff6ff!important;color:#175b9c!important;border:1px solid #d1e4f7!important;
  min-height:34px!important;padding:5px 11px!important;border-radius:8px!important;
  font-size:12px!important;font-weight:600!important;display:inline-flex!important;align-items:center!important;
  margin:1px 0 10px!important;width:auto!important;
}
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-ready-category-title{display:block!important;margin:2px 0 11px!important;font-size:14px!important;color:#173a5d!important}
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-ready-results{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-ready-results .kskd-source-item{min-width:0!important;width:100%!important;box-sizing:border-box!important}
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-ready-loading{font-size:12px;color:#4b6480;padding:8px 0}
/* Three columns only when a genuine wide panel is available. */
@container (min-width:440px){:is(.kskd-shell,.kskd-mobile-sheet) .kskd-ready-category-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
/* Categories must size against the actual drawer, not the narrow icon rail.
   A max-width:100% here previously resolved against the 56-84px rail on
   desktop and squeezed category names into vertical letters. */
:is(.kskd-shell,.kskd-mobile-sheet) #kskd-shapes-panel{
  container-type:inline-size;
  min-width:0!important;
}
@media(min-width:851px){
  /* Preserve the existing 1.1.22 drawer layout and only remove the accidental
     rail-width cap. Max width follows the actual panel, not its parent rail. */
  .kskd-shell[data-desktop-modules-layout] .kskd-workspace .kskd-tools >
  .kskd-module[data-module="shapes"] > #kskd-shapes-panel:not([hidden]){
    box-sizing:border-box!important;
    width:min(292px,calc(100vw - 110px))!important;
    max-width:min(292px,calc(100vw - 110px))!important;
    min-width:225px!important;
  }
  .kskd-shell[data-desktop-modules-layout] #kskd-shapes-panel .kskd-ready-category-name{
    overflow-wrap:break-word!important;
    word-break:normal!important;
    hyphens:auto;
  }
}
/* The mobile bottom-sheet CONTENT is the only vertical scroller. Nested scrolling
   on the original module panel could trap touch panning with overscroll contain. */
.kskd-mobile-sheet .kskd-mobile-sheet-content{
  overflow-y:auto!important;
  overflow-x:hidden!important;
  min-height:0!important;
  overscroll-behavior-y:contain!important;
  -webkit-overflow-scrolling:touch!important;
  touch-action:pan-y!important;
}
.kskd-mobile-sheet .kskd-mobile-sheet-content > #kskd-shapes-panel{
  container-type:inline-size;
  box-sizing:border-box!important;
  min-width:0!important;
  width:100%!important;
  max-width:100%!important;
  max-height:none!important;
  height:auto!important;
  overflow:visible!important;
  overscroll-behavior:auto!important;
  touch-action:pan-y!important;
}
.kskd-mobile-sheet .kskd-ready-category-grid,
.kskd-mobile-sheet .kskd-ready-category,
.kskd-mobile-sheet .kskd-ready-category-visual {
  touch-action:pan-y!important;
}

@media (max-width:767px){
  .kskd-mobile-sheet .kskd-ready-category-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .kskd-mobile-sheet .kskd-ready-category{min-height:110px!important;max-width:100%!important;padding:5px!important}
  .kskd-mobile-sheet .kskd-ready-category-visual{height:79px!important}
  .kskd-mobile-sheet .kskd-ready-category-name{font-size:10px!important}
  .kskd-mobile-sheet .kskd-ready-results{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  /* Do not scroll the portaled panel itself: the sheet content scrolls. */
}
/* Keep the optional inquiry note quiet so the upload remains the main action. */
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-visual-hint{box-sizing:border-box;margin:9px 0;padding:10px 11px;border-radius:9px;background:#f6f9fd;border:1px solid #dae6f4;display:flex;flex-direction:column;gap:5px;color:#38506d}
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-visual-hint strong{font-size:12px;color:#274b77}
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-visual-hint span{font-size:11px;line-height:1.48}
:is(.kskd-shell,.kskd-mobile-sheet) .kskd-open-visual-request{background:transparent!important;border:none!important;box-shadow:none!important;color:#1769c2!important;text-decoration:underline!important;text-underline-offset:3px!important;font-size:11px!important;font-weight:700!important;align-self:flex-start!important;max-width:100%!important;padding:3px 0!important;min-height:26px!important;text-transform:none!important}
.kskd-visual-modal[hidden]{display:none!important}
.kskd-visual-modal{position:fixed!important;inset:0!important;z-index:2147483620!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow-y:auto!important;overscroll-behavior:contain!important;background:rgba(15,28,48,.68)!important;padding:14px!important;box-sizing:border-box!important}
.kskd-visual-dialog{position:relative!important;max-width:510px!important;width:100%!important;max-height:min(90dvh,760px)!important;overflow-y:auto!important;background:white!important;border-radius:14px!important;box-shadow:0 22px 65px rgba(0,0,0,.27)!important;padding:24px!important;box-sizing:border-box!important;color:#283d55!important;font-family:inherit!important}
.kskd-visual-dialog h3{font-size:20px!important;margin:0 28px 8px 0!important;color:#193451!important}
.kskd-visual-dialog>p{font-size:13px!important;line-height:1.5!important}
.kskd-visual-form{display:flex!important;flex-direction:column!important;gap:11px!important;margin-top:12px!important}
.kskd-visual-form label{font-size:12px!important;font-weight:600!important;display:flex!important;flex-direction:column!important;gap:5px!important}
.kskd-visual-form input[type=email],.kskd-visual-form input[type=file],.kskd-visual-form textarea{box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-height:40px!important;border:1px solid #cbd9e9!important;border-radius:7px!important;background:#fff!important;color:#20384f!important;padding:8px!important;font-size:16px!important}
.kskd-visual-form .kskd-visual-consent{display:flex!important;flex-direction:row!important;align-items:flex-start!important;font-size:11px!important;font-weight:400!important;line-height:1.45!important}
.kskd-visual-consent input{margin:2px 6px 0 0!important;width:17px!important;height:17px!important;flex:0 0 17px!important}
.kskd-visual-hp{position:absolute!important;left:-9999px!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}
.kskd-visual-actions{display:flex!important;gap:10px!important;flex-wrap:wrap!important}
.kskd-visual-actions button{padding:10px 15px!important;border-radius:8px!important;font-size:13px!important;font-weight:700!important;cursor:pointer!important;text-transform:none!important;min-height:39px!important}
.kskd-send-visual-request{color:#fff!important;background:#1769c2!important;border:0!important}
.kskd-cancel-visual-request{color:#385472!important;background:#edf3f9!important;border:0!important}
.kskd-close-visual-request{position:absolute!important;right:10px!important;top:9px!important;border:0!important;background:transparent!important;color:#5c7083!important;font-size:24px!important;width:34px!important;height:34px!important;cursor:pointer!important}
.kskd-visual-status{font-size:12px!important;margin:0!important;min-height:0!important;color:#315f8e!important}
@media(max-width:480px){.kskd-visual-dialog{padding:17px!important;max-height:90dvh!important}.kskd-visual-dialog h3{font-size:18px!important}}

/* 1.1.23 — Mobile: one native vertical scroll container for ALL module sheets.
   Parent is portaled to body. Do not create a second scroll region inside a
   natural-height flex item: Safari/Chrome may discard touch panning there. */
@media(max-width:850px){
  body > .kskd-mobile-sheet:not([hidden]){
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-y:contain!important;
    touch-action:pan-y!important;
  }
  body > .kskd-mobile-sheet:not([hidden]) > .kskd-mobile-sheet-header{
    position:sticky!important;
    top:0!important;
    z-index:4!important;
    background:#fff!important;
  }
  body > .kskd-mobile-sheet:not([hidden]) > .kskd-mobile-sheet-content{
    display:block!important;
    box-sizing:border-box!important;
    flex:0 0 auto!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
    overscroll-behavior:auto!important;
    touch-action:pan-y!important;
  }
  body > .kskd-mobile-sheet:not([hidden]) > .kskd-mobile-sheet-content > .kskd-module-panel{
    box-sizing:border-box!important;
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
    overscroll-behavior:auto!important;
    touch-action:pan-y!important;
  }
  body > .kskd-mobile-sheet:not([hidden]) .kskd-ready-category-grid,
  body > .kskd-mobile-sheet:not([hidden]) .kskd-ready-category{
    touch-action:pan-y!important;
  }
  /* Prevent a second nested scroller in results from stealing finger swipes. */
  body > .kskd-mobile-sheet:not([hidden]) .kskd-ready-results,
  body > .kskd-mobile-sheet:not([hidden]) .kskd-my-graphics-list{
    overflow:visible!important;
  }
}
/* Inquiry window lives on body above the mobile dock, sheet and lightbox. */
body > .kskd-visual-modal:not([hidden]){
  z-index:2147483620!important;
  touch-action:pan-y!important;
}
body > .kskd-visual-modal:not([hidden]) .kskd-visual-dialog{
  -webkit-overflow-scrolling:touch!important;
  touch-action:pan-y!important;
}

.kskd-ready-more{grid-column:1/-1;display:block;min-height:36px;padding:8px 12px;border:1px solid #b8d5f5;border-radius:8px;background:#f1f7ff;color:#1b60b0;font-weight:600;cursor:pointer;width:100%;}
