/* ============================================================
   Xmax AI — API Platform (clone of platform.xmax.ai)
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    font-size: clamp(.625rem, calc(100vw / 90), 1rem);
}
@media (min-width: 1440px) { html { font-size: 1rem; } }
@media (max-width: 768px)  { html { font-size: 1rem; } }
@media (max-width: 360px)  { html { font-size: .9375rem; } }

html, body { background-color: #000; }
body {
    margin: 0;
    font-family: "DM Sans", Rubik, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #fff;
}
a, button, input, select, textarea {
    -webkit-tap-highlight-color: transparent;
}
a:focus, a:focus-visible, button:focus, button:focus-visible { outline: none; box-shadow: none; }
::-webkit-scrollbar { width: .375rem; height: .375rem; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: #171717; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3d3d3d; }
code, pre, .x-code-block, .pf-code-card, .pf-code-card pre, .pf-code-card code {
    font-family: "Fira Code", Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ---- tokens ---- */
.pf-body {
    --bg-primary: #171717;
    --bg-silder: #222224;
    --bg-hover: hsla(0,0%,100%,.05);
    --bg-selected: hsla(0,0%,100%,.1);
    --bg-code: #000;
    --bg-btnprimary: #4d3dde;
    --bg-secondary: #141414;
    --bg-tertiary: hsla(0,0%,100%,.1);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-tertiary: hsla(0,0%,100%,.6);
    --border: hsla(0,0%,100%,.2);
    --accent: rgb(77, 61, 222);
    --del: rgb(243, 62, 62);
    --error: rgb(243, 62, 62);
    --bg-avatar: rgb(255, 101, 101);
    --bg-pay: rgba(0, 0, 0, 0.8);
    --bg-modal: rgb(25, 25, 25);
    --text-dim: rgba(255, 255, 255, 0.6);
}

/* ---- shell ---- */
.pf-shell {
    position: relative;
    z-index: 1;
    display: flex;
    background: var(--bg-primary);
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}

/* ===== Sidebar ===== */
.pf-sidebar {
    display: none;
    width: 240px;
    flex-shrink: 0;
    background: var(--bg-silder);
    flex-direction: column;
    border-right: 1px solid var(--border);
    height: 100%;
}
@media (min-width: 769px) { .pf-sidebar { display: flex; } }

.pf-brand {
    padding: 17px 12px 0;
    display: block;
}
.pf-brand img { height: 31px; width: auto; }

.pf-nav { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.pf-nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    border: 0;
    background: transparent;
    color: var(--text-tertiary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.pf-nav-item img { width: 20px; height: 20px; object-fit: contain; }
.pf-nav-item:hover { background: var(--bg-hover); color: var(--text-secondary); }
.pf-nav-item.is-active { background: var(--bg-selected); color: var(--text-primary); }

.pf-sidebar-foot { flex-shrink: 0; padding-bottom: 12px; }
.pf-divider { border-top: .5px solid var(--border); }
.pf-foot-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: transparent;
    border: 0;
    color: var(--text-tertiary);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, color .2s;
}
.pf-foot-item:hover { background: var(--bg-hover); color: var(--text-secondary); }
.pf-foot-main { display: flex; align-items: center; gap: 12px; }
.pf-foot-main img { width: 20px; height: 20px; object-fit: contain; }
.pf-foot-item > img { width: 8px; height: auto; }

/* ===== Main column ===== */
.pf-main {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top bars */
.pf-mobile-head {
    position: relative;
    z-index: 30;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: var(--bg-code);
    height: 4rem;
}
@media (min-width: 769px) { .pf-mobile-head { display: none; } }

.pf-icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: transparent;
    border: 0;
    color: var(--text-primary);
    cursor: pointer;
}
.pf-icon-btn svg { width: 20px; height: 20px; }
.pf-icon-btn:hover { background: var(--bg-hover); }

.pf-head-right { display: flex; align-items: center; gap: 16px; margin-left: 12px; }

.pf-desktop-head { display: none; }
@media (min-width: 769px) {
    .pf-desktop-head {
        position: relative;
        z-index: 30;
        display: block;
        flex-shrink: 0;
        padding: 16px 20px;
    }
}
.pf-desktop-head-inner {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 12px;
}

.pf-login {
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}
.pf-login:hover { background: var(--bg-tertiary); }

/* Scroll area */
.pf-scroll {
    position: relative;
    z-index: 10;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.pf-scroll::-webkit-scrollbar { display: none; width: 0; height: 0; }
@media (max-width: 768px) { .pf-scroll { padding-top: 12px; } }

.pf-container {
    width: 100%;
    margin-inline: auto;
}
@media (min-width: 769px) {
    .pf-container { width: 74.9%; min-width: 320px; }
}
.pf-inner {
    width: 100%;
    margin-inline: auto;
}
@media (min-width: 1920px) { .pf-inner { width: 80%; } }
@media (max-width: 768px) { .pf-container, .pf-inner { padding-inline: 16px; } }

/* ===== Hero ===== */
.pf-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}
@media (min-width: 769px) {
    .pf-hero {
        flex-direction: row;
        align-items: center;
        gap: 3rem;
        margin-bottom: 3rem;
        padding-right: 12px;
    }
}

.pf-hero-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}
.pf-title {
    margin: 0 0 1rem;
    font-size: 1.875rem;
    line-height: 42px;
    font-weight: 700;
    letter-spacing: normal;
}
.pf-title-line { display: block; }
@media (min-width: 1920px) { .pf-title { font-size: 2.25rem; } }

.pf-sub {
    color: var(--text-tertiary);
    font-size: 14px;
    line-height: 1.625;
    margin: 0 0 1.5rem;
    max-width: 24rem;
}
@media (max-width: 768px) { .pf-sub { font-size: 16px; max-width: none; } }

.pf-cta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    background: var(--bg-btnprimary);
    border: 0;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
font-family: Rubik, sans-serif;
    cursor: pointer;
    transition: filter .2s;
    text-decoration: none;
}
.pf-cta:hover { filter: brightness(1.12); }
.pf-cta img { height: 16px; width: auto; }
@media (max-width: 768px) { .pf-cta { font-size: 16px; } }

/* Demo / code panel */
.pf-demo {
    position: relative;
    width: 100%;
    min-width: 0;
    align-self: stretch;
}
@media (min-width: 769px) { .pf-demo { width: 55%; min-height: 0; } }

.pf-demo-tray {
    position: absolute;
    inset: 0;
    z-index: 1;
    min-height: calc(210px);
    border: 1px solid var(--border);
    background: var(--bg-hover);
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

.pf-demo-inner {
    position: relative;
    z-index: 10;
    min-height: 252px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 12px 0;
}
@media (min-width: 769px) { .pf-demo-inner { min-height: 252px; } }

.pf-lang { width: 224px; flex-shrink: 0; }
.pf-lang-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: border-color .2s;
}
.pf-lang-btn:hover { border-color: var(--bg-hover); }
.pf-chev { width: 16px; height: 16px; color: var(--text-tertiary); }

.pf-code-card {
    position: relative;
    width: calc(100% + 12px);
    flex-shrink: 0;
    overflow: hidden;
    background: var(--bg-code);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,.25);
}
@media (min-width: 769px) { .pf-code-card { width: calc(100% + 6px); } }

