/* EditorV4: trusted, fixed-layout story templates. No runtime inline styles. */
.editor-v2-visual {
  container-type: inline-size;
}

.editor-v2-visual.is-editor-v4-rev2 canvas {
  touch-action: pan-y pinch-zoom;
}

.editor-v2-visual.is-editor-v4-rev2.is-crop-active canvas {
  touch-action: none;
}

.editor-v2-visual.is-editor-v4-rev2 [data-v4-carousel-panel] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: auto;
  will-change: transform;
}

.editor-v2-visual.is-editor-v4-rev2 [data-v4-carousel-panel="current"] {
  z-index: 2;
}

.editor-v2-visual.is-editor-v4-rev2 .editor-v4-carousel-panel {
  z-index: 1;
  pointer-events: none;
}

.editor-v2-visual.is-editor-v4-rev2 [data-v4-carousel-panel].is-carousel-settling {
  transition: transform 300ms cubic-bezier(0.22, 0.75, 0.2, 1);
}

.editor-v4-shell {
  display: grid;
  gap: 12px;
  padding: 14px;
  color: #251f31;
  background: #fff;
}

.editor-v4-head {
  display: grid;
  gap: 7px;
}

.editor-v4-head > div,
.editor-v4-head strong,
.editor-v4-head small {
  display: block;
}

.editor-v4-head strong {
  font-size: 16px;
  line-height: 1.18;
}

.editor-v4-head small,
.editor-v4-head > span,
.editor-v4-templates small,
.editor-v4-help {
  font-size: 13px;
}

.editor-v4-head small {
  margin-top: 3px;
  color: #6d6578;
  line-height: 1.35;
}

.editor-v4-head > span {
  color: #0b7549;
  font-weight: 750;
}

.editor-v4-head > span.is-conflict {
  color: #a52b2b;
}

.editor-v4-templates {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(178px, 74%);
  gap: 9px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  scrollbar-width: thin;
}

.editor-v4-templates button {
  min-height: 92px;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  color: #342d40;
  background: #f6f2f8;
  border: 2px solid transparent;
  border-radius: 15px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  scroll-snap-align: start;
}

.editor-v4-templates button[aria-pressed="true"] {
  color: #24154f;
  background: #fff7ed;
  border-color: #ff8a1f;
  box-shadow: 0 8px 24px rgba(80, 45, 130, 0.12);
}

.editor-v4-templates button > i {
  width: 42px;
  height: 64px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(155deg, #2b176c, #8a4de0 62%, #ff8a1f);
  border-radius: 9px;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.editor-v4-templates button[data-category="beauty"] > i {
  background: linear-gradient(155deg, #6e3e77, #d08398 62%, #ffb76d);
}

.editor-v4-templates button span,
.editor-v4-templates button b,
.editor-v4-templates button small {
  display: block;
  min-width: 0;
}

.editor-v4-templates button b {
  font-size: 13px;
  line-height: 1.2;
}

.editor-v4-templates button small {
  margin-top: 4px;
  color: #756d7e;
  line-height: 1.25;
}

.editor-v4-help {
  margin: 0;
  color: #645c6d;
  line-height: 1.45;
}

.editor-v4-help b {
  color: #342b40;
}

.editor-v4-carousel-controls {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  align-items: end;
  gap: 9px;
}

.editor-v4-carousel-controls button,
.editor-v4-carousel-controls select {
  min-height: 46px;
  color: #342d40;
  background: #f6f2f8;
  border: 2px solid transparent;
  border-radius: 13px;
  font: inherit;
  font-weight: 800;
}

.editor-v4-carousel-controls button {
  cursor: pointer;
  font-size: 20px;
}

.editor-v4-carousel-controls button:disabled {
  cursor: default;
  opacity: 0.4;
}

.editor-v4-carousel-controls label,
.editor-v4-carousel-controls label > span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.editor-v4-carousel-controls label > span,
.editor-v4-carousel-position {
  color: #6d6578;
  font-size: 15px;
  font-weight: 750;
}

.editor-v4-carousel-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 12px) / 3);
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0 7px;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.editor-v4-carousel-strip::-webkit-scrollbar {
  display: none;
}

.editor-v4-carousel-strip button {
  min-width: 0;
  min-height: 0;
  display: block;
  aspect-ratio: 9 / 16;
  padding: 3px;
  overflow: hidden;
  color: #342d40;
  background: #f6f2f8;
  border: 2px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  scroll-snap-align: start;
}

.editor-v4-carousel-strip button[aria-pressed="true"] {
  color: #24154f;
  background: #fff7ed;
  border-color: #ff8a1f;
  box-shadow: 0 6px 18px rgba(80, 45, 130, 0.12);
}

.editor-v4-carousel-strip button > canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #eee9f4;
  border-radius: 10px;
}

