/* Makieta: workbench jest wewnątrz pierwszego diva w main (LayoutPage) — owijka musi rozciągać się na całą wysokość viewportu. */
body.editorial-layout-v2 main {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  overflow-x: auto;
  overflow-y: hidden;
}
body.editorial-layout-v2 main > div:has(#editorial-layout-workbench) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
body.editorial-layout-v2 main > div:has(#editorial-layout-workbench) > .border-b.border-border.bg-card {
  flex-shrink: 0;
}
/* PageHeader + workbench w jednej kolumnie — bez tego workbench nie rozciągał wysokości (makieta „na pół ekranu”). */
body.editorial-layout-v2 main > div:has(#editorial-layout-workbench) > div {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
}

#editorial-layout-workbench {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  background: #f4f4f5;
  color: #18181b;
  font-size: 0.8125rem;
  /* Domyślne wartości zanim JS ustawi format z API */
  --elw-paper-margin: 15mm;
  --elw-body-font: 12pt;
  --elw-body-line-height: 1.3;
  --elw-title-font: 14pt;
  --elw-title-line-height: 1.25;
  --elw-lead-font: 11pt;
  --elw-lead-line-height: 1.3;
  --elw-slot-font: 10pt;
  --elw-module-font: 8.5pt;
  --elw-module-title-font: 8pt;
  --elw-blk-inner-pad-x: 0.45rem;
  --elw-blk-inner-pad-y: 0.35rem;
  /* Proporcje „kartki” = format strony z API (applyFormatRow ustawia w JS) */
  --elw-paper-ar-w: 210;
  --elw-paper-ar-h: 297;
  /* Skala podglądu: JS (ResizeObserver) ustawia tak, by mm/pt skalowały się z oknem jak jedna całość */
  --elw-doc-scale: 1;
}
#editorial-layout-workbench .elw-top {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #e4e4e7;
  background: #fafafa;
}
/* Select jak w UI (nie „systemowy”) — appearance + strzałka */
#editorial-layout-workbench .elw-top select#elw-issue,
#editorial-layout-workbench select.elw-select {
  min-width: 14rem;
  padding: 0.35rem 1.75rem 0.35rem 0.55rem;
  border-radius: 0.375rem;
  border: 1px solid #d4d4d8;
  background-color: #fff;
  color: #18181b;
  font-size: 0.8125rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2352525b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  background-size: 0.7rem;
}
#editorial-layout-workbench select.elw-select--narrow {
  min-width: 3.25rem;
  width: auto;
}
#editorial-layout-workbench select.elw-select--format {
  min-width: 11rem;
  max-width: min(100%, 20rem);
}
#editorial-layout-workbench #elw-preview-zoom {
  min-width: 6.75rem;
  max-width: min(100%, 11rem);
}
#editorial-layout-workbench .elw-top button {
  padding: 0.35rem 0.65rem;
  border-radius: 0.375rem;
  border: 1px solid #d4d4d8;
  background: #fff;
  cursor: pointer;
  font-size: 0.75rem;
}
#editorial-layout-workbench .elw-top button.elw-primary {
  background: #18181b;
  color: #fafafa;
  border-color: #18181b;
}
#editorial-layout-workbench .elw-body {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr) 16rem;
  gap: 0;
  min-height: 0;
  height: 100%;
  border-top: none;
}
/* Układ stały (3 kolumny); na wąskim ekranie przewijanie poziome zamiast łamania siatki */
#editorial-layout-workbench .elw-body {
  min-width: 56rem;
}
/* Lewa: strony */
#editorial-layout-workbench .elw-left {
  border-right: 1px solid #e4e4e7;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#editorial-layout-workbench .elw-left h3 {
  margin: 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #71717a;
  border-bottom: 1px solid #f4f4f5;
}
#editorial-layout-workbench .elw-pages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.35rem;
}
#editorial-layout-workbench .elw-page-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.45rem 0.5rem;
  margin-bottom: 2px;
  border-radius: 0.35rem;
  cursor: pointer;
  border: 1px solid transparent;
}
#editorial-layout-workbench .elw-page-item:hover {
  background: #f4f4f5;
}
/* Aktywna strona — niebieski tylko gdy brak materiału na stronie */
#editorial-layout-workbench .elw-page-item.elw-page-item--on:not(.elw-page-item--placed) {
  background: #eff6ff;
  border-color: #93c5fd;
}
#editorial-layout-workbench .elw-page-item.elw-page-item--picked:not(.elw-page-item--placed) {
  background: #fef3c7;
  border-color: #fbbf24;
}
#editorial-layout-workbench .elw-page-item.elw-page-item--on.elw-page-item--picked:not(.elw-page-item--placed) {
  background: #fde68a;
  border-color: #d97706;
}
/* Strona z materiałem — cały wiersz w odcieniu koloru materiału (--elw-page-strip ustawia JS) */
#editorial-layout-workbench .elw-page-item.elw-page-item--placed {
  --strip: var(--elw-page-strip, #94a3b8);
  background: color-mix(in srgb, var(--strip) 38%, white) !important;
  border-color: color-mix(in srgb, var(--strip) 52%, #e4e4e7) !important;
}
#editorial-layout-workbench .elw-page-item.elw-page-item--on.elw-page-item--placed {
  background: color-mix(in srgb, var(--strip) 48%, white) !important;
  border-color: color-mix(in srgb, var(--strip) 58%, #93c5fd) !important;
}
#editorial-layout-workbench .elw-page-item.elw-page-item--picked.elw-page-item--placed {
  background: color-mix(in srgb, var(--strip) 42%, #fffbeb) !important;
  border-color: color-mix(in srgb, var(--strip) 50%, #fbbf24) !important;
}
#editorial-layout-workbench .elw-page-item.elw-page-item--placed:hover {
  filter: brightness(0.98);
}
#editorial-layout-workbench .elw-page-item.elw-page-item--article-focus {
  outline: 2px solid var(--elw-page-focus, #2563eb);
  outline-offset: -2px;
  border-radius: 0.35rem;
}
#editorial-layout-workbench .elw-page-actions {
  flex-shrink: 0;
  padding: 0.5rem;
  border-top: 1px solid #f4f4f5;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
#editorial-layout-workbench .elw-page-actions button {
  width: 100%;
}
#editorial-layout-workbench .elw-page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 0.4rem;
  border: none;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  color: #fafafa !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