.pf-copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background .2s, border-color .2s;
}
.pf-copy-btn:hover { border-color: var(--text-primary); }
.pf-copy-btn svg { width: 14px; height: 14px; }
.pf-copy-btn.is-copied { border-color: #4d3dde; color: #8d7cff; }

.x-code-block {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    height: 194px;
    max-height: 194px;
    background-color: rgb(0,0,0);
}
.x-code-block::-webkit-scrollbar { display: none; width: 0; height: 0; }
.x-code-block pre {
    color: #d4d4d4;
    background: #000;
    margin: 0;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.6;
    tab-size: 2;
    white-space: pre;
    display: block;
    width: max-content;
    min-width: 100%;
}
.x-code-block code { display: block; width: max-content; min-width: 100%; }

/* prism-ish token colors */
.tk-c { color: #6a9955; font-style: italic; }
.tk-s { color: #ce9178; }
.tk-k { color: #c586c0; }
.tk-f { color: #dcdcaa; }
.tk-b { color: #b5cea8; }

/* ===== Gradients behind code (static bleed variant) ===== */
.pf-glow {
    display: none;
    position: absolute;
    z-index: 0;
    top: 0;
    right: -4%;
    left: 34%;
    bottom: 0;
    pointer-events: none;
    overflow: visible;
}
@media (min-width: 769px) { .pf-glow { display: block; } }
.home-code-gradient-bg--bleed {
    position: absolute;
    inset: 0;
    overflow: visible;
    isolation: isolate;
    background: transparent;
    border: none;
    --c1: #2f6bff;
    --c2: #7a35ff;
    --c3: #00a3d7;
    --c4: #caf0fe;
    --speed: 16s;
    --scale: 1.02;
    --blur: 3.5rem;
}
.home-code-gradient-bg__wash {
    position: absolute;
    inset: 0;
    overflow: visible;
    pointer-events: none;
    border-radius: 24px;
    background: transparent;
}
.home-code-gradient-bg--bleed .home-code-gradient-blob {
    display: block;
    position: absolute;
    border-radius: 52% 48% 58% 42%/45% 56% 44% 55%;
    mix-blend-mode: normal;
    transform: translateZ(0);
    will-change: auto;
    filter: blur(4rem) saturate(122%);
    pointer-events: none;
    animation: none;
}
.home-code-gradient-bg--bleed .home-code-gradient-blob--1 { left: -22%; top: -8%;  width: 50%; height: 56%; background: rgba(73,102,255,.56); opacity: .62; }
.home-code-gradient-bg--bleed .home-code-gradient-blob--2 { left: -10%; top: 14%; width: 48%; height: 54%; background: rgba(123,78,255,.5); opacity: .56; }
.home-code-gradient-bg--bleed .home-code-gradient-blob--3 { left: 18%;  top: 8%;  width: 42%; height: 48%; background: rgba(83,152,255,.42); opacity: .46; }
.home-code-gradient-bg--bleed .home-code-gradient-blob--4 { left: -4%;  top: 36%; width: 46%; height: 44%; background: rgba(167,137,255,.38); opacity: .44; }
.home-code-gradient-bg--bleed .home-code-gradient-blob--5 { left: 24%;  top: 30%; width: 36%; height: 40%; background: rgba(120,106,255,.34); opacity: .36; }

/* ===== Model grid ===== */
.pf-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem 1.5rem;
}
@media (min-width: 769px) { .pf-grid { grid-template-columns: 1fr 1fr; } }

.pf-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
}
.pf-card-title {
    margin: 0 0 10px;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}
@media (min-width: 769px) { .pf-card-title { font-size: 18px; } }

.pf-video {
    margin-bottom: 16px;
    overflow: hidden;
    border-radius: 10px;
    background: var(--bg-hover);
    cursor: pointer;
    aspect-ratio: 16/9;
}
.home-video { position: relative; overflow: hidden; width: 100%; height: 100%; }
.home-video__media { display: block; width: 100%; height: 100%; position: absolute; inset: 0; -o-object-fit: cover; object-fit: cover; }
.home-video__poster { z-index: 1; pointer-events: none; }
.home-video__video {
    z-index: 2;
    opacity: 0;
    transition: opacity .4s ease;
}
.home-video__video.is-visible { opacity: 1; }
.home-video__video::-webkit-media-controls { display: none !important; -webkit-appearance: none; }
.home-video__video::-webkit-media-controls-enclosure,
.home-video__video::-webkit-media-controls-panel { display: none !important; }
.home-video__video::-webkit-media-controls-play-button,
.home-video__video::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }
.home-video__skeleton {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: hsla(0,0%,100%,.06);
    animation: home-video-skeleton-pulse 1.5s ease-in-out infinite;
    transition: opacity .4s ease;
}
.home-video__skeleton.is-hidden { opacity: 0; animation: none; pointer-events: none; }
@keyframes home-video-skeleton-pulse {
    0%, to { opacity: 1; }
    50% { opacity: .55; }
}

.pf-card-desc {
    color: var(--text-tertiary);
    font-size: 14px;
    line-height: 1.625;
    margin: 0 0 16px;
}

.pf-try {
    margin-top: auto;
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-btnprimary);
    border: 0;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
font-family: Rubik, sans-serif;
    cursor: pointer;
    transition: filter .2s;
    text-decoration: none;
}
.pf-try:hover { filter: brightness(1.12); }
.pf-try img { height: 16px; width: auto; }
@media (max-width: 768px) { .pf-try { font-size: 16px; } }

/* ===== Footer ===== */
.pf-footer {
    min-width: 320px;
    margin-inline: auto;
    margin-top: 4rem;
    padding-bottom: 2.5rem;
}
.pf-footer-row {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}
@media (min-width: 769px) { .pf-footer-row { display: flex; } }
.pf-copy { color: var(--text-tertiary); font-size: 12px; line-height: 1.625; margin: 0; }
.pf-socials { display: flex; align-items: center; justify-content: center; gap: 14px; }
.pf-social {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: background .2s;
}
.pf-social:hover { background: var(--bg-hover); }
.pf-social img { width: 21px; height: 21px; object-fit: contain; }
.pf-footer-row--mobile { display: flex; flex-direction: column; align-items: center; gap: 12px; }
@media (min-width: 769px) { .pf-footer-row--mobile { display: none; } }

/* ===== Mobile drawer ===== */
.pf-drawer {
    display: none;
}
@media (max-width: 768px) {
    .pf-drawer { display: block; }
    .pf-drawer-backdrop {
        position: fixed;
        inset: 0;
        z-index: 40;
        background: rgba(0,0,0,.6);
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s ease;
    }
    .pf-drawer-panel {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 41;
        width: 264px;
        background: var(--bg-silder);
        padding: 16px 12px;
        transform: translateX(-100%);
        transition: transform .28s cubic-bezier(.22,1,.36,1);
        display: flex;
        flex-direction: column;
        box-shadow: 16px 0 40px rgba(0,0,0,.4);
    }
    .pf-drawer.is-open .pf-drawer-backdrop { opacity: 1; pointer-events: auto; }
    .pf-drawer.is-open .pf-drawer-panel { transform: translateX(0); }
    .pf-drawer-panel .pf-nav { flex: 0 0 auto; }
    .pf-drawer-back { display: inline-block; margin-top: 16px; color: var(--text-primary); font-size: 14px; font-weight: 500; text-decoration: none; }
    .pf-drawer-back:hover { color: #8d7cff; }
}

/* ===== Auth modal (mirrors real site) ===== */
.pf-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.pf-modal[hidden] { display: none; }
.pf-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
    animation: pf-fade-in .2s ease;
}
.pf-modal-dialog {
    position: relative;
    z-index: 1;
    width: 500px;
    max-width: 100%;
    background: rgb(25 25 25);
    border: 1px solid hsla(0,0%,100%,.2);
    border-radius: 16px;
    padding: 24px 36px 36px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,.25), 0 25px 40px rgba(0,0,0,.4);
    animation: pf-pop-in .24s cubic-bezier(.22,1,.36,1);
}
.pf-modal-dialog { max-height: 90vh; max-height: 90dvh; overflow-y: auto; }
@media (max-width: 768px) {
    .pf-modal-dialog { padding: 20px; }
}
@keyframes pf-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pf-pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.pf-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: hsla(0,0%,100%,.6);
    cursor: pointer;
    transition: background .2s, color .2s;
}
.pf-modal-close:hover { background: hsla(0,0%,100%,.05); color: #a1a1aa; }
.pf-modal-close svg { width: 20px; height: 20px; }
.pf-modal-head { display: flex; flex-direction: column; align-items: center; margin-bottom: 24px; }
.pf-modal-logo { height: 24px; width: auto; display: block; margin-bottom: 48px; }
.pf-modal-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.35;
    font-weight: 400;
    text-align: center;
    color: #fff;
}
/* ===== Announcement popup (compact, mirrors old-site size) ===== */
.pf-announce-dialog { width: 384px; max-width: 92vw; padding: 20px; }
.pf-announce-head { display: flex; align-items: center; margin-bottom: 12px; }
.pf-announce-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: hsla(0,0%,100%,.85);
}
.pf-announce-label::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent, rgb(77,61,222));
    box-shadow: 0 0 8px var(--accent, rgb(77,61,222));
}
.pf-announce-image { border-radius: 8px; overflow: hidden; margin-bottom: 12px; border: 1px solid hsla(0,0%,100%,.12); }
.pf-announce-image img { width: 100%; height: 56px; object-fit: cover; display: block; }
.pf-announce-body { display: flex; flex-direction: column; }
.pf-announce-msg {
    margin: 0 0 12px;
    padding: 12px 14px;
    background: rgba(0,0,0,.35);
    border: 1px solid hsla(0,0%,100%,.1);
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.6;
    color: hsla(0,0%,100%,.8);
    white-space: pre-line;
}
.pf-announce-note {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 0 0 12px;
    font-size: 10px;
    line-height: 1.5;
    color: hsla(0,0%,100%,.5);
}
.pf-announce-note svg { width: 13px; height: 13px; margin-top: 1px; color: rgb(251 191 36 / .7); flex-shrink: 0; }
.pf-announce-note strong { color: hsla(0,0%,100%,.7); font-weight: 500; }
.pf-announce-gotit {
    width: 100%;
    justify-content: center;
    padding: 9px 16px;
    font-family: Rubik, sans-serif;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: 11px;
    font-weight: 500;
}
.pf-auth-form { display: flex; flex-direction: column; }
.pf-auth-step { display: flex; flex-direction: column; }
.pf-auth-form[hidden],
.pf-auth-step[hidden] {
    display: none;
}
.pf-input-wrap { margin-bottom: 16px; }
.pf-pw-wrap { position: relative; display: block; }
.pf-pw-wrap input[type="password"],
.pf-pw-wrap input[type="text"] { padding-right: 44px; }
.pf-pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: hsla(0,0%,100%,.45);
    line-height: 1;
}
.pf-pw-toggle:hover { color: hsla(0,0%,100%,.85); }
.pf-pw-toggle--on { color: #4f7cff; }
.pf-input {
    width: 100%;
    padding: 13px 12px;
    background: rgba(0,0,0,.4);
    border: 1px solid transparent;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    transition: border-color .2s;
}
.pf-input::placeholder { color: hsla(0,0%,100%,.4); }
.pf-input:focus { outline: none; border-color: #8b5cf6; }
.pf-input--code { letter-spacing: .4em; font-weight: 600; text-align: center; }
.pf-form-error { margin: 0 0 12px; font-size: 13px; color: #ef4444; }
.pf-auth-btn {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 48px;
    border: 0;
    border-radius: 12px;
    background: rgb(77 61 222);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    font-family: Rubik, sans-serif;
    cursor: pointer;
    transition: filter .2s, background .2s, color .2s;
}
.pf-auth-btn:hover:not(:disabled) { filter: brightness(1.1); }
.pf-auth-btn:disabled {
    background: rgb(42 36 112);
    color: hsla(0,0%,100%,.6);
    cursor: not-allowed;
    filter: none;
}
.pf-consent {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
    font-family: Rubik, sans-serif;
    color: hsla(0,0%,100%,.4);
}
.pf-tip-link {
    border: 0;
    background: none;
    padding: 0;
    font-size: 12px;
    font-family: inherit;
    color: rgb(77 61 222);
    text-decoration: underline;
    cursor: pointer;
}
.pf-tip-link:disabled {
    color: hsla(0,0%,100%,.4);
    text-decoration: none;
    cursor: default;
}
.pf-consent-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 12px;
    line-height: 1.6;
    text-align: left;
    font-family: Rubik, sans-serif;
    color: hsla(0,0%,100%,.4);
}
.pf-consent-row label { margin: 0; }
.pf-consent-row[hidden],
.pf-consent[hidden] {
    display: none;
}
.pf-checkbox {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    margin-top: 1px;
    accent-color: rgb(77 61 222);
}
.pf-verify-hint { margin: 0 0 16px; font-size: 14px; line-height: 1.55; color: hsla(0,0%,100%,.4); }

/* ============================================================
   Xmax AI — Model page (clone of platform.xmax.ai/model)
   ============================================================ */
.pm-page { background: #171717; }

/* Desktop top bar */
.pm-desktop-head { padding: 16px 20px 16px 0; }
.pm-desktop-head-inner { justify-content: flex-end; gap: 12px; align-items: center; }
.pm-docs-link {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 300;
    line-height: 20px;
    text-decoration: none;
    cursor: pointer;
    transition: color .2s;
}
.pm-docs-link:hover { color: var(--text-secondary); }

.pm-scroll { overflow-y: auto; }
.pm-inner { display: flex; flex-direction: column; padding-bottom: 16px; }

/* Header */
.pm-model-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.pm-model-h2 {
    margin: 0;
    font-family: Rubik, sans-serif;
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
}
.pm-model-sub {
    margin: 6px 0 0;
    font-family: Rubik, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 1px;
    color: var(--text-tertiary);
}

/* Tabs + billing */
.pm-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid hsla(0,0%,100%,.2);
    margin-bottom: 24px;
}
.pm-tabs-list { display: flex; gap: 36px; }
.pm-tab {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 0 12px;
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color .2s;
}
.pm-tab img { width: 16px; height: 16px; object-fit: contain; }
.pm-tab:hover { color: var(--text-secondary); }
.pm-tab.is-active { color: var(--text-primary); }
.pm-tab.is-active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: -6px;
    right: -8px;
    height: 2px;
    background: #d5b9ff;
}
@supports (background: var(--border-selected)) {
    .pm-tab.is-active::after { background: var(--border-selected, #d5b9ff); }
}

.pm-billing { display: flex; align-items: center; }
.pm-billing-star { width: 16px; height: auto; }
.pm-billing-text { color: var(--text-tertiary); font-size: 14px; margin-left: 4px; }
.pm-billing-info { position: relative; margin-left: 8px; }
.pm-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    background: transparent;
    border: 0;
    color: inherit;
    opacity: .8;
    cursor: pointer;
    transition: opacity .2s;
}
.pm-info-btn:hover { opacity: 1; }
.pm-info-btn img { width: 14px; height: 14px; }

/* Tooltip */
.pf-tooltip {
    position: fixed;
    z-index: 200;
    min-width: 215px;
    max-width: 260px;
    padding: 10px 12px;
    background: rgba(23,23,23,.98);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,.45);
    font-family: Rubik, sans-serif;
    font-size: 12px;
    font-weight: 300;
    line-height: 18px;
    color: rgba(255,255,255,.6);
    pointer-events: none;
}
.pf-tooltip:not([hidden]) { animation: pf-fade-in .16s ease; }
.pf-tooltip strong { color: rgba(255,255,255,.9); font-weight: 600; }
.pf-tooltip::after {
    content: "";
    position: absolute;
    top: -6px;
    right: 12px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 7px solid rgba(255,255,255,.1);
}

/* Mode selector */
.pm-modes {
    display: flex;
    width: fit-content;
    max-width: 100%;
    margin: 20px auto 20px;
    gap: 4px;
    background: var(--bg-hover);
    border-radius: 12px;
    padding: 4px;
}
.pm-mode {
    padding: 8px 16px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    white-space: nowrap;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: background .2s, color .2s;
}
.pm-mode:hover { color: var(--text-secondary); }
.pm-mode.is-active { background: var(--bg-selected); color: var(--text-primary); }

/* MoX sub-mode + tips */
.pm-mox-sub { margin-bottom: 16px; }
.pm-mox-modes {
    display: flex;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    gap: 4px;
    background: var(--bg-hover);
    border-radius: 12px;
    padding: 4px;
}
.pm-mox-mode {
    padding: 8px 16px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    white-space: nowrap;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: background .2s, color .2s;
}
.pm-mox-mode:hover { color: var(--text-secondary); }
.pm-mox-mode.is-active { background: var(--bg-selected); color: var(--text-primary); }
.pm-tips {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    margin-top: -8px;
    font-family: Rubik, sans-serif;
    font-size: 14px;
    font-weight: 300;
    line-height: 18px;
    color: rgba(255,255,255,.6);
}
.pm-tips-label { font-weight: 500; }
.pm-mox-sub[hidden] { display: none; }

/* Playground grid */
.pm-grid { display: flex; gap: 24px; }
.pm-card {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 16px 16px 8px;
    border: 1px solid hsla(0,0%,100%,.2);
    border-radius: 12px;
}
.pm-input-card { position: relative; z-index: 1; overflow: visible; }
.pm-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    margin-bottom: 6px;
    padding-left: 4px;
}
.pm-card-head span { color: var(--text-primary); font-size: 14px; }
.pm-output-controls { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pm-stop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 26px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: rgba(239, 68, 68, .18);
    color: #fca5a5;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.pm-stop-btn:hover { background: rgba(239, 68, 68, .32); color: #fecaca; }
.pm-stop-btn:disabled { opacity: .45; cursor: not-allowed; }
.pm-stop-btn.is-active { background: rgba(239, 68, 68, .45); color: #fff; }
.pm-stop-btn[hidden] { display: none; }
.pm-output-busy {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px;
    background: rgba(10, 10, 14, .55);
    border-radius: 8px;
}
.pm-output-busy[hidden] { display: none; }
.pm-spinner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.2);
    border-top-color: rgba(255,255,255,.95);
    animation: pm-spin 1s linear infinite;
    flex-shrink: 0;
}
@keyframes pm-spin { to { transform: rotate(360deg); } }
.pm-output-busy-tip {
    margin: 0;
    max-width: 320px;
    color: rgba(255,255,255,.85);
    font-size: 12px;
    text-align: center;
    line-height: 1.5;
}
.pm-live-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
    backdrop-filter: blur(4px);
}
.pm-live-badge[hidden] { display: none; }
.pm-output-controls .pm-live-badge { position: static; background: rgba(239,68,68,.15); color: #fca5a5; }
.pm-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239,68,68,.6);
    animation: pm-pulse 1.4s infinite;
}
@keyframes pm-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239,68,68,.6); }
    70% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
    100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
