@media (max-width: 768px) {
  html body #key#key > #createpost.pg.mobile-createpost.cp-brintage-toolbar-v2.cp-editor-step.cp-free-panel-open {
    justify-content: flex-start !important;
    --free-tools-side-margin: clamp(8px, 2.5vw, 16px);
    row-gap: 0 !important;
    padding-inline: 0 !important;
    padding-bottom: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
  }

  html body #key#key > #createpost.pg.mobile-createpost.cp-brintage-toolbar-v2.cp-editor-step.cp-free-panel-open > .cp-middle {
    order: -1 !important;
    flex: 0 0 auto !important;
    width: min(100%, max(120px, calc(100dvh - 175px))) !important;
    height: auto !important;
    aspect-ratio: 1;
    margin: 0 !important;
  }

  html body #key#key > #createpost.pg.mobile-createpost.cp-brintage-toolbar-v2.cp-editor-step.cp-free-panel-open >
    :is(.cp-caption-pos, .cp-mobile-design-launcher, .cp-collage-tabs, .pB.cp-bottom) {
    display: none !important;
  }

  html body #key#key > #createpost.pg.mobile-createpost.cp-brintage-toolbar-v2.cp-editor-step >
    .cp-mobile-design-sheet[data-mode="free"] {
    --free-panel-head: clamp(36px, 10vw, 49px);
    --free-panel-close: clamp(36px, 9vw, 44px);
    position: relative !important;
    inset: auto !important;
    order: 0 !important;
    flex: 1 1 0 !important;
    align-self: center !important;
    display: none !important;
    justify-content: flex-start !important;
    width: calc(100% - 2 * var(--free-tools-side-margin, 10px)) !important;
    height: auto !important;
    min-height: calc(var(--free-panel-head) + 54px) !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    transition: none !important;
    z-index: 1 !important;
  }

  html body #key#key > #createpost.pg.mobile-createpost.cp-brintage-toolbar-v2.cp-editor-step >
    .cp-mobile-design-sheet[data-mode="free"].is-open {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  html body #key#key > #createpost.pg.mobile-createpost.cp-brintage-toolbar-v2.cp-editor-step >
    .cp-mobile-design-sheet[data-mode="free"] > .cp-mobile-design-sheet-shell {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 100% !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    transform: none !important;
    transition: none !important;
  }

  #key#key > #createpost.pg.mobile-createpost.cp-editor-step >
    .cp-mobile-design-sheet[data-mode="free"] .cp-mobile-design-sheet-head {
    flex: 0 0 var(--free-panel-head) !important;
    min-height: var(--free-panel-head) !important;
    max-height: var(--free-panel-head) !important;
    align-items: center !important;
    padding: 0 calc(var(--free-panel-close) + 16px) !important;
    border-bottom: 0 !important;
    touch-action: pan-y !important;
  }

  #key #createpost .cp-mobile-design-sheet[data-mode="free"] .cp-mobile-design-sheet-handle {
    display: none !important;
  }

  #key #createpost .cp-mobile-design-sheet[data-mode="free"] .cp-mobile-design-sheet-title {
    font-size: clamp(12px, 3.5vw, 16px) !important;
  }

  #key#key > #createpost.pg.mobile-createpost.cp-editor-step >
    .cp-mobile-design-sheet[data-mode="free"] .cp-mobile-design-sheet-close {
    display: grid !important;
    place-items: center;
    left: 0 !important;
    right: auto !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    width: var(--free-panel-close) !important;
    height: var(--free-panel-close) !important;
    background: transparent !important;
    color: #40536b !important;
  }

  #key #createpost .cp-mobile-design-sheet[data-mode="free"] .cp-mobile-design-sheet-close::before {
    content: "";
    width: clamp(16px, 4.6vw, 21px);
    aspect-ratio: 1;
    background-color: currentColor;
    -webkit-mask: url("../icos/arrow-left.svg") center / contain no-repeat;
    mask: url("../icos/arrow-left.svg") center / contain no-repeat;
    pointer-events: none;
  }

  #key #createpost .cp-mobile-design-sheet[data-mode="free"] .cp-mobile-design-sheet-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }

  #key #createpost .cp-mobile-design-sheet[data-mode="free"] .cp-free-controls {
    padding-inline: 0 !important;
  }

  #key #createpost .cp-mobile-design-sheet[data-mode="free"] .cp-free-head-actions > .cp-free-back {
    display: none !important;
  }
}

