* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #070707;
    --panel-bg: #050505;
    --text-color: #ffffff;
    --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-serif: "Cormorant Garamond", "Times New Roman", Times, serif;
    --font-mono: "Space Mono", monospace;
    --padding-global: clamp(20px, 4vw, 40px);
    --panel-gap: clamp(12px, 2.2vh, 24px);
    --panel-inset: clamp(10px, 2vw, 22px);
    --panel-radius: clamp(14px, 2vw, 24px);
}

html,
body {
    width: 100%;
    min-height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
}

body {
    min-height: 100dvh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: var(--panel-gap) var(--panel-inset);
}

.mono-text {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.login-panel {
    position: relative;
    width: 100%;
    min-height: calc(100dvh - (var(--panel-gap) * 2));
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--panel-radius);
    background-color: var(--panel-bg);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 40px 120px rgba(0, 0, 0, 0.72);
}

.login-bg {
    position: absolute;
    inset: -8%;
    z-index: 0;
    background-image:
        linear-gradient(rgba(5, 5, 5, 0.58), rgba(5, 5, 5, 0.72)),
        url("../images/hero.png");
    background-size: cover;
    background-position: center;
    transform: scale(1.06);
    filter: brightness(0.72);
}

.corner-top-left,
.corner-top-right {
    position: absolute;
    z-index: 2;
    opacity: 0.55;
}

.corner-top-left {
    top: 22px;
    left: 25px;
}

.corner-top-right {
    top: 22px;
    right: 25px;
}

.login-footer {
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    bottom: 1.1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.45rem 0.7rem;
    padding: 0 var(--padding-global);
    text-align: center;
    font-size: 0.55rem;
    letter-spacing: 0.16em;
    color: rgba(255, 255, 255, 0.35);
}

.login-center {
    position: relative;
    z-index: 3;
    width: min(92vw, 420px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 2.4rem;
    animation: riseIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2.2rem;
}

.login-logo {
    display: block;
    width: min(82vw, 420px);
    height: auto;
    margin-bottom: 1.15rem;
    transform: translateX(12px);
}

.login-kicker {
    letter-spacing: 0.38em;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.72rem;
}

.login-card {
    position: relative;
    width: 100%;
    padding: clamp(1.8rem, 4vw, 2.4rem) clamp(1.5rem, 4vw, 2.2rem) 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.login-corner {
    position: absolute;
    width: 28px;
    height: 28px;
    pointer-events: none;
}

.login-corner--tl {
    top: 16px;
    left: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-left: 1px solid rgba(255, 255, 255, 0.25);
}

.login-corner--br {
    right: 16px;
    bottom: 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.login-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
    text-align: left;
}

.login-field span {
    font-size: 0.58rem;
    letter-spacing: 0.22em;
    color: rgba(255, 255, 255, 0.48);
}

.login-field input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 0;
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.04em;
    padding: 0.7rem 0 0.65rem;
    outline: none;
    transition: border-color 0.35s ease;
}

.login-field input:focus {
    border-bottom-color: rgba(255, 255, 255, 0.85);
}

.login-error {
    min-height: 1em;
    color: rgba(255, 210, 210, 0.85);
    letter-spacing: 0.14em;
}

.login-cta {
    align-self: center;
    margin-top: 0.35rem;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 12px 34px;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-cta:hover,
.login-cta:focus-visible {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
    letter-spacing: 0.3em;
    padding: 12px 42px;
}

.login-card.is-error {
    animation: shake 0.42s ease;
}

.login-note {
    width: 100%;
    margin-top: 1.55rem;
    padding: 0 clamp(1.5rem, 4vw, 2.2rem);
    font-size: 0.78rem;
    font-weight: 300;
    line-height: 1.7;
    letter-spacing: 0.015em;
    color: rgba(255, 255, 255, 0.58);
    text-align: center;
    text-wrap: balance;
}

.login-note p {
    text-wrap: balance;
}

.login-note p + p {
    margin-top: 0.85em;
}

.welcome-view[hidden],
.login-center[hidden],
.login-error[hidden],
.gallery-main[hidden],
.chapter-view[hidden],
.editor-banner[hidden],
.editor-banner__hint[hidden],
.editor-modal[hidden],
.empty-chapter[hidden],
.empty-chapter__wa[hidden],
.chapter-end[hidden],
.chapter-download-menu[hidden],
.chapter-download-menu__panel[hidden] {
    display: none;
}

/* =========================================
   GALERÍA — PORTADA DE CAPÍTULOS
========================================= */

body.is-gallery {
    align-items: stretch;
}

.gallery-panel {
    position: relative;
    width: 100%;
    min-height: calc(100dvh - (var(--panel-gap) * 2));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--panel-radius);
    background-color: var(--panel-bg);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 40px 120px rgba(0, 0, 0, 0.72);
}

.gallery-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 18px clamp(16px, 2.4vw, 28px) 14px;
    z-index: 5;
    overflow: visible;
}