.pm-media {
    position: relative;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-hover);
    aspect-ratio: 16 / 9;
    min-height: 0;
}
.pm-media-inner { position: absolute; inset: 0; }
.pm-local-render { position: absolute; inset: 0; z-index: 2; }
.pm-local-render[hidden] { display: none; }
.pm-remote-render { position: absolute; inset: 0; z-index: 2; }
.pm-remote-render[hidden] { display: none; }
.pm-empty {
    display: flex;
    height: 100%;
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 clamp(.5rem, 1.5vw, 1.5rem);
    transform: scale(.95);
}
.pm-empty[hidden] { display: none; }
.pm-empty-p {
    margin: 0 0 clamp(.625rem, 1.4vw, 1.5rem);
    color: var(--text-tertiary);
    font-size: clamp(.6875rem, 1.1vw, 1rem);
    text-align: center;
}
.pm-empty-btns { display: flex; gap: clamp(.375rem, .8vw, .875rem); flex-wrap: wrap; justify-content: center; }
.pm-media-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(.25rem, .5vw, .625rem);
    height: clamp(1.75rem, 3.4vw, 2.75rem);
    padding: 0 clamp(.5rem, 1vw, 1rem);
    border: 0;
    border-radius: clamp(.375rem, .65vw, .75rem);
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: clamp(.625rem, 1vw, .875rem);
    white-space: nowrap;
    cursor: pointer;
    transition: background .2s, color .2s, opacity .2s;
}
.pm-media-btn:hover { background: hsla(0,0%,100%,.2); }
.pm-media-btn:disabled { opacity: .5; }
.pm-media-btn svg {
    width: clamp(.75rem, 1.2vw, 1.25rem);
    height: clamp(.75rem, 1.2vw, 1.25rem);
    flex-shrink: 0;
}
.pm-divider {
    display: flex;
    align-items: center;
    gap: clamp(.5rem, 1vw, 1rem);
    width: clamp(11.25rem, 52vw, 20rem);
    max-width: 100%;
    margin: clamp(.5rem, 1.4vw, 1.5rem) auto 0;
}
.pm-divider-line { height: .5px; min-width: 16px; flex: 1; background: hsla(0,0%,100%,.2); }
.pm-divider span {
    color: var(--text-tertiary);
    font-size: clamp(.625rem, .9vw, .875rem);
    white-space: nowrap;
}
.pm-builtins {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 380px;
    margin: 16px auto 0;
}
.pm-builtin {
    position: relative;
    display: inline-flex;
    height: 67.5px;
    min-width: 0;
    max-width: 33%;
    padding: 0;
    border: 0;
    appearance: none;
    overflow: hidden;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    transition: opacity .2s;
}
.pm-builtin:hover { opacity: .8; }
.pm-builtin img { display: block; height: 100%; width: auto; max-width: none; }