@media (max-width: 768px) {
  body > #cp-animation-menu.cp-mobile-animation-sheet {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  body > #cp-animation-menu.cp-mobile-animation-sheet > .cp-animation-sheet {
    width: 100% !important;
    border-radius: 22px 22px 0 0 !important;
    transform: translate3d(0, 105%, 0) !important;
  }

  body > #cp-animation-menu.cp-mobile-animation-sheet.is-open > .cp-animation-sheet {
    transform: translate3d(0, 0, 0) !important;
  }

  #createpost .cp-mobile-design-sheet.cp-tool-sheet-opening:not(.is-dragging),
  #cp-start-photo-picker.cp-tool-sheet-opening:not(.is-dragging) > .cp-start-photo-sheet,
  #cp-thematic-visual-panel.cp-tool-sheet-opening > .cp-thematic-visual-sheet,
  body > #cp-animation-menu.cp-tool-sheet-opening:not(.is-dragging) > .cp-animation-sheet,
  body > #cp-global-effect-menu.cp-tool-sheet-opening:not(.is-dragging) > .cp-global-effect-sheet,
  body > #cp-motion-menu.cp-tool-sheet-opening:not(.is-dragging) > .cp-motion-sheet {
    transition: transform 420ms cubic-bezier(.22, .72, .26, 1) !important;
    will-change: transform;
  }

  body > .cp-tool-sheet-opening :is(.cp-animation-grid, .cp-global-effect-categories, .cp-motion-grid) * {
    animation-play-state: paused !important;
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  #createpost .cp-mobile-design-sheet.cp-tool-sheet-opening,
  #cp-thematic-visual-panel.cp-tool-sheet-opening > .cp-thematic-visual-sheet,
  body > #cp-animation-menu.cp-tool-sheet-opening > .cp-animation-sheet,
  body > #cp-global-effect-menu.cp-tool-sheet-opening > .cp-global-effect-sheet,
  body > #cp-motion-menu.cp-tool-sheet-opening > .cp-motion-sheet {
    transition: none !important;
    will-change: auto;
  }
}

@media (max-width: 768px) {
  .cp-tool-loading > :is(.cp-animation-grid, .cp-motion-grid, .cp-global-effect-categories) {
    display: none !important;
  }

  .cp-tool-ghosts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 8px;
    padding: 10px 12px 14px;
    min-height: 0;
    overflow: hidden;
  }

  .cp-tool-ghosts-effects {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .cp-tool-ghosts > span {
    display: grid;
    align-items: center;
    grid-template-columns: 30px 1fr;
    gap: 8px;
    height: 58px;
    padding-inline: 9px;
    border-radius: 12px;
    background-color: #f3f5f8;
  }

  .cp-tool-ghosts > span::before,
  .cp-tool-ghosts > span::after {
    content: "";
    background-color: #e6ebf1;
    border-radius: 6px;
    height: 9px;
  }

  .cp-tool-ghosts > span::before { height: 30px; }

  .cp-tool-ghosts-effects > span {
    height: 67px;
    grid-template-columns: 1fr;
    place-items: center;
    gap: 3px;
    padding-block: 7px;
  }

  .cp-tool-ghosts-effects > span::before { width: 26px; height: 26px; }
  .cp-tool-ghosts-effects > span::after { width: 65%; height: 7px; }

  #createpost .cp-mobile-design-sheet.cp-tool-sheet-opening .cp-mobile-preflight *,
  #createpost .cp-mobile-design-sheet[data-mode="free"] .cp-mobile-preflight * {
    animation: none !important;
  }

  #createpost .cp-free-ghost-colors {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0 8px;
  }

  #createpost .cp-free-ghost-colors > i {
    width: 23px;
    height: 23px;
    border-radius: 50%;
    background-color: #e6ebf1;
  }
}

@media (max-width: 700px) {
  .cp-tool-loading > .cp-start-photo-grid { display: none !important; }

  .cp-tool-ghosts-photos { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .cp-tool-ghosts-photos > span {
    display: block;
    height: auto;
    aspect-ratio: 1;
    padding: 0;
    background-color: #e6ebf1;
  }

  .cp-tool-ghosts-photos > span::before,
  .cp-tool-ghosts-photos > span::after { content: none; }
}

@media (max-width: 700px) and (prefers-reduced-motion: reduce) {
  #cp-start-photo-picker.cp-tool-sheet-opening .cp-start-photo-sheet { transition: none !important; }
}

@media (max-width: 768px) {
  #createpost .cp-mobile-design-sheet .cp-mobile-catalog-more {
    flex: 0 0 32px;
    align-self: center;
    min-height: 40px;
    border: 1px solid #dde5ef;
    border-radius: 8px;
    background: #f7f9fc;
    color: #40536b;
    font-size: 20px;
    scroll-snap-align: end;
  }
}