.gallery-header__side {
    display: flex;
    align-items: center;
    min-width: 0;
}

.gallery-header__side--left {
    justify-content: flex-start;
}

.gallery-header__side--right {
    justify-content: flex-end;
    gap: 14px;
}

.gallery-header__identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-align: center;
}

.gallery-header__name {
    margin: 0;
    font-family: var(--font-serif);
    font-weight: 300;
    font-size: clamp(1.45rem, 2.6vw, 2.05rem);
    letter-spacing: 0.04em;
    color: #ffffff;
    line-height: 1.15;
}

.gallery-header__amp {
    display: inline-block;
    padding: 0 0.12em;
    font-weight: 300;
    font-style: italic;
    opacity: 0.55;
    letter-spacing: 0;
}

.gallery-header__subtitle {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.gallery-panel.is-chapter .gallery-header__subtitle {
    font-family: var(--font-sans);
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    letter-spacing: 0.04em;
    text-transform: none;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 300;
}

.gallery-header__back,
.gallery-header__exit {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.48);
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.gallery-header__back:hover,
.gallery-header__back:focus-visible,
.gallery-header__exit:hover,
.gallery-header__exit:focus-visible {
    color: #ffffff;
}

.gallery-header__back[hidden],
.chapter-download[hidden] {
    display: none;
}

.gallery-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 8px clamp(14px, 2.2vw, 24px) 18px;
}

.invite-demo {
    display: none;
}

.invite-demo[hidden] {
    display: none !important;
}

.gallery-chapters {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(10px, 1.3vw, 16px);
    min-height: min(64vh, 740px);
    align-items: stretch;
}

.chapter-card {
    position: relative;
    display: block;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    isolation: isolate;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.chapter-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.04);
    transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.chapter-card__veil {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(5, 5, 5, 0.82) 0%,
        rgba(5, 5, 5, 0.18) 46%,
        rgba(5, 5, 5, 0.28) 100%
    );
    transition: background 0.45s ease;
}

.chapter-card__copy {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 22px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    text-align: left;
}

.chapter-card__index {
    font-size: 0.55rem;
    letter-spacing: 0.28em;
    color: rgba(255, 255, 255, 0.5);
}

.chapter-card__title {
    font-size: clamp(1.55rem, 2.6vw, 2.15rem);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.chapter-card__text {
    font-size: 0.88rem;
    font-weight: 300;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.62);
}

.chapter-card:hover img,
.chapter-card:focus-visible img {
    transform: scale(1.1);
}

.chapter-card:hover .chapter-card__veil,
.chapter-card:focus-visible .chapter-card__veil {
    background: linear-gradient(
        to top,
        rgba(5, 5, 5, 0.7) 0%,
        rgba(5, 5, 5, 0.12) 50%,
        rgba(5, 5, 5, 0.22) 100%
    );
}