/* output overlay demos */
.pm-mox-demo, .pm-dimx-demo {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    min-height: 0;
    align-items: center;
    justify-content: center;
    padding: 8px;
}
.pm-mox-demo[hidden], .pm-dimx-demo[hidden] { display: none; }
.pm-mox-demo.pm-got, .pm-dimx-demo.pm-got { display: none; }
.pm-mox-demo-dark {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    pointer-events: none;
}
.pm-mox-demo-inner {
    position: relative;
    z-index: 10;
    display: flex;
    max-width: 100%;
    max-height: 100%;
    min-height: 0;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    pointer-events: auto;
}
.pm-mox-demo-video {
    position: relative;
    width: fit-content;
    max-width: 100%;
    overflow: hidden;
    height: 125px;
    max-height: 100%;
    border-radius: 4px;
}
.pm-mox-demo-video video { display: block; height: 100%; width: auto; max-width: none; border-radius: 4px; }
.pm-mox-demo-tags {
    position: absolute;
    inset: 0;
    display: flex;
    pointer-events: none;
}
.pm-mox-demo-tags > span {
    position: absolute;
    top: 4px;
    left: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 4px;
    border-radius: 4px;
    background: rgba(0,0,0,.5);
    color: #fff;
    font-size: 12px;
    line-height: 18px;
}
.pm-mox-demo-tags > span:last-child { left: auto; right: 4px; }

