:root {
    --constellation-panel: rgba(255,255,255,.035);
    --constellation-panel-strong: rgba(255,255,255,.055);
}

/* ==========================
   HERO CONSTELLATION
========================== */

.constellation-hero {
    background: #020202;
}

.constellation-hero-background {
    overflow: hidden;
    background:
            radial-gradient(circle at 50% 52%, rgba(212,175,55,.16), transparent 18%),
            radial-gradient(circle at 50% 50%, rgba(92,54,135,.22), transparent 48%),
            linear-gradient(180deg, #09080a 0%, #020202 100%);
}

.constellation-hero-background::before,
.constellation-hero-background::after,
.constellation-hero-stars {
    content: "";
    position: absolute;
    pointer-events: none;
}

.constellation-hero-background::before {
    inset: -10%;
    opacity: .48;
    background-image:
            radial-gradient(circle, rgba(255,255,255,.92) 0 1px, transparent 1.35px),
            radial-gradient(circle, rgba(232,200,100,.92) 0 1.35px, transparent 1.8px);
    background-position: 0 0, 38px 31px;
    background-size: 76px 76px, 139px 139px;
    transform: rotate(-7deg) scale(1.08);
}

.constellation-hero-background::after {
    inset: 0;
    opacity: .32;
    background: radial-gradient(circle at center, rgba(255,245,206,.16), transparent 30%);
}

.constellation-hero-stars-1 {
    inset: 14% 18%;
    opacity: .66;
    border-radius: 50%;
    background-image:
            radial-gradient(circle, rgba(255,238,174,.94) 0 1.4px, transparent 1.9px),
            radial-gradient(circle, rgba(255,255,255,.88) 0 1px, transparent 1.4px);
    background-size: 49px 49px, 31px 31px;
    transform: rotate(20deg) scaleY(.58);
    filter: drop-shadow(0 0 4px rgba(255,225,128,.28));
}

.constellation-hero-stars-2 {
    inset: 25% 27%;
    opacity: .42;
    border-radius: 50%;
    background-image: radial-gradient(circle, rgba(255,255,255,.92) 0 1px, transparent 1.5px);
    background-size: 24px 24px;
    transform: rotate(-24deg) scaleY(.48);
}

.constellation-hero-core {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(34vw, 470px);
    aspect-ratio: 1;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background:
            radial-gradient(circle at 45% 42%, rgba(255,255,255,.98), rgba(245,223,141,.82) 8%, transparent 20%),
            radial-gradient(circle, rgba(212,175,55,.24), rgba(92,54,135,.09) 44%, transparent 70%);
    filter: blur(.2px);
    box-shadow: 0 0 90px rgba(212,175,55,.18), 0 0 220px rgba(92,54,135,.16);
}

.constellation-hero-core::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at 36% 32%, #fffef5 0%, #f5df8d 30%, #d4af37 68%, #7d5818 100%);
    box-shadow: 0 0 42px #f5df8d, 0 0 110px rgba(212,175,55,.62), 0 0 190px rgba(212,175,55,.28);
}

.constellation-hero .hero-content-cinematic h1 {
    max-width: 1080px;
}

/* ==========================
   INTRO
========================== */

.constellation-intro-section {
    position: relative;
    overflow: hidden;
    background:
            radial-gradient(circle at 82% 42%, rgba(212,175,55,.08), transparent 28%),
            linear-gradient(180deg, #050505 0%, #080808 100%);
}

.constellation-intro-layout {
    display: grid;
    grid-template-columns: .95fr 1.05fr;
    gap: 90px;
    align-items: center;
}

.constellation-intro-content h2 {
    margin-top: 22px;
    font-size: clamp(2.6rem, 5vw, 5.2rem);
    line-height: .95;
    letter-spacing: -.055em;
    text-transform: uppercase;
}

.constellation-intro-content p {
    max-width: 650px;
    margin-top: 24px;
    color: rgba(255,255,255,.68);
    font-size: 1.05rem;
    line-height: 1.85;
}

.constellation-intro-content .section-intro {
    color: #fff;
    font-size: 1.28rem;
}

.constellation-intro-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
}

.constellation-intro-visual {
    position: relative;
    min-height: 520px;
    display: grid;
    place-items: center;
}

.constellation-memory-star {
    position: relative;
    width: min(460px, 78vw);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
            radial-gradient(circle at center, rgba(245,223,141,.18), transparent 15%),
            radial-gradient(circle at center, rgba(92,54,135,.15), transparent 58%);
}

.constellation-memory-star::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: #fff2b7;
    box-shadow: 0 0 36px #f5df8d, 0 0 95px rgba(212,175,55,.48);
}

.memory-molecule {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(245,223,141,.38);
    border-radius: 50%;
    background: #d4af37;
    box-shadow: 0 0 24px rgba(245,223,141,.62);
}

.memory-molecule::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 120px;
    height: 1px;
    transform-origin: 0 50%;
    background: linear-gradient(90deg, rgba(245,223,141,.30), transparent);
}

.memory-molecule-1 { left: 18%; top: 31%; }
.memory-molecule-1::after { transform: rotate(18deg); }
.memory-molecule-2 { right: 18%; top: 27%; }
.memory-molecule-2::after { transform: rotate(153deg); }
.memory-molecule-3 { right: 12%; bottom: 28%; }
.memory-molecule-3::after { transform: rotate(205deg); }
.memory-molecule-4 { left: 20%; bottom: 20%; }
.memory-molecule-4::after { transform: rotate(-34deg); }
.memory-molecule-5 { left: 45%; top: 10%; }
.memory-molecule-5::after { transform: rotate(90deg); }