#editorial-layout-workbench .elw-page-btn-glyph {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1;
  margin-top: -0.05em;
}
#editorial-layout-workbench .elw-page-btn--add {
  background: #15803d !important;
  border: 1px solid #14532d !important;
}
#editorial-layout-workbench .elw-page-btn--add:hover {
  background: #16a34a !important;
}
#editorial-layout-workbench .elw-page-btn--del {
  background: #b91c1c !important;
  border: 1px solid #991b1b !important;
}
#editorial-layout-workbench .elw-page-btn--del:hover {
  background: #dc2626 !important;
}

/* Środek: pełna szerokość kolumny, wyraźne przyciski (nadpisanie stylów z Reacta) */
#editorial-layout-workbench .elw-center {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 0.65rem 0.75rem 0.75rem;
  overflow: hidden;
  background: #ececf0;
}
#editorial-layout-workbench .elw-center-tools {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.65rem;
  padding: 0.5rem 0.65rem;
  background: #ffffff;
  border: 1px solid #d4d4d8;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
#editorial-layout-workbench .elw-center-tools .elw-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 0.375rem;
  cursor: pointer;
  border-width: 2px;
  border-style: solid;
  color: #fafafa !important;
  background-color: #18181b !important;
  border-color: #09090b !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}
#editorial-layout-workbench .elw-center-tools .elw-btn:hover {
  background-color: #27272a !important;
  border-color: #18181b !important;
}
#editorial-layout-workbench .elw-center-tools .elw-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
#editorial-layout-workbench .elw-center-tools .elw-btn--secondary {
  color: #18181b !important;
  background-color: #ffffff !important;
  border-color: #a1a1aa !important;
}
#editorial-layout-workbench .elw-center-tools .elw-btn--secondary:hover {
  background-color: #f4f4f5 !important;
}
#editorial-layout-workbench .elw-center-tools .elw-btn--ghost {
  color: #3f3f46 !important;
  background-color: #e4e4e7 !important;
  border-color: #a1a1aa !important;
}
#editorial-layout-workbench .elw-center-tools .elw-btn--ghost:hover {
  background-color: #d4d4d8 !important;
}
#editorial-layout-workbench .elw-center-tools .elw-inline-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #52525b;
  margin-left: 0.15rem;
}
#editorial-layout-workbench .elw-center-tools .elw-tools-sep {
  width: 1px;
  align-self: stretch;
  min-height: 1.75rem;
  margin: 0 0.15rem;
  background: #d4d4d8;
}