.editor-v4-carousel-controls select {
  width: 100%;
  padding: 0 10px;
}

.editor-v4-carousel-position {
  margin: -4px 0 0;
  text-align: center;
}

.editor-v4-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.editor-v4-inline-editor {
  position: absolute;
  z-index: 12;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  resize: none;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: 0;
  caret-color: #ff8a1f;
  appearance: none;
}

.editor-v2-visual.is-editor-v4-rev2 .editor-v4-inline-editor {
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  caret-color: auto;
  font-style: normal;
  white-space: pre-wrap;
  overflow-wrap: normal;
  word-break: normal;
  -webkit-user-select: text;
  user-select: text;
  -webkit-text-size-adjust: 100%;
}

.editor-v4-inline-editor:focus {
  background: transparent;
  border: 0;
  outline: 0;
  box-shadow: none;
}

.editor-v4-export-raster {
  position: absolute !important;
  z-index: -1 !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.editor-v2-visual.is-editor-v4-rev2 .editor-v4-inline-editor::selection {
  color: HighlightText;
  background: Highlight;
}

.editor-v4-crop-done {
  position: absolute;
  z-index: 13;
  right: 12px;
  bottom: 12px;
  min-width: 92px;
  min-height: 44px;
  padding: 8px 15px;
  color: #fff;
  background: rgba(22, 12, 54, 0.94);
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
}

.editor-v4-templates button:focus-visible,
.editor-v4-carousel-strip button:focus-visible,
.editor-v4-carousel-controls button:focus-visible,
.editor-v4-carousel-controls select:focus-visible,
.editor-v4-crop-done:focus-visible {
  outline: 3px solid #ff8a1f;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .editor-v2-visual.is-editor-v4-rev2 [data-v4-carousel-panel].is-carousel-settling {
    transition: none;
  }

  .editor-v4-carousel-strip {
    scroll-behavior: auto;
  }
}

