/* Pagetree editor — right canvas (Gridstack mount + link card visual). */

/* Two-column shell: narrower sidebar column, content 2fr */
.editor-page .editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.80fr) minmax(0, 2fr);
    gap: 10px;
    width: 100%;
    max-width: min(100%, var(--editor-layout-max-width-px));
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: clip;
    overflow-y: visible;
    align-items: stretch;
    border: none;
    border-radius: 16px;
}

.editor-page .editor-layout > * {
    min-height: 0;
}

/* Pull scroll column up under the fixed toolbar / down over the bottom rail. */
.editor-page .editor-layout__canvas-scroll {
    box-sizing: border-box;
    min-width: 0;
    min-height: 0;
    /* Avoid grid column width jumping when this column gains/loses a vertical scrollbar. */
    scrollbar-gutter: stable;
    position: relative;
    z-index: 2;
    margin-top: calc(-1 * var(--editor-shell-top-gutter, calc(112px + env(safe-area-inset-top, 0px))));
    padding-top: var(--editor-shell-top-gutter, calc(112px + env(safe-area-inset-top, 0px)));
    margin-bottom: calc(-1 * var(--editor-shell-bottom-gutter, calc(112px + env(safe-area-inset-bottom, 0px))));
    padding-bottom: var(--editor-shell-bottom-gutter, calc(112px + env(safe-area-inset-bottom, 0px)));
    overflow-x: clip;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border: none;
    border-radius: 10px;
}

.editor-page .editor-layout__content {
    width: 100%;
    box-sizing: border-box;
    min-height: 0;
    padding: 48px;
    border: none;
}

/* ── Gridstack overrides ─────────────────────────────────────────────────── */

/* Match Pagetree's transparent canvas; Gridstack defaults paint a light bg. */
.editor-page .grid-stack {
    background: transparent;
    min-height: min(72vh, 760px);
}

/* Drag/resize ghost (Gridstack's "placeholder" when moving an item) */
.editor-page .grid-stack > .grid-stack-placeholder > .placeholder-content {
    background: color-mix(in srgb, #5e69ff 14%, transparent);
    border: 2px solid color-mix(in srgb, #5e69ff 55%, transparent);
    border-radius: calc(var(--editor-grid-cell-radius, 20px) / 2);
    inset: 4px;
}

/* Item being dragged */
.editor-page .grid-stack > .grid-stack-item.ui-draggable-dragging {
    opacity: 0.85;
    z-index: 100;
}

/* Side-only resize handles — directional (no diagonal/proportional). */
.editor-page .grid-stack > .grid-stack-item > .ui-resizable-handle {
    position: absolute;
    background: transparent;
    opacity: 0;
    transition: opacity 0.18s ease;
    z-index: 2;
}

/* Hit-zone strips on each edge */
.editor-page .grid-stack > .grid-stack-item > .ui-resizable-n,
.editor-page .grid-stack > .grid-stack-item > .ui-resizable-s {
    left: 12px;
    right: 12px;
    height: 12px;
    cursor: ns-resize;
}
.editor-page .grid-stack > .grid-stack-item > .ui-resizable-n { top: 2px; }
.editor-page .grid-stack > .grid-stack-item > .ui-resizable-s { bottom: 2px; }

.editor-page .grid-stack > .grid-stack-item > .ui-resizable-e,
.editor-page .grid-stack > .grid-stack-item > .ui-resizable-w {
    top: 12px;
    bottom: 12px;
    width: 12px;
    cursor: ew-resize;
}
.editor-page .grid-stack > .grid-stack-item > .ui-resizable-e { right: 2px; }
.editor-page .grid-stack > .grid-stack-item > .ui-resizable-w { left: 2px; }

/* Circular gripper in the middle of each edge, on hover */
.editor-page .grid-stack > .grid-stack-item > .ui-resizable-handle::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--black);
    border: 2px solid var(--white);
    border-radius: 50%;
    box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--black) 50%, transparent);
}

/* Resize handles only appear after the user clicks the Resize action
   button (which toggles *--resizing on the card). */
.editor-page .grid-stack > .grid-stack-item:has(.editor-link-card--resizing) > .ui-resizable-handle,
.editor-page .grid-stack > .grid-stack-item:has(.editor-text-block--resizing) > .ui-resizable-handle,
.editor-page .grid-stack > .grid-stack-item:has(.editor-quote-block--resizing) > .ui-resizable-handle,
.editor-page .grid-stack > .grid-stack-item:has(.editor-image-card--resizing) > .ui-resizable-handle,
.editor-page .grid-stack > .grid-stack-item:has(.editor-newsletter-card--resizing) > .ui-resizable-handle,
.editor-page .grid-stack > .grid-stack-item:has(.editor-contact-card--resizing) > .ui-resizable-handle,
.editor-page .grid-stack > .grid-stack-item:has(.editor-navigation-card--resizing) > .ui-resizable-handle {
    opacity: 1;
    z-index: 30;
    pointer-events: auto;
}

/* Navigation: horizontal resize only (fixed row height) */
.editor-page .grid-stack > .grid-stack-item:has(.editor-navigation-card) {
    min-height: 88px;
}
.editor-page .grid-stack > .grid-stack-item:has(.editor-navigation-card) > .grid-stack-item-content {
    min-height: 88px;
}
.editor-page .grid-stack > .grid-stack-item:has(.editor-navigation-card) > .ui-resizable-n,
.editor-page .grid-stack > .grid-stack-item:has(.editor-navigation-card) > .ui-resizable-s {
    display: none !important;
    pointer-events: none !important;
}

/* Action-button slide-down menus must sit above neighboring grid widgets. */
.editor-page {
    --editor-card-action-dropdown-z: 99999;
    --editor-card-action-dropdown-item-z: 8;
}

/* Top-layer portal for card action dropdowns (mounted via JS). */
.editor-card-dropdown-portal {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    pointer-events: none;
}

.editor-card-dropdown-portal > .editor-image-card__link-picker {
    pointer-events: auto;
}

/* While a card menu is open, freeze neighbor hover stacking. */
.editor-page .editor-grid--dropdown-open > .grid-stack-item,
.editor-page .editor-grid--dropdown-open > .grid-stack-item:hover {
    z-index: 1 !important;
}

.editor-page .editor-grid--dropdown-open > .grid-stack-item:is(
    :has(.editor-image-card--link-picker-open),
    .grid-stack-item--card-ui-active
) {
    z-index: 50 !important;
    pointer-events: auto;
}

.editor-page .editor-grid--dropdown-open > .grid-stack-item:not(
    :has(.editor-image-card--link-picker-open),
    .grid-stack-item--card-ui-active
) {
    pointer-events: none;
}

.editor-page .editor-grid--dropdown-open .editor-image-card:hover,
.editor-page .editor-grid--dropdown-open .editor-link-card:hover,
.editor-page .editor-grid--dropdown-open .editor-text-block:hover,
.editor-page .editor-grid--dropdown-open .editor-quote-block:hover,
.editor-page .editor-grid--dropdown-open .editor-newsletter-card:hover,
.editor-page .editor-grid--dropdown-open .editor-contact-card:hover,
.editor-page .editor-grid--dropdown-open .editor-navigation-card:hover {
    transform: none;
    box-shadow: none;
}

.editor-page .grid-stack > .grid-stack-item:has(
    .editor-image-card--link-picker-open,
    .editor-text-block__link-picker--open,
    .editor-text-block__color-picker--open
) > .grid-stack-item-content {
    overflow: visible !important;
}

.editor-page .grid-stack > .grid-stack-item:has(
    .editor-navigation-card .editor-inline-nav__group--active:focus-within
),
.editor-page .grid-stack > .grid-stack-item:has(
    .editor-navigation-card:hover .editor-inline-nav__group--active
) {
    z-index: var(--editor-card-action-dropdown-item-z) !important;
}