#editorial-layout-workbench .elw-center-stage {
  container-type: size;
  container-name: elw-paper;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
  overflow: auto;
  padding: 0.35rem 0.5rem 0.5rem;
  box-sizing: border-box;
}
#editorial-layout-workbench .elw-page-frame {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: min(
    100cqw,
    calc(100cqh * var(--elw-paper-ar-w, 210) / var(--elw-paper-ar-h, 297))
  );
  height: min(
    100cqh,
    calc(100cqw * var(--elw-paper-ar-h, 297) / var(--elw-paper-ar-w, 210))
  );
  max-width: none;
  max-height: none;
  aspect-ratio: var(--elw-paper-ar-w, 210) / var(--elw-paper-ar-h, 297);
  min-height: 0;
  min-width: 0;
  margin: 0;
  background: #fff;
  border: 2px solid #27272a;
  border-radius: 0.35rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#editorial-layout-workbench .elw-page-doc-slot {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#editorial-layout-workbench .elw-page-doc-slot.elw-doc-slot--scroll {
  align-items: flex-start;
  justify-content: flex-start;
  overflow: auto;
}
#editorial-layout-workbench .elw-page-doc-scale-wrap {
  position: relative;
  flex-shrink: 0;
}
#editorial-layout-workbench .elw-page-doc {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--elw-paper-ar-w, 210) * 1mm);
  max-width: calc(var(--elw-paper-ar-w, 210) * 1mm);
  height: calc(var(--elw-paper-ar-h, 297) * 1mm);
  box-sizing: border-box;
  padding: var(--elw-paper-margin, 15mm);
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(var(--elw-paper-ar-h, 297) * 1mm);
  overflow: hidden;
  background: #fff;
  transform-origin: top left;
  transform: scale(var(--elw-doc-scale, 1));
}
/* Proporcje kartki: --elw-paper-ar-w / --elw-paper-ar-h (mm z formatu strony) */
/* Siatka 5×8 tylko w trybie „moduły” */
#editorial-layout-workbench .elw-grid.elw-grid--modules {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
}