@media (max-width: 900px) {
    .constellation-intro-layout {
        grid-template-columns: 1fr;
        gap: 45px;
    }

    .constellation-intro-visual {
        min-height: 420px;
    }
}

@media (max-width: 620px) {
    .constellation-hero-core {
        width: min(78vw, 390px);
    }

    .constellation-intro-content h2 {
        font-size: clamp(2.4rem, 12vw, 3.8rem);
    }

    .constellation-intro-visual {
        min-height: 340px;
    }
}

/* ==========================
   LOGIN
========================== */

.login-section {
    position: relative;
    overflow: hidden;
    padding: 160px 0;
    background:
            radial-gradient(circle at 18% 20%, rgba(212,175,55,.1), transparent 30%),
            linear-gradient(180deg, #050505 0%, #090909 100%);
}

.login-card {
    position: relative;
    padding: 42px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 30px;
    background:
            linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.018)),
            radial-gradient(circle at 20% 0%, rgba(212,175,55,.13), transparent 34%);
    box-shadow: 0 34px 100px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.07);
    backdrop-filter: blur(20px);
}

.login-card h2,
.editor-panel h2 {
    margin-top: 18px;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1;
    letter-spacing: -.035em;
}

.login-card p,
.editor-panel p {
    margin-top: 18px;
    color: var(--text);
    line-height: 1.75;
}

.login-card form {
    margin-top: 26px;
}

.login-card input,
.editor-panel input,
.editor-panel textarea,
.editor-panel select {
    width: 100%;
    padding: 17px 18px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 16px;
    background: rgba(0,0,0,.28);
    color: white;
    font-size: 15px;
    transition: .3s ease;
}

.login-card input:focus,
.editor-panel input:focus,
.editor-panel textarea:focus,
.editor-panel select:focus {
    outline: none;
    border-color: rgba(212,175,55,.62);
    background: rgba(0,0,0,.38);
    box-shadow: 0 0 0 4px rgba(212,175,55,.08);
}

.login-card label,
.editor-panel label {
    display: block;
    margin-top: 18px;
    margin-bottom: 8px;
    color: rgba(255,255,255,.82);
    font-size: .84rem;
    font-weight: 800;
}

.full-button {
    width: 100%;
    margin-top: 24px;
}

/* ==========================
   PAGES
========================== */

.page-shell {
    min-height: 100vh;
    padding-top: 150px;
    padding-bottom: 140px;
}

.dashboard-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 50px;
}

.dashboard-head h1 {
    margin-top: 20px;
    font-size: clamp(3rem, 6vw, 6rem);
    line-height: .95;
    letter-spacing: -.05em;
    text-transform: uppercase;
}

.dashboard-head p {
    max-width: 680px;
    margin-top: 22px;
    color: var(--text);
    font-size: 1.05rem;
    line-height: 1.75;
}

.page-status,
.form-status {
    min-height: 24px;
    margin-top: 16px;
    color: #e8c864;
}

.star-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.owned-star-card,
.editor-panel,
.star-canvas-card {
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 24px;
    background: rgba(255,255,255,.035);
    box-shadow: 0 24px 70px rgba(0,0,0,.28);
    backdrop-filter: blur(14px);
}

.owned-star-card {
    transition: .3s ease;
}

.owned-star-card:hover {
    transform: translateY(-6px);
    border-color: rgba(212,175,55,.28);
    box-shadow: 0 30px 90px rgba(0,0,0,.4);
}

.owned-star-visual {
    min-height: 240px;
    display: grid;
    place-items: center;
    background:
            radial-gradient(circle at center, rgba(212,175,55,.18), transparent 38%),
            radial-gradient(circle at 65% 55%, rgba(92,54,135,.14), transparent 46%),
            #070708;
}

.owned-star-visual span {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fffbe6, #f5df8d 36%, #c69728 100%);
    box-shadow: 0 0 34px rgba(245,223,141,.95), 0 0 100px rgba(212,175,55,.38);
}

.owned-star-content {
    padding: 26px;
}

.owned-star-content h2 {
    font-size: 1.45rem;
    line-height: 1.2;
}

.owned-star-content p {
    margin-top: 9px;
    color: var(--grey);
}

.card-actions,
.panel-actions,
.editor-topbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.card-actions {
    margin-top: 22px;
}

.editor-topbar {
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
}

.editor-layout,
.public-star-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(330px, .5fr);
    gap: 26px;
    align-items: start;
}

.editor-main {
    min-width: 0;
}

.star-canvas-head {
    padding: 28px 30px 22px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.star-canvas-head h1 {
    margin-top: 12px;
    font-size: clamp(2.6rem, 5vw, 5rem);
    line-height: .95;
    letter-spacing: -.045em;
}

.star-canvas-head p {
    margin-top: 14px;
    color: var(--grey);
}

.star-canvas {
    display: block;
    width: 100%;
    min-height: 620px;
    height: 68vh;
    max-height: 760px;
    background: #050508;
    touch-action: none;
    cursor: grab;
}

.star-canvas:active {
    cursor: grabbing;
}

.editor-sidebar,
.public-sidebar {
    display: grid;
    gap: 18px;
}

.editor-panel {
    padding: 28px;
}

.editor-panel textarea {
    min-height: 145px;
    resize: vertical;
}

.editor-panel .btn-primary,
.editor-panel .btn-secondary,
.editor-panel .btn-danger {
    margin-top: 18px;
}

.check-row {
    display: flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.check-row input {
    width: 20px;
    min-height: 20px;
    margin: 0;
}

.molecule-list {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 18px;
}

.molecule-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border: 1px solid rgba(212,175,55,.22);
    border-radius: 999px;
    background: rgba(212,175,55,.06);
    color: #f3e6af;
    cursor: pointer;
    transition: .2s ease;
}

.molecule-chip:hover {
    border-color: rgba(212,175,55,.48);
    background: rgba(212,175,55,.11);
}

.molecule-chip span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold-light);
    box-shadow: 0 0 10px rgba(245,223,141,.7);
}