/* dimx example slide */
.pm-dimx-slides { width: fit-content; max-width: 100%; overflow: hidden; touch-action: pan-y; }
.pm-dimx-slide {
    display: none;
    width: fit-content;
    max-width: 100%;
    height: 125px;
    max-height: 100%;
}
.pm-dimx-slide.is-active { display: flex; }
.pm-example-pair {
    position: relative;
    height: 100%;
    flex-shrink: 0;
    overflow: hidden;
}
.pm-example-pair img { display: block; height: 100%; width: auto; max-width: none; }
.pm-example-tag {
    position: absolute;
    top: 4px;
    left: 4px;
    display: flex;
    align-items: center;
    gap: 2px;
    color: #fff;
    font-size: 9px;
    line-height: 1;
}
.pm-example-tag img { width: 12px; height: 12px; flex-shrink: 0; }
.pm-slide-dots { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 8px; }
.pm-slide-dots button {
    width: 4px;
    height: 4px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--text-tertiary);
    cursor: pointer;
    transition: background .2s;
}
.pm-slide-dots button.is-active { background: var(--text-primary); }
.pm-demo-tips {
    margin: 8px 0 0;
    color: rgba(255,255,255,.6);
    font-family: Rubik, sans-serif;
    font-size: 12px;
    font-weight: 300;
    line-height: 16px;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pm-demo-tips span { font-weight: 500; }
.pm-got-it {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    min-width: 72px;
    margin-top: 12px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: rgba(255,255,255,.1);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: background .2s;
}
.pm-got-it:hover { background: rgba(255,255,255,.18); }

/* Preset picker */
.pm-presets {
    display: flex;
    gap: 10px;
    width: fit-content;
    min-width: 0;
    max-width: 100%;
    margin: 0 auto 16px;
}
.pm-preset-scroll[hidden] { display: none; }
.pm-preset-scroll { position: relative; display: flex; flex: 1; min-width: 0; }
.pm-preset-fade {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 10;
    width: 23px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(23,23,23,.9));
}
.pm-preset-row {
    display: flex;
    flex: 1;
    min-width: 0;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    cursor: grab;
}
.pm-preset-row::-webkit-scrollbar { display: none; width: 0; height: 0; }
.pm-chip {
    position: relative;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-hover);
    animation: pm-rise .5s both;
}
@keyframes pm-rise {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}
.pm-chip button {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.pm-chip img {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
    border-radius: 9px;
}
.pm-chip-border {
    position: absolute;
    inset: 0;
    border: 1.5px solid transparent;
    border-radius: 10px;
    pointer-events: none;
    transition: border-color .2s;
}
.pm-chip:hover .pm-chip-border { border-color: var(--bg-hover); }
.pm-chip.is-selected .pm-chip-border { border-color: #b8b8ff; }
.pm-chip-check {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 20;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--bg-btnprimary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.pm-chip-check[hidden] { display: none; }
.pm-chip-check svg { width: 8px; height: 8px; color: var(--text-primary); }
.pm-ref {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 1px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--bg-hover);
    cursor: pointer;
    transition: border-color .2s;
}
.pm-ref:hover { border-color: #b8b8ff; }
.pm-ref svg { width: 20px; height: 20px; color: var(--text-tertiary); }
.pm-ref span { margin-top: 2px; color: var(--text-tertiary); font-size: 12px; line-height: 1.2; white-space: nowrap; }
.pm-ref[hidden] { display: none; }
.pm-ref.has-ref { border-color: #8b5cf6; background: rgba(139, 92, 246, .12); }
.pm-ref-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
    border-radius: 9px;
    z-index: 1;
}

/* Studio-style controls (prompt + start) */
.pm-studio-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.pm-prompt-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    padding: 0 14px;
    border: 1px solid hsla(0,0%,100%,.14);
    border-radius: 10px;
    background: var(--bg-hover);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .2s, background .2s;
}
.pm-prompt-input::placeholder { color: var(--text-tertiary); }
.pm-prompt-input:focus { border-color: #8b5cf6; background: rgba(139,92,246,.06); }
.pm-studio-start {
    flex-shrink: 0;
    height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 10px;
    background: var(--bg-btnprimary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: filter .2s, opacity .2s;
}
.pm-studio-start:hover { filter: brightness(1.08); }
.pm-studio-start:disabled { opacity: .55; cursor: not-allowed; }
.pm-studio-start svg { width: 18px; height: 18px; }

/* Mode-specific chip groups */
.pm-chip-group { display: flex; gap: 10px; }
.pm-chip-group[hidden] { display: none; }

/* Input empty state (original design) */
.pm-input-empty-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0 clamp(.5rem, 1.5vw, 1.5rem);
    transform: scale(.95);
}
.pm-select-media {
    margin: 0 0 clamp(.625rem, 1.4vw, 1.5rem);
    color: var(--text-tertiary);
    font-size: clamp(.6875rem, 1.1vw, 1rem);
    text-align: center;
}
.pm-input-btns { display: flex; gap: clamp(.375rem, .8vw, .875rem); flex-wrap: wrap; justify-content: center; }
.pm-or-start {
    margin-top: clamp(.5rem, 1vw, 1.5rem);
    display: flex;
    align-items: center;
    gap: clamp(.5rem, 1vw, 1rem);
    width: clamp(11.25rem, 20vw, 20rem);
    max-width: 100%;
}
.pm-or-line { height: .5px; min-width: 1rem; flex: 1; background: var(--bg-border-link, rgba(255,255,255,.15)); }
.pm-or-start span { color: var(--text-tertiary); font-size: clamp(.625rem, .9vw, .875rem); white-space: nowrap; }
.pm-builtin-row {
    margin-top: clamp(.5rem, .9vw, 1rem);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .625rem;
}
.pm-builtin {
    position: relative;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    display: inline-block;
    height: 67.5px;
    min-width: 0;
    max-width: 33%;
    overflow: hidden;
    border-radius: 4px;
    appearance: none;
    transition: opacity .2s;
}
.pm-builtin:hover { opacity: .8; }
.pm-builtin img { display: block; height: 100%; width: auto; max-width: none; }

/* Reference upload loading */
.pm-ref { position: relative; overflow: hidden; }
.pm-ref .pm-ref-load,
.pm-chip .pm-chip-load {
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: 2px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .28);
    overflow: hidden;
    z-index: 20;
}
.pm-ref .pm-ref-load::after,
.pm-chip .pm-chip-load::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 45%;
    border-radius: 2px;
    background: linear-gradient(90deg, #8b5cf6, #c4b5fd);
    animation: pm-ref-load 1.1s ease-in-out infinite;
}
@keyframes pm-ref-load {
    0% { left: -45%; }
    100% { left: 105%; }
}
.pm-chip.is-loading img { filter: brightness(.8); }
.pm-chip.is-loading .pm-chip-border { border-color: #8b5cf6; }

/* API tab */
.pm-api-card {
    position: relative;
    overflow: hidden;
    background: var(--bg-code);
    border: 1px solid hsla(0,0%,100%,.2);
    border-radius: 16px;
}
.pm-api-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px 8px 16px;
    border-bottom: 1px solid hsla(0,0%,100%,.2);
}
.pm-api-lang {
    font-size: 12px;
    color: var(--text-tertiary);
    letter-spacing: .5px;
}
.pm-api-code {
    height: auto;
    max-height: 480px;
    padding: 12px 0;
    background: var(--bg-code);
}
.pm-api-code pre { min-width: 100%; width: max-content; white-space: pre; }
.pm-api-code pre[hidden] { display: none; }
.pm-api-code pre code { display: block; }

/* file inputs */
.pm-file-input {
    position: fixed;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

/* responsive */
@media (max-width: 768px) {
    .pm-tabs-list { gap: 16px; }
    .pm-tab { font-size: 13px; }
    .pm-billing-text { font-size: 13px; }
    .pm-grid { flex-direction: column; gap: 16px; }
    .pm-modes { flex-wrap: wrap; justify-content: center; }
    .pm-mode { font-size: 13px; padding: 8px 12px; }
    .pm-mox-demo-video, .pm-dimx-slide { height: 100px; }
    .pm-api-code { max-height: 380px; }
}

/* ===== Logged-in account ===== */
.pf-account { position: relative; margin-left: 4px; }
.pf-avatar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background .2s;
}
.pf-avatar-btn:hover { background: var(--bg-tertiary); }
.pf-avatar-btn .pf-chev { width: 14px; height: 14px; color: var(--text-tertiary); }
.pf-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-btnprimary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}
.pf-account-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--bg-silder);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 20px 40px rgba(0,0,0,.4);
    animation: pf-pop-in .18s ease;
}
.pf-account-name {
    display: block;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pf-account-item {
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .2s;
}
.pf-account-item:hover { background: var(--bg-hover); }

/* ============================================================
   Signed-in header (credits pill + avatar menu)
   ============================================================ */
.pf-credits {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    margin-top: 1px;
    padding: 4px 14px 4px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-hover);
    text-decoration: none;
    transition: background .2s;
}
.pf-credits:hover { background: var(--bg-tertiary); }
.pf-credits img { width: 16px; height: 16px; -o-object-fit: contain; object-fit: contain; }
.pf-credits span { color: var(--text-primary); font-size: 15px; font-weight: 500; line-height: 1; }