@media (min-width: 760px) {
  .editor-v4-shell {
    padding: 18px;
  }

  .editor-v4-head {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .editor-v4-templates {
    grid-auto-columns: minmax(184px, 28%);
  }
}

/* The calendar card is a passive preview. Editing owns gestures only after
 * the explicit "Dopieszcz projekt" action opens the isolated stage. */
.creator-result-card:not(.is-editor-fullscreen) .material-editor-canvas {
  pointer-events: none;
  touch-action: pan-y;
  cursor: default;
}

.result-editor-fullscreen-bar {
  display: none;
}

html.editor-fullscreen-root,
html.editor-fullscreen-root body,
body.editor-fullscreen-open {
  overflow: hidden;
  overscroll-behavior: none;
}

body.editor-fullscreen-open .creator-body {
  overflow: hidden;
  overscroll-behavior: none;
}

.creator-result-card.is-editor-fullscreen {
  position: fixed;
  z-index: 1300;
  top: var(--editor-viewport-top, 0px);
  left: var(--editor-viewport-left, 0px);
  width: var(--editor-viewport-width, 100%);
  max-width: none;
  height: var(--editor-viewport-height, 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  align-content: start;
  gap: 12px;
  margin: 0;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-block: 12px 72px;
  -webkit-overflow-scrolling: touch;
  color: #251f31;
  background: #f7f4fa;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow-anchor: none;
}

.creator-result-card.is-editor-fullscreen,
.creator-result-card.is-editor-fullscreen > *,
.creator-result-card.is-editor-fullscreen .editor-v4-shell,
.creator-result-card.is-editor-fullscreen .editor-v3-shell {
  min-width: 0;
  min-height: 0;
}

.creator-result-card.is-editor-fullscreen .result-editor-fullscreen-bar {
  flex: 0 0 auto;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result-editor-fullscreen-bar > span,
.result-editor-fullscreen-bar strong,
.result-editor-fullscreen-bar small {
  display: block;
}

.result-editor-fullscreen-bar strong {
  font-size: 16px;
  line-height: 1.2;
}

.result-editor-fullscreen-bar small {
  margin-top: 2px;
  color: #6d6578;
  font-size: 13px;
  line-height: 1.25;
}

.result-editor-fullscreen-bar button {
  min-width: 76px;
  min-height: 44px;
  padding: 8px 12px;
  color: #fff;
  background: #2f1b68;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
  cursor: pointer;
}

.creator-result-card.is-editor-fullscreen .creator-result-copy {
  display: none !important;
}

.creator-result-card.is-editor-fullscreen .result-design-panel {
  position: static !important;
  flex: 0 0 auto;
  order: 3;
  width: min(100%, 720px);
  max-height: none;
  display: block !important;
  justify-self: center;
  align-self: center;
  margin: 0;
  overflow: visible;
  border: 1px solid #e2dbe8;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(23, 12, 56, 0.1);
}

.creator-result-card.is-editor-fullscreen .creator-result-visual {
  position: relative;
  flex: 0 0 auto;
  order: 2;
  align-self: start;
  justify-self: center;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  overflow: hidden;
  contain: layout paint;
  border-radius: 16px;
  box-shadow: 0 16px 42px rgba(23, 12, 56, 0.18);
}

.creator-result-card.is-editor-fullscreen .creator-result-visual.is-story {
  width: min(100%, 420px);
  aspect-ratio: 9 / 16;
}

.creator-result-card.is-editor-fullscreen .creator-result-visual.is-post {
  width: min(100%, 480px);
  aspect-ratio: 4 / 5;
}

.creator-result-card.is-editor-fullscreen .creator-result-visual .material-editor-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.creator-result-card.is-editor-fullscreen .material-editor-canvas {
  pointer-events: auto;
}

.creator-result-card.is-editor-fullscreen .editor-v4-inline-editor,
.creator-result-card.is-editor-fullscreen .editor-v3-inline-editor {
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  padding: 0;
  overflow: visible;
  color: transparent;
  background: rgba(92, 105, 255, 0.055);
  border: 0;
  outline: 0;
  box-shadow: none;
  caret-color: #315cff;
  font-size: 16px;
  white-space: pre-wrap;
  overflow-wrap: normal;
  word-break: normal;
  transform-origin: top left;
  -webkit-user-select: text;
  user-select: text;
  -webkit-text-size-adjust: 100%;
  -webkit-text-fill-color: transparent;
  contain: layout paint style;
}

.creator-result-card.is-editor-fullscreen.is-editor-keyboard-visible {
  gap: 7px;
  padding-top: max(7px, env(safe-area-inset-top));
  padding-bottom: max(7px, env(safe-area-inset-bottom));
}

.creator-result-card.is-editor-fullscreen.is-editor-keyboard-visible .result-editor-fullscreen-bar {
  min-height: 44px;
}

.creator-result-card.is-editor-fullscreen.is-editor-keyboard-visible .result-editor-fullscreen-bar small,
.creator-result-card.is-editor-fullscreen.is-editor-keyboard-visible .editor-v4-head,
.creator-result-card.is-editor-fullscreen.is-editor-keyboard-visible .editor-v4-help,
.creator-result-card.is-editor-fullscreen.is-editor-keyboard-visible .editor-v4-carousel-position {
  display: none;
}

.creator-result-card.is-editor-fullscreen.is-editor-keyboard-visible .editor-v4-shell {
  gap: 4px;
  padding: 7px;
}

.creator-result-card.is-editor-fullscreen .editor-v4-inline-editor:focus,
.creator-result-card.is-editor-fullscreen .editor-v3-inline-editor:focus {
  background: rgba(92, 105, 255, 0.075);
  box-shadow: inset 0 0 0 1px rgba(49, 92, 255, 0.28);
}

.creator-result-card.is-editor-fullscreen .editor-v4-inline-editor::selection,
.creator-result-card.is-editor-fullscreen .editor-v3-inline-editor::selection {
  color: transparent;
  background: rgba(49, 92, 255, 0.34);
  -webkit-text-fill-color: transparent;
}

.creator-brand-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  color: #30283a;
  background: #f7f4fa;
  border: 1px solid #e2dbe8;
  border-radius: 16px;
}

.editor-v4-theme-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: min(100%, 320px);
  padding: 4px;
  color: #30283a;
  background: #f0ecf4;
  border: 1px solid #ddd5e4;
  border-radius: 14px;
}

.editor-v4-theme-switch[hidden] {
  display: none;
}

.editor-v4-theme-switch button {
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  color: #62596c;
  background: transparent;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.editor-v4-theme-switch button[aria-pressed="true"] {
  color: #2d2055;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(39, 28, 53, 0.12);
}

.editor-v4-theme-switch button:focus-visible {
  outline: 3px solid rgba(72, 49, 188, 0.28);
  outline-offset: 2px;
}

.editor-v4-theme-switch button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.creator-brand-entry > span,
.creator-brand-entry strong,
.creator-brand-entry strong small {
  display: block;
}

.creator-brand-entry strong {
  font-size: 16px;
}

.creator-brand-entry strong small {
  margin-top: 2px;
  color: #756d7e;
  font-size: 13px;
  font-weight: 700;
}

.creator-brand-entry > span > span {
  display: block;
  margin-top: 4px;
  color: #6d6578;
  font-size: 15px;
  line-height: 1.4;
}

.creator-brand-entry a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  color: #3f2db0;
  background: #eeebff;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 850;
  text-decoration: none;
}

@media (max-width: 420px) {
  .creator-brand-entry {
    grid-template-columns: 1fr;
  }

  .creator-brand-entry a {
    width: 100%;
  }
}