.molecule-preview #previewMessage {
    margin-top: 14px;
    color: rgba(255,255,255,.72);
    line-height: 1.75;
    white-space: pre-wrap;
}

.public-star-card .star-canvas {
    cursor: pointer;
}

/* ==========================
   BUTTONS
========================== */

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 30px;
    border: 1px solid rgba(255,120,120,.35);
    border-radius: 999px;
    background: rgba(255,80,80,.08);
    color: #ffb6b6;
    font-weight: 700;
    cursor: pointer;
    transition: .3s ease;
}

.btn-danger:hover {
    transform: translateY(-3px);
    border-color: rgba(255,120,120,.55);
}

/* ==========================
   RESPONSIVE
========================== */

@media (max-width: 980px) {
    .editor-layout,
    .public-star-layout {
        grid-template-columns: 1fr;
    }

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

    .star-canvas {
        min-height: 520px;
        height: 62vh;
    }
}

@media (max-width: 620px) {

    .login-section {
        padding: 100px 0;
    }

    .login-card {
        padding: 28px;
        border-radius: 24px;
    }

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

    .dashboard-head {
        align-items: stretch;
        flex-direction: column;
    }

    .page-shell {
        padding-top: 125px;
        padding-bottom: 100px;
    }

    .star-canvas {
        min-height: 430px;
        height: 58vh;
    }

    .editor-panel,
    .star-canvas-head {
        padding: 22px;
    }
}

/* =========================================================
   EDITOR / PUBLIC STAR — UX V2
   ========================================================= */

.editor-flow,
.public-star-flow {
    display: grid;
    gap: 26px;
}

.editor-star-card,
.public-star-card {
    width: 100%;
}

.editor-star-title {
    font-size: clamp(2rem, 3.5vw, 3.4rem) !important;
    line-height: 1 !important;
    letter-spacing: -.035em !important;
    text-transform: none !important;
}

.editor-panel h2,
.molecule-preview h2,
.public-molecule-detail h2 {
    margin-top: 0;
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    line-height: 1.15;
    letter-spacing: -.02em;
}

.editor-panel h3 {
    font-size: 1.15rem;
}

.molecule-list-block {
    padding: 20px 22px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 20px;
    background: rgba(255,255,255,.025);
}

.molecule-list-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.molecule-list-head strong {
    font-size: .95rem;
}

.molecule-list-head > div > span {
    color: var(--grey);
    font-size: .86rem;
}

#newMoleculeButton,
#newMoleculeButton span {
    color: #080808;
}

.molecule-list {
    margin-top: 14px;
}

.molecule-chip.active {
    border-color: rgba(245,223,141,.85);
    background: rgba(212,175,55,.19);
    color: #fff7d2;
    box-shadow: 0 0 0 3px rgba(212,175,55,.08), 0 10px 28px rgba(0,0,0,.28);
}

.molecule-chip.active span {
    background: #fff8d2;
    box-shadow: 0 0 14px rgba(245,223,141,1);
}

.editor-settings-grid {
    display: grid;
    grid-template-columns: minmax(280px, .72fr) minmax(0, 1.65fr);
    gap: 26px;
    align-items: stretch;
}

.compact-panel,
.molecule-editor-panel {
    min-width: 0;
}

.molecule-editor-panel {
    border-color: rgba(212,175,55,.15);
}

.molecule-editor-panel.is-editing {
    border-color: rgba(245,223,141,.55);
    box-shadow: 0 0 0 3px rgba(212,175,55,.06), 0 28px 80px rgba(0,0,0,.34);
}

.panel-heading-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.panel-heading-row p {
    margin-top: 8px;
    font-size: .92rem;
}

.panel-title-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(245,223,141,.38);
    border-radius: 50%;
    background: rgba(212,175,55,.12);
    color: var(--gold-light);
    font-size: 1.65rem;
    line-height: 1;
}

.form-grid-2,
.form-grid-3 {
    display: grid;
    gap: 16px;
}

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

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

.access-panel {
    padding: 30px;
}

.access-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.access-intro > div:first-child {
    max-width: 760px;
}

.access-intro .section-tag {
    margin-bottom: 10px;
}

.access-intro p {
    margin-top: 10px;
}

.button-plus {
    margin-right: 8px;
    font-size: 1.2rem;
}

.access-list {
    display: grid;
    gap: 12px;
    margin-top: 26px;
}

.access-empty {
    margin-top: 24px;
    padding: 22px;
    border: 1px dashed rgba(255,255,255,.12);
    border-radius: 16px;
    color: var(--grey);
    text-align: center;
}

.access-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 18px 20px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    background: rgba(0,0,0,.18);
}

.access-row.is-revoked {
    opacity: .62;
}

.access-row-main {
    min-width: 0;
}

.access-row-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.access-row-title strong {
    font-size: 1rem;
}

.access-login {
    margin-top: 5px;
    color: var(--grey);
    font-size: .88rem;
}

