:root {
    --guest-bg: #f6f0eb;
    --guest-panel: rgba(255, 255, 255, 0.9);
    --guest-border: rgba(83, 109, 100, 0.18);
    --guest-shadow: 0 24px 64px rgba(30, 43, 40, 0.14);
    --guest-success: #198754;
    --guest-danger: #b42318;
    --guest-warning: #b8860b;
    --guest-text: #1f2a2d;
    --guest-subtle: #5b6c73;
    --guest-accent: #4c6661;
    --guest-accent-2: #d5876f;
    --guest-card: #ffffff;
    --guest-muted: #eef2f3;
}

* {
    box-sizing: border-box;
}

body.guest-view-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(110, 141, 133, 0.18), transparent 30%),
        linear-gradient(145deg, #f5efe9 0%, #f9f4ef 36%, #f3eee8 100%);
    color: var(--guest-text);
}

body.guest-view-body:not(.guest-gallery-active) {
    display: grid;
    place-items: center;
    padding: 20px;
}

body.no-scroll {
    overflow: hidden;
}

.guest-view-shell {
    width: min(1120px, 100%);
    margin: 0;
}

.guest-view-card {
    background: var(--guest-panel);
    border: 1px solid var(--guest-border);
    box-shadow: var(--guest-shadow);
    border-radius: 28px;
    overflow: hidden;
}

body.guest-view-body:not(.guest-gallery-active) .guest-view-card {
    width: min(540px, 100%);
    margin: 0 auto;
}

.guest-view-header {
    background: linear-gradient(135deg, rgba(44, 66, 63, 0.96), rgba(76, 102, 97, 0.92));
    color: white;
    padding: 28px 28px 20px;
}

body.guest-view-body:not(.guest-gallery-active) .guest-view-header {
    display: none;
}

.guest-view-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.guest-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.guest-brand-mark {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #f2c9ad, var(--guest-accent-2));
    color: #1f2a2d;
    font-size: 1.1rem;
}

.guest-back-link {
    color: rgba(255, 255, 255, 0.82);
    font-weight: 600;
    font-size: 0.9rem;
}

.guest-view-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    min-height: 620px;
}

body.guest-view-body:not(.guest-gallery-active) .guest-view-layout {
    grid-template-columns: 1fr;
    min-height: auto;
}

.guest-form-panel {
    padding: 28px;
    background: rgba(255, 255, 255, 0.42);
    border-right: 1px solid var(--guest-border);
}

body.guest-view-body:not(.guest-gallery-active) .guest-form-panel {
    border-right: none;
}

body.guest-view-body.guest-gallery-active {
    display: block;
}

body.guest-view-body.guest-gallery-active .guest-view-shell {
    width: 100%;
    min-height: 100vh;
}

body.guest-view-body.guest-gallery-active .guest-view-card {
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

body.guest-view-body.guest-gallery-active .guest-view-layout {
    grid-template-columns: 1fr;
    min-height: 0;
    flex: 1;
}

body.guest-view-body.guest-gallery-active .guest-form-panel {
    display: none;
}

.guest-header-copy h1 {
    margin: 0 0 8px;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    letter-spacing: -0.05em;
    line-height: 1.05;
}

.guest-header-copy p {
    margin: 0;
    color: var(--guest-subtle);
    font-size: 0.96rem;
}

.guest-form {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.guest-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guest-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--guest-subtle);
}

.guest-input {
    width: 100%;
    border: 1px solid rgba(83, 109, 100, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
    padding: 14px 16px;
    font: inherit;
    color: var(--guest-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.guest-input:focus {
    outline: none;
    border-color: rgba(76, 102, 97, 0.7);
    box-shadow: 0 0 0 4px rgba(76, 102, 97, 0.12);
}

.guest-input.error {
    border-color: rgba(180, 35, 24, 0.5);
    box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.08);
}

.guest-submit {
    border: none;
    border-radius: 999px;
    padding: 15px 18px;
    background: linear-gradient(135deg, var(--guest-accent), var(--guest-accent-2));
    color: white;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 14px 24px rgba(76, 102, 97, 0.18);
}

.guest-submit:hover {
    transform: translateY(-1px);
}

.guest-submit:disabled {
    opacity: 0.75;
    cursor: wait;
}

.guest-alert {
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 0.92rem;
    line-height: 1.5;
    display: none;
    border: 1px solid transparent;
}

.guest-alert.visible {
    display: block;
}

.guest-alert.warning {
    background: rgba(184, 134, 11, 0.10);
    color: var(--guest-warning);
    border-color: rgba(184, 134, 11, 0.25);
}

.guest-alert.error {
    background: rgba(180, 35, 24, 0.08);
    color: var(--guest-danger);
    border-color: rgba(180, 35, 24, 0.18);
}

.guest-alert.success {
    background: rgba(25, 135, 84, 0.08);
    color: var(--guest-success);
    border-color: rgba(25, 135, 84, 0.2);
}

.guest-form-note {
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--guest-subtle);
    line-height: 1.5;
}

.guest-gallery-panel {
    padding: 28px;
    background: rgba(255, 255, 255, 0.22);
}

body.guest-view-body:not(.guest-gallery-active) .guest-gallery-panel {
    display: none;
}

body.guest-view-body.guest-gallery-active .guest-gallery-panel {
    padding: 28px;
    min-height: 0;
    flex: 1;
    overflow: auto;
    background: rgba(255, 255, 255, 0.16);
}

.guest-gallery-feed {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.guest-gallery-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.guest-gallery-header-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.guest-gallery-header h2 {
    margin: 0;
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: -0.04em;
}

.guest-gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.guest-gallery-meta {
    color: var(--guest-subtle);
    font-size: 0.9rem;
    font-weight: 600;
}

.guest-gallery-span-all {
    grid-column: 1 / -1;
}

.guest-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
}

.guest-gallery-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
}