.chapter-view {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    text-align: left;
    min-height: 0;
    padding: 28px 0 28px;
    animation: riseIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.gallery-panel.is-chapter {
    overflow-y: auto;
}

.gallery-panel.is-chapter .gallery-header {
    position: sticky;
    top: 0;
    background: var(--panel-bg);
}

.gallery-panel.is-chapter-view .gallery-header {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas:
        "back name exit"
        "chapter name download";
    align-items: center;
    column-gap: 16px;
    row-gap: 4px;
    padding-bottom: 16px;
}

.gallery-panel.is-chapter-view .gallery-header__identity {
    display: contents;
}

.gallery-panel.is-chapter-view .gallery-header__side--left {
    grid-area: back;
    align-self: start;
}

.gallery-panel.is-chapter-view .gallery-header__name {
    grid-area: name;
    align-self: center;
}

.gallery-panel.is-chapter-view .gallery-header__subtitle {
    grid-area: chapter;
    justify-self: start;
    align-self: center;
    text-align: left;
}

.gallery-panel.is-chapter-view .chapter-download-menu {
    grid-area: download;
    justify-self: end;
    align-self: center;
    margin-top: 0;
}

.gallery-panel.is-chapter-view .gallery-header__side--right {
    grid-area: exit;
    align-self: start;
}

.chapter-download-menu {
    position: relative;
    display: flex;
    justify-content: flex-end;
}

.chapter-download {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 10px 20px;
    margin-top: 0.45rem;
    font-size: 0.55rem;
    letter-spacing: 0.16em;
    cursor: pointer;
    border-radius: 2px;
    white-space: nowrap;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.chapter-download-menu .chapter-download {
    margin-top: 0;
}

.chapter-download:hover,
.chapter-download:focus-visible,
.chapter-download-menu.is-open .chapter-download {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
}

.chapter-download:disabled {
    opacity: 0.55;
    cursor: wait;
    background: none;
    color: #ffffff;
}

.chapter-download-menu__panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 100%;
    display: flex;
    flex-direction: column;
    z-index: 8;
    background: var(--panel-bg);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.chapter-download-menu__item {
    display: block;
    width: 100%;
    margin: 0;
    padding: 10px 20px;
    border: 0;
    background: none;
    color: inherit;
    font-size: 0.55rem;
    letter-spacing: 0.16em;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.chapter-download-menu__item + .chapter-download-menu__item {
    box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.12);
}

.chapter-download-menu__item:hover,
.chapter-download-menu__item:focus-visible {
    background: #ffffff;
    color: #000000;
}

.chapter-download-menu__item[aria-disabled="true"] {
    opacity: 0.38;
    cursor: default;
    pointer-events: none;
}

.gallery-panel.is-chapter.is-chapter-view {
    height: calc(100dvh - (var(--panel-gap) * 2));
    max-height: calc(100dvh - (var(--panel-gap) * 2));
}

.chapter-end {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 52px;
    padding: 28px clamp(16px, 2.4vw, 28px) 18px;
    background: var(--panel-bg);
    box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.08);
    text-align: center;
}

.chapter-end__sign {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem 0.7rem;
    margin: 0;
    font-size: 0.62rem;
    letter-spacing: 0.28em;
    color: rgba(255, 255, 255, 0.45);
}

.pinterest-mosaic {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1vw, 12px);
    padding: 0 clamp(14px, 2.2vw, 24px);
}

.pinterest-grid {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: clamp(8px, 1vw, 12px);
}

.pinterest-grid[hidden] {
    display: none;
}

.pinterest-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1vw, 12px);
}

.pinterest-item {
    position: relative;
    display: block;
    width: 100%;
}

.pinterest-item__shot {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    line-height: 0;
    overflow: hidden;
    border-radius: 16px;
}

.pinterest-item__shot img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
    transition: opacity 0.4s ease;
    -webkit-user-drag: none;
}

.pinterest-item__shot:hover img,
.pinterest-item__shot:focus-visible img {
    opacity: 0.88;
}

.pinterest-item__remove {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background: rgba(8, 8, 8, 0.72);
    color: #ffffff;
    cursor: pointer;
    opacity: 0;
    pointer-events: auto;
    transition: opacity 0.2s ease;
}

.pinterest-item:hover .pinterest-item__remove,
.pinterest-item__remove:focus-visible {
    opacity: 1;
}

.pinterest-item.is-dragging {
    opacity: 0.35;
    pointer-events: none;
}