.access-status {
    padding: 4px 9px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    color: var(--grey);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.access-status.is-active {
    border-color: rgba(212,175,55,.34);
    background: rgba(212,175,55,.1);
    color: #f1da87;
}

.access-row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn-small {
    min-height: 38px !important;
    padding: 0 16px !important;
    margin-top: 0 !important;
    font-size: .72rem;
}

.access-form {
    margin-top: 26px;
    padding: 24px;
    border: 1px solid rgba(212,175,55,.24);
    border-radius: 20px;
    background: rgba(212,175,55,.035);
}

.access-form-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.access-close {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 50%;
    background: transparent;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
}

.public-molecule-detail,
.viewer-panel {
    width: 100%;
    padding: 30px;
}

.selected-molecule-badge {
    margin-bottom: 10px;
    color: var(--gold);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .14em;
}

.private-message-box {
    margin-top: 18px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    background: rgba(0,0,0,.22);
    color: rgba(255,255,255,.78);
    line-height: 1.75;
    white-space: pre-wrap;
}

.private-message-box.is-locked {
    color: var(--grey);
    font-style: italic;
}

#openPrivateButton {
    margin-top: 18px;
    gap: 9px;
}

.viewer-panel-context {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.lock-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(212,175,55,.1);
}

.viewer-panel-context p {
    margin-top: 8px;
}

@media (max-width: 980px) {
    .editor-settings-grid,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .access-intro,
    .access-row {
        align-items: stretch;
        flex-direction: column;
    }

    .access-row-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 680px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .access-panel,
    .public-molecule-detail,
    .viewer-panel {
        padding: 22px;
    }

    .molecule-list-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}

/* =========================================================
   MOLECULE ACCESS UX V3
   ========================================================= */

.molecule-list-head > div {
    display: grid;
    gap: 3px;
}

#newMoleculeButton {
    margin: 0;
}

.access-molecule-context {
    margin-top: 14px !important;
    color: var(--grey);
    font-size: .92rem;
}

.access-molecule-context strong {
    margin-left: 6px;
    color: var(--gold-light);
}

#accessAddButton:disabled {
    opacity: .42;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 680px) {
    #newMoleculeButton {
        width: 100%;
    }
}


/* ==========================
   ADMIN
========================== */

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin: 18px 0 54px;
}

.admin-stat-card {
    padding: 22px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 20px;
    background: rgba(255,255,255,.035);
}

.admin-stat-card strong {
    display: block;
    color: var(--gold-light);
    font-size: 2rem;
    line-height: 1;
}

.admin-stat-card span {
    display: block;
    margin-top: 10px;
    color: var(--grey);
    font-size: .82rem;
}

.admin-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.admin-section-head-spaced {
    margin-top: 56px;
}

.admin-section-head h2 {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 22px;
    background: rgba(255,255,255,.025);
}

.admin-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 17px 18px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    color: var(--grey);
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.admin-table td strong,
.admin-table td small {
    display: block;
}

.admin-table td small {
    margin-top: 4px;
    color: var(--grey);
}

.admin-table tr:last-child td {
    border-bottom: 0;
}

.admin-row-attention {
    background: rgba(212,175,55,.055);
}

.admin-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-state {
    display: inline-flex;
    padding: 4px 9px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
}

.admin-state-sold {
    border-color: rgba(212,175,55,.38);
    color: var(--gold-light);
}

.admin-state-reserved {
    color: #f0cf86;
}

.admin-state-available {
    color: #a9e8b5;
}

.admin-muted {
    color: var(--grey);
}

.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(0,0,0,.78);
    backdrop-filter: blur(10px);
}

.admin-modal[hidden] {
    display: none;
}

.admin-modal-card {
    width: min(620px, 100%);
    max-height: 90vh;
    overflow: auto;
    padding: 30px;
    border: 1px solid rgba(212,175,55,.22);
    border-radius: 26px;
    background: #0a0a0c;
    box-shadow: 0 30px 120px rgba(0,0,0,.7);
}

.admin-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.admin-modal-close {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 50%;
    background: transparent;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
}

.admin-modal-card form {
    margin-top: 22px;
}

.admin-modal-card label {
    display: block;
    margin: 16px 0 7px;
    color: rgba(255,255,255,.82);
    font-size: .84rem;
    font-weight: 800;
}

.admin-modal-card input {
    width: 100%;
    padding: 15px 17px;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 14px;
    background: rgba(255,255,255,.04);
    color: white;
}

.admin-modal-card small {
    display: block;
    margin-top: 7px;
    color: var(--grey);
}

.editor-settings-grid-single {
    grid-template-columns: 1fr;
}

@media (max-width: 680px) {
    .admin-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-modal-card {
        padding: 22px;
    }
}


.admin-account-state {
    display: inline-flex;
    padding: 4px 9px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
}

.admin-account-state.is-active {
    color: #a9e8b5;
}

.admin-account-state.is-blocked {
    color: #f0a3a3;
}

/* =========================================================
   PAID MOLECULES / OWNER SHOP
   ========================================================= */

.public-sale-panel,
.sale-settings-panel,
.purchase-history-panel {
    width: 100%;
}