/* Widok bloków — bez podziału na 40 komórek */
#editorial-layout-workbench .elw-canvas {
  flex: 1 1 auto;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #f4f4f5;
}
#editorial-layout-workbench .elw-hitlayer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(8, 1fr);
  pointer-events: none;
}
#editorial-layout-workbench .elw-hit {
  pointer-events: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: cell;
}
#editorial-layout-workbench .elw-hit:hover {
  background: rgba(37, 99, 235, 0.06);
}
#editorial-layout-workbench .elw-hit.elw-hit--sel {
  box-shadow: inset 0 0 0 2px #2563eb;
  z-index: 1;
}
#editorial-layout-workbench .elw-hit.elw-hit--drop {
  background: rgba(22, 163, 74, 0.14);
}
#editorial-layout-workbench .elw-blk {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid #eee;
  border-radius: 0.25rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  cursor: pointer;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  z-index: 0;
  /* Klik / zaznaczenie obsługuje warstwa .elw-hit — inaczej duży blok przejmuje zdarzenia i zostaje „jedna komórka”. */
  pointer-events: none;
}
#editorial-layout-workbench .elw-blk:hover {
  border-color: #d4d4d8;
}
#editorial-layout-workbench .elw-blk.elw-blk--sel {
  outline: 3px solid #2563eb;
  outline-offset: 1px;
  z-index: 1;
}
#editorial-layout-workbench .elw-blk.elw-blk--drop {
  outline: 3px dashed #16a34a;
  background: #ecfdf5;
}
#editorial-layout-workbench .elw-blk-empty {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--elw-blk-inner-pad-y, 0.35rem) var(--elw-blk-inner-pad-x, 0.45rem);
  font-size: var(--elw-slot-font, 10pt);
  line-height: var(--elw-body-line-height, 1.3);
  color: #71717a;
  text-align: center;
}
#editorial-layout-workbench .elw-blk-article {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: var(--elw-blk-inner-pad-y, 0.4rem) var(--elw-blk-inner-pad-x, 0.5rem);
  gap: 0.25rem;
  text-align: left;
  box-sizing: border-box;
}
/* Tryb akapitów: karta materiału wypełnia cały prostokąt bloku (nie zostaje „pół strony” pustej w środku) */
#editorial-layout-workbench.elw-text-paragraphs .elw-blk > .elw-blk-article {
  position: absolute;
  inset: 0;
  flex: none;
  width: auto;
  height: auto;
  min-height: 0;
}
#editorial-layout-workbench .elw-blk-content-wrap {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
/* Tryb akapitów: obszar treści rozciąga się w pionie do dołu bloku (bez przewijania w podglądzie) */
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content-wrap {
  flex: 1 1 auto;
  min-height: 0;
}
#editorial-layout-workbench .elw-blk-title {
  font-weight: 700;
  font-size: var(--elw-title-font, 14pt);
  line-height: var(--elw-title-line-height, 1.25);
  color: #0f172a;
  flex-shrink: 0;
}
#editorial-layout-workbench .elw-blk-lead {
  font-size: var(--elw-lead-font, 11pt);
  line-height: var(--elw-lead-line-height, 1.3);
  color: #475569;
  flex-shrink: 0;
}
#editorial-layout-workbench .elw-blk-lines {
  flex-shrink: 0;
  font-size: 0.58rem;
  font-weight: 600;
  color: #64748b;
  padding: 0.08rem 0 0.12rem;
  letter-spacing: 0.02em;
}
#editorial-layout-workbench .elw-blk-content {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  font-size: var(--elw-body-font, 12pt);
  line-height: var(--elw-body-line-height, 1.3);
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
  box-sizing: border-box;
}
#editorial-layout-workbench .elw-blk-content.elw-blk-content--line-slice {
  align-self: stretch;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}