/* ── Link card ───────────────────────────────────────────────────────────── */

.editor-page .grid-stack > .grid-stack-item > .grid-stack-item-content {
    inset: 22px;
    overflow: visible;
    min-width: 0;
}

.editor-link-card {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 26px;
    background: var(--white);
    color: var(--black);
    border: 1px solid var(--editor-card-border, color-mix(in srgb, #0b0b0d 14%, transparent));
    border-radius: calc(var(--editor-grid-cell-radius, 20px) / 2);
    /* visible so the top-left delete button can overflow the card */
    overflow: visible;
    cursor: grab;
    user-select: none;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.editor-link-card[data-card-radius="sharp"] {
    border-radius: 2px;
}

.editor-link-card[data-card-radius="soft"] {
    border-radius: calc(var(--editor-grid-cell-radius, 32px) / 2);
}

.editor-link-card[data-card-radius="hard"] {
    border-radius: 24px;
}

.editor-link-card[data-card-radius="circular"] {
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 38px;
    border-radius: 24px;
    aspect-ratio: 1;
}

.editor-link-card[data-card-radius="circular"] .editor-link-card__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
}

.editor-link-card[data-card-radius="circular"] .editor-link-card__domain {
    text-align: center;
    width: 100%;
}

.editor-link-card[data-card-radius="circular"] .editor-link-card__favicon {
    display: block;
    margin: 0 auto 10px;
}

.editor-link-card[data-card-radius="circular"] .editor-link-card__title {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding-left: 0;
    padding-right: 0;
    text-align: center;
}

.editor-link-card:hover {
    box-shadow: 0 18px 36px -22px color-mix(in srgb, var(--black) 60%, transparent);
    transform: translateY(-1px);
}

.editor-link-card:active,
.grid-stack-item.ui-draggable-dragging .editor-link-card {
    cursor: grabbing;
}

.editor-link-card__head {
    display: block;
    width: 100%;
}

.editor-link-card__favicon {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: transparent;
    object-fit: contain;
    padding: 0;
    box-sizing: border-box;
    margin: 0 0 10px;
}

.editor-link-card__title {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 4px 8px;
    border: 0;
    outline: 0;
    border-radius: 8px;
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    font-weight: var(--fw-light);
    line-height: 1.25;
    color: var(--black);
    overflow: hidden;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    resize: none;
    cursor: text;
    text-align: left;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color 0.15s ease;
}

.editor-link-card__title:hover {
    background: color-mix(in srgb, var(--black) 6%, transparent);
}

.editor-link-card__title:focus {
    background: color-mix(in srgb, var(--black) 8%, transparent);
}

.editor-link-card__domain {
    width: 100%;
    margin-top: 0;
    padding-top: 0;
    font-size: 13px;
    font-weight: var(--fw-light);
    color: color-mix(in srgb, var(--black) 55%, transparent);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-link-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    gap: 0.35em;
    margin-top: 10px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: var(--fw-light);
    letter-spacing: 0.02em;
    text-decoration: none;
    color: #fff;
    background: #18181b;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 2px color-mix(in srgb, var(--black) 12%, transparent);
}

.editor-link-card[data-card-platform="instagram"] .editor-link-card__cta {
    background: linear-gradient(120deg, #f58529, #dd2a7b, #8134af);
}

.editor-link-card[data-card-platform="youtube"] .editor-link-card__cta {
    background: #ff0000;
}

.editor-link-card[data-card-platform="whatsapp"] .editor-link-card__cta {
    color: #18181b;
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--black) 14%, transparent);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--black) 8%, transparent);
}

.editor-link-card[data-card-platform="whatsapp"] .editor-link-card__cta:hover {
    filter: none;
    background: color-mix(in srgb, var(--black) 4%, #fff);
}

.editor-link-card__cta:hover {
    filter: brightness(1.06);
}

.editor-link-card__cta-count {
    font-weight: inherit;
    letter-spacing: inherit;
}

/* 1×1 / very short cell: favicon + title one row, domain hidden */
.editor-page .editor-link-card--micro:not(.editor-link-card--has-media) {
    justify-content: center;
    align-items: stretch;
    padding: 10px 12px;
}

.editor-page .editor-link-card--micro:not(.editor-link-card--has-media) .editor-link-card__body {
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.editor-page .editor-link-card--micro:not(.editor-link-card--has-media) .editor-link-card__domain {
    display: none !important;
}

.editor-page .editor-link-card--micro:not(.editor-link-card--has-media) .editor-link-card__cta {
    display: none !important;
}

.editor-page .editor-link-card--micro:not(.editor-link-card--has-media) .editor-link-card__head {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    min-height: 0;
}

.editor-page .editor-link-card--micro:not(.editor-link-card--has-media) .editor-link-card__favicon {
    width: 22px;
    height: 22px;
    margin: 0 !important;
    flex-shrink: 0;
    align-self: center;
}

.editor-page .editor-link-card--micro:not(.editor-link-card--has-media) .editor-link-card__title {
    flex: 1 1 auto;
    min-width: 0;
    width: auto !important;
    max-width: none !important;
    margin: 3px 0 0 0 !important;
    padding: 0 !important;
    align-self: center;
}

.editor-page .editor-link-card--micro[data-card-radius="circular"]:not(.editor-link-card--has-media) {
    aspect-ratio: auto;
    padding: 10px 12px;
}

.editor-page .editor-link-card--micro[data-card-radius="circular"]:not(.editor-link-card--has-media) .editor-link-card__favicon {
    margin: 0 !important;
}

/* ── Body wrapper + image placeholder ────────────────────────────────────
   The body keeps the original 1x1 vertical stack (favicon → title →
   domain). When the card is resized past 1 cell, init.php sets
   `editor-link-card--has-media` plus `data-card-media-side`, which
   switches the card into a grid so the placeholder fills the new space
   without disturbing the body. */
.editor-link-card__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    min-width: 0;
}

.editor-link-card__media {
    display: none;
}

.editor-link-card--has-media {
    display: grid;
    gap: 14px;
    align-items: stretch;
}

.editor-link-card--has-media .editor-link-card__body {
    grid-area: body;
    align-self: stretch;
    min-width: 0;
}

.editor-link-card--has-media .editor-link-card__media {
    grid-area: media;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    min-width: 0;
    min-height: 64px;
    padding: 14px;
    border-radius: 7px;
    background: color-mix(in srgb, var(--black) 6%, transparent);
    color: color-mix(in srgb, var(--black) 55%, transparent);
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.editor-link-card--has-media .editor-link-card__media:hover {
    background: color-mix(in srgb, var(--black) 10%, transparent);
    color: color-mix(in srgb, var(--black) 75%, transparent);
}

/* Side variants — body keeps the original cell footprint, media takes
   the rest. Horizontal: split 50/50 columns; Vertical: body uses its
   natural height, media absorbs the remaining space. */
.editor-link-card--has-media[data-card-media-side="right"] {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 1fr;
    grid-template-areas: "body media";
}

.editor-link-card--has-media[data-card-media-side="left"] {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 1fr;
    grid-template-areas: "media body";
}

.editor-link-card--has-media[data-card-media-side="bottom"] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "body" "media";
}

.editor-link-card--has-media[data-card-media-side="top"] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas: "media" "body";
}

.editor-link-card__media-icon {
    line-height: 1;
    font-size: 32px;
    color: inherit;
    font-variation-settings:
        'FILL' 0,
        'wght' 200,
        'GRAD' 0,
        'opsz' 32;
}

.editor-link-card__media-label {
    font-family: inherit;
    font-size: 12px;
    font-weight: var(--fw-light);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: inherit;
}