.sale-panel-head,
.purchase-history-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.sale-price {
    flex: 0 0 auto;
    color: var(--gold-light);
    font-size: clamp(1.8rem, 4vw, 2.65rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: .025em;
    white-space: nowrap;
    text-shadow: 0 0 28px rgba(212,175,55,.2);
}

/* Buttons: same premium language as the constellation chips and the Sailor cart. */
.page-shell .btn-primary {
    position: relative;
    border: 1px solid rgba(245,223,141,.46);
    background: linear-gradient(135deg, #f5df8d 0%, #d4af37 48%, #9e7426 100%);
    color: #080808;
    box-shadow: 0 14px 34px rgba(212,175,55,.18), inset 0 1px 0 rgba(255,255,255,.4);
    font-size: .82rem;
    font-weight: 900;
    letter-spacing: .075em;
    text-transform: uppercase;
}

.page-shell .btn-primary:hover {
    transform: translateY(-2px);
    border-color: rgba(255,241,185,.72);
    box-shadow: 0 20px 48px rgba(212,175,55,.28), inset 0 1px 0 rgba(255,255,255,.5);
}

.page-shell .btn-secondary {
    border: 1px solid rgba(255,255,255,.13);
    background: rgba(255,255,255,.025);
    color: rgba(255,255,255,.88);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .045em;
}

.page-shell .btn-secondary:hover {
    transform: translateY(-2px);
    border-color: rgba(212,175,55,.44);
    background: rgba(212,175,55,.055);
    color: var(--gold-light);
    box-shadow: 0 14px 34px rgba(0,0,0,.26);
}

.page-shell .btn-primary:focus-visible,
.page-shell .btn-secondary:focus-visible,
.page-shell .btn-danger:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 3px;
}

.page-shell .btn-small {
    min-height: 40px !important;
    padding: 0 17px !important;
    font-size: .7rem;
}

#openPurchaseButton {
    min-height: 52px;
    margin-top: 20px;
    padding: 0 26px;
}

/* Shared form controls. */
.editor-panel input,
.editor-panel textarea,
.editor-panel select {
    min-height: 52px;
    border-color: rgba(255,255,255,.105);
    border-radius: 14px;
    background-color: rgba(0,0,0,.30);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.018);
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.editor-panel input:hover,
.editor-panel textarea:hover,
.editor-panel select:hover {
    border-color: rgba(255,255,255,.17);
}

.editor-panel input:focus,
.editor-panel textarea:focus,
.editor-panel select:focus {
    outline: 0;
    border-color: rgba(212,175,55,.65);
    background-color: rgba(0,0,0,.38);
    box-shadow: 0 0 0 4px rgba(212,175,55,.075), inset 0 1px 0 rgba(255,255,255,.02);
}

.editor-panel select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 50px;
    background-image:
        linear-gradient(45deg, transparent 50%, #f5df8d 50%),
        linear-gradient(135deg, #f5df8d 50%, transparent 50%);
    background-position:
        calc(100% - 21px) 50%,
        calc(100% - 16px) 50%;
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
    cursor: pointer;
}

.editor-panel select option {
    background: #101010;
    color: #fff;
}

.editor-panel label {
    color: rgba(255,255,255,.88);
    font-size: .82rem;
    font-weight: 800;
}

/* Public purchase form. */
.purchase-form {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid rgba(255,255,255,.075);
}

.purchase-form > .form-grid-2:first-child {
    margin-bottom: 18px;
}

.purchase-form textarea {
    min-height: 152px;
    resize: vertical;
}

.purchase-billing {
    display: grid;
    gap: 18px;
    min-width: 0;
    margin: 28px 0 20px;
    padding: 24px;
    border: 1px solid rgba(212,175,55,.22);
    border-radius: 22px;
    background:
        radial-gradient(circle at 14% 0%, rgba(212,175,55,.085), transparent 35%),
        rgba(255,255,255,.022);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.purchase-billing legend {
    padding: 0 10px;
    color: #fff;
    font-size: 1.08rem;
    font-weight: 900;
}

.purchase-billing > label {
    margin-top: 0;
}

.purchase-billing .form-grid-2 {
    gap: 16px;
}

.purchase-customer-type {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.purchase-customer-option {
    position: relative;
    display: block !important;
    margin: 0 !important;
    cursor: pointer;
}

.purchase-customer-option > input {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

.purchase-customer-card {
    display: flex;
    min-height: 86px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 16px 18px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 16px;
    background: rgba(0,0,0,.24);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.018);
    transition: border-color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.purchase-customer-card strong {
    color: #fff;
    font-size: .9rem;
    font-weight: 900;
}

.purchase-customer-card small {
    color: rgba(255,255,255,.52);
    font-size: .78rem;
    font-weight: 500;
    line-height: 1.4;
}

.purchase-customer-option:hover .purchase-customer-card {
    transform: translateY(-1px);
    border-color: rgba(212,175,55,.4);
}

.purchase-customer-option > input:checked + .purchase-customer-card {
    border-color: rgba(212,175,55,.72);
    background: rgba(212,175,55,.10);
    box-shadow: 0 0 0 3px rgba(212,175,55,.065), inset 0 1px 0 rgba(255,255,255,.025);
}

.purchase-customer-option > input:focus-visible + .purchase-customer-card {
    outline: 2px solid var(--gold-light);
    outline-offset: 3px;
}

.purchase-validation-note,
.sale-validation-lock {
    margin: 18px 0;
    padding: 14px 16px;
    border: 1px solid rgba(212,175,55,.15);
    border-radius: 14px;
    background: rgba(212,175,55,.04);
    color: rgba(255,255,255,.62);
    font-size: .87rem;
    line-height: 1.6;
}

.purchase-form .panel-actions {
    margin-top: 22px;
}

.purchase-payment-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    width: 100vw;
    height: 100dvh;
    padding: 28px;
    overflow: auto;
    background: rgba(0,0,0,.78);
    backdrop-filter: blur(12px);
    box-sizing: border-box;
}

.purchase-payment-modal[hidden] {
    display: none;
}

body.purchase-payment-open {
    overflow: hidden;
}

.purchase-payment-dialog {
    position: relative;
    width: min(760px, 100%);
    max-height: calc(100dvh - 56px);
    overflow: auto;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 26px;
    background: #101010;
    box-shadow: 0 34px 120px rgba(0,0,0,.72);
}

.purchase-payment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 24px;
    border-bottom: 1px solid rgba(255,255,255,.10);
}

.purchase-payment-head h2 {
    margin: 0;
    font-size: 1.55rem;
    line-height: 1.2;
}

.purchase-payment-close {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 12px;
    background: rgba(255,255,255,.025);
    color: #fff;
    font-size: 1.65rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.purchase-payment-close:hover {
    border-color: rgba(212,175,55,.46);
    background: rgba(212,175,55,.06);
}

.purchase-payment-body {
    padding: 28px 24px 30px;
}

.purchase-payment-badge {
    display: inline-flex;
    padding: 8px 12px;
    border: 1px solid rgba(212,175,55,.42);
    border-radius: 999px;
    background: rgba(212,175,55,.07);
    color: var(--gold-light);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .08em;
}

.purchase-payment-body h3 {
    margin-top: 20px;
    font-size: clamp(1.55rem, 3vw, 2rem);
    line-height: 1.15;
}

.purchase-payment-help {
    max-width: 660px;
    margin-top: 18px;
    color: rgba(255,255,255,.68);
    line-height: 1.75;
}

.purchase-payment-validity {
    margin-top: 26px;
    padding: 20px;
    border: 1px solid rgba(212,175,55,.34);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(212,175,55,.10), rgba(212,175,55,.035)),
        rgba(0,0,0,.18);
}

.purchase-payment-validity > strong {
    color: #fff;
    font-size: .96rem;
}

.purchase-payment-validity p {
    margin-top: 9px;
    color: rgba(255,255,255,.66);
    line-height: 1.65;
}

.purchase-payment-countdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.09);
    color: rgba(255,255,255,.82);
}