body.is-editor .pinterest-item {
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

body.is-editor .pinterest-item__shot img {
    pointer-events: none;
}

body.is-editor .pinterest-col {
    min-height: 88px;
    padding-bottom: 36px;
}

.pinterest-item.drop-before::before,
.pinterest-item.drop-after::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(190, 140, 90, 1);
    z-index: 4;
    pointer-events: none;
}

.pinterest-item.drop-before::before {
    top: -6px;
}

.pinterest-item.drop-after::after {
    bottom: -6px;
}

.pinterest-col.drop-empty {
    outline: 2px dashed rgba(190, 140, 90, 0.9);
    outline-offset: -4px;
}

.pinterest-ghost {
    position: fixed;
    z-index: 20000;
    margin: 0;
    pointer-events: none;
    opacity: 0.92;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}

.pinterest-ghost .pinterest-item__remove {
    display: none;
}

body.is-dragging-photo {
    cursor: grabbing;
    user-select: none;
}

body.is-dragging-photo .pinterest-item__shot {
    cursor: grabbing;
}

.empty-chapter {
    max-width: 28rem;
    margin: 12vh auto 0;
    padding: 0 1.4rem 3rem;
    text-align: center;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.5);
}

.empty-chapter__kicker {
    margin-bottom: 0.85rem;
    color: rgba(255, 255, 255, 0.38);
}

.empty-chapter__title {
    margin: 0 0 0.85rem;
    font-family: var(--font-serif);
    font-size: clamp(1.7rem, 4vw, 2.2rem);
    font-weight: 300;
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: inherit;
}

.empty-chapter__text {
    margin: 0 auto 1.6rem;
    max-width: 24rem;
    font-size: 0.95rem;
    line-height: 1.65;
    color: inherit;
}

.empty-chapter__wa {
    display: inline-block;
    padding: 12px 22px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: inherit;
    text-decoration: none;
    letter-spacing: 0.16em;
}

.empty-chapter__wa:hover,
.empty-chapter__wa:focus-visible {
    border-color: currentColor;
}

.photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-lightbox[hidden] {
    display: none;
}

.photo-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 3, 3, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.photo-lightbox__stage {
    position: relative;
    z-index: 1;
    margin: 0;
    width: min(92vw, 1080px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.photo-lightbox__stage img {
    max-width: 100%;
    max-height: 78vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.photo-lightbox__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(100%, 420px);
    color: rgba(255, 255, 255, 0.55);
}

.photo-lightbox__bar a {
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 0.18em;
}

.photo-lightbox__bar a:hover {
    opacity: 0.7;
}

.photo-lightbox__nav,
.photo-lightbox__close {
    position: absolute;
    z-index: 2;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
}

.photo-lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    padding: 12px;
}

.photo-lightbox__nav--prev { left: clamp(8px, 2vw, 28px); }
.photo-lightbox__nav--next { right: clamp(8px, 2vw, 28px); }

.photo-lightbox__close {
    top: 22px;
    right: 28px;
}

body.is-lightbox {
    overflow: hidden;
}

.gallery-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.45rem 0.7rem;
    text-align: center;
    padding: 0 16px 14px;
    font-size: 0.55rem;
    letter-spacing: 0.16em;
    color: rgba(255, 255, 255, 0.35);
}

.login-footer a,
.gallery-footer a {
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    transition: color 0.3s ease;
}

.login-footer a:hover,
.login-footer a:focus-visible,
.gallery-footer a:hover,
.gallery-footer a:focus-visible {
    color: rgba(255, 255, 255, 0.88);
}

/* Prueba: mosaico Pinterest en claro */
body.is-pinterest-light {
    background: #ffffff;
    color: #111111;
}