/* Once an upload succeeds the placeholder turns into a clipped image
   surface. We DON'T clip the wrapper (`overflow: visible`) so the
   top-left action pill keeps its half-overflow; the rounded corners
   are applied to the <img> itself instead. */
.editor-link-card--has-media .editor-link-card__media--has-image {
    background: transparent;
    color: var(--white);
    padding: 0;
    overflow: visible;
    cursor: default;
}

.editor-link-card__media-image {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.editor-link-card__actions--media {
    z-index: 4;
}

.editor-link-card[data-card-image-state="uploading"] .editor-link-card__media {
    opacity: 0.6;
    pointer-events: none;
}

/* Hover action bar — bottom-center pill, half-overflowing the card. Styled to
   match the bottom dock (.editor-floating-nav): dark glass, white icons. */
.editor-link-card__actions {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 30%) translateY(6px);
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 3px;
    border-radius: 999px;
    background: color-mix(in srgb, #0b0b0d 88%, transparent);
    border: 1px solid color-mix(in srgb, var(--white) 12%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    backdrop-filter: blur(14px) saturate(1.15);
    box-shadow:
        0 1px 0 color-mix(in srgb, var(--white) 10%, transparent) inset,
        0 18px 36px -18px color-mix(in srgb, var(--black) 92%, transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 60;
}

.editor-link-card:hover .editor-link-card__actions,
.editor-link-card:has(.editor-link-card__actions:hover) .editor-link-card__actions,
.editor-text-block:hover .editor-link-card__actions,
.editor-text-block:has(.editor-link-card__actions:hover) .editor-link-card__actions,
.editor-quote-block:hover .editor-link-card__actions,
.editor-quote-block:has(.editor-link-card__actions:hover) .editor-link-card__actions {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 50%) translateY(0);
}

.editor-link-card__action {
    width: 28px;
    height: 28px;
    padding: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: color-mix(in srgb, var(--white) 78%, transparent);
    cursor: pointer;
    transition:
        background-color 180ms ease,
        color 180ms ease,
        border-color 180ms ease;
}

.editor-link-card__action:hover {
    color: var(--white);
    background: color-mix(in srgb, var(--white) 8%, transparent);
    border-color: color-mix(in srgb, var(--white) 16%, transparent);
}

.editor-link-card__action[aria-pressed="true"] {
    color: var(--white);
    background: color-mix(in srgb, #5e69ff 50%, transparent);
    border-color: color-mix(in srgb, var(--white) 24%, transparent);
}

.editor-link-card__action .material-symbols-outlined {
    display: block;
    line-height: 1;
    font-size: 20px;
    color: inherit;
    font-variation-settings:
        'FILL' 0,
        'wght' 200,
        'GRAD' 0,
        'opsz' 24;
}

/* Top-left delete pill — same dark-glass container/buttons as the bottom
   action bar, just positioned on the top-left corner. */
.editor-link-card__actions--delete {
    top: 0;
    left: 0;
    bottom: auto;
    right: auto;
    transform: translate(-30%, -30%) translateY(-6px);
}

.editor-link-card:hover .editor-link-card__actions--delete,
.editor-link-card:has(.editor-link-card__actions:hover) .editor-link-card__actions--delete,
.editor-text-block:hover .editor-link-card__actions--delete,
.editor-text-block:has(.editor-link-card__actions:hover) .editor-link-card__actions--delete,
.editor-quote-block:hover .editor-link-card__actions--delete,
.editor-quote-block:has(.editor-link-card__actions:hover) .editor-link-card__actions--delete {
    transform: translate(-30%, -30%) translateY(0);
}

/* Image placeholder action pill — same exact dark-glass button system as
   the card actions, anchored inside the placeholder's top-left corner. */
.editor-link-card__actions--media {
    top: 0;
    left: 0;
    right: auto;
    bottom: auto;
    transform: translate(-30%, -30%) translateY(-6px);
}

.editor-link-card:hover .editor-link-card__actions--media,
.editor-link-card:has(.editor-link-card__actions:hover) .editor-link-card__actions--media {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-30%, -30%) translateY(0);
}

/* ── Text block widget ─────────────────────────────────────────────────── */
.editor-text-block {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: var(--white);
    color: var(--black);
    border: 1px solid var(--editor-card-border, color-mix(in srgb, #0b0b0d 14%, transparent));
    border-radius: calc(var(--editor-grid-cell-radius, 32px) / 2);
    overflow: visible;
    cursor: grab;
    user-select: none;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.editor-text-block:hover {
    box-shadow: 0 18px 36px -22px color-mix(in srgb, var(--black) 60%, transparent);
    transform: translateY(-1px);
}

.editor-text-block:active,
.grid-stack-item.ui-draggable-dragging .editor-text-block {
    cursor: grabbing;
}

.editor-text-block__input,
.editor-text-block__input:hover,
.editor-text-block__input:active,
.editor-text-block__input:focus,
.editor-text-block__input:focus-visible {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
    outline: 0;
    background: transparent;
    color: var(--black);
    font-family: var(--text-block-font, var(--font-primary));
    font-weight: var(--fw-light);
    line-height: 1.45;
    letter-spacing: -0.01em;
    text-align: left;
    /* "anywhere" shifts min-content and can reflow oddly when the grid cell width changes. */
    word-break: normal;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    resize: none;
    cursor: text;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Rich-text from the browser — default p/div margins can look like an extra line after a width reflow. */
.editor-text-block__input p,
.editor-text-block__input div {
    margin: 0;
}

.editor-text-block:hover .editor-text-block__input:not(:focus):not(:focus-visible) {
    background: color-mix(in srgb, var(--black) 5%, transparent);
}

.editor-text-block__input:focus,
.editor-text-block__input:focus-visible {
    background: transparent;
}

.editor-text-block__input b,
.editor-text-block__input strong {
    font-weight: 700;
}

.editor-text-block__input i,
.editor-text-block__input em {
    font-style: italic;
}

.editor-text-block__input a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

/* contenteditable placeholder — :empty triggers when there are no text
   nodes, no <br>, no inline tags. */
.editor-text-block__input:empty::before,
.editor-text-block__input[data-empty='true']::before {
    content: attr(data-placeholder);
    color: color-mix(in srgb, var(--black) 42%, transparent);
    pointer-events: none;
}

/* Block-level size variants: small (default), medium, large. */
.editor-text-block[data-text-block-size="small"]  .editor-text-block__input { font-size: 16px; }
.editor-text-block[data-text-block-size="medium"] .editor-text-block__input { font-size: 21px; }
.editor-text-block[data-text-block-size="large"]  .editor-text-block__input { font-size: 26px; }

/* Block-level alignment. */
.editor-text-block[data-text-block-align="left"]   .editor-text-block__input { text-align: left;   }
.editor-text-block[data-text-block-align="center"] .editor-text-block__input { text-align: center; }
.editor-text-block[data-text-block-align="right"]  .editor-text-block__input { text-align: right;  }

/* ── Quote block widget (w:2 × h:1 — same row height as section titles) ─ */
.editor-quote-block {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    padding: 0 16px;
    background: var(--quote-block-bg, var(--white));
    color: var(--black);
    border: 1px solid var(--editor-card-border, color-mix(in srgb, #0b0b0d 14%, transparent));
    border-radius: calc(var(--editor-grid-cell-radius, 32px) / 2);
    overflow: visible;
    cursor: grab;
    user-select: none;
    transition: box-shadow 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

.editor-quote-block__input-wrap {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    align-self: stretch;
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;
}

.editor-quote-block__mark {
    flex: 0 0 auto;
    align-self: flex-start;
    padding-top: 10px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    color: var(--quote-block-color, var(--black));
    pointer-events: none;
}

.editor-quote-block[data-quote-block-size="small"]  .editor-quote-block__mark { font-size: 44px; }
.editor-quote-block[data-quote-block-size="medium"] .editor-quote-block__mark { font-size: 52px; }
.editor-quote-block[data-quote-block-size="large"]  .editor-quote-block__mark { font-size: 60px; }

.editor-quote-block:hover {
    box-shadow: 0 18px 36px -22px color-mix(in srgb, var(--black) 60%, transparent);
    transform: translateY(-1px);
}

.editor-quote-block:active,
.grid-stack-item.ui-draggable-dragging .editor-quote-block {
    cursor: grabbing;
}

.editor-quote-block__input,
.editor-quote-block__input:hover,
.editor-quote-block__input:active,
.editor-quote-block__input:focus,
.editor-quote-block__input:focus-visible {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    max-height: 100%;
    flex: 1 1 auto;
    align-self: center;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    outline: 0;
    background: transparent;
    color: var(--black);
    font-family: var(--quote-block-font, var(--font-primary));
    font-weight: var(--fw-light);
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-align: left;
    word-break: normal;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    resize: none;
    cursor: text;
    overflow-x: hidden;
    overflow-y: auto;
}

.editor-quote-block__input p,
.editor-quote-block__input div {
    margin: 0;
}

.editor-quote-block[data-quote-block-size="small"]  .editor-quote-block__input { font-size: 16px; }
.editor-quote-block[data-quote-block-size="medium"] .editor-quote-block__input { font-size: 21px; }
.editor-quote-block[data-quote-block-size="large"]  .editor-quote-block__input { font-size: 26px; }

.editor-quote-block:hover .editor-quote-block__input:not(:focus):not(:focus-visible) {
    background: color-mix(in srgb, var(--black) 5%, transparent);
}

.editor-quote-block__input:focus,
.editor-quote-block__input:focus-visible {
    background: transparent;
}

.editor-quote-block__input b,
.editor-quote-block__input strong {
    font-weight: 700;
}

.editor-quote-block__input i,
.editor-quote-block__input em {
    font-style: italic;
}

.editor-quote-block__input a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

.editor-quote-block__input:empty::before,
.editor-quote-block__input[data-empty='true']::before {
    content: attr(data-placeholder);
    color: color-mix(in srgb, var(--black) 42%, transparent);
    pointer-events: none;
}

.editor-quote-block[data-quote-block-align="left"]   .editor-quote-block__input { text-align: left;   }
.editor-quote-block[data-quote-block-align="center"] .editor-quote-block__input { text-align: center; }
.editor-quote-block[data-quote-block-align="right"]  .editor-quote-block__input { text-align: right;  }

/* Color picker popover — slides out and down from the bottom action bar.
   Same dark-glass surface as the action pill so the two read as one
   piece of UI. */
.editor-text-block__color-picker {
    position: absolute;
    left: 50%;
    bottom: -14px;
    transform: translate(-50%, 0) translateY(-6px);
    z-index: var(--editor-card-action-dropdown-z, 99999);
    display: grid;
    grid-template-columns: repeat(8, 22px);
    gap: 6px;
    padding: 10px;
    border-radius: 14px;
    background: color-mix(in srgb, #0b0b0d 92%, transparent);
    border: 1px solid color-mix(in srgb, var(--white) 12%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    backdrop-filter: blur(14px) saturate(1.15);
    box-shadow:
        0 1px 0 color-mix(in srgb, var(--white) 10%, transparent) inset,
        0 18px 36px -18px color-mix(in srgb, var(--black) 92%, transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.editor-text-block__color-picker--open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 100%) translateY(8px);
}

.editor-text-block__color-swatch {
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid color-mix(in srgb, var(--white) 18%, transparent);
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease;
}

.editor-text-block__color-swatch:hover {
    transform: scale(1.12);
    border-color: color-mix(in srgb, var(--white) 60%, transparent);
}

.editor-text-block__color-swatch:focus-visible {
    outline: none;
    border-color: var(--white);
    box-shadow: 0 0 0 2px color-mix(in srgb, #5e69ff 60%, transparent);
}

/* Link picker popover — same slide-down behavior as the color palette. */
.editor-text-block__link-picker {
    position: absolute;
    left: 50%;
    bottom: -14px;
    transform: translate(-50%, 0) translateY(-6px);
    z-index: var(--editor-card-action-dropdown-z, 99999);
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 8px;
    width: min(300px, calc(100% + 72px));
    padding: 10px;
    border-radius: 14px;
    background: color-mix(in srgb, #0b0b0d 92%, transparent);
    border: 1px solid color-mix(in srgb, var(--white) 12%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    backdrop-filter: blur(14px) saturate(1.15);
    box-shadow:
        0 1px 0 color-mix(in srgb, var(--white) 10%, transparent) inset,
        0 18px 36px -18px color-mix(in srgb, var(--black) 92%, transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.editor-text-block__link-picker--open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 100%) translateY(8px);
}

.editor-text-block__link-input {
    min-width: 0;
    height: 34px;
    box-sizing: border-box;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--white) 16%, transparent);
    background: color-mix(in srgb, var(--white) 9%, transparent);
    color: var(--white);
    font-family: var(--font-primary);
    font-size: 13px;
    outline: none;
}

.editor-text-block__link-input::placeholder {
    color: color-mix(in srgb, var(--white) 42%, transparent);
}

.editor-text-block__link-input:focus {
    border-color: color-mix(in srgb, #7c86ff 70%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, #7c86ff 28%, transparent);
}

.editor-text-block__link-save {
    height: 34px;
    padding: 0 12px;
    border: 1px solid color-mix(in srgb, var(--white) 16%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--white) 10%, transparent);
    color: var(--white);
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.editor-text-block__link-save:hover:not(:disabled) {
    background: color-mix(in srgb, var(--white) 16%, transparent);
}

.editor-text-block__link-save:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.editor-text-block__link-error {
    grid-column: 1 / -1;
    min-height: 14px;
    color: color-mix(in srgb, #fca5a5 92%, var(--white));
    font-size: 11px;
    line-height: 1.2;
}

/* Image-card link picker — slide-down rectangle beneath the action bar. */
.editor-image-card__link-picker {
    position: absolute;
    left: 50%;
    bottom: -14px;
    transform: translate(-50%, 0) translateY(-6px);
    z-index: var(--editor-card-action-dropdown-z, 99999);
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 8px;
    width: min(300px, calc(100% + 72px));
    padding: 10px;
    border-radius: 14px;
    background: color-mix(in srgb, #0b0b0d 92%, transparent);
    border: 1px solid color-mix(in srgb, var(--white) 12%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    backdrop-filter: blur(14px) saturate(1.15);
    box-shadow:
        0 1px 0 color-mix(in srgb, var(--white) 10%, transparent) inset,
        0 18px 36px -18px color-mix(in srgb, var(--black) 92%, transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.editor-image-card__link-picker--open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 100%) translateY(8px);
}

.editor-image-card__link-picker--floating {
    position: fixed;
    bottom: auto;
    margin: 0;
    z-index: var(--editor-card-action-dropdown-z, 99999);
    transform: translate(-50%, 0) !important;
}

.editor-image-card__link-picker--floating.editor-image-card__link-picker--open {
    transform: translate(-50%, 0) !important;
}

.editor-image-card__link-input {
    min-width: 0;
    height: 34px;
    box-sizing: border-box;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--white) 16%, transparent);
    background: color-mix(in srgb, var(--white) 9%, transparent);
    color: var(--white);
    font-family: var(--font-primary);
    font-size: 13px;
    outline: none;
}

.editor-image-card__link-input::placeholder {
    color: color-mix(in srgb, var(--white) 42%, transparent);
}

.editor-image-card__link-input:focus {
    border-color: color-mix(in srgb, #7c86ff 70%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, #7c86ff 28%, transparent);
}

.editor-image-card__link-save {
    height: 34px;
    padding: 0 12px;
    border: 1px solid color-mix(in srgb, var(--white) 16%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--white) 10%, transparent);
    color: var(--white);
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.editor-image-card__link-save:hover {
    background: color-mix(in srgb, var(--white) 16%, transparent);
}

.editor-image-card__link-error {
    grid-column: 1 / -1;
    min-height: 14px;
    color: color-mix(in srgb, #fca5a5 92%, var(--white));
    font-size: 11px;
    line-height: 1.2;
}

.editor-image-card__link-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--editor-page-bg, #faf9f5) 82%, transparent);
    -webkit-backdrop-filter: blur(8px) saturate(1.1);
    backdrop-filter: blur(8px) saturate(1.1);
    color: var(--editor-bio-color, var(--black));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.editor-image-card__link-badge .material-symbols-outlined {
    font-size: 16px;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

.editor-image-card[data-image-card-link] .editor-image-card__link-badge {
    opacity: 1;
}

/* ── Section title widget ────────────────────────────────────────────────
   Full-width text widget added from the bottom dock's "Title" button.
   Uses the same theme variables as the sidebar title input so the look
   stays consistent with the page's design tokens. */
.editor-section-title {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    cursor: grab;
    user-select: none;
    overflow: visible;
    border: 1px dashed transparent;
    border-radius: 10px;
    transition: border-color 0.18s ease, background-color 0.15s ease;
}

/* Faint dashed outline on hover signals "this whole row is the widget,
   grab anywhere outside the input to drag it". */
.grid-stack-item:hover .editor-section-title,
.editor-section-title:hover {
    border-color: color-mix(in srgb, var(--section-title-color, var(--editor-title-color)) 28%, transparent);
}

.editor-section-title:active,
.grid-stack-item.ui-draggable-dragging .editor-section-title {
    cursor: grabbing;
}

/* Auto-grow wrapper: ::after mirrors the textarea text so the grid sizes
   to the content. Textarea + mirror share the single grid cell. */
.editor-section-title__input-wrap {
    display: inline-grid;
    align-items: center;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0 16px;
    border-radius: 10px;
    vertical-align: middle;
    transition: background-color 0.15s ease;
}

.editor-section-title__input-wrap::after {
    content: attr(data-value) ' ';
    visibility: hidden;
    grid-area: 1 / 1 / 2 / 2;
    padding: 6px 10px;
    color: var(--section-title-color, var(--editor-title-color));
    font-family: var(--section-title-font, var(--editor-title-font));
    font-size: var(--section-title-size, 1.5rem);
    font-weight: var(--section-title-weight, 300);
    font-style: var(--editor-title-style);
    line-height: 1.2;
    letter-spacing: -0.03em;
    text-align: left;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    pointer-events: none;
}

/* Empty placeholder reserves a sensible minimum width so an empty title
   still has a visible click target. */
.editor-section-title__input-wrap:not([data-value])::after,
.editor-section-title__input-wrap[data-value='']::after {
    content: 'Section title...';
}

.editor-section-title__input-wrap:hover {
    background-color: color-mix(in srgb, var(--section-title-color, var(--editor-title-color)) 6%, transparent);
}

.editor-section-title__input-wrap:focus-within {
    background-color: color-mix(in srgb, var(--section-title-color, var(--editor-title-color)) 9%, transparent);
}

.editor-section-title__input,
.editor-section-title__input:hover,
.editor-section-title__input:active,
.editor-section-title__input:focus,
.editor-section-title__input:focus-visible {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    box-sizing: border-box;
    grid-area: 1 / 1 / 2 / 2;
    width: 100%;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 6px 10px;
    border: none;
    border-radius: 10px;
    background: transparent;
    background-color: transparent;
    color: var(--section-title-color, var(--editor-title-color));
    font-family: var(--section-title-font, var(--editor-title-font));
    font-size: var(--section-title-size, 1.5rem);
    font-weight: var(--section-title-weight, 300);
    font-style: var(--editor-title-style);
    line-height: 1.2;
    letter-spacing: -0.03em;
    text-align: left;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    resize: none;
    outline: none;
    box-shadow: none;
    cursor: text;
    overflow: hidden;
}

.editor-section-title__input::placeholder {
    color: color-mix(in srgb, var(--section-title-color, var(--editor-title-color)) 42%, transparent);
    opacity: 1;
}

.editor-section-title__input::selection {
    background: color-mix(in srgb, var(--section-title-color, var(--editor-title-color)) 24%, transparent);
    color: var(--section-title-color, var(--editor-title-color));
}

/* Bottom action pill on section titles: same dark-glass look as the
   link card's bottom actions, revealed on widget hover. */
.editor-section-title .editor-section-title__actions {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.grid-stack-item:hover .editor-section-title__actions,
.editor-section-title:hover .editor-section-title__actions,
.editor-section-title:has(.editor-section-title__actions:hover) .editor-section-title__actions,
.grid-stack-item:has(.editor-section-title__actions:hover) .editor-section-title__actions {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 50%) translateY(0);
}

.editor-section-title-design-modal__body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-top: 6px;
}

.editor-text-block-design-modal__body {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding-top: 8px;
}

.text-block-settings-field {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.text-block-settings-field.quote-block-settings-colors-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: end;
}

.text-block-settings-field-label {
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: var(--fw-light);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--white);
}

.text-block-settings-type-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.text-block-settings-font-field {
    flex: 1 1 200px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}

.text-block-settings-font-label {
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: var(--fw-light);
    letter-spacing: 0.04em;
    color: color-mix(in srgb, var(--white) 72%, transparent);
}

.text-block-settings-font-field .editor-card-design-field__select {
    width: 100%;
}

.text-block-settings-size-layout-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.text-block-settings-size-layout-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.text-block-settings-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--white) 14%, transparent);
    background: color-mix(in srgb, var(--white) 4%, transparent);
    width: fit-content;
    flex: 0 0 auto;
}

.text-block-settings-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--white);
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.text-block-settings-toolbar-btn:hover {
    background: color-mix(in srgb, var(--white) 10%, transparent);
}

.text-block-settings-toolbar-btn[aria-pressed="true"] {
    background: color-mix(in srgb, #7c86ff 28%, transparent);
    color: #fff;
}

.text-block-settings-link-popover {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
    margin-top: 4px;
}

.text-block-settings-link-popover[hidden] {
    display: none !important;
}

.text-block-settings-link-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--white) 16%, transparent);
    background: #16161a;
    color: var(--white);
    font-family: var(--font-primary);
    font-size: 14px;
}

.text-block-settings-link-input:focus {
    outline: none;
    border-color: color-mix(in srgb, #7c86ff 65%, transparent);
}

.text-block-settings-link-save {
    padding: 10px 14px;
    border: 0;
    border-radius: 10px;
    background: color-mix(in srgb, #7c86ff 85%, #000);
    color: #fff;
    font-family: var(--font-primary);
    font-size: 14px;
    cursor: pointer;
}

.text-block-settings-link-save:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.text-block-settings-link-error {
    grid-column: 1 / -1;
    font-size: 12px;
    color: #fca5a5;
    min-height: 1em;
}

.text-block-settings-toggle-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 5px;
}

.text-block-settings-toggle-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--white) 16%, transparent);
    background: #16161a;
    color: var(--white);
    font-family: var(--font-primary);
    font-size: 12px;
    cursor: pointer;
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease;
}

#text-block-settings-align-group .text-block-settings-toggle-item {
    min-width: 30px;
    padding: 0 7px;
}

.text-block-settings-toggle-item[aria-checked="true"] {
    border-color: color-mix(in srgb, #7c86ff 70%, transparent);
    background: color-mix(in srgb, #7c86ff 22%, #16161a);
    box-shadow: 0 0 0 1px color-mix(in srgb, #7c86ff 35%, transparent);
}

.text-block-settings-toggle-item .material-symbols-outlined {
    font-size: 17px;
}

@media (max-width: 520px) {
    .text-block-settings-type-row {
        flex-direction: column;
        align-items: stretch;
    }

    .text-block-settings-toolbar {
        align-self: flex-start;
    }

    .text-block-settings-size-layout-row {
        grid-template-columns: 1fr;
    }
}

.editor-section-title-design-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

/* Card design modal */
.editor-card-design-modal__body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-top: 6px;
}

.editor-card-design-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin: 0;
}

.editor-card-design-field__label {
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: var(--fw-light);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--white);
}

.editor-card-design-field__select {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 11px 13px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--white) 16%, transparent);
    background-color: #16161a;
    color: var(--white);
    color-scheme: dark;
    font-family: var(--font-primary);
    font-size: 15px;
    font-weight: var(--fw-light);
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.editor-card-design-field__select option {
    background-color: #16161a;
    color: var(--white);
    font-weight: var(--fw-light);
    font-size: 15px;
}

.editor-card-design-field__select:hover {
    border-color: color-mix(in srgb, var(--white) 26%, transparent);
}

.editor-card-design-field__select:focus-visible {
    outline: none;
    border-color: color-mix(in srgb, #7c86ff 65%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, #7c86ff 40%, transparent);
}

.editor-card-design-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.editor-card-design-swatch {
    box-sizing: border-box;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.16),
        0 2px 10px rgba(0, 0, 0, 0.38);
    transition:
        transform 0.15s ease,
        box-shadow 0.2s ease;
}

.editor-card-design-swatch:hover {
    transform: scale(1.06);
}

.editor-card-design-swatch[aria-pressed="true"] {
    outline: 2px solid color-mix(in srgb, #a8b4ff 95%, transparent);
    outline-offset: 2px;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.22),
        0 0 0 1px color-mix(in srgb, #7c86ff 55%, transparent),
        0 8px 20px rgba(0, 0, 0, 0.45);
}

/* ── Image card widget ──────────────────────────────────────────────────
   Standalone image card — same size, border, radius, and hover styles as
   the link card. The uploaded image fills the card via object-fit:cover
   and clips itself with border-radius:inherit so the action buttons can
   still overflow (card stays overflow:visible). */
.editor-image-card {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: var(--white);
    color: var(--black);
    border: 1px solid var(--editor-card-border, color-mix(in srgb, #0b0b0d 14%, transparent));
    border-radius: calc(var(--editor-grid-cell-radius, 20px) / 2);
    overflow: visible;
    cursor: grab;
    user-select: none;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.editor-image-card[data-card-radius="sharp"]    { border-radius: 2px; }
.editor-image-card[data-card-radius="soft"]     { border-radius: calc(var(--editor-grid-cell-radius, 32px) / 2); }
.editor-image-card[data-card-radius="hard"]     { border-radius: 24px; }
.editor-image-card[data-card-radius="circular"] { border-radius: 24px; }

.editor-image-card:hover {
    box-shadow: 0 18px 36px -22px color-mix(in srgb, var(--black) 60%, transparent);
    transform: translateY(-1px);
}

.editor-image-card:active,
.grid-stack-item.ui-draggable-dragging .editor-image-card {
    cursor: grabbing;
}

.editor-image-card:hover .editor-link-card__actions,
.editor-image-card:has(.editor-link-card__actions:hover) .editor-link-card__actions {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 50%) translateY(0);
}

.editor-image-card:hover .editor-link-card__actions--delete,
.editor-image-card:has(.editor-link-card__actions:hover) .editor-link-card__actions--delete {
    transform: translate(-30%, -30%) translateY(0);
}

.editor-image-card__image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.editor-image-card__video-shell {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    background: var(--black);
}

.editor-image-card__video-shell .editor-image-card__video {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    /* Let clicks reach action buttons (same idea as link-card media z-index). */
    pointer-events: none;
}

/* Loading ring: visibility controlled only via JS (add .editor-image-card__video-spinner--hidden). */
.editor-image-card__video-shell .editor-image-card__video-spinner {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: color-mix(in srgb, var(--black) 35%, transparent);
    border-radius: inherit;
}

.editor-image-card__video-shell .editor-image-card__video-spinner::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid color-mix(in srgb, var(--white) 28%, transparent);
    border-top-color: color-mix(in srgb, var(--white) 92%, transparent);
    animation: editor-image-card-video-spin 0.7s linear infinite;
}

.editor-image-card__video-spinner--hidden {
    display: none !important;
}

.editor-image-card__video-spinner--hidden::after {
    animation: none !important;
    content: none !important;
}

@keyframes editor-image-card-video-spin {
    to {
        transform: rotate(360deg);
    }
}

.editor-link-card__play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 42px;
    height: 42px;
    background: #ff0000;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 2;
    pointer-events: none;
    transition: transform 0.15s ease, background 0.15s ease;
}

.editor-link-card:hover .editor-link-card__play-btn {
    transform: translate(-50%, -50%) scale(1.1);
}

.editor-link-card__play-btn .material-symbols-outlined {
    font-size: 28px;
    font-variation-settings: 'FILL' 1;
}

.editor-link-card--has-video .editor-link-card__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.1);
    transition: background 0.2s ease;
}

.editor-link-card--has-video:hover .editor-link-card__media::after {
    background: rgba(0, 0, 0, 0);
}

.editor-link-card__iframe-wrap {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: #000;
    border-radius: inherit;
    overflow: hidden;
}

.editor-link-card__iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.editor-link-card--video-only .editor-link-card__body {
    display: none !important;
}

.editor-link-card--video-only {
    background: #000 !important;
    padding: 0 !important;
    display: block !important;
    gap: 0 !important;
}

.editor-link-card--video-only .editor-link-card__media {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    border-radius: inherit;
    background: transparent !important;
    pointer-events: none;
}

.editor-link-card--video-only .editor-link-card__media-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
}

.editor-link-card--video-only .editor-link-card__actions--media {
    display: none !important;
}

/* Caption — plain themed text when idle, editable input on hover. */
.editor-image-card__caption {
    position: absolute;
    left: 28px;
    bottom: 28px;
    z-index: 2;
    box-sizing: border-box;
    max-width: calc(100% - 56px);
    width: auto;
    min-width: 60px;
    max-height: calc(3em + 14px);
    margin: 0;
    padding: 5px 10px 6px;
    border: none;
    border-radius: 8px;
    resize: none;
    overflow: hidden;
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: pre-wrap;
    background: color-mix(in srgb, var(--editor-page-bg, #faf9f5) 82%, transparent);
    -webkit-backdrop-filter: blur(8px) saturate(1.1);
    backdrop-filter: blur(8px) saturate(1.1);
    color: var(--editor-bio-color, var(--black));
    font-family: var(--editor-bio-font, var(--font-primary));
    font-size: 1.0625rem;
    font-weight: var(--editor-bio-weight, var(--fw-light));
    font-style: var(--editor-bio-style, normal);
    line-height: 1.28;
    min-height: calc(1.28em + 11px);
    letter-spacing: -0.01em;
    outline: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, background-color 0.18s ease, color 0.18s ease;
    cursor: text;
    field-sizing: content;
}

.editor-image-card__caption::placeholder {
    color: color-mix(in srgb, var(--white) 50%, transparent);
}

/* Has a caption saved — show as plain themed text (always visible) */
.editor-image-card[data-image-card-caption] .editor-image-card__caption {
    opacity: 1;
    pointer-events: auto;
}

/* On hover — show the input with dark glass bg so the user can edit */
.editor-image-card:hover .editor-image-card__caption {
    opacity: 1;
    pointer-events: auto;
    background: color-mix(in srgb, #0b0b0d 72%, transparent);
    -webkit-backdrop-filter: blur(10px) saturate(1.15);
    backdrop-filter: blur(10px) saturate(1.15);
    color: var(--white);
}

.editor-image-card__caption:focus {
    opacity: 1;
    pointer-events: auto;
    background: color-mix(in srgb, #0b0b0d 78%, transparent);
    -webkit-backdrop-filter: blur(10px) saturate(1.15);
    backdrop-filter: blur(10px) saturate(1.15);
    color: var(--white);
}

/* ── Viewport responsive ─────────────────────────────────────────────── */

@media (max-width: 960px) {
    .editor-page .editor-layout:not(.editor-layout--mobile-preview) {
        grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
        gap: 8px;
    }

    .editor-page .editor-layout:not(.editor-layout--mobile-preview) .editor-layout__content {
        padding: 28px 16px;
    }

    .editor-page .editor-layout:not(.editor-layout--mobile-preview) .grid-stack > .grid-stack-item > .grid-stack-item-content {
        inset: 12px;
    }

    .editor-page .grid-stack {
        min-height: min(64vh, 640px);
    }
}

@media (max-width: 760px) {
    .editor-page .dashboard-subpage-main--editor-shell:not(:has(.editor-layout--mobile-preview)) {
        overflow-x: clip;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
    }

    .editor-page .editor-layout:not(.editor-layout--mobile-preview) {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .editor-page .editor-layout:not(.editor-layout--mobile-preview) .editor-layout__sidebar {
        padding: 12px 0 4px;
        align-self: auto;
        max-height: none;
        overflow: visible;
    }

    .editor-page .editor-layout:not(.editor-layout--mobile-preview) .editor-layout__canvas-scroll {
        margin-top: 0;
        padding-top: 0;
        margin-bottom: 0;
        padding-bottom: 0;
        overflow: visible;
    }

    .editor-page .editor-layout:not(.editor-layout--mobile-preview) .editor-layout__content {
        min-width: 0;
        padding: 4px 0 20px;
    }

    .editor-page .editor-layout:not(.editor-layout--mobile-preview) .grid-stack {
        width: 100%;
        max-width: 100%;
        min-height: min(52vh, 520px);
    }

    .editor-page .editor-layout:not(.editor-layout--mobile-preview) .grid-stack > .grid-stack-item > .grid-stack-item-content {
        inset: 8px;
    }

    /* Touch-friendly card actions on narrow viewports */
    .editor-page .editor-layout:not(.editor-layout--mobile-preview) .editor-link-card__actions:not(.editor-link-card__actions--delete):not(.editor-link-card__actions--media) {
        bottom: 6px;
        transform: translate(-50%, 0) translateY(6px);
    }

    .editor-page .editor-layout:not(.editor-layout--mobile-preview) .editor-link-card:hover .editor-link-card__actions:not(.editor-link-card__actions--delete):not(.editor-link-card__actions--media),
    .editor-page .editor-layout:not(.editor-layout--mobile-preview) .editor-text-block:hover .editor-link-card__actions:not(.editor-link-card__actions--delete):not(.editor-link-card__actions--media),
    .editor-page .editor-layout:not(.editor-layout--mobile-preview) .editor-quote-block:hover .editor-link-card__actions:not(.editor-link-card__actions--delete):not(.editor-link-card__actions--media),
    .editor-page .editor-layout:not(.editor-layout--mobile-preview) .editor-image-card:hover .editor-link-card__actions:not(.editor-link-card__actions--delete):not(.editor-link-card__actions--media) {
        transform: translate(-50%, 0) translateY(0);
    }

    .editor-page .editor-layout:not(.editor-layout--mobile-preview) .editor-link-card__action {
        width: 34px;
        height: 34px;
    }

    .editor-page .editor-layout:not(.editor-layout--mobile-preview) .editor-link-card__action .material-symbols-outlined {
        font-size: 22px;
    }
}

/* ── Mobile preview mode ────────────────────────────────────────────── */

.editor-page .editor-layout {
    transition:
        max-width 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        gap 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.editor-page .editor-layout.editor-layout--mobile-preview {
    grid-template-columns: 1fr;
    max-width: 390px;
    margin-left: auto;
    margin-right: auto;
    gap: 0;
    overflow-x: hidden;
    overflow-y: auto;
    border: none;
    border-radius: 28px;
    padding: 12px 0;
    box-shadow: 0 24px 48px -12px color-mix(in srgb, var(--black) 30%, transparent);
}

.editor-page .editor-layout--mobile-preview .editor-layout__canvas-scroll {
    margin-top: 0;
    padding-top: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    overflow: visible;
}

.editor-page .editor-layout--mobile-preview .editor-layout__content {
    padding: 8px 4px;
}

.editor-page .editor-layout--mobile-preview .grid-stack > .grid-stack-item > .grid-stack-item-content {
    inset: 6px;
    min-width: 0;
}

/* In mobile, keep action bars inside the card instead of overflowing into
   the next card's hit area.  Slightly larger buttons for touch targets. */
.editor-layout--mobile-preview .editor-link-card__actions:not(.editor-link-card__actions--delete):not(.editor-link-card__actions--media) {
    bottom: 6px;
    transform: translate(-50%, 0) translateY(6px);
}
.editor-layout--mobile-preview .editor-link-card:hover .editor-link-card__actions:not(.editor-link-card__actions--delete):not(.editor-link-card__actions--media),
.editor-layout--mobile-preview .editor-text-block:hover .editor-link-card__actions:not(.editor-link-card__actions--delete):not(.editor-link-card__actions--media),
.editor-layout--mobile-preview .editor-quote-block:hover .editor-link-card__actions:not(.editor-link-card__actions--delete):not(.editor-link-card__actions--media),
.editor-layout--mobile-preview .editor-image-card:hover .editor-link-card__actions:not(.editor-link-card__actions--delete):not(.editor-link-card__actions--media) {
    transform: translate(-50%, 0) translateY(0);
}

.editor-layout--mobile-preview .editor-link-card__action {
    width: 34px;
    height: 34px;
}
.editor-layout--mobile-preview .editor-link-card__action .material-symbols-outlined {
    font-size: 22px;
}

.editor-layout--mobile-preview .editor-link-card__actions--delete {
    transform: translate(0, 0) translateY(-6px);
    top: 6px;
    left: 6px;
}
.editor-layout--mobile-preview .editor-link-card:hover .editor-link-card__actions--delete,
.editor-layout--mobile-preview .editor-text-block:hover .editor-link-card__actions--delete,
.editor-layout--mobile-preview .editor-quote-block:hover .editor-link-card__actions--delete,
.editor-layout--mobile-preview .editor-image-card:hover .editor-link-card__actions--delete {
    transform: translate(0, 0) translateY(0);
}

.editor-layout--mobile-preview .editor-link-card__actions--media {
    transform: translate(0, 0) translateY(-6px);
    top: 6px;
    left: 6px;
}
.editor-layout--mobile-preview .editor-link-card:hover .editor-link-card__actions--media {
    transform: translate(0, 0) translateY(0);
}

/* ── Newsletter card ────────────────────────────────────── */
.editor-newsletter-card {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: calc(var(--editor-grid-cell-radius, 32px) / 2);
    background:
        linear-gradient(
            172deg,
            color-mix(in srgb, var(--white) 8%, transparent) 0%,
            color-mix(in srgb, var(--white) 2%, transparent) 100%
        ),
        color-mix(in srgb, var(--black) 90%, #07070a);
    border: 1px solid color-mix(in srgb, var(--white) 16%, transparent);
    box-shadow: 0 4px 12px -4px rgba(0,0,0,.25);
    color: var(--white, #fff);
    cursor: grab;
    overflow: visible;
    box-sizing: border-box;
    user-select: none;
}
.editor-newsletter-card__content {
    display: flex;
    flex-direction: column;
    align-items: stretch; /* Stretch children to fill width */
    gap: 14px;
    width: 100%;
    height: 100%;
    padding: 32px 32px 32px;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: inherit;
}
.editor-newsletter-card__heading {
    font: inherit;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.25;
    color: inherit;
    text-align: left;
    background: none;
    border: none;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: break-word; /* Ensure words break to stay inside */
    word-break: break-word;
    pointer-events: none;
    user-select: none;
}
.editor-newsletter-card__desc {
    font-size: 1.35rem;
    line-height: 1.5;
    color: color-mix(in srgb, currentColor 55%, transparent);
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.editor-newsletter-card__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    margin-top: 10px;
}
.editor-newsletter-card__fake-input {
    width: 100%;
    height: 56px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--white) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--white) 12%, transparent);
    color: color-mix(in srgb, var(--white) 30%, transparent);
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    padding: 0 18px;
    white-space: nowrap;
    overflow: hidden;
    box-sizing: border-box;
}
.editor-newsletter-card__fake-btn {
    align-self: flex-start;
    height: 48px;
    border-radius: 12px;
    background: var(--white, #fff);
    color: var(--black, #000);
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    padding: 0 32px;
    white-space: nowrap;
}
.editor-newsletter-card:hover .editor-link-card__actions:not(.editor-link-card__actions--delete),
.editor-newsletter-card:has(.editor-link-card__actions:hover) .editor-link-card__actions:not(.editor-link-card__actions--delete) {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 50%) translateY(0);
}
.editor-newsletter-card:hover .editor-link-card__actions--delete,
.editor-newsletter-card:has(.editor-link-card__actions:hover) .editor-link-card__actions--delete {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-30%, -30%) translateY(0);
}
.editor-newsletter-card--resizing {
    outline: 2px dashed color-mix(in srgb, var(--white) 40%, transparent);
    outline-offset: 4px;
}

.editor-newsletter-card.is-light-bg .editor-newsletter-card__fake-input {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.4);
}
.editor-newsletter-card.is-light-bg .editor-newsletter-card__fake-btn {
    background: #18181b;
    color: #fafafa;
}
.editor-newsletter-card.is-light-bg .editor-newsletter-card__heading {
    border-color: transparent;
}

/* ── Contact card ───────────────────────────────────────── */
.editor-contact-card {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: calc(var(--editor-grid-cell-radius, 32px) / 2);
    background:
        linear-gradient(
            172deg,
            color-mix(in srgb, var(--white) 8%, transparent) 0%,
            color-mix(in srgb, var(--white) 2%, transparent) 100%
        ),
        color-mix(in srgb, var(--black) 90%, #07070a);
    border: 1px solid color-mix(in srgb, var(--white) 16%, transparent);
    box-shadow: 0 4px 12px -4px rgba(0,0,0,.25);
    color: var(--white, #fff);
    cursor: grab;
    overflow: visible;
    box-sizing: border-box;
    user-select: none;
}
.editor-contact-card__content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    flex: 1;
    min-height: 0;
    width: 100%;
    height: 100%;
    padding: 32px 32px 32px;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: inherit;
}
.editor-contact-card__text {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1 1 auto;
    min-height: 0;
}
.editor-contact-card__heading {
    font: inherit;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.25;
    color: inherit;
    text-align: left;
    background: none;
    border: none;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
    pointer-events: none;
    user-select: none;
}
.editor-contact-card__desc {
    font-size: 1.35rem;
    line-height: 1.5;
    color: color-mix(in srgb, currentColor 55%, transparent);
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.editor-contact-card__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    flex: 0 0 auto;
    margin-top: auto;
}
.editor-contact-card--wide .editor-contact-card__content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    align-content: stretch;
    height: 100%;
}
.editor-contact-card--wide .editor-contact-card__text {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    align-self: stretch;
    gap: 14px;
    flex: none;
    width: 100%;
    min-height: 0;
    height: 100%;
}
.editor-contact-card--wide .editor-contact-card__form {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-self: stretch;
    margin-top: 0;
    flex: none;
    width: 100%;
    min-height: 0;
    height: 100%;
}
.editor-contact-card__fake-input {
    width: 100%;
    height: 56px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--white) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--white) 12%, transparent);
    color: color-mix(in srgb, var(--white) 30%, transparent);
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    padding: 0 18px;
    white-space: nowrap;
    overflow: hidden;
    box-sizing: border-box;
}
.editor-contact-card__fake-textarea {
    width: 100%;
    min-height: 88px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--white) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--white) 12%, transparent);
    color: color-mix(in srgb, var(--white) 30%, transparent);
    font-size: 1.05rem;
    display: flex;
    align-items: flex-start;
    padding: 16px 18px;
    box-sizing: border-box;
}
.editor-contact-card__fake-btn {
    align-self: flex-start;
    height: 48px;
    border-radius: 12px;
    background: var(--white, #fff);
    color: var(--black, #000);
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    padding: 0 32px;
    white-space: nowrap;
}
.editor-contact-card:hover .editor-link-card__actions:not(.editor-link-card__actions--delete),
.editor-contact-card:has(.editor-link-card__actions:hover) .editor-link-card__actions:not(.editor-link-card__actions--delete) {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 50%) translateY(0);
}
.editor-contact-card:hover .editor-link-card__actions--delete,
.editor-contact-card:has(.editor-link-card__actions:hover) .editor-link-card__actions--delete {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-30%, -30%) translateY(0);
}
.editor-contact-card--resizing {
    outline: 2px dashed color-mix(in srgb, var(--white) 40%, transparent);
    outline-offset: 4px;
}
.editor-contact-card.is-light-bg .editor-contact-card__fake-input,
.editor-contact-card.is-light-bg .editor-contact-card__fake-textarea {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
    color: rgba(0, 0, 0, 0.4);
}
.editor-contact-card.is-light-bg .editor-contact-card__fake-btn {
    background: #18181b;
    color: #fafafa;
}
.editor-contact-card.is-light-bg .editor-contact-card__heading {
    border-color: transparent;
}

/* ── Navigation card (inline strip) ─────────────────────── */
.editor-navigation-card {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-radius: calc(var(--editor-grid-cell-radius, 32px) / 2);
    background: transparent;
    border: 1px dashed color-mix(in srgb, var(--white) 14%, transparent);
    color: var(--white, #fff);
    cursor: grab;
    overflow: visible;
    box-sizing: border-box;
    user-select: none;
    padding: 10px 14px;
}
.editor-navigation-card__nav {
    max-width: 100%;
    justify-content: flex-end;
}
.editor-navigation-card:hover .editor-link-card__actions:not(.editor-link-card__actions--delete),
.editor-navigation-card:has(.editor-link-card__actions:hover) .editor-link-card__actions:not(.editor-link-card__actions--delete) {
    opacity: 1;
    pointer-events: auto;
}
.editor-navigation-card:hover .editor-link-card__actions--delete,
.editor-navigation-card:has(.editor-link-card__actions:hover) .editor-link-card__actions--delete {
    opacity: 1;
    pointer-events: auto;
}
.editor-navigation-card--resizing {
    cursor: default;
}