.purchase-payment-countdown-row strong {
    color: #fff;
    font-size: 1.18rem;
    font-variant-numeric: tabular-nums;
}

.purchase-payment-link-label {
    display: block;
    margin-top: 26px;
    color: #fff;
    font-size: .86rem;
    font-weight: 800;
}

.purchase-payment-url {
    width: 100%;
    margin-top: 10px;
    padding: 16px 17px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    background: rgba(0,0,0,.28);
    color: rgba(255,255,255,.92);
    font-size: .9rem;
}

.purchase-payment-url:focus {
    outline: none;
    border-color: rgba(212,175,55,.58);
    box-shadow: 0 0 0 4px rgba(212,175,55,.07);
}

.purchase-payment-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.purchase-payment-actions .btn-primary,
.purchase-payment-actions .btn-secondary {
    min-height: 48px;
    margin: 0;
}

.purchase-payment-status {
    min-height: 22px;
    margin-top: 18px;
    color: var(--grey);
    font-size: .88rem;
}

@media (max-width: 620px) {
    .purchase-payment-modal {
        align-items: end;
        padding: 12px;
    }

    .purchase-payment-dialog {
        max-height: calc(100vh - 24px);
        border-radius: 22px;
    }

    .purchase-payment-head {
        padding: 18px;
    }

    .purchase-payment-body {
        padding: 22px 18px 24px;
    }

    .purchase-payment-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .purchase-payment-actions .btn-primary,
    .purchase-payment-actions .btn-secondary {
        width: 100%;
    }
}

/* Owner shop and paid purchases. */
.sale-settings-panel form {
    margin-top: 22px;
}

.sale-settings-panel .check-row {
    margin: 0 0 8px;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    background: rgba(0,0,0,.16);
}

.sale-settings-panel .check-row input {
    width: 20px;
    min-height: 20px;
    accent-color: var(--gold);
}

.purchase-list {
    display: grid;
    gap: 12px;
    margin-top: 24px;
}

.purchase-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    background: rgba(0,0,0,.18);
    transition: border-color .2s ease, background .2s ease;
}

.purchase-row:hover {
    border-color: rgba(212,175,55,.18);
    background: rgba(212,175,55,.022);
}

.purchase-row-main {
    min-width: 0;
}

.purchase-row-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.purchase-row-meta {
    margin-top: 8px;
    color: var(--grey);
    font-size: .86rem;
    line-height: 1.6;
}

.purchase-row-message {
    margin-top: 12px;
    color: rgba(255,255,255,.78);
    line-height: 1.65;
    white-space: pre-wrap;
}

