.content-panel {
  position: relative;
  width: 100%;
  margin: 0 0 14px;
  padding-block: var(--ui-editor-panel-padding-block-start) var(--ui-editor-panel-padding-block-end);
  padding-inline: var(--content-inline-inset, 26px);
  border: 0;
  background: rgba(255, 255, 255, .62);
}

.panel-control-strip {
  position: absolute;
  top: 3px;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--ui-compact-gap);
  height: var(--ui-icon-button-size);
  padding-inline: var(--ui-compact-inset);
  transform: translateX(-50%);
}

.panel-duplicate-button,
.panel-copy-button,
.panel-delete-button {
  color: var(--muted-color);
}

.panel-drag-handle {
  position: absolute;
  top: 3px;
  inset-inline-start: 4px;
  z-index: 2;
}

.panel-compact-button {
  --panel-compact-glyph-size: 10px;
  position: absolute;
  top: 3px;
  inset-inline-end: 4px;
  z-index: 2;
  color: var(--muted-color);
  opacity: 0;
  transition: opacity 100ms ease;
}

.panel-compact-button::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--panel-compact-glyph-size);
  height: 1px;
  transform: translate(-50%, -50%);
  background: currentColor;
  content: "";
}

.panel-compact-button::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: var(--panel-compact-glyph-size);
  transform: translate(-50%, -50%);
  background: currentColor;
  content: "";
}

.content-panel:not(.is-compact) > .panel-compact-button::after { display: none; }

.content-panel:hover > .panel-compact-button,
.content-panel.is-selected:not(.is-placed) > .panel-compact-button,
.content-panel.is-compact > .panel-compact-button,
.panel-compact-button:focus-visible { opacity: .78; }

.panel-drag-handle::before {
  position: absolute;
  top: 5.5px;
  left: 7.75px;
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 6px 0 currentColor,
    0 5.5px currentColor,
    6px 5.5px currentColor,
    0 11px currentColor,
    6px 11px currentColor;
  content: "";
}

.panel-duplicate-button {
  position: relative;
  opacity: 0;
  cursor: copy;
  touch-action: none;
  transition: opacity 100ms ease;
}

.panel-delete-button {
  position: relative;
  opacity: 0;
  cursor: pointer;
  transition: opacity 100ms ease;
}

.panel-copy-button {
  position: relative;
  opacity: 0;
  cursor: copy;
  transition: opacity 100ms ease;
}

.panel-copy-button::before,
.panel-duplicate-button::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--ui-panel-control-icon-size);
  height: var(--ui-panel-control-icon-size);
  transform: translate(-50%, -50%);
  background: currentColor;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  content: "";
}

.panel-copy-button::before {
  mask-image: url("../assets/icons/UI/Copy-icon.svg?v=1.5.18");
  -webkit-mask-image: url("../assets/icons/UI/Copy-icon.svg?v=1.5.18");
}

.panel-duplicate-button::before {
  mask-image: url("../assets/icons/UI/Duplicate-icon.svg?v=1.5.18");
  -webkit-mask-image: url("../assets/icons/UI/Duplicate-icon.svg?v=1.5.18");
}

.content-panel:hover > .panel-drag-handle,
.content-panel.is-selected:not(.is-placed) > .panel-drag-handle,
.panel-drag-handle:focus-visible { opacity: var(--ui-object-handle-opacity-active); }
.content-panel:hover > .panel-control-strip .panel-duplicate-button,
.content-panel.is-selected:not(.is-placed) > .panel-control-strip .panel-duplicate-button,
.panel-duplicate-button:focus-visible { opacity: .78; }
.content-panel:hover > .panel-control-strip .panel-copy-button,
.content-panel.is-selected:not(.is-placed) > .panel-control-strip .panel-copy-button,
.panel-copy-button:focus-visible { opacity: .78; }
.content-panel:hover > .panel-control-strip .panel-delete-button,
.content-panel.is-selected:not(.is-placed) > .panel-control-strip .panel-delete-button,
.panel-delete-button:focus-visible { opacity: .78; }
.content-panel.is-draft > .panel-control-strip,
.content-panel.is-draft > .panel-drag-handle { display: none; }

.panel-delete-confirmation {
  position: absolute;
  top: 30px;
  left: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: var(--ui-floating-gap);
  width: max-content;
  padding: var(--ui-floating-padding-md) var(--ui-floating-padding-lg);
  transform: translateX(-50%);
  color: var(--text-color);
  font-size: var(--ui-font-size-control);
  line-height: var(--ui-line-height-solid);
}