.pf-avatar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background .2s;
}
.pf-avatar-btn:hover { background: transparent; }
.pf-avatar-btn .pf-avatar--lg { width: 36px; height: 36px; }
.pf-avatar-btn:hover .pf-avatar--lg { box-shadow: 0 0 0 2px var(--border); }
.pf-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-btnprimary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}
.pf-avatar--lg {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-avatar);
    color: #fff;
    font-family: Rubik, sans-serif;
    font-size: 16px;
    font-weight: 600;
}
.pf-avatar-btn .pf-chev { width: 14px; height: 14px; color: var(--text-tertiary); }
.pf-arrow-icon { width: 8px; height: auto; flex-shrink: 0; }

.pf-account-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
width: 320px;
    max-width: calc(100vw - 24px);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,.5);
    animation: pf-pop-in .18s ease;
}
.pf-account-menu[hidden] { display: none; }
.pf-account-notifs { border-top: 1px solid var(--border); }
.pf-account-notifs-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 4px;
}
.pf-account-notifs-head > span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
}
.pf-account-notifs-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    margin-left: 6px;
    padding: 0 4px;
    border-radius: 8px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: none;
}
.pf-account-notifs-count[hidden] { display: none; }
.pf-account-notifs-readall {
    border: 0;
    background: none;
    padding: 0;
    color: #2dd4bf;
    font-size: 12px;
    cursor: pointer;
}
.pf-account-notifs-readall:hover { text-decoration: underline; }
.pf-account-notifs-list { overflow-y: auto; max-height: 220px; padding: 4px 0; }
.pf-account-notifs-empty {
    margin: 0;
    padding: 14px 16px;
    color: var(--text-tertiary);
    font-size: 13px;
    text-align: center;
}
.pf-account-notif {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.pf-account-notif:last-child { border-bottom: 0; }
.pf-account-notif.is-unread { background: rgba(45,212,191,.05); }
.pf-account-notif-title {
    margin: 0 0 2px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
}
.pf-account-notif-msg {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 12px;
    line-height: 1.45;
}
.pf-account-notif-time {
    margin: 4px 0 0;
    color: var(--text-tertiary);
    font-size: 11px;
}
.pf-account-menu-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}
.pf-account-menu-id { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.pf-account-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pf-account-mail {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 13px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pf-account-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 14px 16px;
    border: 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s;
}
.pf-account-row:hover { background: var(--bg-hover); }
.pf-account-row-val { margin-left: 2px; color: var(--text-primary); font-weight: 500; }
.pf-account-row--signout { color: var(--error); }
.pf-account-row--signout:hover { background: var(--bg-hover); }
.pf-account-row--signout svg { width: 16px; height: 16px; flex-shrink: 0; }
.pf-account-row--signout span { font-size: 15px; font-weight: 500; }

.pf-head-right .pf-credits + .pf-account { margin-left: 12px; }

/* ============================================================
   Dashboard pages shared (API Keys / Usage / Credits)
   ============================================================ */
.pf-page-title { margin: 0; font-family: Rubik, sans-serif; font-size: 20px; font-weight: 500; color: var(--text-primary); }
.pf-page-sub {
    margin: 6px 0 0;
    font-family: Rubik, sans-serif;
    font-size: 14px;
    letter-spacing: 1px;
    line-height: 1.5;
    color: var(--text-tertiary);
}
.pf-page-sub--mob { display: none; }
@media (max-width: 768px) {
    .pf-page-sub--desk { display: none; }
    .pf-page-sub--mob { display: block; font-size: 12px; }
    .pf-page-sub--mob span { display: block; }
}
.pf-pill-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    flex-shrink: 0;
    padding: 8px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--bg-btnprimary);
    color: var(--text-primary);
    font-family: Rubik, sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: filter .2s, opacity .2s;
}
.pf-pill-btn:hover { filter: brightness(1.12); }
.pf-pill-btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.pf-pill-btn img { width: 10px; height: auto; }
@media (max-width: 768px) {
    .pf-pill-btn { font-size: 12px; gap: 6px; padding: 6px 12px; }
}

/* ============================================================
   API Keys page
   ============================================================ */
.pak-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 24px;
}
.pak-head > div { min-width: 0; }
.pak-table-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.pak-table-scroll { overflow-x: auto; }
.pak-table { width: 100%; min-width: 640px; border-collapse: collapse; }
.pak-table thead { border-bottom: 1px solid var(--border); }
.pak-table th {
    padding: 12px 24px;
    text-align: left;
    font-family: Rubik, sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    width: 25%;
}
.pak-table th.pak-th-key { width: auto; min-width: 208px; }
.pak-table th.pak-th-actions {
    width: 120px;
    min-width: 120px;
    text-align: right;
    padding-right: 24px;
}
.pak-table tbody tr { transition: background .2s; }
.pak-table tbody tr:hover { background: var(--bg-hover); }
.pak-table td {
    padding: 16px 24px;
    vertical-align: middle;
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
}
.pak-key-name { color: var(--text-primary); font-size: 14px; }
.pak-secret { display: flex; align-items: center; }
.pak-created { color: var(--text-tertiary); font-size: 14px; }
.pak-actions { text-align: right; }
.pak-actions-inner { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.pak-round-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border: 0;
    border-radius: 999px;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: background .2s;
}
.pak-round-btn:hover { background: rgba(255,255,255,.18); }
.pak-round-btn img { width: 16px; height: 16px; }
.pak-round-btn--del { background: var(--del); opacity: .9; }
.pak-round-btn--del:hover { background: var(--del); opacity: 1; }
.pak-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
}
.pak-pager-btns { display: flex; align-items: center; gap: 8px; }
.pak-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}
.pak-page-btn:hover:not(:disabled) { background: var(--bg-tertiary); }
.pak-page-btn:disabled { opacity: .5; cursor: not-allowed; }
.pak-page-btn svg { width: 16px; height: 16px; color: var(--text-tertiary); }
.pak-page-btn--active {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--text-primary);
    font-weight: 500;
    cursor: default;
}
.pak-pager-info { color: rgba(255,255,255,.8); font-size: 13px; }
@media (max-width: 768px) {
    .pak-table th { padding: 8px 12px; }
    .pak-table td { padding: 10px 12px; }
    .pak-table th.pak-th-actions { padding-right: 12px; }
    .pak-actions-inner { gap: 6px; }
}