.guest-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.guest-sort-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-right: 4px;
}

.guest-page-btn {
    border: 1px solid rgba(76, 102, 97, 0.3);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--guest-text);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 9px 14px;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.guest-page-btn:hover:not(:disabled) {
    border-color: rgba(76, 102, 97, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(31, 42, 45, 0.08);
}

.guest-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.guest-load-more-btn {
    min-width: 160px;
}

.guest-sort-btn {
    border: 1px solid rgba(76, 102, 97, 0.26);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--guest-text);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 8px 12px;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.guest-sort-btn:hover {
    border-color: rgba(76, 102, 97, 0.64);
    transform: translateY(-1px);
}

.guest-sort-btn.active {
    background: linear-gradient(135deg, var(--guest-accent), var(--guest-accent-2));
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 10px 18px rgba(76, 102, 97, 0.18);
}

.guest-page-status {
    color: var(--guest-subtle);
    font-size: 0.85rem;
    font-weight: 600;
}

.guest-gallery-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.guest-page-size-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-left: 4px;
}

.guest-page-size-btn {
    border: 1px solid rgba(76, 102, 97, 0.26);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--guest-text);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 8px 12px;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.guest-page-size-btn:hover {
    border-color: rgba(76, 102, 97, 0.64);
    transform: translateY(-1px);
}

.guest-page-size-btn.active {
    background: linear-gradient(135deg, var(--guest-accent), var(--guest-accent-2));
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 10px 18px rgba(76, 102, 97, 0.18);
}

.guest-media-card {
    background: var(--guest-card);
    border: 1px solid var(--guest-border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(24, 35, 35, 0.07);
}

.guest-media-thumb {
    width: 100%;
    height: 220px;
    object-fit: contain;
    object-position: center;
    display: block;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(83, 109, 100, 0.08), rgba(213, 135, 111, 0.15));
}

.guest-media-thumb-video {
    background: #1a2325;
}

.guest-media-preview {
    position: relative;
    background: linear-gradient(135deg, rgba(83, 109, 100, 0.08), rgba(213, 135, 111, 0.15));
}

.guest-media-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 18, 18, 0.68);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    transition: transform 0.2s ease, background 0.2s ease;
}

.guest-media-play-overlay:hover {
    transform: translate(-50%, -50%) scale(1.05);
    background: rgba(10, 18, 18, 0.82);
}

.guest-media-play-overlay i {
    font-size: 1rem;
    margin-left: 2px;
}

.guest-media-caption {
    font-size: 0.78rem;
    color: var(--guest-subtle);
    padding: 10px 12px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.guest-empty {
    min-height: 260px;
    display: grid;
    place-items: center;
    text-align: center;
    border: 1px dashed rgba(83, 109, 100, 0.28);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.4);
    color: var(--guest-subtle);
    padding: 28px;
}

.guest-image-viewer {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 999;
}

.guest-image-viewer.visible {
    display: block;
}

.guest-image-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 22, 21, 0.82);
    backdrop-filter: blur(2px);
}

.guest-image-viewer-dialog {
    --viewer-image-width: min(82vw, 960px);
    --viewer-image-height: min(78vh, 760px);
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    width: calc(var(--viewer-image-width) + 20px);
    height: calc(var(--viewer-image-height) + 20px);
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(8, 12, 12, 0.94);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.4);
    padding: 10px;
}

.guest-image-viewer-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 1.05rem;
    cursor: pointer;
}

.guest-image-viewer-frame {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.guest-image-viewer-photo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
}

.guest-image-viewer-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    display: none;
}

@media (min-width: 1200px) {
    .guest-view-layout {
        grid-template-columns: 380px minmax(0, 1fr);
    }
}

@media (max-width: 1024px) {
    .guest-view-layout {
        grid-template-columns: 320px minmax(0, 1fr);
        min-height: 540px;
    }
}

@media (max-width: 860px) {
    .guest-view-shell {
        width: 100%;
    }

    .guest-view-card {
        border-radius: 20px;
    }

    .guest-view-layout {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .guest-form-panel {
        border-right: none;
        border-bottom: 1px solid var(--guest-border);
    }

    .guest-view-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    body.guest-view-body:not(.guest-gallery-active) {
        padding: 12px;
    }
}

@media (max-width: 640px) {
    body.guest-view-body.guest-gallery-active .guest-view-card {
        min-height: 100vh;
    }

    .guest-view-header {
        padding: 22px 18px 16px;
    }

    .guest-form-panel,
    .guest-gallery-panel {
        padding: 18px;
    }

    .guest-header-copy h1 {
        font-size: 1.6rem;
    }

    .guest-submit {
        width: 100%;
    }

    .guest-media-thumb {
        height: 190px;
    }

    .guest-page-size-group {
        width: 100%;
        justify-content: center;
        padding-left: 0;
    }

    .guest-sort-group {
        width: 100%;
        justify-content: center;
        padding-right: 0;
    }

    .guest-gallery-toolbar {
        width: 100%;
        justify-content: center;
    }

    .guest-gallery-footer {
        justify-content: center;
    }

    .guest-image-viewer-dialog {
        width: calc(var(--viewer-image-width) + 12px);
        height: calc(var(--viewer-image-height) + 12px);
        max-width: calc(100vw - 8px);
        max-height: calc(100vh - 8px);
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.18);
        padding: 6px;
        background: rgba(8, 12, 12, 0.98);
    }

    .guest-image-viewer-close {
        top: 8px;
        right: 8px;
        width: 34px;
        height: 34px;
    }

    .guest-image-viewer-frame {
        padding: 0;
    }

    .guest-image-viewer-photo {
        border-radius: 8px;
    }
}