body.is-pinterest-light .gallery-panel {
    background: #ffffff;
    color: #111111;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

body.is-pinterest-light .gallery-panel.is-chapter .gallery-header {
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

body.is-pinterest-light .chapter-end {
    background: #ffffff;
    box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.08);
}

body.is-pinterest-light .editor-banner {
    background: #ffffff;
    color: rgba(0, 0, 0, 0.42);
}

body.is-pinterest-light .editor-banner__link {
    color: rgba(0, 0, 0, 0.62);
}

body.is-pinterest-light .editor-banner__link:hover,
body.is-pinterest-light .editor-banner__link:focus-visible {
    color: #111111;
}

body.is-pinterest-light .gallery-header__name {
    color: #111111;
}

body.is-pinterest-light .gallery-header__amp {
    color: #111111;
    opacity: 0.5;
}

body.is-pinterest-light .gallery-header__subtitle,
body.is-pinterest-light .gallery-panel.is-chapter .gallery-header__subtitle {
    color: rgba(0, 0, 0, 0.62);
}

body.is-pinterest-light .gallery-header__back,
body.is-pinterest-light .gallery-header__exit {
    color: rgba(0, 0, 0, 0.48);
}

body.is-pinterest-light .gallery-header__back:hover,
body.is-pinterest-light .gallery-header__back:focus-visible,
body.is-pinterest-light .gallery-header__exit:hover,
body.is-pinterest-light .gallery-header__exit:focus-visible {
    color: #111111;
}

body.is-pinterest-light .chapter-download {
    border-color: rgba(0, 0, 0, 0.28);
    color: #111111;
}

body.is-pinterest-light .chapter-download:hover,
body.is-pinterest-light .chapter-download:focus-visible,
body.is-pinterest-light .chapter-download-menu.is-open .chapter-download {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
}

body.is-pinterest-light .chapter-download:disabled {
    color: #111111;
}

body.is-pinterest-light .chapter-download-menu__panel {
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

body.is-pinterest-light .chapter-download-menu__item {
    color: #111111;
}

body.is-pinterest-light .chapter-download-menu__item + .chapter-download-menu__item {
    box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.08);
}

body.is-pinterest-light .chapter-download-menu__item:hover,
body.is-pinterest-light .chapter-download-menu__item:focus-visible {
    background: #111111;
    color: #ffffff;
}

body.is-pinterest-light .pinterest-item__shot img {
    border-radius: 12px;
}

body.is-pinterest-light .chapter-end__sign {
    color: rgba(0, 0, 0, 0.42);
}

body.is-pinterest-light .empty-chapter {
    color: rgba(0, 0, 0, 0.52);
}

body.is-pinterest-light .empty-chapter__kicker {
    color: rgba(0, 0, 0, 0.38);
}

body.is-pinterest-light .empty-chapter__title {
    color: #111111;
}

body.is-pinterest-light .empty-chapter__wa {
    border-color: rgba(0, 0, 0, 0.28);
    color: #111111;
}

body.is-pinterest-light .empty-chapter__wa:hover,
body.is-pinterest-light .empty-chapter__wa:focus-visible {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
}

body.is-pinterest-light .gallery-footer {
    color: rgba(0, 0, 0, 0.38);
}

body.is-pinterest-light .gallery-footer a {
    color: rgba(0, 0, 0, 0.48);
}

body.is-pinterest-light .gallery-footer a:hover,
body.is-pinterest-light .gallery-footer a:focus-visible {
    color: #111111;
}

@media (max-width: 860px) {
    .gallery-header {
        grid-template-columns: 1fr 1fr;
        row-gap: 10px;
        padding-bottom: 12px;
    }

    .gallery-header__identity {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .gallery-header__side--left,
    .gallery-header__side--right {
        grid-row: 2;
    }

    .gallery-header__side--right {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .gallery-panel:not(.is-chapter-view) .gallery-header {
        position: static;
        padding: 48px 16px 20px;
        row-gap: 0;
    }

    .gallery-panel:not(.is-chapter-view) .gallery-header__identity {
        padding-top: 0;
    }

    .gallery-panel:not(.is-chapter-view) .gallery-header__side--left {
        display: none;
    }

    .gallery-panel:not(.is-chapter-view) .gallery-header__side--right {
        position: static;
        grid-row: auto;
    }

    .gallery-panel:not(.is-chapter-view) .gallery-header__exit {
        position: absolute;
        top: 10px;
        right: 12px;
        z-index: 8;
        margin: 0;
        padding: 8px 4px;
    }

    .gallery-panel:not(.is-chapter-view) .chapter-card img {
        transform: none;
    }

    .gallery-chapters .chapter-card[data-chapter="preboda"] img,
    .gallery-chapters .chapter-card[data-chapter="preboda"]:hover img {
        opacity: 1;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: 50% 26%;
        transform: none;
    }

    .gallery-panel.is-chapter-view .gallery-header {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "back exit"
            "name name"
            "chapter download";
        row-gap: 8px;
    }

    .gallery-panel.is-chapter-view .gallery-header__side--left,
    .gallery-panel.is-chapter-view .gallery-header__side--right {
        grid-row: auto;
        align-self: center;
    }

    .gallery-panel.is-chapter-view .gallery-header__name,
    .gallery-panel.is-chapter-view .gallery-header__subtitle,
    .gallery-panel.is-chapter-view .chapter-download-menu {
        justify-self: center;
        text-align: center;
    }

    .gallery-panel.is-chapter-view .gallery-header__subtitle {
        justify-self: start;
        text-align: left;
    }

    .gallery-panel.is-chapter-view .chapter-download-menu {
        justify-self: end;
    }

    .gallery-chapters {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(3, minmax(0, 1fr));
        min-height: 0;
        overflow: hidden;
        gap: 10px;
    }

    .chapter-card {
        min-height: 0;
    }

    .invite-demo {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        flex: 0 0 auto;
        margin-top: 10px;
        padding: 12px 16px;
        border-radius: 14px;
        text-decoration: none;
        color: inherit;
        background: rgba(255, 255, 255, 0.04);
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
    }

    .invite-demo__copy {
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
        min-width: 0;
    }

    .invite-demo__kicker {
        color: rgba(255, 255, 255, 0.42);
    }

    .invite-demo__title {
        font-family: var(--font-serif);
        font-size: 1.2rem;
        font-weight: 300;
        letter-spacing: 0.02em;
    }

    .invite-demo__go {
        color: rgba(255, 255, 255, 0.45);
        font-size: 1.1rem;
    }

    .pinterest-mosaic {
        padding: 0 12px;
        gap: 10px;
    }

    .pinterest-grid {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 10px;
    }

    .pinterest-col {
        flex: 1 1 100%;
        width: 100%;
        gap: 10px;
    }

    .photo-lightbox__stage {
        width: min(94vw, 1080px);
        padding: 0 8px;
    }

    .photo-lightbox__stage img {
        max-height: 72vh;
    }
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(22px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-7px);
    }

    75% {
        transform: translateX(7px);
    }
}

@media (max-width: 720px) {
    .corner-top-right {
        display: none;
    }

    body:has(.login-panel) {
        padding: 8px;
    }

    .login-panel {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        min-height: calc(100svh - 16px);
    }

    .login-panel .corner-top-left {
        top: 12px;
        left: 14px;
    }

    .login-center {
        width: min(84vw, 340px);
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 3.8rem 0 0.8rem;
    }

    .login-brand {
        margin-bottom: 1.25rem;
    }

    .login-logo {
        width: min(78vw, 300px);
        max-width: none;
        height: auto;
        margin-bottom: 0.7rem;
        transform: translateX(6px);
    }

    .login-kicker {
        font-size: 0.62rem;
        letter-spacing: 0.28em;
    }

    .login-panel .login-corner {
        display: none;
    }

    .login-panel .login-card {
        padding: 1.2rem 1.15rem 1.15rem;
        gap: 0.8rem;
    }

    .login-panel .login-field {
        gap: 0.35rem;
    }

    .login-panel .login-field input {
        padding: 0.4rem 0 0.35rem;
        font-size: 16px;
    }

    .login-panel .login-cta {
        margin-top: 0.1rem;
        padding: 10px 28px;
    }

    .login-panel .login-note {
        margin-top: 0.85rem;
        padding: 0 0.2rem;
        font-size: 0.72rem;
        line-height: 1.5;
    }

    .login-panel .login-note p + p {
        margin-top: 0.45em;
    }

    .login-footer {
        position: relative;
        bottom: auto;
        flex-shrink: 0;
        padding: 0.35rem 1rem max(0.85rem, env(safe-area-inset-bottom));
    }

    .gallery-panel.is-chapter-view .gallery-header {
        padding-top: 14px;
    }
}

@media (max-width: 720px) and (max-height: 700px) {
    .login-center {
        padding-top: 3.4rem;
    }

    .login-logo {
        width: min(72vw, 260px);
    }

    .login-panel .login-note {
        font-size: 0.68rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-center,
    .login-card.is-error,
    .login-cta,
    .chapter-view,
    .chapter-card img {
        animation: none;
        transition: none;
    }
}

.editor-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.2rem;
    padding: 0 clamp(16px, 2.4vw, 28px) 12px;
    color: rgba(255, 255, 255, 0.42);
}

.editor-banner__hint {
    color: rgba(190, 140, 90, 0.95);
}

.editor-banner__link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0;
}

.editor-banner__link:hover {
    color: #ffffff;
}

.editor-main {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 8px clamp(16px, 2.4vw, 28px) 28px;
}

.editor-lead {
    max-width: 30rem;
    margin: 0 auto 1.8rem;
    text-align: center;
    font-size: 0.92rem;
    font-weight: 300;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.55);
}

.editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.editor-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.editor-card__open {
    position: relative;
    display: block;
    height: 280px;
    padding: 0;
    border: 0;
    color: inherit;
    cursor: pointer;
    overflow: hidden;
}

.editor-card__open img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.04);
    transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.editor-card__open:hover img {
    transform: scale(1.1);
}

.editor-card__meta {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 14px 16px 16px;
    font-size: 0.86rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.72);
}

.editor-card__meta .mono-text {
    display: inline-block;
    min-width: 4.6rem;
    margin-right: 0.4rem;
    color: rgba(255, 255, 255, 0.38);
}

.editor-card--new {
    min-height: 360px;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    background: transparent;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.editor-card--new:hover {
    border-color: rgba(255, 255, 255, 0.45);
    color: #ffffff;
}

.editor-card__plus {
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
}

.editor-modal {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(5, 5, 5, 0.72);
}

.editor-form {
    width: min(92vw, 420px);
}

.editor-form .login-kicker {
    text-align: center;
    margin-bottom: 0.4rem;
}

.editor-chapters {
    border: none;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    text-align: left;
}

.editor-chapters legend {
    margin-bottom: 0.4rem;
    color: rgba(255, 255, 255, 0.45);
}

.editor-chapters label {
    font-size: 0.9rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
}

.editor-form__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.4rem;
}