/* Przyciski „Przenieś…” nad siatką zdarzeń (z-index > .elw-hitlayer) */
#editorial-layout-workbench .elw-overflow-flyout-host {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
#editorial-layout-workbench .elw-floating-overflow-btn {
  pointer-events: auto;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.35rem;
  max-height: 22px;
  min-height: 20px;
  height: 22px;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
  border: none;
  border-radius: 0.2rem;
  background: #1e3a8a;
  color: #fff !important;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#editorial-layout-workbench .elw-floating-overflow-btn:hover {
  background: #2563eb;
}
/* Gazeta / continuous — jeden blok tekstu */
#editorial-layout-workbench.elw-text-continuous .elw-blk-content {
  white-space: pre-wrap;
}
/* Dokument — HTML treści (akapity, listy); pełna szerokość; reszta wysokości pod treścią (pseudo-element) */
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html {
  align-self: stretch;
  white-space: normal;
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html::after {
  content: '';
  flex: 1 1 0%;
  min-height: 0;
  width: 100%;
}
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html * {
  max-width: none !important;
  box-sizing: border-box;
}
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html img,
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html video,
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html svg {
  max-width: 100% !important;
  height: auto;
  cursor: default;
}
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html table {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html p {
  margin: 0 0 0.55em 0;
  max-width: none !important;
  width: 100%;
  box-sizing: border-box;
}
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html .elw-slice-flow,
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html .elw-slice-logical {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  box-sizing: border-box;
  white-space: normal;
  word-break: break-word;
  text-align: left;
  line-height: var(--elw-body-line-height, 1.3);
}
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html .elw-slice-plain {
  margin: 0 0 0.45em 0;
  max-width: none !important;
  width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-break: break-word;
  line-height: inherit;
}
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html h1,
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html h2,
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html h3 {
  font-size: 1.08em;
  font-weight: 700;
  margin: 0.65em 0 0.35em 0;
  line-height: var(--elw-title-line-height, 1.25);
  color: #0f172a;
}
/* Pierwszy blok treści pod tytułem/lead — bez sztucznego „skoku” (Word często daje nagłówek lub pusty akapit) */
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html .elw-slice-logical:first-child > :first-child {
  margin-top: 0 !important;
}
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html .elw-slice-logical:first-child h1:first-child,
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html .elw-slice-logical:first-child h2:first-child,
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html .elw-slice-logical:first-child h3:first-child {
  margin-top: 0 !important;
}
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html .elw-slice-logical:first-child p:first-of-type {
  margin-top: 0 !important;
}
/* Pełna treść HTML bez opakowania .elw-slice-logical — pierwszy akapit / nagłówek w treści */
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html > p:first-of-type,
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html > h1:first-child,
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html > h2:first-child,
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html > h3:first-child {
  margin-top: 0 !important;
}
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html ul,
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html ol {
  margin: 0 0 0.55em 1.1em;
  padding: 0;
}
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html li {
  margin-bottom: 0.2em;
}
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html a {
  color: #1d4ed8;
  text-decoration: underline;
}
#editorial-layout-workbench.elw-text-paragraphs .elw-blk-content.elw-blk-content--html mark.editorial-correction-hl {
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
#editorial-layout-workbench .elw-center-tools button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#editorial-layout-workbench .elw-cell.elw-cell--in-block {
  border-color: rgba(24, 24, 27, 0.28);
}
#editorial-layout-workbench .elw-cell.elw-cell--anchor {
  box-shadow: inset 0 0 0 2px rgba(24, 24, 27, 0.38);
  z-index: 1;
}
#editorial-layout-workbench .elw-cell {
  min-width: 0;
  min-height: 0;
  border-radius: 0;
  border: 1px solid #c4c4cc;
  background: #f8fafc;
  font-size: var(--elw-module-font, 8.5pt);
  line-height: var(--elw-body-line-height, 1.3);
  padding: 2px 3px;
  overflow: hidden;
  cursor: pointer;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3f3f46 !important;
  position: relative;
}
#editorial-layout-workbench .elw-cell.elw-join-r {
  border-right-color: transparent;
  margin-right: -1px;
}
#editorial-layout-workbench .elw-cell.elw-join-b {
  border-bottom-color: transparent;
  margin-bottom: -1px;
}
#editorial-layout-workbench .elw-cell.elw-cell--sel {
  outline: 2px solid #2563eb;
  outline-offset: -1px;
  z-index: 2;
}
#editorial-layout-workbench .elw-cell.elw-cell--drop {
  background: #ecfdf5;
  border-color: #34d399;
}
#editorial-layout-workbench .elw-cell .elw-cell-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  font-weight: 600;
  font-size: var(--elw-module-title-font, 8pt);
  line-height: var(--elw-title-line-height, 1.2);
  color: #0f172a;
}
/* Poradnik (? ) — okno modalne */
#editorial-layout-workbench .elw-help-btn {
  padding: 0.35rem 0.5rem;
  min-width: 2rem;
}
#editorial-layout-workbench .elw-help-btn svg {
  display: block;
}
#editorial-layout-workbench #elw-help-dialog.elw-help-dialog {
  max-width: min(40rem, 94vw);
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 0.5rem;
  background: #fafafa;
  color: #18181b;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.22);
}
#editorial-layout-workbench #elw-help-dialog.elw-help-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}
#editorial-layout-workbench .elw-help-dialog__box {
  display: flex;
  flex-direction: column;
  max-height: min(85vh, 40rem);
}
#editorial-layout-workbench .elw-help-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e4e4e7;
  background: #fff;
  border-radius: 0.5rem 0.5rem 0 0;
  flex-shrink: 0;
}
#editorial-layout-workbench .elw-help-dialog__head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
#editorial-layout-workbench .elw-help-dialog__close {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0 0.25rem;
  cursor: pointer;
  color: #71717a;
  border-radius: 0.25rem;
}
#editorial-layout-workbench .elw-help-dialog__close:hover {
  background: #f4f4f5;
  color: #18181b;
}
#editorial-layout-workbench .elw-help-dialog__body {
  overflow-y: auto;
  padding: 0.85rem 1rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
}
#editorial-layout-workbench .elw-help-section {
  margin-bottom: 1rem;
}
#editorial-layout-workbench .elw-help-section:last-child {
  margin-bottom: 0;
}
#editorial-layout-workbench .elw-help-section h3 {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #52525b;
}
#editorial-layout-workbench .elw-help-section p {
  margin: 0 0 0.5rem;
  color: #3f3f46;
}
#editorial-layout-workbench .elw-help-section p:last-child {
  margin-bottom: 0;
}