/* Create API Key modal */
.pak-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0,0,0,.8);
    animation: pf-fade-in .18s ease;
}
.pak-modal[hidden] { display: none; }
.pak-modal-dialog {
    position: relative;
    z-index: 1;
    width: 520px;
    max-width: 100%;
    background: var(--bg-modal);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 32px 32px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,.5);
    animation: pf-pop-in .24s cubic-bezier(.22,1,.36,1);
}
@media (max-width: 768px) { .pak-modal { padding: 16px; } .pak-modal-dialog { padding: 24px 20px; } }
.pak-modal-title { margin: 0 0 20px; font-family: Rubik, sans-serif; font-size: 22px; font-weight: 500; color: var(--text-primary); }
.pak-modal-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}
.pak-modal-label em { color: var(--error); font-style: normal; }
.pak-modal-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,.4);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    transition: border-color .2s;
}
.pak-modal-input::placeholder { color: rgba(255,255,255,.4); }
.pak-modal-input:focus { outline: none; border-color: var(--accent); }
.pak-modal-actions { display: flex; align-items: center; gap: 12px; margin-top: 24px; }
.pak-modal-actions .pf-pill-btn { flex: 1; }
.pak-modal-cancel {
    flex: 1;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-primary);
    font-family: Rubik, sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s;
}
.pak-modal-cancel:hover { background: var(--bg-hover); }

/* ============================================================
   Usage page
   ============================================================ */
.pus-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
}
.pus-balance { text-align: right; }
.pus-balance-label { margin: 0 0 6px; font-family: Rubik, sans-serif; font-size: 14px; color: var(--text-tertiary); }
.pus-balance-val {
    margin: 0;
    font-family: Rubik, sans-serif;
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 24px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.pus-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.pus-select { position: relative; display: inline-block; }
.pus-select-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 112px;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-hover);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s;
}
.pus-select-btn:hover { background: var(--bg-tertiary); }
.pus-select-btn svg { width: 16px; height: 16px; color: var(--text-tertiary); transition: transform .2s; }
.pus-select.is-open .pus-select-btn svg { transform: rotate(180deg); }
.pus-select-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 40;
    width: 100%;
    padding: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0,0,0,.4);
    animation: pf-pop-in .16s ease;
}
.pus-select-menu[hidden] { display: none; }
.pus-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 2px 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background .2s;
}
.pus-option:hover { background: var(--bg-hover); }
.pus-option svg { width: 16px; height: 16px; color: var(--text-secondary); }
.pus-option[hidden] { display: none; }
.pus-hint { margin: 0; font-family: Rubik, sans-serif; font-size: 14px; color: var(--text-tertiary); }
@media (max-width: 768px) { .pus-hint { font-size: 13px; } }
.pus-chart-card {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 52px 96px;
}
.pus-chart-card svg { display: block; width: 100%; height: 300px; }
@media (max-width: 768px) { .pus-chart-card { padding: 12px; } }

.pus-history { margin-top: 28px; }
.pus-history-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pus-history-rate { font-family: Rubik, sans-serif; font-size: 14px; color: var(--text-tertiary); }
.pus-history-list { display: flex; flex-direction: column; gap: 8px; }
.pus-history-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--bg-hover); border: 1px solid var(--border); border-radius: 10px;
    padding: 14px 18px;
}
.pus-history-row:hover { background: var(--bg-tertiary); }
.pus-history-main { min-width: 0; }
.pus-history-title { margin: 0 0 3px; font-family: Rubik, sans-serif; font-size: 14px; color: var(--text-primary); word-break: break-word; }
.pus-history-date { margin: 0; font-size: 12px; color: var(--text-tertiary); }
.pus-history-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.pus-empty { padding: 40px 20px; text-align: center; font-size: 14px; color: var(--text-tertiary); border: 1px dashed var(--border); border-radius: 10px; }

.pus-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.pus-summary-item { background: var(--bg-hover); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.pus-summary-label { margin: 0 0 6px; font-size: 12px; color: var(--text-tertiary); }
.pus-summary-val { margin: 0; font-family: Rubik, sans-serif; font-size: 24px; font-weight: 700; color: var(--text-primary); }
.pus-summary-unit { font-size: 13px; font-weight: 500; color: var(--text-tertiary); }
@media (max-width: 600px) { .pus-summary { grid-template-columns: 1fr; } }

.pus-history-charge { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.pus-charge-label { font-size: 11px; color: var(--text-tertiary); }
.pus-history-amt { font-family: Rubik, sans-serif; font-size: 16px; font-weight: 600; color: #fca5a5; }
.pus-history-debit {
    font-size: 12px; padding: 3px 9px; border-radius: 999px;
    background: rgba(248, 113, 113, .14); color: #fca5a5;
}

/* ============================================================
   Credits page
   ============================================================ */
.pcr-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.pcr-balance { text-align: right; }
.pcr-balance-label { margin: 0 0 6px; font-family: Rubik, sans-serif; font-size: 14px; color: var(--text-tertiary); }
.pcr-balance-val {
    margin: 0;
    font-family: Rubik, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 24px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.pcr-card {
    background: var(--bg-modal);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}
.pcr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 180px));
    gap: 30px;
    justify-content: flex-start;
    margin-bottom: 24px;
}
.pcr-pack {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-pay);
    color: var(--text-primary);
    font-family: Rubik, sans-serif;
    text-align: center;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}