.legal-panel {
    width: 100%;
    max-width: 820px;
    min-height: calc(100dvh - (var(--panel-gap) * 2));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--panel-radius);
    background-color: var(--panel-bg);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 40px 120px rgba(0, 0, 0, 0.72);
}

.legal-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 18px clamp(16px, 2.4vw, 28px);
}

.legal-top a {
    color: rgba(255, 255, 255, 0.48);
    text-decoration: none;
    transition: color 0.3s ease;
}

.legal-top a:hover,
.legal-top a:focus-visible {
    color: #ffffff;
}

.legal-wrap {
    flex: 1;
    overflow: auto;
    padding: 8px clamp(22px, 4vw, 48px) 36px;
}

.legal-eyebrow {
    margin-bottom: 0.85rem;
    color: rgba(255, 255, 255, 0.42);
}

.legal-wrap h1 {
    margin: 0 0 0.55rem;
    font-weight: 300;
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
    letter-spacing: 0.04em;
    line-height: 1.15;
}

.legal-updated {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.45);
}

.legal-wrap h2 {
    margin: 2rem 0 0.7rem;
    font-size: 1.02rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.legal-wrap p,
.legal-wrap li {
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.62);
}

.legal-wrap p {
    margin-bottom: 0.85rem;
}

.legal-wrap ul {
    margin: 0 0 1rem 1.15rem;
}

.legal-wrap li {
    margin-bottom: 0.4rem;
}

.legal-wrap a {
    color: #ffffff;
}

.legal-note {
    margin-top: 2.4rem;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.38);
}

.legal-panel .gallery-footer {
    padding-top: 8px;
}
