/* Freeform page canvas: background / header / images as boxes on the viewport */
.look-page-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.look-box {
    position: absolute;
    box-sizing: border-box;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    pointer-events: none;
}
.look-box-pagebg { z-index: 0; }
.look-box-header { z-index: 1; }
.look-box-layer { z-index: 2; }
.look-box-pagebg::after,
.look-box-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, var(--look-shade, 0));
    pointer-events: none;
}

.shell,
.main,
.site-header,
header.site-header,
.site-nav {
    position: relative;
    z-index: 1;
}
.main[data-look-content-top],
.look-content-shift {
    padding-top: var(--look-content-top, 0vh);
}

.look-stage {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: transparent;
    isolation: isolate;
    min-height: 14rem;
}
.look-stage.look-size-card { aspect-ratio: 4 / 3; }
.look-card-stage .look-box { position: absolute; }

.look-make-btn {
    margin: 0.5rem 0 0.75rem;
    min-height: 2.75rem;
    padding: 0.65rem 1rem;
}

.look-editor-root[hidden] { display: none !important; }
.look-editor-root {
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: #0b121c;
    display: flex;
    flex-direction: column;
    color: #f4f7fb;
    padding:
        env(safe-area-inset-top, 0)
        env(safe-area-inset-right, 0)
        env(safe-area-inset-bottom, 0)
        env(safe-area-inset-left, 0);
}
.look-editor-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    padding: 0.4rem 0.55rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: #101822;
    flex-shrink: 0;
}
.look-editor-bar .btn,
.look-editor-bar button {
    cursor: pointer;
    min-height: 2.35rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
}
.look-editor-title {
    font-weight: 700;
    margin-right: 0.35rem;
    width: auto;
    font-size: 0.95rem;
    flex: 0 0 auto;
}
.look-ed-tools {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-right: auto;
}
.look-ed-tool {
    opacity: 0.72;
}
.look-ed-tool.is-on {
    opacity: 1;
    outline: 2px solid #3dffA8;
    outline-offset: 1px;
}
.look-ed-tool-pane {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.55rem;
    align-items: center;
    width: 100%;
}
.look-editor-canvas-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0.35rem;
    overflow: hidden;
}
.look-editor-canvas-free {
    position: relative;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    background:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px) 0 0 / 100% 10%,
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px) 0 0 / 10% 100%,
        #152033;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    border-radius: 0.5rem;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}
.look-ed-box {
    position: absolute;
    box-sizing: border-box;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    cursor: move;
    touch-action: none;
}
.look-ed-box.is-empty {
    background-color: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}
.look-ed-box.is-selected {
    outline: 2px solid #3dffA8;
    outline-offset: 1px;
    z-index: 5;
}
.look-ed-box.is-dimmed {
    opacity: 0.28;
    pointer-events: none;
    filter: grayscale(0.35);
}
.look-ed-page { z-index: 1; }
.look-ed-header { z-index: 2; }
.look-ed-layer { z-index: 4; }

/* Live page ghost: avatar, bio, cards under the art */
.look-ed-page-preview {
    position: absolute;
    bottom: 2%;
    z-index: 3;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    overflow: hidden;
    max-height: calc(100% - 4%);
}
.look-ed-page-preview.is-focus-bio .look-ed-prev-cards {
    opacity: 0.35;
}
.look-ed-page-preview.is-focus-cards .look-ed-prev-hero {
    opacity: 0.35;
}
.look-ed-prev-hero,
.look-ed-prev-cards {
    transition: opacity 0.15s ease, outline-color 0.15s ease;
}
.look-ed-prev-hero.is-active-zone,
.look-ed-prev-cards.is-active-zone {
    outline: 2px solid #3dffA8;
    outline-offset: 2px;
    border-radius: 0.65rem;
}
.look-ed-prev-hero {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    padding: 0.55rem;
    border-radius: 0.65rem;
    background: rgba(10, 16, 28, 0.88);
    border: 1px solid rgba(255,255,255,0.18);
}
.look-ed-prev-avatar {
    width: 3.1rem;
    height: 3.1rem;
    border-radius: 999px;
    flex-shrink: 0;
    background: #2a3a52 center/cover no-repeat;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}
.look-ed-prev-name {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
}
.look-ed-prev-bio {
    margin-top: 0.2rem;
    font-size: 0.72rem;
    line-height: 1.35;
    color: rgba(244,247,251,0.82);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.look-ed-prev-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}
.look-ed-prev-card {
    aspect-ratio: 4 / 3;
    border-radius: 0.45rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.14);
    display: flex;
    align-items: flex-end;
    padding: 0.35rem;
    font-size: 0.68rem;
    color: rgba(244,247,251,0.9);
}
.look-ed-prev-card span {
    background: rgba(0,0,0,0.45);
    padding: 0.1rem 0.3rem;
    border-radius: 0.25rem;
}