/* Prawa: materiały DnD */
#editorial-layout-workbench .elw-right {
  border-left: 1px solid #e4e4e7;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#editorial-layout-workbench .elw-right h3 {
  margin: 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #71717a;
  border-bottom: 1px solid #f4f4f5;
}
#editorial-layout-workbench .elw-articles {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.35rem;
}
#editorial-layout-workbench .elw-art {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.4rem 0.35rem;
  margin-bottom: 2px;
  border-radius: 0.35rem;
  border: 1px solid #f4f4f5;
  cursor: grab;
  background: #fafafa;
}
#editorial-layout-workbench .elw-art:active {
  cursor: grabbing;
}
#editorial-layout-workbench .elw-art:hover {
  border-color: #d4d4d8;
  background: #fff;
}
#editorial-layout-workbench .elw-art.elw-art--accent:not(.elw-art--on-page) {
  border-left: 4px solid var(--elw-art-accent, #a1a1aa);
  padding-left: calc(0.35rem + 1px);
}
#editorial-layout-workbench .elw-art.elw-art--accent.elw-art--on-page {
  border-left-width: 1px;
  border-left-color: color-mix(in srgb, var(--elw-art-accent, #6d1028) 45%, #e4e4e7);
  padding-left: 0.35rem;
}
#editorial-layout-workbench .elw-art.elw-art--on-page {
  --accent: var(--elw-art-accent, #6d1028);
  background: color-mix(in srgb, var(--accent) 28%, white);
  border-color: color-mix(in srgb, var(--accent) 45%, #e4e4e7);
}
#editorial-layout-workbench .elw-art.elw-art--on-page .elw-art-title {
  color: color-mix(in srgb, var(--accent) 58%, #0f172a) !important;
}
#editorial-layout-workbench .elw-art.elw-art--on-page .elw-art-meta {
  color: color-mix(in srgb, var(--accent) 38%, #475569) !important;
}
#editorial-layout-workbench .elw-art.elw-art--on-page:hover {
  background: color-mix(in srgb, var(--accent) 34%, white);
  border-color: color-mix(in srgb, var(--accent) 52%, #d4d4d8);
}
#editorial-layout-workbench .elw-art.elw-art--focus {
  outline: 2px solid var(--elw-art-accent, #2563eb);
  outline-offset: 1px;
}
#editorial-layout-workbench .elw-drag {
  flex-shrink: 0;
  width: 1rem;
  color: #a1a1aa;
  font-size: 0.9rem;
  line-height: 1;
  user-select: none;
}
#editorial-layout-workbench .elw-art .elw-art-body {
  flex: 1 1 auto;
  min-width: 0;
  cursor: pointer;
}
#editorial-layout-workbench .elw-art-edit {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-top: 0.05rem;
  border-radius: 0.3rem;
  color: #52525b;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  cursor: pointer;
  text-decoration: none;
}
#editorial-layout-workbench .elw-art-edit:hover {
  color: #18181b;
  background: #fff;
  border-color: #d4d4d8;
}
#editorial-layout-workbench .elw-art--on-page .elw-art-edit {
  color: #fecdd3;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}
#editorial-layout-workbench .elw-art--on-page .elw-art-edit:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}
#editorial-layout-workbench .elw-art-title {
  font-weight: 600;
  font-size: 0.75rem;
  color: #18181b;
}
#editorial-layout-workbench .elw-art-meta {
  font-size: 0.65rem;
  color: #71717a;
  margin-top: 0.15rem;
}

#editorial-layout-workbench .elw-status {
  font-size: 0.72rem;
  color: #71717a;
}
