body.community-isolated-open {
  overflow: hidden !important;
}

.community-isolated-overlay {
  position: fixed;
  inset: 0;
  z-index: 100220;
  overflow: auto;
  padding: 18px;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 10% 0%, rgba(236, 72, 153, .14), transparent 28%),
    rgba(20, 10, 37, .78);
  backdrop-filter: blur(8px);
}

.community-isolated-dialog {
  width: min(1480px, 100%);
  min-height: calc(100vh - 36px);
  margin: 0 auto;
  box-sizing: border-box;
}

.community-isolated-editor.hoja3 {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 36px);
  margin: 0;
  border: 1px solid rgba(236, 72, 153, .2);
  box-shadow: 0 28px 90px rgba(15, 23, 42, .34);
  padding: 16px 18px 24px;
}

.community-isolated-editor .hoja3-header {
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: wrap;
  margin: -16px -18px 16px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(124, 58, 237, .1);
}

/* The shared-model window is read-only; keep the original editor field
   untouched while hiding only its cloned header input. */
.community-isolated-editor .pattern-name-field {
  display: none !important;
}

.community-isolated-credit {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 8px 12px;
  border: 1px solid rgba(236, 72, 153, .22);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 247, 251, .96), rgba(247, 243, 255, .98));
  box-shadow: 0 8px 22px rgba(124, 58, 237, .08);
}

.community-isolated-credit-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  font-size: 17px;
}

.community-isolated-credit-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.community-isolated-credit-copy small {
  display: none !important;
  color: #a21caf;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .07em;
}

.community-isolated-credit-copy strong {
  overflow: hidden;
  color: #312e81;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-isolated-credit-copy > span {
  color: #6b7280;
  font-size: 12px;
}

.community-isolated-credit-size {
  color: #7c3aed !important;
  font-weight: 800;
}

.community-isolated-editor .hoja3-body {
  min-height: 0;
}

/* The independent view is a centered, full-width read/row-marking surface. */
.community-isolated-editor .hoja3-body {
  display: block !important;
  width: 100%;
}

.community-isolated-editor .hoja3-controls {
  display: none !important;
}

.community-isolated-editor .hoja3-canvas-area {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0 auto;
  box-sizing: border-box;
}

.community-isolated-editor .canvas-wrap {
  width: 100% !important;
  height: min(72vh, 760px) !important;
  max-width: none !important;
  max-height: none !important;
  min-height: 320px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  overflow: auto !important;
  box-sizing: border-box;
}

.community-isolated-canvas-stage {
  position: relative;
  flex: 0 0 auto;
  width: 1px;
  height: 1px;
}

/* Keep the highlight exactly over the centered stage, not at the wrapper edge. */
.community-isolated-canvas-stage > .isolated-highlight-layer {
  position: absolute;
  inset: 0;
}

.community-isolated-inline-palette {
  width: 100%;
  margin: 0 0 12px;
  padding: 10px 12px;
  box-sizing: border-box;
  border: 1px solid rgba(124, 58, 237, .12);
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 24px rgba(124, 58, 237, .06);
}

.community-isolated-inline-palette .palette-area {
  width: 100%;
}

.community-isolated-inline-palette .palette-area h4 {
  margin: 0 0 7px;
}

.community-isolated-inline-palette .isolated-palette-list {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 0 !important;
  max-height: none !important;
  padding: 4px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  box-sizing: border-box;
}

.community-isolated-inline-palette .isolated-palette-item {
  flex: 0 0 auto;
  min-width: 112px;
  min-height: 32px;
  padding: 5px 7px;
}

.community-isolated-inline-palette .isolated-palette-item input[readonly] {
  cursor: default;
}

/* Keep the source editor's control-hiding rules scoped to this clone. */
.community-isolated-editor .community-isolated-top-header,
.community-isolated-editor .community-isolated-orientation-block,
.community-isolated-editor .community-isolated-width-block,
.community-isolated-editor .community-isolated-height-block,
.community-isolated-editor .hoja3-controls > div:has(.toggle-buttons[aria-label="Orden de secuencia"]),
.community-isolated-editor .hoja3-controls > div:has(.toggle-buttons[aria-label="Modo de lectura"]),
.community-isolated-editor .community-isolated-generate-report,
.community-isolated-editor .community-isolated-save-project,
.community-isolated-editor .community-isolated-share-project,
.community-isolated-editor .community-isolated-export-project {
  display: none !important;
}

.community-isolated-editor .hoja3-controls > * {
  order: 99 !important;
}

.community-isolated-editor .community-isolated-top-header {
  order: 1 !important;
}