.panel-delete-confirmation[hidden] { display: none; }

.panel-delete-confirm-button { --ui-quiet-button-color: var(--ui-danger); }

.panel-drop-placeholder {
  width: 100%;
  margin: 0 0 14px;
  border-radius: var(--ui-radius-placeholder);
  background: var(--ui-drop-placeholder-surface);
}

.panel-drag-ghost {
  position: fixed;
  z-index: 1000;
  margin: 0;
  background: var(--ui-surface-drag-preview);
  box-shadow: var(--ui-shadow-floating);
  opacity: .94;
  pointer-events: none;
}

.panel-drag-ghost > .panel-control-strip,
.panel-drag-ghost > .panel-compact-button { visibility: hidden; }
.panel-drag-ghost > .panel-drag-handle { opacity: var(--ui-object-handle-opacity-active); }
.content-panel.is-panel-drag-source { display: none; }

.content-panel.is-selected {
  outline: 1px solid var(--ui-editor-panel-selected-border);
  outline-offset: -1px;
}
.content-panel.is-placed {
  background: var(--ui-control-bg);
  outline-color: transparent;
}
.panel-blocks {
  display: grid;
  gap: 12px;
  padding-inline: var(--ui-editor-blocks-inline-padding);
}
.panel-compact-preview {
  display: grid;
  gap: 5px;
  min-height: 28px;
  padding: 1px 9px 0;
  outline: none;
  cursor: pointer;
}
.panel-compact-preview__line {
  min-width: 0;
  overflow: hidden;
  color: var(--ui-editor-compact-preview-text);
  font-size: var(--regular-font-size, var(--font-size));
  line-height: var(--ui-editor-compact-preview-line-height);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.panel-compact-preview__line--level0 {
  font-family: var(--level0-font-family, var(--regular-font-family, var(--font-family)));
  font-size: var(--level0-font-size, var(--list-level-0-size));
  font-weight: var(--level0-font-weight, var(--list-root-weight));
  letter-spacing: -.005em;
}
.panel-compact-preview__line--heading1 {
  font-family: var(--heading1-font-family);
  font-size: var(--heading1-font-size);
  font-weight: 650;
}
.panel-compact-preview__line--media {
  font-size: var(--ui-font-size-caption);
  font-weight: var(--ui-font-weight-regular);
}
.panel-compact-preview__line.is-empty {
  color: var(--muted-color);
  font-size: var(--ui-font-size-caption);
}
.panel-compact-preview:focus-visible {
  background: color-mix(in srgb, var(--ui-accent) 7%, transparent);
  border-radius: var(--ui-radius-block-selection);
}
.empty-panel-writing-surface,
.empty-block-editor {
  min-height: 28px;
  cursor: text;
}
.empty-panel-editor,
.empty-block-editor {
  min-height: 28px;
  outline: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.empty-panel-editor:empty::before,
.empty-block-editor:empty::before,
.empty-segment-editor:empty::before,
.text-block-editor:empty::before {
  color: var(--muted-color);
  content: attr(data-placeholder);
  opacity: .72;
  pointer-events: none;
}
.empty-panel-writing-surface { padding-inline-start: 9px; }
.content-block {
  position: relative;
  min-width: 0;
  padding-inline-start: 0;
}
.content-block::before {
  position: absolute;
  top: 4px;
  bottom: 4px;
  inset-inline-start: calc(-1 * var(--ui-object-block-handle-line-offset));
  z-index: 2;
  width: 1px;
  background: linear-gradient(
    to bottom,
    currentColor 0 5px,
    transparent 5px 23px,
    currentColor 23px
  );
  color: var(--ui-object-handle-color);
  opacity: 0;
  pointer-events: none;
  transition: color 100ms ease, opacity 100ms ease;
  content: "";
}
.content-block::after {
  position: absolute;
  top: 11px;
  inset-inline-start: calc(-1 * var(--ui-object-block-handle-grip-offset) - 1px);
  z-index: 3;
  width: 7px;
  height: 11px;
  background: radial-gradient(circle at 1.5px 1.5px, currentColor 0 1.25px, transparent 1.5px) 0 0 / 4px 4px repeat;
  color: var(--ui-object-handle-color);
  opacity: 0;
  pointer-events: none;
  scale: 1;
  transition: color 100ms ease, opacity 100ms ease, scale 100ms ease;
  content: "";
}
.content-block:hover::before,
.content-block:hover::after,
.content-block.is-selected::before,
.content-block.is-selected::after,
.content-block:has(> .block-drag-handle:focus-visible)::before,
.content-block:has(> .block-drag-handle:focus-visible)::after {
  opacity: .55;
}
.content-block:has(> .block-drag-handle:hover)::before,
.content-block:has(> .block-drag-handle:hover)::after,
.content-block:has(> .block-drag-handle:focus-visible)::before,
.content-block:has(> .block-drag-handle:focus-visible)::after {
  color: var(--ui-accent);
  opacity: var(--ui-object-handle-opacity-active);
}
.content-block:has(> .block-drag-handle:hover)::after,
.content-block:has(> .block-drag-handle:focus-visible)::after { scale: 1.25; }
.content-block.is-selected {
  --block-selection-fill: color-mix(in srgb, var(--ui-accent) 9%, transparent);
  isolation: isolate;
  background: transparent;
  border-radius: var(--ui-radius-block-selection);
}
.content-block.is-placed {
  --block-selection-fill: var(--ui-control-bg);
}
.block-selection-region {
  position: absolute;
  inset: 0;
  inset-inline-start: calc(-1 * var(--ui-object-selection-inline-outset));
  z-index: -1;
  border-radius: inherit;
  background: var(--block-selection-fill);
  pointer-events: none;
}
.content-block:is(.content-block--image, .content-block--drawing).is-selected {
  background: transparent;
}
.content-block:is(.content-block--image, .content-block--drawing).is-selected
  > :is(.workspace-image-button, .image-upload-placeholder, .drawing-preview) {
  outline: 2px solid var(--ui-accent);
  outline-offset: -2px;
}
.ui-object-drag-handle.block-drag-handle {
  position: absolute;
  top: -2px;
  inset-inline-start: calc(-1 * var(--ui-object-block-handle-hit-offset));
  z-index: 3;
  width: 14px;
  height: 28px;
  color: transparent;
  font-size: 0;
  line-height: 0;
  letter-spacing: 0;
  opacity: 0;
  cursor: default;
}
.content-block:hover > .block-drag-handle,
.content-block.is-selected > .block-drag-handle,
.block-drag-handle:focus-visible { opacity: var(--ui-object-handle-opacity-active); }
.ui-object-drag-handle.block-drag-handle:active { cursor: grabbing; }
.text-block-editor {
  min-height: 1.55em;
  outline: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: var(--regular-font-size, var(--font-size));
  font-family: var(--regular-font-family, var(--font-family));
  font-weight: var(--regular-font-weight, 400);
  line-height: var(--content-line-height, var(--line-height));
}
.block-drop-placeholder {
  height: 34px;
  background: var(--ui-drop-placeholder-surface);
  border-radius: var(--ui-radius-placeholder);
}
.block-drag-ghost {
  position: fixed;
  z-index: 1000;
  padding: 9px 12px;
  border: 1px solid var(--ui-border);
  background: var(--ui-surface-drag-preview);
  color: var(--text-color);
  font-size: var(--ui-font-size-body-sm);
  pointer-events: none;
}
.content-block.is-block-drag-source { display: none; }
.cell-framed-image.is-block-drag-source,
.cell-framed-image.is-drag-source { visibility: hidden; }
body.is-dragging-block { cursor: grabbing; user-select: none; }
.workspace-image-button {
  position: relative;
  display: block;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: grab;
}
.workspace-image-button:active { cursor: grabbing; }
body.is-editing-image-crop .cell-framed-image.is-crop-editing .workspace-image-button { cursor: grab; }
body.is-editing-image-crop .cell-framed-image.is-crop-editing .workspace-image-button:active { cursor: grabbing; }
:is(.workspace-image-button--block, .image-upload-placeholder--block, .drawing-preview--block) { width: 100%; }
.workspace-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  object-position: left top;
}
.image-upload-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 116px;
  padding: 0;
  border: 1px dashed color-mix(in srgb, var(--muted-color) 42%, transparent);
  background: color-mix(in srgb, var(--panel-bg) 72%, transparent);
  color: var(--muted-color);
  font-size: var(--ui-font-size-media-placeholder);
  font-weight: var(--ui-font-weight-light);
  cursor: pointer;
}
.image-upload-placeholder:hover,
.image-upload-placeholder:focus-visible {
  border-color: var(--ui-accent);
  color: var(--ui-accent);
  outline: none;
}
.drawing-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 3 / 2;
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--muted-color) 24%, transparent);
  background: #fff;
  color: var(--muted-color);
  font-size: var(--ui-font-size-drawing-placeholder);
  cursor: zoom-in;
}
.drawing-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.drawing-preview:hover,
.drawing-preview:focus-visible { border-color: var(--ui-accent); outline: none; }
.drawing-editor {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 20px;
  background: rgba(238, 239, 236, .97);
}
.drawing-editor[hidden] { display: none; }
.drawing-editor__toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--ui-action-gap-wide);
}
.drawing-editor__toolbar button.is-active { color: var(--ui-accent); }
.drawing-editor__toolbar input[type="color"] {
  width: var(--ui-drawing-color-control-size);
  height: var(--ui-drawing-color-control-size);
  padding: 2px;
  border: 0;
  background: transparent;
}
.drawing-editor__toolbar input[type="range"] { width: 130px; }
.drawing-editor__toolbar span { min-width: 28px; color: var(--muted-color); font-size: var(--ui-font-size-caption); }
.drawing-editor__width-control {
  --drawing-width-preview-size: 40px;
  display: grid; grid-template-columns: minmax(0, 1fr) var(--drawing-width-preview-size);
  align-items: center; gap: 8px; width: 240px; min-width: 0;
}
.drawing-editor__width-slider {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  min-width: 0; min-height: var(--drawing-width-preview-size); gap: 8px; padding-inline: 10px;
  border-radius: var(--ui-radius-field); background: var(--ui-control-bg);
  color: var(--ui-value-muted); font-size: var(--ui-font-size-caption);
}
.drawing-editor__width-slider input[type="range"] { width: 100%; min-width: 0; margin: 0; }
.drawing-editor__toolbar .drawing-editor__width-value { width: 5ch; min-width: 0; text-align: end; white-space: nowrap; font: inherit; font-variant-numeric: tabular-nums; color: inherit; }
.drawing-editor__toolbar .drawing-editor__width-preview {
  position: relative; display: grid; place-items: center; min-width: 0;
  width: var(--drawing-width-preview-size); height: var(--drawing-width-preview-size);
  border-radius: var(--ui-radius-field); background: var(--ui-control-bg); z-index: 1;
}
.drawing-editor__width-preview > span { position: absolute; min-width: 0; border-radius: 50%; pointer-events: none; }
.drawing-editor__width-ghost { border: 1.5px solid var(--ui-value-primary); z-index: 1; }
.drawing-editor__width-ghost[hidden] { display: none; }
.drawing-editor__close { margin-inline-start: 16px; }
.drawing-editor__canvas {
  display: block;
  width: min(100%, 1200px);
  max-height: 100%;
  aspect-ratio: 3 / 2;
  margin: auto;
  border: 1px solid var(--ui-border);
  background: #fff;
  cursor: crosshair;
  touch-action: none;
}
.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 48px;
  background: var(--ui-backdrop-immersive);
}
.image-viewer[hidden] { display: none; }
.image-viewer__viewport {
  width: 100%;
  height: 100%;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}
