.collage-split-node--column {
    grid-template-columns: var(--split-ratio) 8px minmax(0, 1fr);
}

.collage-split-node--row {
    grid-template-rows: var(--split-ratio) 8px minmax(0, 1fr);
}

.collage-split-node--column > .collage-divider {
    cursor: col-resize;
    touch-action: none;
}

.collage-split-node--row > .collage-divider {
    cursor: row-resize;
    touch-action: none;
}

.collage-divider.is-dragging {
    background: #e5322d;
}

.collage-editor-cell[data-image-id]:not([data-image-id=""]) {
    cursor: pointer;
}

.collage-editor-cell.selected[data-image-id]:not([data-image-id=""]) {
    cursor: grab;
    touch-action: none;
}

.collage-editor-cell.selected.is-panning {
    cursor: grabbing;
}

.collage-editor-cell.selected.is-panning .collage-cell-media {
    box-shadow: inset 0 0 0 2px rgba(229, 50, 45, .55);
}
.collage-editor-workspace > * {
    min-width: 0;
}

.collage-properties-panel *, .collage-assets-panel * {
    box-sizing: border-box;
}

.collage-properties-panel input, .collage-properties-panel select {
    max-width: 100%;
    min-width: 0;
}

.collage-properties-panel fieldset {
    min-inline-size: 0;
    max-width: 100%;
}

@media (min-width: 821px) and (max-width: 1100px) {
    body:has(.collage-creator) .topbar-inner {
        flex-wrap: wrap;
    }
}

.collage-properties-panel .collage-property-buttons {
    flex-wrap: wrap;
}

.collage-properties-panel .collage-property-buttons button {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

[data-photo-preparing]:not([hidden]) {
    position: fixed;
    z-index: 1100;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    width: max-content;
    max-width: calc(100% - 32px);
    padding: 16px 20px;
    border-radius: 8px;
    background: #e5322d;
    color: #fff;
    box-shadow: 0 6px 24px #0003;
    font-weight: 600;
}

[data-photo-preparing]:not([hidden])::before {
    content: '';
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border: 2px solid #ffffff66;
    border-top-color: #fff;
    border-radius: 50%;
    animation: collage-preparation-spin 1s linear infinite;
}

@keyframes collage-preparation-spin {
    to { transform: rotate(360deg); }
}

[data-photo-preparing] > svg {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    stroke: currentColor;
}

[data-photo-preparing-text] { min-width: 0; overflow-wrap: anywhere; }

[data-photo-preparing][data-state="complete"]::before {
    content: '\2713';
    border: 0;
    border-radius: 0;
    animation: none;
}

@media (prefers-reduced-motion: reduce) {
    [data-photo-preparing]:not([hidden])::before { animation: none; }
}

body:has(.collage-creator) .site-footer,
body:has(.collage-creator) .pre-footer-content {
    display: block;
}

.collage-photo-handles {
    position: absolute;
    pointer-events: none;
    transform-origin: center;
}

.collage-photo-edge {
    position: absolute;
    z-index: 4;
    min-width: 0;
    min-height: 0;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    pointer-events: auto;
    touch-action: none;
}

.collage-photo-edge:focus-visible { outline: 3px solid #008b83; }
.collage-photo-edge--left { left: 0; top: 0; width: 12px; height: 100%; cursor: ew-resize; }
.collage-photo-edge--right { right: 0; top: 0; width: 12px; height: 100%; cursor: ew-resize; }
.collage-photo-edge--top { top: 0; left: 0; width: 100%; height: 12px; cursor: ns-resize; }
.collage-photo-edge--bottom { bottom: 0; left: 0; width: 100%; height: 12px; cursor: ns-resize; }
.collage-photo-edge--top-left { top: 0; left: 0; cursor: nwse-resize; }
.collage-photo-edge--top-right { top: 0; right: 0; cursor: nesw-resize; }
.collage-photo-edge--bottom-left { bottom: 0; left: 0; cursor: nesw-resize; }
.collage-photo-edge--bottom-right { bottom: 0; right: 0; cursor: nwse-resize; }

.collage-asset-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: -4px -8px 20px; border-bottom: 1px solid #e3e6ec; padding-bottom: 10px; }
.collage-asset-tabs button { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 62px; min-width: 0; padding: 8px 3px; border: 0; border-radius: 6px; background: transparent; color: #646c7b; cursor: pointer; font-size: 11px; line-height: 1.25; overflow-wrap: anywhere; }
.collage-asset-tabs button[aria-selected="true"] { color: #c72525; background: #fff0ef; box-shadow: inset 0 -2px #ef2b2d; }
.collage-asset-tabs button:focus-visible { outline: 2px solid #008b83; outline-offset: 2px; }
.collage-inline-layouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.collage-inline-layouts button { min-width: 0; border: 1px solid #dfe3eb; border-radius: 6px; padding: 6px; background: #fff; cursor: pointer; }
.collage-inline-layouts img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.collage-inline-layouts strong { display: block; margin-top: 6px; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.collage-inline-layouts button[aria-pressed="true"] { border-color: #ef2b2d; box-shadow: 0 0 0 1px #ef2b2d; background: #fff8f8; }
.collage-assets-panel > [data-asset-pane] > .collage-blank-option { margin: 0 0 14px; padding: 12px; grid-template-columns: auto 1fr; font-size: 13px; }
.collage-assets-panel [data-asset-pane][hidden], .collage-properties-panel [hidden] { display: none; }
.collage-selection-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 12px; color: #7a8393; text-align: center; font-size: 13px; }
.collage-canvas-stage { background: #edf0f5; border: 1px solid #dfe3eb; border-radius: 4px; }
.collage-canvas-hint { margin: 12px 0 0; }
.collage-cell-empty { width: 42px; height: 42px; border: 1px dashed #a5afc0; border-radius: 50%; background: #f4f6fa; color: #69758a; font-size: 25px; cursor: pointer; }
.collage-cell-empty:hover, .collage-cell-empty:focus-visible { background: #fff0ef; color: #c72525; outline: 2px solid #ef2b2d; outline-offset: 3px; }
@media (min-width: 1101px) { .collage-editor-workspace { grid-template-columns: 260px minmax(0, 1fr) 264px; } }
@media (max-width: 820px) { .collage-inline-layouts { grid-template-columns: repeat(3, minmax(0, 1fr)); } .collage-asset-tabs { margin-top: 0; } }
@media (max-width: 520px) { .collage-inline-layouts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