.purchase-state {
    display: inline-flex;
    padding: 4px 9px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.purchase-state.is-paid {
    border-color: rgba(212,175,55,.4);
    color: var(--gold-light);
}

.purchase-state.is-published {
    border-color: rgba(130,220,155,.35);
    color: #a9e8b5;
}

.purchase-state.is-rejected {
    color: #f0a3a3;
}

.purchase-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.molecule-paid-mark {
    margin-left: 8px;
    color: var(--gold-light);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

@media (max-width: 760px) {
    .sale-panel-head,
    .purchase-history-head,
    .purchase-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .purchase-actions {
        justify-content: flex-start;
    }

    .sale-price {
        white-space: normal;
    }
}

@media (max-width: 620px) {
    .purchase-billing {
        padding: 18px;
    }

    .purchase-customer-type,
    .purchase-billing .form-grid-2,
    .purchase-form > .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .purchase-form .panel-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .purchase-form .panel-actions .btn-primary,
    .purchase-form .panel-actions .btn-secondary {
        width: 100%;
    }
}


/* =========================================================
   PURCHASE FORM — DYNAMIC BILLING
   ========================================================= */

.purchase-form [hidden] {
    display: none !important;
}

.purchase-email-note {
    display: grid;
    gap: 7px;
    margin-top: 22px;
    padding: 18px 20px;
    border: 1px solid rgba(87, 220, 137, .24);
    border-radius: 16px;
    background: rgba(34, 128, 73, .10);
    color: rgba(255,255,255,.72);
}

.purchase-email-note strong {
    color: #8df0b1;
    font-size: .95rem;
}

.purchase-email-note span {
    line-height: 1.6;
}


/* =========================================================
   PURCHASE CHECKOUT — CART STYLE
   ========================================================= */

button,
.btn-primary,
.btn-secondary,
.btn-danger,
#openPurchaseButton,
.purchase-customer-option,
.purchase-payment-close,
.purchase-modal-close {
    cursor: pointer;
}

button:disabled,
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
    cursor: not-allowed;
}

.purchase-form-modal {
    position: fixed;
    inset: 0;
    z-index: 9900;
    display: grid;
    place-items: center;
    width: 100vw;
    height: 100dvh;
    padding: 20px;
    overflow: auto;
    background: rgba(0,0,0,.78);
    backdrop-filter: blur(12px);
    box-sizing: border-box;
}

.purchase-form-modal[hidden] {
    display: none;
}

body.purchase-form-open {
    overflow: hidden;
}

.purchase-form-dialog {
    width: min(760px, 100%);
    max-height: calc(100dvh - 40px);
    overflow: auto;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 26px;
    background: #111;
    box-shadow: 0 34px 120px rgba(0,0,0,.72);
}

.purchase-form-head {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px;
    border-bottom: 1px solid rgba(255,255,255,.10);
    background: #111;
}

.purchase-form-head h2 {
    margin: 0;
    font-size: 1.55rem;
    line-height: 1.2;
}

.purchase-modal-close {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 12px;
    background: rgba(255,255,255,.025);
    color: #fff;
    font-size: 1.65rem;
    line-height: 1;
}

.purchase-form {
    margin: 0;
    padding: 0;
    border: 0;
}

.purchase-form-body {
    padding: 18px 22px 26px;
}

.purchase-step-badge {
    display: inline-flex;
    padding: 8px 12px;
    border: 1px solid rgba(212,175,55,.42);
    border-radius: 999px;
    background: rgba(212,175,55,.07);
    color: var(--gold-light);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .075em;
}

.purchase-form-body > h3 {
    margin-top: 20px;
    color: #fff;
    font-size: clamp(1.55rem, 3vw, 2rem);
    line-height: 1.15;
}

.purchase-form-intro {
    margin-top: 14px;
    color: rgba(255,255,255,.74);
    line-height: 1.7;
}

.purchase-email-warning {
    margin-top: 20px;
    padding: 16px 18px;
    border: 1px solid rgba(212,175,55,.28);
    border-radius: 14px;
    background: rgba(212,175,55,.07);
    color: #f4dc7d;
    line-height: 1.65;
}

.purchase-selection-card,
.purchase-molecule-card {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 18px;
    background: rgba(255,255,255,.025);
}

.purchase-card-title {
    display: block;
    margin-bottom: 16px;
    color: var(--gold-light);
    font-size: .77rem;
    font-weight: 900;
    letter-spacing: .07em;
}

.purchase-selection-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 4px 0 14px;
    color: rgba(255,255,255,.94);
}

.purchase-selection-row strong {
    white-space: nowrap;
}

.purchase-selection-total {
    padding-top: 14px;
    padding-bottom: 0;
    border-top: 1px solid rgba(255,255,255,.10);
    font-size: 1.04rem;
    font-weight: 900;
}

.purchase-molecule-card .form-grid-2 {
    margin-bottom: 8px;
}

.purchase-form-dialog label,
.purchase-form-dialog .purchase-billing label {
    display: block;
    margin-top: 16px;
    margin-bottom: 7px;
    color: rgba(255,255,255,.9);
    font-size: .82rem;
    font-weight: 800;
}

.purchase-form-dialog input,
.purchase-form-dialog textarea,
.purchase-form-dialog select {
    width: 100%;
    min-height: 54px;
    padding: 15px 16px;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 14px;
    background: rgba(0,0,0,.30);
    color: #fff;
    font-size: .94rem;
    box-sizing: border-box;
}

.purchase-form-dialog textarea {
    min-height: 138px;
    resize: vertical;
}

.purchase-form-dialog select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 48px;
    background-image:
        linear-gradient(45deg, transparent 50%, #f5df8d 50%),
        linear-gradient(135deg, #f5df8d 50%, transparent 50%);
    background-position:
        calc(100% - 21px) 50%,
        calc(100% - 16px) 50%;
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
    cursor: pointer;
}

.purchase-form-dialog input:focus,
.purchase-form-dialog textarea:focus,
.purchase-form-dialog select:focus {
    outline: 0;
    border-color: rgba(212,175,55,.65);
    box-shadow: 0 0 0 4px rgba(212,175,55,.075);
}

.purchase-form-dialog .purchase-billing {
    margin-top: 28px;
    margin-bottom: 0;
    padding: 22px;
}

.purchase-billing-help {
    margin: 0 0 16px;
    color: rgba(255,255,255,.70);
    line-height: 1.7;
}

.purchase-form-dialog .purchase-customer-option {
    margin: 0 !important;
}

.purchase-form-dialog .purchase-customer-card {
    min-height: 84px;
}

.purchase-form-dialog .purchase-email-note {
    margin-top: 18px;
}

.purchase-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 4;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 22px;
    border-top: 1px solid rgba(255,255,255,.10);
    background: #111;
}