.image-viewer__stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 100%;
  min-height: 100%;
}
.image-viewer__image {
  display: block;
  max-width: none;
  max-height: none;
  object-fit: contain;
  user-select: none;
}
.image-viewer__controls {
  position: absolute;
  z-index: 1;
  top: 14px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: var(--ui-control-gap-md);
  transform: translateX(-50%);
}
.image-viewer__zoom-value {
  min-width: 40px;
  color: var(--ui-value-secondary);
  font-size: var(--ui-font-size-caption);
  text-align: end;
}
.image-viewer__close {
  position: absolute;
  top: 18px;
  inset-inline-end: 22px;
  width: var(--ui-immersive-close-size);
  height: var(--ui-immersive-close-size);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ui-text-on-immersive);
  font-size: var(--ui-font-size-immersive-close);
  font-weight: var(--ui-font-weight-light);
  cursor: pointer;
}
.panel-items.is-empty { min-height: 28px; }

.add-panel-button {
  display: grid;
  place-items: center;
  width: var(--ui-icon-button-size);
  height: var(--ui-icon-button-size);
  margin: -5px auto 16px;
  padding: 0;
  border: 0;
  color: var(--muted-color);
  background: transparent;
  font-size: var(--ui-icon-button-size);
  line-height: var(--ui-line-height-solid);
  opacity: .38;
  cursor: pointer;
}

.add-panel-button:hover { opacity: .85; }

.add-panel-button--empty-segment {
  margin: 0 auto;
}

.empty-segment-writing-surface {
  min-height: 100%;
  padding: 12px;
  cursor: text;
}

.empty-segment-editor {
  min-height: 24px;
  outline: none;
}

body.is-panel-frames-hidden .content-panel:not(.panel-drag-ghost) {
  background: transparent;
}