.look-ed-handle {
    position: absolute;
    right: -10px;
    bottom: -10px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #3dffA8;
    border: 1px solid #0a1220;
    cursor: nwse-resize;
    touch-action: none;
}
.look-ed-nudge {
    display: inline-grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.15rem;
    padding: 0.2rem 0.35rem;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 0.45rem;
    background: rgba(0,0,0,0.25);
}
.look-ed-nudge-label {
    font-size: 0.72rem;
    opacity: 0.85;
}
.look-ed-nudge-mid {
    display: flex;
    gap: 0.2rem;
}
.look-ed-nudge-btn,
.look-ed-box-nudge button {
    min-width: 2.35rem;
    min-height: 2.35rem;
    border-radius: 0.4rem;
    border: 1px solid rgba(255,255,255,0.2);
    background: #1a2433;
    color: #f4f7fb;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
}
.look-ed-nudge-btn:active,
.look-ed-box-nudge button:active {
    background: #3dffA8;
    color: #0a1220;
}
.look-ed-box-nudge {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 7.5rem;
    height: 7.5rem;
    z-index: 6;
    pointer-events: none;
}
.look-ed-box-nudge button {
    position: absolute;
    pointer-events: auto;
    background: rgba(16, 24, 34, 0.88);
}
.look-ed-box-nudge button[data-nudge="up"] { left: 50%; top: 0; transform: translateX(-50%); }
.look-ed-box-nudge button[data-nudge="down"] { left: 50%; bottom: 0; transform: translateX(-50%); }
.look-ed-box-nudge button[data-nudge="left"] { left: 0; top: 50%; transform: translateY(-50%); }
.look-ed-box-nudge button[data-nudge="right"] { right: 0; top: 50%; transform: translateY(-50%); }
.look-ed-content-guide {
    position: absolute;
    left: 0;
    right: 0;
    height: 28px;
    margin-top: -14px;
    border-top: 2px dashed #ffb84d;
    z-index: 8;
    cursor: ns-resize;
    touch-action: none;
}
.look-ed-content-guide span {
    position: absolute;
    left: 0.5rem;
    top: 0.35rem;
    font-size: 0.75rem;
    background: rgba(0,0,0,0.55);
    padding: 0.2rem 0.45rem;
    border-radius: 0.25rem;
    color: #ffb84d;
    pointer-events: none;
}
.look-ed-content-guide.is-selected {
    border-top-color: #3dffA8;
}
.look-editor-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.55rem;
    align-items: center;
    padding: 0.45rem 0.55rem calc(0.45rem + env(safe-area-inset-bottom, 0));
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: #101822;
    flex-shrink: 0;
    max-height: 28vh;
    overflow: auto;
}
.look-editor-tools label {
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
    font-size: 0.8rem;
    min-height: 2rem;
}
.look-editor-tools select {
    min-height: 2rem;
    border-radius: 0.35rem;
    border: 1px solid rgba(255,255,255,0.2);
    background: #1a2433;
    color: inherit;
    padding: 0.2rem 0.35rem;
}
.look-editor-tools input[type="range"] {
    width: min(9rem, 38vw);
    accent-color: #3dffA8;
}
.look-editor-tools input[type="color"] {
    width: 2rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    background: transparent;
}
.look-editor-hint {
    display: none;
}

@media (min-width: 720px) {
    .look-editor-canvas-free {
        width: min(100%, 720px);
    }
    .look-ed-handle {
        width: 18px;
        height: 18px;
        right: -7px;
        bottom: -7px;
    }
    .look-ed-prev-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 719px) {
    .look-editor-bar .btn,
    .look-editor-bar button {
        flex: 1 1 calc(33.33% - 0.35rem);
        min-height: 2.5rem;
    }
    .look-editor-bar .btn[data-le-save],
    .look-editor-bar button[data-le-save] {
        flex: 1 1 100%;
        background: #1f8f5f;
    }
    .look-editor-title {
        width: 100%;
        margin-bottom: 0.1rem;
    }
    .main[data-look-content-top] {
        padding-top: min(var(--look-content-top, 0vh), 55vh);
    }
    .look-stage.look-size-card {
        min-height: 11rem;
    }
    .look-make-btn {
        width: 100%;
    }
}

/* Transparent hero when freeform look art is active (XxxNorway) */
.creator-hero.has-look-art {
    background: transparent;
    border-color: transparent;
}
.creator-hero.has-look-art .creator-row {
    background: rgba(14, 23, 36, 0.72);
    border-radius: 0.75rem;
    padding: 0.65rem;
}
.looks-admin-sticky {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--surface-solid, #101822);
    padding: 0.65rem 0;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.looks-legacy details {
    margin-top: 1rem;
}
.looks-legacy summary {
    cursor: pointer;
    font-weight: 650;
    margin-bottom: 0.5rem;
}