@media (max-width: 768px) {
  body > #cp-thematic-visual-panel.cp-thematic-mobile-sheet {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    overflow: visible;
    pointer-events: none;
  }

  #cp-thematic-visual-panel.cp-thematic-mobile-sheet > .cp-thematic-visual-sheet {
    box-sizing: border-box;
    max-height: var(--br-r760-visible-panel-max, 80dvh);
    padding: 0 16px max(14px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #dbe6f2;
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    background: #fbfdff;
    box-shadow: 0 -10px 32px rgba(15, 31, 52, .18);
    transform: translate3d(0, 105%, 0);
  }

  #cp-thematic-visual-panel.cp-thematic-mobile-sheet.is-open > .cp-thematic-visual-sheet {
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
  }

  #cp-thematic-visual-panel.cp-thematic-mobile-sheet .cp-thematic-visual-handle {
    margin: 8px auto 0;
    width: 42px;
    height: 4px;
    background: #cbd5e1;
  }

  #cp-thematic-visual-panel.cp-thematic-mobile-sheet .cp-thematic-visual-head {
    position: relative;
    justify-content: center;
    min-height: 48px;
    margin: 0 0 10px;
    padding: 6px 40px 8px;
    border-bottom: 1px solid #e8eef6;
    text-align: center;
  }

  #cp-thematic-visual-panel.cp-thematic-mobile-sheet .cp-thematic-visual-head strong {
    color: #25344b;
    font-size: 16px;
  }

  #cp-thematic-visual-panel.cp-thematic-mobile-sheet .cp-thematic-visual-close {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    background: #f1f5fa;
    color: #65748b;
  }

  #cp-thematic-visual-panel.cp-thematic-mobile-sheet .cp-thematic-visual-row {
    margin-block: 9px 12px;
  }

  #cp-thematic-visual-panel.cp-thematic-mobile-sheet .cp-thematic-visual-foot {
    border-color: #e8eef6;
  }

  #cp-thematic-visual-panel.cp-thematic-mobile-sheet .cp-thematic-visual-reset {
    border-color: #dbe6f2;
    background: #f1f5fa;
    color: #40536b;
  }

  .cp-thematic-visual-sheet.cp-tool-loading > :is(.cp-thematic-visual-row, .cp-thematic-visual-foot) {
    display: none !important;
  }

  .cp-tool-ghosts-thematic {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .cp-tool-ghosts-thematic > span {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-inline: 0;
    background: transparent;
  }

  .cp-tool-ghosts-thematic > span::before { width: 45%; height: 12px; }
  .cp-tool-ghosts-thematic > span::after { width: 100%; height: 7px; }

  .cp-tool-ghosts-thematic::after {
    content: "";
    justify-self: end;
    width: 90px;
    height: 32px;
    border-radius: 9px;
    background: #e6ebf1;
  }
}

@media (max-width: 768px) {
  #cp-thematic-visual-panel.cp-thematic-mobile-sheet .cp-thematic-visual-head strong::before {
    content: "";
    display: inline-block;
    width: 17px;
    height: 17px;
    margin-inline-end: 7px;
    vertical-align: -3px;
    background: #46688f;
    -webkit-mask: url("../icos/br-toolbar-sliders.svg") center / contain no-repeat;
    mask: url("../icos/br-toolbar-sliders.svg") center / contain no-repeat;
  }

  #cp-thematic-visual-panel.cp-thematic-mobile-sheet .cp-thematic-visual-row output {
    color: #326592;
  }

  #cp-thematic-visual-panel.cp-thematic-mobile-sheet .cp-thematic-visual-row input[type=range] {
    accent-color: #3582c7;
  }
}

/* Los tres modos comparten ancho y pueden crecer si una etiqueta ocupa dos líneas. */
@media (max-width: 768px) {
  html:not([data-br-native-device="tablet"]) body #key#key > #createpost.pg.mobile-createpost.cp-brintage-toolbar-v2.cp-editor-step > .cp-mobile-design-launcher {
    --cp-mode-icon-size: clamp(16px, 4.5vw, 21px);
    --cp-mode-padding: clamp(7px, 2vw, 12px);
    flex: 0 0 auto !important;
    height: auto !important;
    max-height: none !important;
    grid-template-rows: auto !important;
    align-items: stretch !important;
    gap: var(--cp-phone-menu-gap, clamp(5px, 1.5vw, 9px)) !important;
  }

  html:not([data-br-native-device="tablet"]) body #key#key > #createpost.pg.mobile-createpost.cp-brintage-toolbar-v2.cp-editor-step > .cp-mobile-design-launcher > button.cp-mobile-design-launch:not([data-mode="favorites"]) {
    display: grid !important;
    position: relative !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--cp-mode-icon-size) auto;
    align-content: start !important;
    justify-items: center;
    gap: clamp(4px, 1.3vw, 7px) !important;
    min-height: 54px !important;
    height: auto !important;
    max-height: none !important;
    padding: var(--cp-mode-padding) clamp(5px, 1.5vw, 10px) !important;
    font-size: clamp(.75rem, 3.2vw, .9rem) !important;
    line-height: 1.2 !important;
    letter-spacing: normal !important;
    text-align: center !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    text-overflow: clip !important;
  }

  html:not([data-br-native-device="tablet"]) body #key#key > #createpost.pg.mobile-createpost.cp-brintage-toolbar-v2.cp-editor-step > .cp-mobile-design-launcher > button.cp-mobile-design-launch:not([data-mode="favorites"])::before {
    width: var(--cp-mode-icon-size) !important;
    height: var(--cp-mode-icon-size) !important;
  }

  html:not([data-br-native-device="tablet"]) body #key#key > #createpost.pg.mobile-createpost.cp-brintage-toolbar-v2.cp-editor-step > .cp-mobile-design-launcher > button[data-mode="thematic"]::after {
    position: absolute !important;
    inset: var(--cp-mode-padding) 7px auto auto !important;
    margin: 0 !important;
    pointer-events: none;
  }
}