.community-isolated-editor .community-isolated-orientation-block {
  order: 2 !important;
}

.community-isolated-editor .community-isolated-width-block {
  order: 3 !important;
}

.community-isolated-editor .community-isolated-height-block {
  order: 4 !important;
}

.community-isolated-editor .hoja3-controls > div:has(.toggle-buttons[aria-label="Orden de secuencia"]) {
  order: 5 !important;
}

.community-isolated-editor .hoja3-controls > div:has(.toggle-buttons[aria-label="Modo de lectura"]) {
  order: 6 !important;
}

.community-isolated-editor .canvas-wrap {
  height: auto;
  min-height: 0;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  overflow: visible !important;
  max-width: none !important;
}

.community-isolated-editor .isolated-pattern-canvas {
  position: relative;
  z-index: 1;
  display: block;
  max-width: none;
  image-rendering: pixelated;
}

.community-isolated-editor .isolated-highlight-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  max-width: none;
}

.community-isolated-editor .isolated-palette-list {
  overflow-y: auto;
}

.isolated-palette-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
}

.isolated-palette-swatch {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(0, 0, 0, .2);
  border-radius: 4px;
}

.isolated-palette-item input {
  min-width: 0;
  flex: 1;
  padding: 3px 5px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font: 700 13px monospace;
}

.isolated-palette-hex {
  flex: 0 0 auto;
  color: #0f172a;
  font: 800 12px monospace;
}

.community-isolated-editor .isolated-report-box {
  max-height: 38vh;
}

.community-isolated-report-row {
  cursor: pointer;
}

.community-isolated-row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.community-isolated-row-actions button,
.community-isolated-sequence .color-pill {
  border: 1px solid rgba(124, 58, 237, .2);
  border-radius: 8px;
  background: #fff;
  color: #5b21b6;
  cursor: pointer;
  font-weight: 800;
}

.community-isolated-row-actions button {
  padding: 5px 8px;
  font-size: 12px;
}

.community-isolated-row-thumbnail {
  width: 45px;
  height: 45px;
  flex: 0 0 45px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  image-rendering: pixelated;
}

/* Paint-only row position marker layered above each report miniature. */
.report-thumbnail-guide {
  position: relative;
  display: block;
  flex: 0 0 45px;
  width: 45px;
  height: 45px;
  overflow: hidden;
  border-radius: 6px;
  isolation: isolate;
}

.report-thumbnail-guide > .community-isolated-row-thumbnail {
  display: block;
  width: 45px;
  height: 45px;
}

.report-thumbnail-guide-line,
.report-thumbnail-guide-cell {
  position: absolute;
  z-index: 2;
  display: block;
  pointer-events: none;
  box-sizing: border-box;
  border: 0;
  background: #ff1493;
  box-shadow:
    0 0 2px rgba(255, 255, 255, .95),
    0 0 5px rgba(255, 20, 147, .95),
    0 0 9px rgba(255, 20, 147, .8);
}

.report-thumbnail-guide-line {
  min-height: 2px;
  transform: translateY(-50%);
}

.report-thumbnail-guide-cell {
  border: 1px solid #ff1493;
  background: rgba(255, 20, 147, .22);
}

.community-isolated-sequence .color-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  color: #0f172a;
  font: 800 12px monospace;
}

.community-isolated-sequence .color-swatch {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(0, 0, 0, .14);
  border-radius: 3px;
}

.community-isolated-empty-report {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
}

/* Shared-model window branding: keep only the requested headings/buttons in
   the platform's arcade pink without affecting the canvas or thread palette. */
.community-isolated-editor .btn-back,
.community-isolated-editor .hoja3-title,
.community-isolated-inline-palette .palette-area h4,
.community-isolated-editor .isolated-report-box > h4 {
  color: #e639af !important;
  font-family: "Press Start 2P", monospace !important;
}

@media (max-width: 900px) {
  .community-isolated-overlay {
    padding: 0;
  }

  .community-isolated-dialog,
  .community-isolated-editor.hoja3 {
    min-height: 100vh;
    border-radius: 0;
  }

  .community-isolated-editor .hoja3-header {
    margin: -16px -18px 16px;
  }

  .community-isolated-credit {
    width: 100%;
    margin-left: 0;
  }

  .community-isolated-editor .hoja3-body {
    flex-direction: column;
  }

  .community-isolated-editor .hoja3-controls {
    width: 100%;
    max-width: none;
    min-width: 0;
    max-height: none;
  }

  .community-isolated-editor .hoja3-canvas-area {
    width: 100%;
  }

  .community-isolated-editor .canvas-wrap {
    min-height: 0;
    height: auto;
  }
}
