:root {
    --jade-950: #0b4a44;
    --jade-900: #1b8075;
    --jade-800: #2b988c;
    --jade-700: #3db2a3;
    --jade-500: #63c9bb;
    --mint-100: #e9f8f5;
    --white: #ffffff;
    --danger: #b12f2f;
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    color: var(--jade-950);
    background: linear-gradient(160deg, #f8fffe 0%, #ecfaf8 45%, #e4f4f2 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--jade-900);
    color: var(--white);
    box-shadow: 0 6px 14px rgba(27, 128, 117, 0.26);
}

.brand {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.menu {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.menu a {
    opacity: 0.92;
}

.container {
    width: min(1180px, 92%);
    margin: 24px auto;
}

.alert {
    padding: 11px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.alert-success {
    background: #d5f4ee;
    color: #0f5a4f;
}

.alert-error {
    background: #fbe4e4;
    color: var(--danger);
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 12px 20px rgba(9, 75, 68, 0.09);
}

.grid {
    display: grid;
    gap: 20px;
}

.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stack {
    display: grid;
    gap: 10px;
}

input,
textarea,
select,
button {
    font: inherit;
}

input,
textarea,
select {
    border: 1px solid #b0d7d0;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fcfffe;
}

textarea {
    resize: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    background: var(--jade-700);
    color: var(--white);
    cursor: pointer;
    font-weight: 600;
}

.btn.secondary {
    background: #55bdae;
}

.btn.danger {
    background: #d45a5a;
}

.album-list,
.media-list {
    display: grid;
    gap: 12px;
}

.album-item,
.media-item {
    border: 1px solid #d4ece7;
    border-radius: 12px;
    padding: 12px 14px;
    background: #f8fdfc;
}

.album-item {
    display: grid;
    gap: 4px;
}

.album-item span,
.meta,
.muted,
small {
    color: #4f726e;
}

.album-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.media-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid #dcefea;
    text-align: left;
    padding: 8px;
}

.auth-card {
    width: min(480px, 100%);
    margin: 60px auto;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.hero h1 {
    margin-top: 0;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.12;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.hero-viewer h2 {
    margin-top: 0;
}

.mini-viewer-wrap {
    position: relative;
    width: 100%;
    height: 260px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #c8e8e2;
}

.mini-viewer-wrap a-scene {
    width: 100%;
    height: 100%;
}

.mini-watermark {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
    width: 110px;
    opacity: 0.85;
    pointer-events: none;
}

.public-carousel {
    margin-top: 12px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 320px);
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.public-card {
    border: 1px solid #d4ece7;
    border-radius: 14px;
    overflow: hidden;
    background: #fafffe;
}

.card-thumb {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
}

.card-thumb.placeholder {
    display: grid;
    place-items: center;
    background: linear-gradient(140deg, #0e5a52, #1b8579);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.6px;
}

.public-card-body {
    padding: 12px;
    display: grid;
    gap: 6px;
}

.public-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.album-head {
    margin-bottom: 16px;
}

.media-item-rich .media-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.media-thumb {
    width: 72px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #cee8e3;
}

.media-thumb.placeholder {
    display: grid;
    place-items: center;
    background: #e5f4f1;
    color: #2a6b63;
    font-size: 12px;
    font-weight: 700;
}

.explore-head {
    margin-bottom: 16px;
}

.hidden {
    display: none;
}

.viewer-page {
    margin: 0;
    background: #041a18;
    color: var(--white);
    min-height: 100vh;
    overflow: hidden;
    touch-action: none;
}

.back-link {
    position: fixed;
    left: 14px;
    top: 14px;
    z-index: 90;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ecffff;
    padding: 8px 12px;
    border-radius: 999px;
}

.viewer-shell {
    position: relative;
    width: 100vw;
    height: 100vh;
}

.viewer-shell a-scene {
    width: 100%;
    height: 100%;
}

.viewer-shell canvas {
    touch-action: none;
}

.viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 70;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    font-size: 30px;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.nav-prev {
    left: 18px;
}

.nav-next {
    right: 18px;
}

.watermark {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 16px;
    z-index: 70;
    width: clamp(90px, 12vw, 160px);
    opacity: 0.82;
    pointer-events: none;
}

.viewer-caption {
    position: absolute;
    left: 16px;
    bottom: 18px;
    z-index: 72;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 12px;
    border-radius: 10px;
    display: grid;
    gap: 2px;
    max-width: 38vw;
}

.viewer-strip {
    position: absolute;
    right: 14px;
    bottom: 16px;
    z-index: 72;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 8px;
    display: grid;
    gap: 6px;
    max-height: 40vh;
    overflow-y: auto;
    width: min(360px, 48vw);
}

.strip-item {
    padding: 7px 9px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.09);
    font-size: 14px;
}

.strip-item.active {
    background: rgba(51, 160, 144, 0.75);
}

.video-toggle {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 85;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 9px 14px;
}

.gyro-toggle {
    position: absolute;
    top: 14px;
    right: 150px;
    z-index: 85;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 9px 14px;
}

.gyro-toggle.single-top-control {
    right: 14px;
}

.zoom-controls {
    position: absolute;
    top: 108px;
    right: 14px;
    z-index: 86;
    display: grid;
    gap: 8px;
}

.zoom-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 960px) {
    .two-columns {
        grid-template-columns: 1fr;
    }

    .hero {
        grid-template-columns: 1fr;
    }

    .album-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .viewer-caption {
        bottom: 84px;
        max-width: 74vw;
    }

    .viewer-strip {
        width: calc(100vw - 28px);
        left: 14px;
        right: 14px;
        bottom: 16px;
        max-height: 22vh;
    }

    .watermark {
        bottom: 46px;
    }

    .zoom-controls {
        top: 114px;
    }
}