.purchase-form-actions .btn-primary,
.purchase-form-actions .btn-secondary,
.purchase-payment-actions .btn-primary,
.purchase-payment-actions .btn-secondary {
    cursor: pointer;
}

@media (max-width: 620px) {
    .purchase-form-modal {
        align-items: end;
        padding: 10px;
    }

    .purchase-form-dialog {
        max-height: calc(100dvh - 20px);
        border-radius: 22px;
    }

    .purchase-form-body,
    .purchase-form-head,
    .purchase-form-actions {
        padding-left: 18px;
        padding-right: 18px;
    }

    .purchase-selection-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .purchase-form-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .purchase-form-actions .btn-primary,
    .purchase-form-actions .btn-secondary {
        width: 100%;
    }
}


/* =========================================================
   PURCHASE MODALS — CUSTOM SCROLLBAR
   ========================================================= */

.purchase-form-dialog,
.purchase-payment-dialog {
    scrollbar-width: thin;
    scrollbar-color: rgba(212,175,55,.72) transparent;
    scrollbar-gutter: stable;
}

.purchase-form-dialog::-webkit-scrollbar,
.purchase-payment-dialog::-webkit-scrollbar {
    width: 7px;
}

.purchase-form-dialog::-webkit-scrollbar-track,
.purchase-payment-dialog::-webkit-scrollbar-track {
    background: transparent;
}

.purchase-form-dialog::-webkit-scrollbar-thumb,
.purchase-payment-dialog::-webkit-scrollbar-thumb {
    min-height: 48px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(212,175,55,.72);
    background-clip: padding-box;
}

.purchase-form-dialog::-webkit-scrollbar-thumb:hover,
.purchase-payment-dialog::-webkit-scrollbar-thumb:hover {
    background: rgba(245,223,141,.92);
    background-clip: padding-box;
}


/* =========================================================
   PURCHASE SELECT OPTIONS
   ========================================================= */

.purchase-form-dialog select option {
    background: #111;
    color: #fff;
}


/* =========================================================
   PAID MOLECULE — PROTECTED CONTENT
   ========================================================= */

.paid-molecule-lock {
    margin-top: 22px;
    padding: 16px 18px;
    border: 1px solid rgba(212,175,55,.25);
    border-radius: 15px;
    background: rgba(212,175,55,.065);
    color: rgba(255,255,255,.72);
    line-height: 1.6;
}

.paid-molecule-lock strong {
    display: block;
    margin-bottom: 5px;
    color: var(--gold-light);
}

.molecule-editor-panel.is-paid .panel-title-icon {
    background: rgba(212,175,55,.08);
    color: var(--gold-light);
}

.molecule-editor-panel [hidden] {
    display: none !important;
}


/* =========================================================
   NEW MOLECULE BUTTON — FINAL OVERRIDE
   ========================================================= */

#newMoleculeButton.btn-primary {
    opacity: 1 !important;
    filter: none !important;
    color: #080808 !important;
    cursor: pointer;
}

#newMoleculeButton.btn-primary *,
#newMoleculeButton.btn-primary span {
    opacity: 1 !important;
    color: #080808 !important;
    -webkit-text-fill-color: #080808 !important;
}

#newMoleculeButton.btn-primary:disabled {
    opacity: .42 !important;
    cursor: not-allowed;
}


/* =========================================================
   BUYER MOLECULE ACCESS
   ========================================================= */

.purchase-actions button:disabled {
    opacity: .38;
    cursor: not-allowed;
}

.molecule-access-page {
    min-height: 72vh;
}

.buyer-molecule-summary {
    display: grid;
    gap: 5px;
    margin-top: 24px;
    padding: 18px 20px;
    border: 1px solid rgba(212,175,55,.25);
    border-radius: 16px;
    background: rgba(212,175,55,.055);
}

.buyer-molecule-summary span {
    color: var(--gold-light);
    font-size: .75rem;
    font-weight: 900;
    letter-spacing: .07em;
}

.buyer-molecule-summary strong {
    color: #fff;
    font-size: 1.12rem;
}

.buyer-molecule-summary small {
    color: var(--grey);
}

.molecule-access-panel .access-list,
.molecule-access-panel .access-form {
    margin-top: 24px;
}


/* =========================================================
   GLOBAL STATUS NOTICE
   ========================================================= */
.global-status-notice {
    position: fixed;
    left: 50%;
    top: max(92px, env(safe-area-inset-top));
    z-index: 20000;
    display: flex;
    align-items: center;
    gap: 18px;
    width: min(680px, calc(100vw - 32px));
    padding: 16px 18px;
    border: 1px solid rgba(245,223,141,.42);
    border-radius: 16px;
    background: rgba(18,16,10,.97);
    color: #f5df8d;
    box-shadow: 0 20px 70px rgba(0,0,0,.62);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -18px);
    transition: opacity .2s ease, transform .2s ease;
    backdrop-filter: blur(16px);
}

.global-status-notice.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.global-status-notice-text {
    flex: 1;
    min-width: 0;
    font-size: .92rem;
    font-weight: 700;
    line-height: 1.45;
}

.global-status-notice-close {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 50%;
    background: rgba(255,255,255,.04);
    color: #fff;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}

.molecule-access-panel .access-row-main {
    min-width: 0;
}

.molecule-access-panel .access-login {
    margin-top: 5px;
}

@media (max-width: 680px) {
    .global-status-notice {
        top: max(76px, env(safe-area-inset-top));
        width: calc(100vw - 20px);
        padding: 14px 15px;
    }
}