.pcr-pack:hover { background: var(--bg-hover); }
.pcr-pack.is-active { border-color: rgba(255,255,255,.9); box-shadow: 0 0 0 2px rgba(255,255,255,.9); }
.pcr-pack-star {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    margin-bottom: 16px;
    border-radius: 999px;
    background: var(--border);
}
.pcr-pack-star img { width: 20px; height: 20px; -o-object-fit: contain; object-fit: contain; }
.pcr-pack-body { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; width: 100%; }
.pcr-pack-value { margin: 0 0 4px; font-size: 18px; line-height: 20px; color: var(--text-primary); }
.pcr-pack-label { margin: 0; font-size: 11px; line-height: 14px; color: var(--text-tertiary); }
.pcr-pack-price {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 32px;
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-hover);
    color: var(--text-primary);
    font-size: 12px;
}
.pcr-buy {
    width: 100%;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: var(--bg-btnprimary);
    color: var(--text-primary);
    font-family: Rubik, sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: filter .2s;
}
.pcr-buy:hover { filter: brightness(1.12); }
.pcr-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.pcr-history-head h2 { margin: 0; }
.pcr-invoice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s;
}
.pcr-invoice:hover { background: var(--bg-hover); }
.pcr-invoice img { width: 12px; height: auto; }
.pcr-empty { text-align: center; font-size: 14px; color: var(--text-tertiary); }
@media (max-width: 768px) {
    .pcr-card { padding: 12px; }
    .pcr-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
    .pcr-pack { padding: 12px 8px; justify-content: space-between; aspect-ratio: 134/146; }
    .pcr-pack-star { width: 24px; height: 24px; margin-bottom: 0; }
    .pcr-pack-star img { width: 16px; height: 16px; }
    .pcr-pack-value { font-size: 14px; margin: 0 0 2px; }
    .pcr-pack-price { height: 24px; margin-top: 0; font-size: 11px; }
}
.pf-login-wall {
    max-width: 520px;
    margin: 0 auto;
    padding: 48px 24px 64px;
    text-align: center;
}
.pf-login-wall-title { margin: 0 0 8px; font-size: 22px; font-weight: 400; color: #fff; }
.pf-login-wall-desc { margin: 0 0 24px; font-size: 14px; color: var(--text-tertiary, #a1a1aa); }
.pf-login-wall .pf-auth-btn { width: 100%; max-width: 320px; margin: 0 auto; }
.pf-login-wall-tip { margin-top: 16px; font-size: 13px; color: var(--text-tertiary, #a1a1aa); }

.pcr-purchase {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface, #171717);
    border: 1px solid var(--border, #27272a);
    border-radius: 12px;
    margin-bottom: 10px;
}
.pcr-purchase-main { display: flex; flex-direction: column; gap: 2px; }
.pcr-purchase-title { margin: 0; font-size: 14px; color: var(--text-primary, #fff); }
.pcr-purchase-date { margin: 0; font-size: 12px; color: var(--text-tertiary, #a1a1aa); }
.pcr-purchase-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.pcr-purchase-amt { margin: 0; font-size: 14px; font-weight: 600; color: #2dd4bf; }
.pcr-purchase-ok { font-size: 12px; }
.pcr-purchase-ok--approved { color: var(--text-tertiary, #a1a1aa); }
.pcr-purchase-ok--pending { color: #eab308; }
.pcr-purchase-ok--declined { color: #ef4444; }

.pcr-method { display: flex; gap: 12px; margin: 20px 0 4px; flex-wrap: wrap; }
.pcr-method-opt { cursor: pointer; flex: 1 1 200px; }
.pcr-method-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pcr-method-box { display: flex; align-items: center; justify-content: center; padding: 14px 16px; border: 1px solid var(--border, #27272a); border-radius: 14px; background: rgba(255,255,255,.02); transition: border-color .15s, background .15s; }
.pcr-method-opt input:checked + .pcr-method-box { border-color: #2dd4bf; background: rgba(45,212,191,.08); }
.pcr-method-name { font-family: Rubik, sans-serif; font-size: 14px; font-weight: 500; color: var(--text-primary, #fff); }

.pcr-buy { margin-top: 20px; }

.pcr-modal-backdrop { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,.6); z-index: 200; opacity: 0; pointer-events: none; transition: opacity .2s; }
.pcr-modal-backdrop.is-open { opacity: 1; pointer-events: auto; }
.pcr-modal { position: relative; width: 100%; max-width: 460px; background: var(--bg-card, #18181b); border: 1px solid var(--border, #27272a); border-radius: 20px; padding: 28px; }
.pcr-modal-close { position: absolute; top: 14px; right: 16px; background: none; border: 0; font-size: 26px; line-height: 1; color: var(--text-tertiary, #a1a1aa); cursor: pointer; }
.pcr-modal-title { margin: 0 0 6px; font-family: Rubik, sans-serif; font-size: 18px; color: var(--text-primary, #fff); }
.pcr-modal-sub { margin: 0 0 18px; font-size: 13px; color: var(--text-tertiary, #a1a1aa); }
.pcr-bank-details { display: grid; gap: 6px; padding: 14px 16px; border-radius: 12px; background: rgba(45,212,191,.06); border: 1px solid rgba(45,212,191,.2); margin-bottom: 18px; }
.pcr-bank-line { margin: 0; font-size: 13px; color: var(--text-tertiary, #a1a1aa); display: flex; justify-content: space-between; gap: 10px; }
.pcr-bank-line strong { color: var(--text-primary, #fff); }
.pcr-field { display: grid; gap: 6px; margin-bottom: 16px; }
.pcr-field span { font-size: 13px; color: var(--text-tertiary, #a1a1aa); }
.pcr-field input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border, #27272a); background: rgba(255,255,255,.03); color: var(--text-primary, #fff); font-size: 14px; }
.pcr-field input[type="file"] { padding: 10px; }
.pcr-bank-ref-hint { margin: 0 0 16px; font-size: 12px; color: #eab308; }
.pcr-bank-submit { width: 100%; padding: 13px; border-radius: 12px; border: 0; background: #2dd4bf; color: #062a26; font-family: Rubik, sans-serif; font-weight: 600; font-size: 15px; cursor: pointer; }
.pcr-bank-note { margin: 14px 0 0; font-size: 12px; color: var(--text-tertiary, #a1a1aa); text-align: center; }

/* Payment method popup — mirrors the legacy checkout modal (centered head + info box + stacked buttons) */
.pcr-pay-modal { padding: 28px 24px 20px; max-width: 400px; }
.pcr-pay-head { text-align: center; margin-bottom: 20px; }
.pcr-pay-icon {
    width: 44px; height: 44px;
    margin: 0 auto 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(45,212,191,.18), rgba(59,130,246,.16));
    display: flex; align-items: center; justify-content: center;
}
.pcr-pay-icon img { width: 24px; height: 24px; object-fit: contain; }
.pcr-pay-name { margin: 0 0 4px; font-family: Rubik, sans-serif; font-size: 18px; font-weight: 600; color: var(--text-primary, #fff); }
.pcr-pay-coins { margin: 6px 0 10px; }
.pcr-pay-coins-num {
    font-family: Rubik, sans-serif; font-size: 40px; font-weight: 800; line-height: 1;
    background: linear-gradient(90deg, #2dd4bf, #60a5fa);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.pcr-pay-coins-label { display: block; margin-top: 2px; font-size: 12px; color: var(--text-tertiary, #a1a1aa); }
.pcr-pay-price {
    display: inline-flex; align-items: baseline; gap: 4px;
    background: rgba(255,255,255,.04); border: 1px solid var(--border, #27272a);
    border-radius: 10px; padding: 8px 14px;
}
.pcr-pay-price-sym { font-size: 12px; color: var(--text-tertiary, #a1a1aa); font-weight: 500; }
.pcr-pay-price-num { font-size: 18px; font-weight: 700; color: var(--text-primary, #fff); }

.pcr-pay-box { background: rgba(255,255,255,.02); border: 1px solid var(--border, #27272a); border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.pcr-pay-box-label { font-size: 11px; font-weight: 600; color: var(--text-tertiary, #a1a1aa); text-align: center; margin-bottom: 10px; }
.pcr-pay-methods { display: grid; gap: 8px; }
.pcr-pay-method {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 12px 14px;
    border: 1px solid var(--border, #27272a); border-radius: 10px;
    background: rgba(255,255,255,.03);
    color: var(--text-primary, #fff);
    font-family: Rubik, sans-serif; text-align: left; cursor: pointer;
    transition: border-color .15s, background .15s;
}
.pcr-pay-method:hover { border-color: #2dd4bf; background: rgba(45,212,191,.08); }
.pcr-pay-method-ico {
    width: 34px; height: 34px; flex-shrink: 0;
    border-radius: 9px; display: flex; align-items: center; justify-content: center;
    background: rgba(45,212,191,.12); color: #2dd4bf;
}
.pcr-pay-method--bank .pcr-pay-method-ico { background: rgba(59,130,246,.12); color: #60a5fa; }
.pcr-pay-method-svg { width: 18px; height: 18px; }
.pcr-pay-method-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pcr-pay-method-name { font-size: 14px; font-weight: 500; }
.pcr-pay-method-sub { font-size: 12px; color: var(--text-tertiary, #a1a1aa); }

.pcr-pay-cancel-link {
    display: block; width: 100%;
    padding: 4px 0; background: transparent; border: 0; cursor: pointer;
    font-family: Rubik, sans-serif; font-size: 11px; letter-spacing: .08em;
    text-transform: uppercase; color: var(--text-tertiary, #a1a1aa);
    transition: color .15s;
}
.pcr-pay-cancel-link:hover { color: var(--text-primary, #fff); }

.pcr-empty-note { margin-top: 10px; font-size: 12px; color: var(--text-tertiary, #a1a1aa); text-align: center; }
