/* ============================================
   master.css — Pixlr site-wide layout & sidebar
   ============================================ */

:root {
    --sidebar-full: 240px;
    --sidebar-mini: 64px;
    --sidebar-width: var(--sidebar-full);
    --sidebar-transition: 0.2s ease;
}

* {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-touch-callout: none !important;
    box-sizing: border-box;

    overscroll-behavior-x: none;
    touch-action: manipulation;
    vertical-align: top;
    outline: none;
}
*::after, *::before {
    box-sizing: inherit;
}
*:focus {
    outline: none;
}

body {
    margin: 0;
    padding: 0;

    font-size: 14px;
    line-height: 18px;

    font-weight: 500;
    font-family: var(--font);
    color: var(--text-color);
    background-color: var(--body-color);

    overflow-x: hidden;

    display: grid;
    gap: 0px 4px;
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-columns: var(--sidebar-width) 1fr;
    transition: grid-template-columns 0.25s ease;
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "sidebar header"
        "sidebar main"
        "sidebar footer";
}

html.overcast,
html.workcast {
    overflow: hidden;
}

/* ---- Focus Mode (fullscreen tool container) ---- */

html.overcast .focus-mode {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    margin: 0;
    border: none;
    padding: 0;
    z-index: 100;
    border-radius: 0;
    background-color: var(--panel-color);
}
.focus-close {
    position: fixed;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    display: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--component-dim);
    border: 1px solid var(--component-dim);
    transition: all 0.2s;
    z-index: 101;
}
html.overcast .focus-close,
html.workcast .focus-close {
    display: flex;
}
.focus-close:hover {
    border-color: var(--component-border);
    background-color: var(--component-highlight);
}
.focus-close svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-color);
    stroke-width: 2;
}

@media only screen and (min-width:651px) {

    body::-webkit-scrollbar-track {
        margin: 2px;
        background-color: #00000000;
    }
    body::-webkit-scrollbar {
        width: 8px;
        display: block !important;
        background-color: #00000000;
        transition: all 0.15s linear;
    }
   body::-webkit-scrollbar-thumb {
        border-radius: 5px;
        background-color: #ffffff00;
    }
    body:hover::-webkit-scrollbar-thumb {
        background-color: var(--scrollbar-color);
    }
    body::-webkit-scrollbar-thumb:hover {
        background-color: var(--scrollbar-color-hover);
    }
}

nav         { grid-area: sidebar; }
header      { grid-area: header; }
main        { grid-area: main; }
footer      { grid-area: footer; }

header, main, footer {
    min-width: 0;
    background-color: var(--page-color);
}

.wrap {
    width: calc(100% - 80px);
    max-width: 1920px;
    margin-left: auto;
    margin-right: auto;
}

main > .wrap {
    padding: 10px 0;
}

.top-hero {
    position: relative;
    align-items: center;
    background-color: var(--component-dim);
    background-image: url(/images/top-bg.webp);
    background-position-y: center;
    background-size: cover;
    min-height: 150px;
    z-index: 3;
    border-radius: 25px;
    margin-top: 10px;
}
.top-hero .plate {
    top: 0;
    left: 5%;
    gap: 15px;
    padding: 15px 25px 15px 20px;
    display: flex;
    color:#fff;
    font-size: 1.2rem;
    font-weight: 500;
    align-items: center;
    position: absolute;
    background-color: #ffffff20; 
}

/* ---- Gbox (reusable soft card) ---- */

.gbox {
    background: var(--component-dim);
    border-radius: 25px;
    padding: 30px;
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    transition: background 0.15s;
}
.gbox:hover {
    background: var(--component-highlight);
}
.gbox img.hero {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 16px;
}
.gbox h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-opaque);
}
.gbox p {
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.5;
}

/* ---- Section Typography ---- */

.row-label {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    background-color: var(--accent-color);
}
.row-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-top: 16px;
    color: var(--text-opaque);
}
.row-cat {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--accent-color);
}

/* ---- Section Defaults ---- */

section .center {
    text-align: center;
}
section .center p {
    max-width: 600px;
    margin: 12px auto 0;
    color: var(--text-dim);
}

.wrap.max {
    max-width: 1200px;
    margin: 0 auto;
}

/* ---- Nest Layout (two-column with flip) ---- */

.wrap.nest {
    display: flex;
    gap: 60px;
    align-items: center;
    margin-top: 60px;
}
.wrap.nest .left { flex: 1; min-width: 0; }
.wrap.nest .right { flex: 1; min-width: 0; }
.wrap.nest.flip { flex-direction: row-reverse; }
.wrap.nest .left h2 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 12px;
    color: var(--text-opaque);
}
.wrap.nest .left p {
    margin-top: 12px;
    color: var(--text-dim);
    line-height: 1.6;
}
.wrap.nest .left .button { margin-top: 24px; }

/* ---- Reels (horizontal scroll) ---- */

.reels {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
}
.reels::-webkit-scrollbar { display: none; }
.reels > * {
    scroll-snap-align: start;
    flex-shrink: 0;
    width: 260px;
}
.reels.center {
    justify-content: center;
    flex-wrap: wrap;
    overflow: visible;
}

/* ---- Error Pages ---- */

.error-page {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    text-align: center;
    align-items: center;
    flex-direction: column;
    justify-content: center;
}
.error-page h1 {
    font-size: 6rem;
    font-weight: 800;
}
.error-page p {
    margin-top: 12px;
    color: var(--text-dim);
}
.error-page a {
    margin-top: 24px;
    color: var(--accent-color);
}

/* ---- FAQ ---- */

.faq details {
    color: var(--text-dim);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-top: 0;
    padding: 14px 0;
    border-bottom: solid 1px var(--component-dim);
}
.faq summary {
    font-weight: 500;
    color: var(--text-color);
    display: flex;
    cursor: pointer;
    list-style: none;
    font-size: 0.925rem;
    justify-content: space-between;
    transition: color .15s ease;
}
.faq summary::-webkit-details-marker {
    display: none;
}
.faq summary::after {
    content: "\002B";
    flex-shrink: 0;
    margin-left: 16px;
}
.faq details[open] summary::after {
    content: "\00D7";
}
.faq details p {
    margin-top: 8px;
}

/* ---- Legal / Long-form Text ---- */

main > .wrap.legal {
    max-width: 1200px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 80px;
    align-items: start;
}
.legal-tldr {
    position: sticky;
    top: 24px;
    padding-top: 40px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-dim);
}
.legal-tldr h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-color);
    margin-bottom: 12px;
}
.legal-tldr ul {
    list-style: disc;
    padding-left: 16px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.legal-body h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}
.legal-body h2, .legal-body h3 {
    margin-top: 32px;
    margin-bottom: 8px;
}
.legal-body p {
    color: var(--text-color);
    line-height: 1.7;
    margin: 16px 0;
}
.legal-body a {
    color: var(--accent-color);
}
.legal-body table, .legal-body td, .legal-body th {
    border: 1px solid var(--component-dim);
    border-collapse: collapse;
    padding: 10px;
}
.legal-body ol, .legal-body ul {
    padding-left: 40px;
    margin: 16px 0;
    line-height: 1.7;
}
.legal-body ol { list-style-type: decimal; }
.legal-body .lower-roman { list-style-type: lower-roman; }
.legal-body .lower-alpha { list-style-type: lower-alpha; }
.legal-body .lower-alpha li {
    margin-left: 20px;
    padding: 4px 0 4px 8px;
}
.legal-body .disc { list-style-type: disc; }

@media (max-width: 800px) {
    .row-title { font-size: 1.6rem; }
    .wrap.nest { flex-direction: column; gap: 32px; }
    .wrap.nest.flip { flex-direction: column; }
    .wrap.nest .left h2 { font-size: 1.4rem; }

    main > .wrap.legal {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .legal-tldr {
        position: static;
    }
}

.nest {
    gap: 30px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}
.nest.flip {
    flex-direction: row-reverse;
}
.nest .left {
    width: 50%;
    display: flex;
    max-width: 600px;
    flex-direction: column;
    justify-content: center;
}
.nest .right {
    display: flex;
    padding: 50px;
    align-items: center;
    justify-content: center;
}
.nest img {
    width: 100%;
    height: auto;
    max-width: 600px;
    border-radius: 25px;
}
.nest ol {
    display: block;
    padding: 0 0 0 40px;
    list-style: none;
    overflow: hidden;
    counter-reset: numList;
}
.nest ol li {
    position: relative;
    margin-bottom: 30px;
}
.nest ol li:before {
    counter-increment: numList;
    content: counter(numList);
    position: absolute;
    left: -40px;
    text-align: center;
    color: #fff;
    line-height: 24px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    background: var(--accent-color);
}

.reels li {
    padding: 20px;
    max-width: 350px;
    min-width: 350px;
    border-radius: 25px;
    border: solid 1px var(--component-dim);
}
.reels li img {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 4 / 2.5;
    border-radius: 10px;
    margin-bottom: 10px;
}
.reels li h3 {
    font-size: 15px;
}
.reels li p {
    font-size: 13px;
}

@media (max-width: 825px) {
    .nest,
    .nest.flip {
        gap: 0px;
        flex-direction: column;
    }
    .nest .right,
    .nest .left {
        width: 100%;
    }
}

/* ---- Visitor Info (SEO sections, hidden for logged-in users) ---- */

body.authenticated .vinfo {
    display: none;
}
.uinfo {
    display: none;
}
body.authenticated .uinfo {
    display: block;
}

nav {
    top: 0;
    left: 0;
    z-index: 99;
    position: fixed;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    color: var(--text-color);
    background-color: var(--page-color);
    transition: width 0.25s ease;
}

nav .sidebar-head {
    flex-shrink: 0;
    padding: 16px 16px 0px 16px;
}

nav .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color) !important;
}

nav .logo-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    
    display: flex;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    background-color: #333333;
}

nav .logo-icon svg {
    width: 28px;
    height: 28px;
    margin-top: 2px;
    margin-right: 2px;
}

nav .logo-text {
    width: 80px;
    height: auto;
    margin-left: 10px;
    fill: currentColor;
}

/* ---- Toggle Handle (vertical bar in the gap) ---- */

.sidebar-toggle {
    position: absolute;
    left: calc(100% + 4px);
    top: 50%;
    transform: translateY(-50%);
    height: 80px;
    width: 24px;
    cursor: pointer;
    z-index: 100;
    transition: transform 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Compensate for nav resize so chevron stays under the mouse */
.sidebar-toggle:hover {
    transform: translateY(-50%) translateX(10px);
}
body:has(#sidebar-check:checked) .sidebar-toggle:hover {
    transform: translateY(-50%) translateX(-10px);
}

.sidebar-toggle::before,
.sidebar-toggle::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 15px;
    background-color: var(--text-opaque);
    left: 10px;
    transition: transform 0.25s ease, left 0.25s ease, opacity 0.25s ease, height 0.25s ease;
    opacity: 0.4;
}

.sidebar-toggle::before {
    bottom: 50%;
    transform-origin: center bottom;
}

.sidebar-toggle::after {
    top: 50%;
    transform-origin: center top;
}

.sidebar-toggle:hover::before,
.sidebar-toggle:hover::after {
    opacity: 0.8;
    height: 8px;
    width: 2px;
}

/* Hover when maximized (not checked) → left chevron "<" */
.sidebar-toggle:hover::before {
    transform: rotate(40deg);
    left: 2px;
}
.sidebar-toggle:hover::after {
    transform: rotate(-40deg);
    left: 2px;
}

/* Hover when minimized (checked) → right chevron ">" */
body:has(#sidebar-check:checked) .sidebar-toggle:hover::before {
    transform: rotate(-40deg);
    left: 20px;
}
body:has(#sidebar-check:checked) .sidebar-toggle:hover::after {
    transform: rotate(40deg);
    left: 20px;
}

/* Maximized hover — nav shrinks (preview collapse), line moves left */
body:not(:has(#sidebar-check:checked)):has(.sidebar-toggle:hover) {
    --sidebar-width: calc(var(--sidebar-full) - 10px);
}

/* Minimized hover — nav grows (preview expand), line moves right */
body:has(#sidebar-check:checked):has(.sidebar-toggle:hover) {
    --sidebar-width: calc(var(--sidebar-mini) + 10px);
}

#sidebar-check {
    display: none;
}

/* ---- Menu ---- */

nav menu {
    flex: 1;
    overflow: visible;
    padding: 0px 10px;
    margin: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Section headers */

nav menu .section-header {
    padding: 16px 14px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
    transition: none;
    overflow: hidden;
}

/* Nav items & action buttons — shared states */

nav menu li a,
nav .action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    padding: 0 14px;
    border-radius: 6px;
    color: var(--text-dim) !important;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
    white-space: nowrap;
    overflow: visible;
    position: relative;
}

nav menu li a:hover {
    background-color: var(--component-dim);
    color: var(--text-opaque) !important;
}

nav menu li.active a {
    background-color: var(--component-dim);
    color: var(--text-opaque) !important;
}

/* Icons */

nav menu li a > svg,
nav menu li a > img,
nav .action-btn > svg {
    width: 22px;
    height: 22px;
    min-width: 22px;
    flex-shrink: 0;
}

nav menu li a > img {
    border-radius: 4px;
}

/* Labels */

nav menu li a span {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Sidebar Actions (bottom) ---- */

nav .actions {
    flex-shrink: 0;
    margin-top: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Sidebar card (user/login) */

nav .sidebar-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--component-dim);
    border-radius: 8px;
    color: var(--text-dim) !important;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    position: relative;
    overflow: hidden;
}

nav .sidebar-card:hover {
    background: var(--component-highlight);
    color: var(--text-color) !important;
}

nav .sidebar-card > svg {
    width: 24px;
    height: 24px;
    min-width: 24px;
    flex-shrink: 0;
}

nav .sidebar-card-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    line-height: 1.3;
}

nav .sidebar-card-text strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

nav .sidebar-card-text small {
    font-size: 11px;
    color: var(--text-dim);
    white-space: nowrap;
}

/* Action row (icon-only horizontal strip) */

nav .action-row {
    display: flex;
    gap: 0;
}

.action-icon {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    min-width: 42px;
    border-radius: 6px;
    color: var(--text-dim);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    position: relative;
}

.action-icon:hover {
    background: var(--component-dim);
    color: var(--text-opaque);
}

.action-icon > svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
    flex-shrink: 0;
}


#noti-red-dot {
    display: block;
    position: absolute;
    border-radius: 50%;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background-color: #c01111;
    box-shadow: 3px 3px 8px 0 rgba(0, 0, 0, 0.2);
}

/* ---- Sidebar Popups (theme, language) ---- */

.sidebar-pop {
    display: none;
    position: fixed;
    background: var(--panel-color);
    border: 1px solid var(--component-dim);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 200;
    outline: none;
    width: max-content;
}

.sidebar-pop.open {
    display: block;
}

.sidebar-pop label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.sidebar-pop label + label {
    margin-top: 14px;
}

.pop-colors {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
}

.pop-colors > div {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
}

.pop-colors > div:hover {
    transform: scale(1.2);
}

.pop-workspaces {
    display: flex;
    gap: 6px;
}

.pop-workspaces > div {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.1s;
}

.pop-workspaces > div:hover {
    transform: scale(1.1);
}

.sidebar-pop .link {
    display: inline-block;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-dim);
    cursor: pointer;
    text-decoration: none;
}

.sidebar-pop .link:hover {
    color: var(--text-color);
}

/* Language popup */

#language-pop {
    max-height: calc(100vh - 80px);
    max-height: calc(100dvh - 80px);
    overflow-y: auto;
    min-width: 180px;
}

#language-pop a {
    display: block;
    padding: 6px 8px;
    border-radius: 4px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
}

#language-pop a:hover {
    background: var(--component-dim);
    color: var(--text-color);
}

/* Tools grid popup */

.tools-grid-pop {
    width: 760px;
    max-width: calc(100vw - 32px);
    padding: 24px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.tools-column-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--component-dim);
}

.tools-column-head svg {
    width: 16px;
    height: 16px;
}

.tools-grid-item {
    display: block;
    padding: 5px 0;
    color: var(--text-color);
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
}

.tools-grid-item:hover {
    color: var(--text-opaque);
}

.tools-grid-item .badge-new {
    font-size: 9px;
    font-weight: 700;
    background: var(--accent-color, #0099CC);
    color: #fff;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}

input, textarea, button {
    font-family: var(--font);
}

h1,h2,h3,h4,h5 {
    margin: 0;
    font-weight: 700;
    line-height: normal;
    color: var(--text-color);
}
h1 { font-size:2.0em; }
h2 { font-size:1.5em; }
h3 { font-size:1.2em; }
h4 { font-size:1.1em; }
h5 { font-size:1em; }

a {
    color:#7286ff;
    cursor: pointer;
    text-decoration: none;
    transition: all .1s linear;
}
a:hover:not(.button) {
    color:#9baaff;
}

p {
    margin:0px;
    margin-top: 10px;
}

menu, ol,ul {
    padding: 0 0 0 0;
    margin: 0 0 0 0;
    list-style: none;
    list-style-image: none;
}

.grab { cursor: grab !important; }
.crosshair { cursor: crosshair !important; }

.disabled {
    opacity: 0.4 !important;
    cursor: default !important; 
    pointer-events: none !important;
}
.offscreen {
    position: absolute;
    top: -100px;
    left: -500px;
}

.split {
    display: flex;
    align-items: center;
    justify-content: space-between !important;
}
.input-group {
    display: flex;
    position: relative;
    flex-direction: column;
    margin-top: 20px;
    line-height: 18px;
    text-transform: none;
}

.heavy { font-weight: 600; }
.center { text-align: center; }

.top-0 { margin-top: 0px !important; }
.top-4 { margin-top: 4px !important; }
.top-5 { margin-top: 5px !important; }
.top-8 { margin-top: 8px !important; }
.top-10 { margin-top: 10px !important; }
.top-15 { margin-top: 15px !important; }
.top-16 { margin-top: 16px !important; }
.top-20 { margin-top: 20px !important; }
.top-30 { margin-top: 30px !important; }
.top-40 { margin-top: 40px !important; }
.top-50 { margin-top: 50px !important; }
.top-60 { margin-top: 60px !important; }
.top-80 { margin-top: 80px !important; }
.top-100 { margin-top: 100px !important; }
.top-200 { margin-top: 200px !important; }

.tab-0 { margin-left:0px !important; }
.tab-5 { margin-left:5px !important; }
.tab-10 { margin-left:10px !important; }
.tab-15 { margin-left:15px !important; }
.tab-20 { margin-left:20px !important; }
.tab-25 { margin-left:25px !important; }
.tab-30 { margin-left:30px !important; }
.tab-40 { margin-left:40px !important; }

.margin-y-24 { margin: 24px 0; }

.pad-10 { padding:10px !important; }
.pad-15 { padding:15px !important; }
.pad-20 { padding:20px !important; }
.pad-30 { padding:30px !important; }
.pad-40 { padding:40px !important; }
.pad-50 { padding:50px !important; }
.pad-60 { padding:60px !important; }

.pad-x-32 { padding: 0 32px; }

.pad-y-32 { padding: 32px 0; }
.pad-y-40 { padding: 40px 0; }
.pad-y-60 { padding: 60px 0; }

.pad-top-10 { padding-top:10px !important; }
.pad-top-15 { padding-top:15px !important; }
.pad-top-20 { padding-top:20px !important; }
.pad-top-30 { padding-top:30px !important; }
.pad-top-40 { padding-top:40px !important; }
.pad-top-50 { padding-top:50px !important; }
.pad-top-80 { padding-top:80px !important; }

.w-50 { width:50% !important; max-width: 50% !important; }
.w-80 { width:80% !important; max-width: 80% !important; }
.w-100 { width:100% !important; max-width: 100% !important; }

.is-desktop { display: flex !important; }
.is-mobile { display: none !important; }

.col {
    display: flex;
    flex-direction: column;
    position: relative;
}

.flex {
    display: flex;
}

.flex-1 {
    flex: 1;
}
.gap-2 {
    gap: 0.5rem;
}
.gap-4 {
    gap: 1rem;
}

.grid {
    display: grid;
    align-items: center;
}

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

.grid-template-2>div>img {
    max-width: 100%;
}
.working {
    position: relative;
    pointer-events: none;
}
.working:before {
    content: '';
    z-index: 99;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border-radius: 50%;
    border: 2px solid #ffffff22;
    border-top-color: #fff;
    animation: rotate360 1.5s ease infinite;
    transition: all .25s linear;
}
.working.large:before {
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border: 5px solid #ffffff22;
    border-top-color: #fff;
}
.working.black::before {
    border: 2px solid #00000022;   /* lighter black border */
    border-top-color: #000;        /* solid black top for the spinner */
}
.group.working * {
    opacity:0.4 !important;
}   

label {
    font-weight: 500;
    display: flex;
    align-items: center;
}
label.working {
    padding-left:24px;
}
label.working::before {
    left:8px;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    margin-left: -8px;
}

.flow-up {
    animation: flow-up .5s ease 1;
    animation-fill-mode: forwards;
}
.flow-down {
    animation: flow-down .5s ease 1;
    animation-fill-mode: forwards;
}
.flow-left {
    animation: flow-left .5s ease 1;
    animation-fill-mode: forwards;
}
.flow-right {
    animation: flow-right .5s ease 1;
    animation-fill-mode: forwards;
}
.fade-out {
    animation: fade-out .5s ease 1 !important;
    animation-fill-mode: forwards !important;
}
.fade-out-fast {
    animation: fade-out .2s ease 1 !important;
    animation-fill-mode: forwards !important;
}
.fade-in {
    animation: fade-in .5s ease 1;
    animation-fill-mode: forwards;
}
.bounce-in {
    animation: bounce-in .5s linear 1;
    animation-fill-mode: forwards;
}
.jiggle {
    animation: jiggle 0.3s infinite;
}
.is-loading {
    border: solid 1px rgba(255, 255, 255);
    animation: 1.5s shine linear infinite;

    background-color: #e4e3e3;
    background: linear-gradient(
        100deg,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0.8) 50%,
        rgba(255, 255, 255, 0) 60%
      ) #e4e3e3;
    background-size: 200% 100%;
    background-position-x: 180%;
}

.mansorary {
    gap: 10px;
    display: grid;
    grid-auto-flow: dense;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));    
}
.mansorary.medium {
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));    
}
.mansorary.large {
    gap: 25px;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));    
}

.mansorary > div {
    display: block;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    border-radius: 6px;
}
.mansorary.mansorary.medium > div {
    border-radius: 10px;
}
.mansorary.mansorary.large > div {
    border-radius: 12px;
}

.mansorary > div > img {
    width: 100%;
    height: 100%;
}

/* ----------------- animations -------------- */

@keyframes rotate360 {
    to {transform: rotate(360deg);}
}
@keyframes shine {
    to { background-position-x: -20%;}
}
@keyframes flow-down {
    0% { transform:translateY(-20px); opacity:0}
    50% { transform:translateY(0px);}
    100% { opacity:1;}
}
@keyframes flow-up {
    0% { transform:translateY(20px); opacity:0}
    50% { transform:translateY(0px);}
    100% { opacity:1;}
}
@keyframes flow-left {
    0% { transform:translateX(20px); opacity:0}
    50% { transform:translateY(0px);}
    100% { opacity:1;}
}
@keyframes flow-right {
    0% { transform:translatex(-20px); opacity:0}
    50% { transform:translateX(0px);}
    100% { opacity:1;}
}
@keyframes fade-out {
    to { opacity: 0; transform:scale(0.8,0.8);}
}
@keyframes fade-in {
    from { opacity: 0; transform:scale(0.8,0.8);}
    to { opacity: 1; transform:scale(1, 1);}
}
@keyframes drop-slide {
    from {transform:translateY(10px);}
    to { transform:translateY(0px);}
}
@keyframes jiggle {
    0% { transform: rotate(0); }
    25% { transform: rotate(-2deg); }
	50% { transform: rotate(0); }
    75% { transform: rotate(2deg); }
    100% { transform: rotate(0); }
}
@keyframes shake {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-6px); }
  50%  { transform: translateX(6px); }
  75%  { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

/* -------------------- Modal ------------------------*/

#topmost {
    z-index: 999;
    position: absolute;
    top: 0;
    left: 0;
}
.modal {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    overflow: auto;
    position: fixed;
    padding: 10px 0px;
    touch-action: none;
    align-items: center;
    justify-content: center;
    will-change: background-color, backdrop-filter;
    transition: background-color .2s ease-in-out, backdrop-filter .2s ease-in-out;
}
.modal-loader {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}
.modal-loader-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.modal-loader-spinner {
    width: 50px;
    height: 50px;
}
.modal-loader-title {
    font-size: 14px;
    letter-spacing: 1px;
    color: var(--text-color);
}
.modal-loader-bar {
    width: 260px;
    height: 6px;
    border-radius: 3px;
    background: var(--component-dim);
    overflow: hidden;
}
.modal-loader-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    background: var(--accent-color);
}
.modal-loader-label {
    font-size: 12px;
    opacity: 0.6;
}
.modal::-webkit-scrollbar {
    width: 16px;
}
.modal::-webkit-scrollbar-thumb {
    height: 56px;
    border-radius: 8px;
    border: 4px solid transparent;
    background-clip: content-box;
    background-color: #ffffff40;
}
.modal::-webkit-scrollbar-thumb:hover {
    background-color: #ffffff50;
}

#dim-message {
    color: rgba(255, 255, 255, 0.9);
    font-size: 40px;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin: 0 auto;
}
.dim {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: grayscale(.75);
}

/* ============== Sheet (modal inner panel) ============== */

.sheet {
    width: 90%;
    max-width: 600px;
    min-height: 60vh;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    background: var(--panel-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.sheet.ani {
    opacity: 1;
}
.sheet.wide {
    max-width: 1000px;
}
.sheet.full {
    max-width: 1440px;
}
.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px 60px 5px 20px;
    flex-shrink: 0;
}
.sheet-header strong {
    font-size: 15px;
}
.sheet-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    background: var(--component-dim);
    transition: background-color 0.15s;
}
.sheet-close:hover {
    background: var(--component-color);
}
.sheet-close svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-dim);
    stroke-width: 2;
    fill: none;
}
.sheet-close:hover svg {
    stroke: var(--text-opaque);
}
.sheet-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 20px 20px;
}
@media only screen and (min-width: 826px) {
    .sheet-content::-webkit-scrollbar { width: 8px; }
    .sheet-content::-webkit-scrollbar-track { background: transparent; }
    .sheet-content::-webkit-scrollbar-thumb { border-radius: 4px; background-color: var(--scrollbar-color); }
    .sheet-content::-webkit-scrollbar-thumb:hover { background-color: var(--scrollbar-color-hover); }
}
/* ============== Base input styles ============== */

input[type='number'],
input[type='text'],
input[type='url'],
input[type='email'],
input[type='password'],
textarea {
    width: 55px;
    height: 28px;
    overflow: hidden;
    text-align: right;
    padding-left: 4px;
    padding-right: 4px;
    border-radius: 4px;
    color: var(--text-color);
    font-family: var(--font);
    transition: all 0.15s linear;
    background-color: var(--component-shade);
    border: solid 1px var(--component-color);
    -moz-appearance: textfield;
    appearance: textfield;
}
input[type='text'],
input[type='url'],
input[type='password'],
input[type='email'],
textarea {
    resize: none;
    height: 36px;
    line-height: 22px;
    padding-left: 6px;
    margin: 0px;
    text-align: left;
}
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}
textarea {
    font-size: 13px;
    height: auto;
}
html:not(.touch) input[type='number']:hover:not(:focus),
html:not(.touch) input[type='text']:hover:not(:focus),
html:not(.touch) input[type='url']:hover:not(:focus),
html:not(.touch) textarea:hover:not(:focus) {
    border: solid 1px var(--component-highlight);
    color: var(--text-opaque);
}
input[type='number']:focus,
input[type='text']:focus,
input[type='url']:focus,
textarea:focus {
    border: 1px solid var(--accent-color);
    color: var(--text-opaque);
}
input[type='number'].error,
input[type='text'].error,
textarea.error,
textarea:invalid,
input:invalid {
    border: 1px solid #d1480e !important;
}

.sheet-search {
    flex: 1;
    min-width: 100px;
    max-width: 600px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--component-dim);
    background: var(--component-color);
    color: var(--text-color);
    font-size: 13px;
    outline: none;
}

.sheet-pane input[type='text'].sheet-input,
.sheet-pane input[type='email'].sheet-input,
.sheet-pane input[type='password'].sheet-input,
.sheet-pane textarea.sheet-input {
    width: 100%;
    height: auto;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--component-dim);
    background: var(--component-color);
    color: var(--text-color);
    font-size: 14px;
    text-align: left;
    overflow: visible;
    outline: none;
    margin-top: 4px;
    box-sizing: border-box;
    appearance: none;
}
.sheet-input:focus {
    border-color: var(--accent-color);
}
.sheet-input:disabled {
    opacity: 0.5;
}

.pref-language-list a {
    display: block;
    padding: 6px 8px;
    border-radius: 4px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
}
.pref-language-list a:hover {
    background: var(--component-dim);
    color: var(--text-color);
}
.pref-language-list a.active {
    color: var(--text-color);
}
.pref-language-list a .check {
    margin-right: 6px;
    font-weight: bold;
    color: var(--accent-color);
}

/* ============== Sheet layout (nav + panes) ============== */

.sheet-layout {
    display: flex;
    flex: 1;
    min-height: 0;
}
.sheet-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
    padding: 40px 16px 20px;
    background: var(--page-color);
    position: relative;
}
.sheet-nav::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 100%;
    background: linear-gradient(to left, rgb(0 0 0 / 5%), transparent);
    pointer-events: none;
}
:root.light .sheet-nav::after {
    background: linear-gradient(to left, rgb(0 0 0 / 2%), transparent);
}
.sheet-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: none;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-dim);
    transition: all 0.15s linear;
    text-align: left;
    width: 100%;
}
.sheet-nav-item:hover {
    color: var(--text-color);
}
.sheet-nav-item.active {
    background: var(--component-dim);
    color: var(--text-color);
}
.sheet-nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.sheet-panes {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--panel-color);
    border-left: 1px solid var(--component-dim);
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
}
@media only screen and (min-width: 826px) {
    .sheet-panes::-webkit-scrollbar { width: 8px; }
    .sheet-panes::-webkit-scrollbar-track { background: transparent; }
    .sheet-panes::-webkit-scrollbar-thumb { border-radius: 4px; background-color: var(--scrollbar-color); }
    .sheet-panes::-webkit-scrollbar-thumb:hover { background-color: var(--scrollbar-color-hover); }
}
.sheet-pane {
    display: none;
}
.sheet-pane.active {
    display: block;
}

/* ============== Template Card ============== */

.template-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: var(--component-shade);
    break-inside: avoid;
}
.template-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Cover image — static flow so card height follows image aspect */
.template-card-cover {
    width: 100%;
    display: block;
}

/* Video overlays cover, fades in on hover */
.template-card-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
}
.template-card:hover .template-card-video {
    opacity: 1;
}

/* Audio icon */
.template-card-audio-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    z-index: 3;
}

/* Badges top-left */
.template-card-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 4px;
    z-index: 3;
}
.template-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    color: #fff;
}
.template-badge.type-image { background: rgba(59, 130, 246, 0.85); }
.template-badge.type-edit { background: rgba(245, 158, 11, 0.85); }
.template-badge.type-video { background: rgba(168, 85, 247, 0.85); }
.template-badge.type-spaces { background: rgba(16, 185, 129, 0.85); }
.template-badge.badge-new {
    background: rgba(239, 68, 68, 0.85);
}

/* Info overlay — gradient at bottom, slides down on hover */
.template-card-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 30px 10px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    z-index: 2;
    transition: transform 0.25s ease;
}
.template-card:hover .template-card-overlay {
    transform: translateY(100%);
}
.template-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.template-card-description {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============== Template Grid (inline) ============== */

.template-grid-section {
    padding: 0 10px;
}
.template-grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}
.template-grid-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}
.template-grid-footer {
    display: flex;
    justify-content: center;
    padding: 20px 0 10px;
}
.template-grid {
    columns: 4 220px;
    column-gap: 10px;
}
.template-grid .template-card {
    margin-bottom: 10px;
}

/* ============== Template Sheet (inside .sheet) ============== */

.template-sheet {
    height: 85vh;
    max-height: 85vh;
}
.template-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    padding-bottom: 20px;
}
.template-tab {
    padding: 6px 14px;
    border: none;
    border-radius: 20px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-dim);
    background: var(--component-dim);
    transition: all 0.15s;
}
.template-tab:hover {
    color: var(--text-color);
}
.template-tab.active {
    background: var(--accent-color);
    color: #fff;
}
.template-sheet .template-grid {
    columns: 4 220px;
    column-gap: 10px;
}
.template-empty {
    padding: 40px;
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
}

@media only screen and (max-width: 768px) {
    .template-sheet .sheet-nav {
        display: none;
    }
    .template-sheet {
        max-width: 100%;
        height: 90vh;
        max-height: 90vh;
        border-radius: 10px 10px 0 0;
    }
    .template-grid {
        columns: 2 140px;
    }
}

/* ============== Option list ============== */

.option-list {
    gap: 4px;
    width: 100%;
    display: flex;
    flex-direction: column;
    list-style: none;
    padding: 0;
    margin: 0;
}
.option-list li {
    flex: 1;
    gap: 10px;
    display: flex;
    cursor: pointer;
    min-height: 42px;
    padding-left: 3px;
    user-select: none;
    position: relative;
    border-radius: 4px;
    align-items: center;
    align-content: center;
    transition: all .15s linear;
    border: solid 1px rgba(255,255,255,0);
}
html:not(.touch) .option-list li:hover:not(.selected) {
    background-color: var(--panel-color);
}
.option-list li:active {
    transform: translateY(2px);
}
.option-list li.selected {
    color: #fff;
    background-color: var(--accent-color);
}
.option-list li img {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    margin-left: 5px;
}
.option-list li.selected img {
    opacity: 1;
}

/* ============== Sheet Pane Scroll ============== */

.sheet-pane {
    overflow-y: auto;
    overflow-x: hidden;
}
.sheet-pane.active {
    flex: 1;
    min-height: 0;
}
.sheet-pane .loader {
    display: block;
    margin: auto;
}
@media only screen and (min-width: 826px) {
    .sheet-pane::-webkit-scrollbar { width: 8px; }
    .sheet-pane::-webkit-scrollbar-track { background: transparent; }
    .sheet-pane::-webkit-scrollbar-thumb { border-radius: 4px; background-color: var(--scrollbar-color); }
    .sheet-pane::-webkit-scrollbar-thumb:hover { background-color: var(--scrollbar-color-hover); }
}
.sheet-panes > .sheet-header {
    padding: 0 50px 20px 0;
    flex-shrink: 0;
}
.sheet-footer {
    flex-shrink: 0;
    padding-top: 20px;
}
.picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}
.picker-grid-item {
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
    position: relative;
    background: var(--component-dim);
}
.picker-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.picker-grid-item:hover {
    outline: 2px solid var(--accent-color);
    outline-offset: -2px;
}
.picker-grid-item.selected {
    outline: 3px solid var(--accent-color);
    outline-offset: -3px;
}

/* Split layout in filepicker: picker left, preview right (multi-select) */
.picker-split {
    display: flex;
    gap: 20px;
    flex: 1;
    min-height: 0;
}
.picker-split .dropper-box {
    flex: 1;
    min-width: 0;
}
.picker-split .upload-thumbs {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    align-content: start;
}
@media (max-width: 768px) {
    .picker-split {
        flex-direction: column;
    }
}

/* Audio feed items in picker */
.picker-audio-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    gap: 6px;
}
.picker-audio-waveform {
    width: 100%;
    height: 50px;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.picker-audio-item.playing .picker-audio-waveform {
    opacity: 1;
}
.picker-audio-prompt {
    font-size: 11px;
    color: var(--text-dim);
    text-align: center;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    margin: 0;
}
/* Video feed items in picker */
.picker-grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.picker-grid-item.selected::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-color) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.picker-grid.upload-thumbs {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 6px;
    margin-top: 10px;
}
.upload-thumbs .picker-grid-item {
    cursor: pointer;
}
.upload-thumbs .picker-grid-item::after {
    content: '\2715';
    opacity: 0;
    width: 30px;
    height: 30px;
    z-index: 3;
    color: #fff;
    font-size: 14px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    position: absolute;
    top: calc(50% - 15px);
    left: calc(50% - 15px);
    transition: opacity .15s linear;
    background-color: rgba(0, 0, 0, 0.7);
}
.upload-thumbs .picker-grid-item:hover::after {
    opacity: 1;
}

/* ============== Tab Toggle ============== */

.tab-toggle {
    display: inline-flex;
    border-radius: 8px;
    background: var(--component-dim);
    padding: 3px;
}
.tab-toggle-item {
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-dim);
    font-size: 13px;
    transition: all 0.15s;
}
.tab-toggle-item.active {
    background: var(--accent-color);
    color: #fff;
}

/* ============== Pill Toggle ============== */

.pill-toggle {
    display: flex;
    align-items: center;
    padding: 5px;
    border-radius: 50vh;
    background: var(--component-dim);
    user-select: none;
    margin: 0 auto;
    width: fit-content;
}
.pill-toggle-item {
    padding: 8px 20px;
    border-radius: 50vh;
    cursor: pointer;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}
.pill-toggle-item.active {
    background: var(--panel-color);
    color: var(--text-color);
}

/* ============== Dropper Box ============== */

.dropper-box {
    flex: 1;
    display: flex;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s linear;
    gap: 6px;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid var(--component-highlight);
    background-color: var(--component-shade);
    color: var(--text-color);
    position: relative;
}
.dropper-box:hover {
    border-color: var(--component-border);
}

.dropper-box .icon,
.dropper-box .drop-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 5px;
    background: var(--accent-color);
    opacity: var(--hover-opacity);
}
.dropper-box .browse {
    color: var(--accent-color);
}
.dropper-box .dropper-description {
    font-size: 12px;
    color: var(--text-dim);
}
.dropper-box .button {
    width: 90%;
    max-width: 280px;
}

.dropper-box.dragover,
.dropper-box.drag-over {
    outline: dashed 2px var(--accent-color);
    outline-offset: -4px;
}

.dropper-box:has(canvas, > img) .icon,
.dropper-box:has(canvas, > img) .drop-icon,
.dropper-box:has(canvas, > img) .text,
.dropper-box:has(canvas, > img) > span,
.dropper-box:has(canvas, > img) #show-examples-link {
    display: none;
}
.dropper-box:has(canvas, > img),
.dropper-box.full:has(canvas, > img),
.dropper-box.compact:has(canvas, > img) {
    padding: 0;
    border: none;
    overflow: hidden;
}
.dropper-box.full:has(canvas, > img) {
    height: 300px;
}
.dropper-box > img,
.dropper-box canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.dropper-box.cover > img,
.dropper-box.cover canvas {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}
.dropper-box:has(canvas, > img)::after {
    opacity: 0;
    width: 50px;
    height: 50px;
    z-index: 3;
    font-size: 14px;
    content: '\01F5D9';
    line-height: 50px;
    text-align: center;
    border-radius: 50%;
    position: absolute;
    top: calc(50% - 25px);
    left: calc(50% - 25px);
    pointer-events: none;
    transition: opacity 0.15s linear;
    background-color: rgba(0, 0, 0, 0.6);
}
.dropper-box:has(canvas, > img):hover::after {
    opacity: 1;
}

.dropper-box .thumbnail .thumbnail-over {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    position: absolute;
    align-items: center;
    justify-content: center;
}

/* -- Full: page-level landing dropper (collage, swapper, prompter) -- */
.dropper-box.full {
    min-height: 300px;
    border-radius: 25px;
    padding: 20px 10px;
}
.dropper-box.full .icon,
.dropper-box.full .drop-icon {
    width: 50px;
    height: 50px;
}

/* -- Compact: inline reference dropper -- */
.dropper-box.compact {
    min-height: 80px;
    min-width: 0;
    width: 100%;
    padding: 20px;
    border-radius: 10px;
    flex-direction: row;
    gap: 10px;
}
.dropper-box.compact .icon {
    width: 24px;
    height: 24px;
    background: none;
    border-radius: 0;
    margin-bottom: 0;
}
.dropper-box.compact .text {
    font-size: 13px;
}
.dropper-box.compact.has-image {
    padding: 0;
    border: none;
    overflow: hidden;
    position: relative;
}
.dropper-box.compact.has-image canvas {
    object-fit: cover;
    display: block;
}
.dropper-box.compact.has-image::after {
    opacity: 0;
    width: 50px;
    height: 50px;
    z-index: 3;
    font-size: 14px;
    content: '\01F5D9';
    line-height: 50px;
    text-align: center;
    border-radius: 50%;
    position: absolute;
    top: calc(50% - 25px);
    left: calc(50% - 25px);
    pointer-events: none;
    transition: opacity 0.15s linear;
    background-color: rgba(0, 0, 0, 0.6);
}
.dropper-box.compact.has-image:hover::after {
    opacity: 1;
}

/* -- Dropper reference container -- */
.reference-droppers {
    display: flex;
    gap: 6px;
}
.reference-droppers .dropper-box {
    flex: 1;
    min-width: 0;
    border-radius: 10px;
}

/* -- Dropper mobile -- */
@media only screen and (max-width: 825px) {
    .dropper-box {
        width: 100%;
        min-width: unset;
        padding: 10px;
    }
    .dropper-box.full {
        min-height: 200px;
        padding: 15px 10px;
    }
    .dropper-box canvas {
        max-height: 180px;
    }
}

/* ---- Tooltip ---- */

html:not(.touch) [tooltip] {
    position: relative;
}
html:not(.touch) [tooltip]::before,
html:not(.touch) [tooltip]::after {
    text-transform: uppercase;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1px;
    line-height: 26px;
    user-select: none;
    pointer-events: none;
    position: absolute;
    display: none;
}
html:not(.touch) [tooltip]::before {
    content: '';
    border: 5px solid transparent;
    z-index: 1001;
}
html:not(.touch) [tooltip]::after {
    content: attr(tooltip);
    text-align: center;
    vertical-align: middle;
    text-indent: 1px;
    min-width: 20px;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0px 10px;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    background: var(--invert-bg);
    color: var(--invert-text);
    z-index: 1000;
}
html:not(.touch) [tooltip]:hover::before,
html:not(.touch) [tooltip]:hover::after {
    display: block;
}

/* FLOW: UP (default) */
html:not(.touch) [tooltip]:not([flow])::before,
html:not(.touch) [tooltip][flow^='up']::before {
    bottom: calc(100% + 3px);
    border-bottom-width: 0;
    border-top-color: var(--invert-bg);
}
html:not(.touch) [tooltip]:not([flow])::after,
html:not(.touch) [tooltip][flow^='up']::after {
    bottom: calc(100% + 8px);
}
html:not(.touch) [tooltip]:not([flow])::before,
html:not(.touch) [tooltip]:not([flow])::after,
html:not(.touch) [tooltip][flow^='up']::before,
html:not(.touch) [tooltip][flow^='up']::after {
    left: 50%;
    transform: translate(-50%, -0.5em);
}

/* FLOW: UP-RIGHT */
html:not(.touch) [tooltip][flow^='up-right']::before {
    bottom: calc(100% + 3px);
    border-bottom-width: 0;
    border-top-color: var(--invert-bg);
    left: 50%;
}
html:not(.touch) [tooltip][flow^='up-right']::after {
    bottom: calc(100% + 8px);
    transform: translate(0, -0.5em);
    left: -5px;
}

/* FLOW: UP-LEFT */
html:not(.touch) [tooltip][flow^='up-left']::before {
    bottom: calc(100% + 3px);
    border-bottom-width: 0;
    border-top-color: var(--invert-bg);
    right: 50%;
}
html:not(.touch) [tooltip][flow^='up-left']::after {
    bottom: calc(100% + 8px);
    right: -5px;
    left: unset;
    transform: translate(0, -0.5em);
}

/* FLOW: DOWN */
html:not(.touch) [tooltip][flow^='down']::before {
    top: 100%;
    border-top-width: 0;
    border-bottom-color: var(--invert-bg);
}
html:not(.touch) [tooltip][flow^='down']::after {
    top: calc(100% + 5px);
}
html:not(.touch) [tooltip][flow^='down']::before,
html:not(.touch) [tooltip][flow^='down']::after {
    left: 50%;
    transform: translate(-50%, 0.5em);
}

/* FLOW: LEFT */
html:not(.touch) [tooltip][flow^='left']::before {
    top: 50%;
    border-right-width: 0;
    border-left-color: var(--invert-bg);
    left: calc(0em - 5px);
    transform: translate(-0.5em, -50%);
}
html:not(.touch) [tooltip][flow^='left']::after {
    top: 50%;
    right: calc(100% + 5px);
    transform: translate(-0.5em, -50%);
}

/* FLOW: RIGHT */
html:not(.touch) [tooltip][flow^='right']::before {
    top: 50%;
    border-left-width: 0;
    border-right-color: var(--invert-bg);
    right: calc(0em - 5px);
    transform: translate(0.5em, -50%);
}
html:not(.touch) [tooltip][flow^='right']::after {
    top: 50%;
    left: calc(100% + 5px);
    transform: translate(0.5em, -50%);
}

/* ---- Footer ---- */

footer {
    padding: 100px 0px 30px 0px;
}

footer .footer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(max-content, 300px));
    gap: 30px;
}

footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

footer ul .column-head {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-opaque);
}

footer ul li {
    line-height: 32px;
}

footer a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
}

footer a:hover {
    color: var(--text-opaque);
}

footer .footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--component-dim);
}

footer .footer-bottom span {
    color: var(--text-dim);
    font-size: 13px;
    opacity: 0.6;
}

footer .footer-social {
    display: flex;
    gap: 16px;
}

footer .footer-social a {
    color: var(--text-dim);
    display: flex;
}

footer .footer-social a:hover {
    color: var(--text-opaque);
}

footer .footer-social svg {
    width: 16px;
    height: 16px;
}

/* ---- Sidebar Minimal (desktop only) ---- */

@media (min-width: 826px) {
    body:has(#sidebar-check:checked) {
        --sidebar-width: var(--sidebar-mini);
    }

    /* Logo — hide text in minimal */
    body:has(#sidebar-check:checked) nav .logo-text {
        display: none;
    }

    body:has(#sidebar-check:checked) nav .sidebar-head {
        display: flex;
        justify-content: center;
        padding: 16px 8px 6px 8px;
    }

    /* Section headers become thin dividers */
    body:has(#sidebar-check:checked) nav menu .section-header {
        font-size: 0;
        padding: 0;
        margin: 8px 12px;
        height: 1px;
        background-color: var(--component-highlight);
        overflow: hidden;
    }

    /* Nav items & action buttons: icon only, centered */
    body:has(#sidebar-check:checked) nav menu li a {
        justify-content: center;
        overflow: visible;
    }

    /* Hide labels in minimal mode */
    body:has(#sidebar-check:checked) nav menu li a span {
        display: none;
    }

    /* Hide user/login card in minimal (header bar has user menu) */
    body:has(#sidebar-check:checked) nav .sidebar-card {
        display: none;
    }

    /* Action row becomes column in minimal */
    body:has(#sidebar-check:checked) nav .action-row {
        flex-direction: column;
        gap: 2px;
    }

    body:has(#sidebar-check:checked) nav .action-icon {
        height: 42px;
        min-height: 42px;
        border-radius: 6px;
        overflow: visible;
    }

    /* Hide theme & language in minimal (they move to floating panels) */
    body:has(#sidebar-check:checked) nav .action-row-only {
        display: none;
    }

    /* Hide tooltips in full sidebar (labels visible) */
    body:not(:has(#sidebar-check:checked)) nav [tooltip]::before,
    body:not(:has(#sidebar-check:checked)) nav [tooltip]::after {
        display: none !important;
    }

    /* Force right tooltips on sidebar elements in minimal mode */
    body:has(#sidebar-check:checked) nav .action-icon[tooltip]::before {
        top: 50%;
        bottom: auto;
        border-top-width: 5px;
        border-bottom-width: 5px;
        border-left-width: 0;
        border-right-color: var(--invert-bg);
        border-top-color: transparent;
        right: calc(0em - 5px);
        left: auto;
        transform: translate(0.5em, -50%);
    }
    body:has(#sidebar-check:checked) nav .action-icon[tooltip]::after {
        top: 50%;
        bottom: auto;
        left: calc(100% + 5px);
        right: auto;
        transform: translate(0.5em, -50%);
    }
}

/* ---- Top bar (desktop + mobile) ---- */

.mobile-close {
    display: none;
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 15px 0px 0 0;
}

/* Hamburger hidden on desktop */
.header-bar > .mobile-menu-toggle {
    display: none;
}

/* Logo hidden on desktop */
.header-bar-logo {
    display: none;
    text-decoration: none;
    align-items: center;
}
.header-bar-logo-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}
.header-bar-logo-text {
    height: 22px;
    width: auto;
    margin-left: 6px;
    color: var(--text-opaque);
}

.header-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.header-bar .header-bar-pricing {
    color: var(--text-color);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s;
}
.header-bar .header-bar-pricing:hover {
    color: var(--text-color);
    background-color: var(--component-dim);
}

/* Avatar button */
.header-bar-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--component-dim);
    transition: background-color 0.15s;
}
.header-bar-avatar:hover {
    background-color: var(--component-color);
}
.header-bar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.header-bar-avatar svg {
    color: var(--text-dim);
    transition: color 0.15s;
}
.header-bar-avatar:hover svg {
    color: var(--text-color);
}


/* ---- User dropdown menu ---- */

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background-color: var(--panel-color);
    border: 1px solid var(--component-dim);
    border-radius: 16px;
    padding: 8px;
    z-index: 300;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    flex-direction: column;
}
.user-dropdown.open {
    display: flex;
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
}
.user-dropdown-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background-color: var(--component-dim);
    display: flex;
    align-items: center;
    justify-content: center;
}
.user-dropdown-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.user-dropdown-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.user-dropdown-info strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-opaque);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-dropdown-info small {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.user-dropdown-divider {
    height: 1px;
    background-color: var(--component-dim);
    margin: 4px 8px;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-color) !important;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}
.user-dropdown-item:hover {
    background-color: var(--component-dim);
    color: var(--text-opaque) !important;
}
.user-dropdown-item svg {
    flex-shrink: 0;
}
.user-dropdown-item span:first-of-type {
    flex: 1;
}

.user-dropdown-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    margin-left: auto;
}
.user-dropdown-badge.badge-free {
    background-color: var(--component-dim);
    color: var(--text-dim);
}
.user-dropdown-badge.badge-plus {
    background-color: rgba(156, 196, 43, 0.15);
    color: #9cc42b;
}
.user-dropdown-badge.badge-premium {
    background-color: rgba(236, 200, 0, 0.15);
    color: #ecc800;
}
.user-dropdown-badge.badge-ultra {
    background-color: rgba(245, 97, 35, 0.15);
    color: #f56123;
}

.user-dropdown-value {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 500;
}


/* ---- Responsive ---- */

@media (max-width: 825px) {
    body {
        --sidebar-width: 0px;
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main"
            "footer";
    }

    nav {
        width: 100%;
        transform: translateX(-100%);
        transition: transform 0.15s ease;
    }

    @media (min-width: 600px) {
        nav {
            max-width: 60%;
        }
    }

    nav.menu-active {
        transform: translateX(0);
    }

    /* Hide desktop-only elements on mobile */
    .sidebar-toggle,
    nav .sidebar-head {
        display: none;
    }

    /* Mobile close button */
    .mobile-close {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        cursor: pointer;
        color: var(--text-dim);
        background-color: var(--component-dim);
        transition: background-color 0.15s, color 0.15s;
        z-index: 201;
    }

    .mobile-close:hover {
        background-color: var(--component-highlight);
        color: var(--text-color);
    }

    .mobile-close svg {
        width: 18px;
        height: 18px;
        stroke: currentColor;
        fill: none;
        stroke-width: 2;
        stroke-linecap: round;
    }

    /* Show hamburger on mobile (left side) */
    .header-bar > .mobile-menu-toggle {
        display: flex;
        order: -1;
    }

    .header-bar {
        justify-content: space-between;
    }

    /* Show logo on mobile */
    .header-bar-logo {
        display: flex;
        align-items: center;
        text-decoration: none;
    }

    /* Hide pricing link on mobile, keep login button */
    .header-bar a.header-bar-pricing {
        display: none;
    }

    .mobile-menu-toggle {
        width: 42px;
        height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        border-radius: 50%;
        color: var(--text-color);
        background-color: var(--component-dim);
        transition: background-color 0.15s;
        flex-shrink: 0;
    }

    .mobile-menu-toggle:hover {
        background-color: var(--component-highlight);
    }

    .mobile-menu-toggle svg {
        width: 24px;
        height: 24px;
        stroke: currentColor;
        fill: none;
        stroke-width: 2;
        stroke-linecap: round;
    }

    /* User dropdown: full-screen slide from right (mirrors nav from left) */
    .user-dropdown {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
        padding: 60px 16px 16px;
        z-index: 200;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.15s ease;
        display: flex;
        box-shadow: none;
    }
    .user-dropdown.open {
        transform: translateX(0);
    }

    .user-dropdown .mobile-close {
        display: flex;
    }

    /* Mobile bottom drawer for popups */
    .sidebar-pop {
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        border: none;
        width: 100%;
        max-height: 70vh;
        border-radius: 25px 25px 0 0;
        padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px));
        transform: translateY(100%);
        transition: transform 0.2s ease;
        display: block;
        visibility: hidden;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
        overflow-y: auto;
    }
    .sidebar-pop.open {
        transform: translateY(0);
        visibility: visible;
    }
    .sidebar-pop::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        border-radius: 2px;
        margin: 0 auto 12px;
        flex-shrink: 0;
        background: var(--text-dim);
    }

    #language-pop {
        display: block;
    }

    .top-hero {
        margin-top: 0px;
        min-height: 100px;
        border-radius: 15px;
    }

    .top-hero .plate {
        font-size: 0.9rem;
        padding: 10px 15px 10px 15px;
        gap: 10px;
    }
    .top-hero .plate img {
        width: 28px;
        height: 28px;
    }

    .tools-grid-pop {
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        padding: 50px 20px 20px;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.15s ease;
        display: block;
        visibility: hidden;
        box-shadow: none;
    }
    .tools-grid-pop.open {
        transform: translateX(0);
        visibility: visible;
    }
    .tools-grid-pop::before {
        display: none;
    }

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

    .is-desktop { display: none !important; }
    .is-mobile { display: flex !important; }
}

/* ============================================
   Components (migrated from general.css)
   ============================================ */

/* --------------------- Plan Card (shared) ------------------- */

.pcard {
    display: flex;
    align-self: flex-end;
    flex-direction: column;
    padding: 32px;
    position: relative;
    border-radius: 18px;
    background: var(--group-color);
    border: 1px solid var(--component-dim);
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.pcard:hover {
    border-color: var(--component-highlight);
}
.pcard.pop {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 1px var(--accent-color);
}
.pcard.disabled {
    opacity: 0.5;
    pointer-events: none;
}
.pcard .pbadge {
    position: absolute;
    top: -14px;
    right: 40px;
    padding: 4px 16px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    color: #fff;
    background: var(--accent-color);
}
.pcard .pbadge.pink { background: #e85d2a; }
.pcard .pname {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-opaque);
}
.pcard .pname svg { width: 24px; height: 24px; flex-shrink: 0; }
.pcard .ptag {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 15px;
}
.pcard .pprice {
    margin-top: 32px;
    text-align: center;
}
.pcard .amt {
    display: block;
    font-size: 2.8rem;
    line-height: 3.1rem;
    font-weight: 900;
    color: var(--text-opaque);
}
.pcard .pfrom {
    display: block;
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-bottom: -4px;
}
.pcard .pmo {
    display: block;
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 4px;
}
.pcard .strike-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 4px;
}
.pcard .strike {
    text-decoration: line-through;
    color: var(--text-dim);
    font-size: 0.85rem;
}
.pcard .dbadge {
    background: #c50000;
    color: #fff;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
}
.pcard .bnote {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 4px;
}
.pcard .pcta {
    margin-top: 24px;
}
.pcard .pdiv {
    border: none;
    border-top: 1px solid var(--component-dim);
    margin: 24px 0 16px;
}
.pcard .fhead {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 12px;
}
.pcard .flist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}
.pcard .flist li {
    font-size: 0.84rem;
    color: var(--text-color);
    padding-left: 24px;
    position: relative;
    line-height: 1.45;
}
.pcard .flist li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    font-weight: 800;
    color: var(--accent-color);
}

/* --------------------- Subscription Bounce Sheet ------------------- */

.bounce-sheet {
    max-width: 960px;
    min-height: auto;
    overflow-y: auto;
}
.bounce-header {
    text-align: center;
    padding: 30px 20px 0;
}
.bounce-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-opaque);
}
.bounce-header p {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-top: 10px;
    line-height: 1.5;
}
.bounce-plans {
    display: flex;
    gap: 20px;
    padding: 20px;
    align-items: flex-end;
}
.bounce-plans .pcard {
    flex: 1 1 0;
}
html:not(.touch) .bounce-plans .pcard:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.bounce-footer {
    text-align: center;
    padding: 0 20px 20px;
    font-size: 0.84rem;
    color: var(--text-dim);
    line-height: 1.5;
}
.bounce-footer a {
    color: var(--accent-color);
}
.bounce-skip {
    cursor: pointer;
    opacity: 0.6;
    font-size: 0.85rem;
}
.bounce-skip:hover {
    opacity: 1;
}

@media (max-width: 900px) {
    .bounce-sheet { max-width: 100%; }
    .bounce-plans {
        overflow-x: auto;
        flex-wrap: nowrap;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
    }
    .bounce-plans::-webkit-scrollbar { display: none; }
    .bounce-plans { scrollbar-width: none; }
    .bounce-plans .pcard {
        min-width: 280px;
        flex-shrink: 0;
        scroll-snap-align: center;
    }
}

/* ----------------- Announce ---------------- */

.announce {
    display: flex;
    flex-direction: row;
    cursor: default;
    position: relative;
    max-height: 96%;
    max-width: 1080px;
    width: calc(100% - 40px);
    color: #333;
    font-size: 14px;
    line-height: 18px;
    border-radius: 20px;
    background-color: #fff;
    box-shadow: 0px 0px 20px 2px rgba(0,0,0,0.3);
    opacity: 0;
    transform: scale(.8);
    will-change: transform, opacity;
    transition: transform .2s ease-in-out, opacity .2s ease-in-out;
}
.announce.ani {
    opacity:1;
    transform: scale(1);
}
.announce .announce-close {
    display: flex;
    opacity: 1;
    top: -16px;
    right: -16px;
    z-index: 200;
    width: 36px;
    height: 36px;
    justify-content: center;
    cursor: pointer;
    align-items: center;
    border-radius: 50%;
    position: absolute;
    border: solid 2px #fff;
    background-color: #4e4e4e;
    transition: all 0.15s linear;
}

.announce .announce-close img {
    width: 12px;
    height: 12px;
    opacity: 0.9;
    transition: all 0.15s linear;
}
html:not(.touch) .announce-close:hover {
    background-color: #979797;
}
html:not(.touch) .announce-close:hover img {
    opacity: 1;
}
.announce .content {
    overflow-y: auto;
    overflow-x: hidden;
}
.announce .content::-webkit-scrollbar {
    width: 16px;
}
.announce .content::-webkit-scrollbar-thumb {
    height: 56px;
    border-radius: 8px;
    border: 4px solid transparent;
    background-clip: content-box;
    background-color: #999;
}
.announce .content::-webkit-scrollbar-thumb:hover {
    background-color: #666;
}
.announce .half {
    width:500px;
    padding:50px;
    display: flex;
    min-height: 650px;
    align-items: center;
    flex-direction: column;
    justify-content: center;
}
.announce .hero {
    flex:1;
    overflow: hidden;
    background-size: cover;
    border-radius: 19px 0 0 19px;
    background-position: 50% 50%;
}
.announce h1,
.announce h2,
.announce h3,
.announce h4,
.announce h5 {
    color: #000;
}
.announce h1.large {
    font-size: 3.5em;
}
.announce p {
    font-size: 1.1em;
}
.announce label {
    font-weight: bold;
}
.announce a:not(.button) {
    color: #5766c3;
}
.announce a:hover:not(.button) {
    color:#2f376b;
}
.announce .button:not(.white) {
    color:#fff;
    background-color: #000;
}
.announce .switch {
    margin-left:3px;
    justify-content: flex-start;
}
.announce .switch span:first-of-type {
    background: #bbb;
}
.announce input:checked + .switch span:first-of-type {
    background: #000;
}
.announce select,
.announce input[type="email"],
.announce input[type="text"],
.announce input[type="number"],
.announce input[type="password"] {
    width: 100%;
    height: 40px;
    margin-top:4px;
    padding: 0 10px;
    color: #323539;
    background: #fff;
    line-height: 38px;
    border-radius: 4px;
    transition: all 0.15s linear;
    border: 1px solid #dbdbdb;
    appearance: textfield;
}
.announce select option {
    background-color: initial;
}
.announce input[type="email"]:focus,
.announce input[type="text"]:focus,
.announce input[type="number"]:focus,
.announce input[type="password"]:focus,
html:not(.touch) .announce select:hover,
html:not(.touch) .announce input[type="email"]:hover,
html:not(.touch) .announce input[type="text"]:hover,
html:not(.touch) .announce input[type="number"]:hover,
html:not(.touch) .announce input[type="password"]:hover {
    color: #333;
    border: 1px solid #333;
}
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}
.announce input.invalid {
    border: 1px solid #E71D36 !important;
    background-color: #FFF6F6 !important;
}
.announce .error-msg {
    width: 100%;
    display: none;
    font-size: 13px;
    color: #E71D36;
    margin:4px 0 0 0;
}
.premium-plug, .user-plug {
    top: -30px;
    left:calc(50% - 40px);
    width:80px;
    height:80px;
    padding:5px;
    display: block;
    overflow: hidden;
    position: absolute;
    border-radius: 50%;
    background-color: #fff;
}
.premium-plug img, .user-plug img {
    display: block;
    width: 100%;
    height: 100%;
    padding:10px;
    border-radius: 50%;
    background-color: #ecb302;
}
.user-plug img {
    background-color: #3e3e3e;
}

/* ------------------- Credit Meter ------------- */

.credit-meter {
    display: inline-flex;
    padding: 4px 12px 4px 8px;
    cursor: pointer;
    border-radius: 6px;
    align-items: center;
    color:var(--text-dim);
    transition: all 0.15s linear;
    background-color: var(--component-dim);
}
.credit-meter::before {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    margin-right:4px;
    background-color: var(--text-dim);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 14.82c7.733 0 14-2.648 14-5.91S23.733 3 16 3 2 5.647 2 8.91s6.267 5.91 14 5.91m0 9.45c-5.343 0-10.068-1.302-13.048-3.313-.607.665-.952 1.38-.952 2.133C2 26.352 8.268 29 16 29s14-2.648 14-5.91c0-.754-.344-1.468-.951-2.127-2.98 2.005-7.706 3.307-13.048 3.307zm0-7.09c-5.343 0-10.068-1.302-13.048-3.313C2.345 14.532 2 15.247 2 16c0 3.262 6.268 5.91 14 5.91S30 19.262 30 16c0-.753-.344-1.468-.951-2.127-2.98 2.005-7.706 3.307-13.048 3.307z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 14.82c7.733 0 14-2.648 14-5.91S23.733 3 16 3 2 5.647 2 8.91s6.267 5.91 14 5.91m0 9.45c-5.343 0-10.068-1.302-13.048-3.313-.607.665-.952 1.38-.952 2.133C2 26.352 8.268 29 16 29s14-2.648 14-5.91c0-.754-.344-1.468-.951-2.127-2.98 2.005-7.706 3.307-13.048 3.307zm0-7.09c-5.343 0-10.068-1.302-13.048-3.313C2.345 14.532 2 15.247 2 16c0 3.262 6.268 5.91 14 5.91S30 19.262 30 16c0-.753-.344-1.468-.951-2.127-2.98 2.005-7.706 3.307-13.048 3.307z'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    transition: all 0.15s linear;
}
.credit-meter:hover {
    color:var(--text-opaque);
    background-color: var(--component-highlight);
}
.credit-meter:hover::before {
    background-color:var(--text-opaque);
}

/*------------------- Entry ------------------ */

.entry .chooser {
    gap:20px;
    display: flex;
    padding-top:30px;
    flex-direction: column;
}
.entry .social-button {
    gap:10px;
    color:#555;
    width: 100%;
    height: 48px;
    padding:0 20px;
    display: flex;
    cursor: pointer;
    font-weight: bold;
    border-radius: 8px;
    align-items: center;
    justify-content:flex-start;
    transition: all .15s linear;
    border: 1px solid #dbdbdb;
}
.entry .social-button:hover {
    border: 1px solid #333;
}

/* -------------- News Dialog ----------------- */

.news-dialog.single-news {
    max-width: 675px;
}
.news-dialog .news-split {
    display: flex;
}
.news-dialog .news-body {
    overflow-y: auto;
}
.news-dialog .news-body::-webkit-scrollbar {
    width: 16px;
}
.news-dialog .news-body::-webkit-scrollbar-thumb {
    height: 56px;
    border-radius: 8px;
    border: 4px solid transparent;
    background-clip: content-box;
    background-color: #999;
}
.news-dialog .news-body::-webkit-scrollbar-thumb:hover {
    background-color: #666;
}
.news-dialog .news-cover {
    width: 100%;
    min-height: 300px;
    object-fit: cover;
    display: block;
}
.news-dialog .cover-stack {
    overflow: hidden;
    position: relative;
}
.news-dialog .play-button {
    position: absolute;
    z-index: 150;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.news-dialog .play-button > img {
    width: 80px;
    height: 80px;
}
.news-dialog .player-container {
    position: absolute;
    z-index: 200;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.news-dialog .player {
    background: #000;
    border: none;
}
.news-dialog .news-menu {
    padding: 40px;
    min-width: 320px;
    flex-direction: column;
    background: rgba(0,0,0,0.1);
}
.news-dialog .news-menu .headline {
    font-size: 20px;
    font-weight: bold;
    line-height: 40px;
}
.news-dialog .news-menu .item {
    display: flex;
    color: inherit;
    font-size: 14px;
    align-items: center;
    margin-top: 20px;
}
.news-dialog .news-menu .item.selected {
    font-weight: bold;
}
.news-dialog .news-content {
    padding: 40px;
    display: flex;
    overflow: hidden;
    flex-direction: column;
}
.news-dialog .news-title {
    gap: 10px;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
}
.news-dialog .news-date {
    display: flex;
    flex-direction: row;
    gap: 8px;
}
.news-dialog .news-headline {
    font-size: 26px;
    font-weight: bold;
    line-height: initial;
}
.news-dialog .news-text {
    font-size: 14px;
    line-height: 24px;
    padding: 20px 0;
}
.news-dialog .show {
    display: flex !important;
}

/* --------------- Buttons --------------------- */

.buttons {
    gap: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.button {
    border: none;
    display: inline-flex;
    cursor: pointer;
    user-select: none;
    position: relative;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    color: #fff;
    gap: 10px;
    height: 32px;
    min-height: 32px;
    border-radius: 50vh;
    padding-left: 20px;
    padding-right: 20px;
    white-space: nowrap;
    transition: all 0.15s linear;
}
button.flex {
    flex:1;
    display: flex;
}
.button.negative,
.button.outline {
    height:34px;
    background: none;
    color: var(--text-dim);
    border: 1px solid var(--component-highlight);
}
html:not(.touch) .button.negative:hover:not(.disabled),
html:not(.touch) .button.outline:hover:not(.disabled) {
    background: var(--component-dim);
    color: var(--text-opaque);
}
.button.tiny {
    gap:4px;
    height:24px;
    min-height: 24px;
    font-size:12px;
    min-width: unset;
}
.button.small {
    gap:6px;
    height:28px;
    min-height: 28px;
    font-size:12px;
    min-width: unset;
}
.button.med {
    height: 40px;
    min-height: 40px;
    min-width: 120px;
}
.button.large {
    height: 46px;
    min-height: 40px;
    font-size: 14px;
    min-width: 150px;
    text-transform: none;
}
.button.xlarge {
    height: 60px;
    min-height: 60px;
    font-size: 15px;
    text-transform: none;
}
.button.black {
    color:#fff;
    background-color: #1a1a1a;
}
html:not(.touch) .button.black:hover:not(.disabled):not(.working) {
    background-color: #fff;
    color:#1a1a1a;
}
.button.white {
    background: #fff;
    color: #323539;
    border: 1px solid #D3D4D4;
}
.button.positive {
    background-color: var(--accent-color);
}
html:not(.touch) .button.positive:hover:not(.disabled):not(.working) {
    filter: brightness(1.15);
}
.button.purple {
    background-color: #8c54bd;
}
.button.purple img {
    opacity: 1;
}
html:not(.touch) .button.purple:hover:not(.disabled):not(.working) {
    background-color: #995dce;
}
.button.disabled,
.button:disabled {
    opacity: 0.4;
    cursor: default;
    box-shadow: none;
}
.button:disabled:hover {
    box-shadow: none !important;
}
.button:active:not(.disabled):not(.working) {
    transform: translateY(2px);
}
.button.working {
    color:transparent !important;
}
.button.working > img {
    opacity: 0 !important;
}
.button > img {
    opacity: var(--normal-opacity);
    transition: all 0.15s linear;
}
.button.positive > img {
    opacity: .9;
}
.button:has(img) {
    padding-left:10px;
}
.button.med:has(img) {
    padding-left:15px;
}
html:not(.touch) .button:hover:not(.disabled):not(.working) > img {
    opacity: 1;
}

/* --------------- Switch --------------------- */

.switch {
    gap:10px;
    display: flex;
    cursor: pointer;
    user-select: none;
    align-items: center;
    justify-content: space-between;
}
.switch span:first-of-type {
    width: 36px;
    height: 20px;
    border-radius: 10px;
    position: relative;
    transition: all 0.2s linear;
    background: var(--component-dim);
}
.switch span:first-of-type:after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    transition: 0.3s;
    border-radius: 50%;
    background: var(--text-dim);
}
input[type='checkbox'] {
    height: 0;
    width: 0;
    visibility: hidden;
    display: block !important;
    padding: 0px !important;
    margin: 0px !important;
}
input:checked + .switch span:first-of-type {
    background-color: var(--accent-color);
}
input:checked + .switch span:first-of-type:after {
    left: calc(100% - 3px);
    transform: translateX(-100%);
    background: #fff;
}
.switch span:first-of-type:active:after {
    width: 18px;
}

/* --------------- Close Button --------------------- */

.close {
    z-index: 80;
    width: 28px;
    height: 28px;
    padding: 7px;
    cursor: pointer;
    user-select: none;
    position: absolute;
    right: 6px; top: 6px;
    border-radius: 50%;
    transition: all 0.15s linear;
    opacity: var(--normal-opacity);
}
.close:active,
html:not(.touch) img.close:hover  {
    opacity: 1;
}

/* --------------- Toggle Switch --------------------- */

.toggle-switch {
    display: flex;
    justify-content: center;
    user-select: none;
}
.toggle-switch .toggle-check { display: none; }
.toggle-switch label {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 4px;
    font-weight: 700;
    color: var(--text-color);
    border-radius: 50vh;
    background: var(--component-dim);
    border: 1px solid var(--component-dim);
    cursor: pointer;
}
.toggle-switch .switch-option {
    position: relative;
    text-align: center;
    padding: 8px 24px;
    border-radius: 50vh;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s, color 0.15s;
}
.toggle-switch a.switch-option:hover {
    color: inherit;
    text-decoration: none;
}
.toggle-switch .switch-option.active {
    background: #1a1a1a;
    color: #fff;
}
/* Checkbox-driven toggle (collage, etc.) */
.toggle-switch .toggle-check:not(:checked) + label .switch-a {
    background: #1a1a1a;
    color: #fff;
}
.toggle-switch .toggle-check:checked + label .switch-b {
    background: #1a1a1a;
    color: #fff;
}

/* --------------- Model Selector --------------------- */

#generator-model-selector {
    position: relative;
}
.model-trigger {
    gap: 8px;
    width: 100%;
    max-width: 300px;
    height: 50px;
    min-height: 50px;
    padding: 0 12px 0 6px;
    display: flex;
    cursor: pointer;
    align-items: center;
    border-radius: 6px;
    border: 1px solid var(--component-dim);
    transition: all 0.15s linear;
}
.model-trigger:active,
html:not(.touch) .model-trigger:hover {
    border: 1px solid var(--component-border);
}
.model-trigger.fast { border: solid 1px #66b5e0; background-color: #66b5e015; }
.model-trigger.pro { border: solid 1px #9259cc; background-color: #9359CC15; }
.model-trigger.ultra { border: solid 1px #b6913c; background-color: #B6923C15; }
.model-trigger:after {
    content: '';
    width: 0; height: 0;
    border-style: solid;
    border-width: 5px 5px 0 5px;
    border-color: var(--text-color) transparent transparent transparent;
    pointer-events: none;
    margin-left: 4px;
}
.model-dropdown {
    gap: 2px;
    top: 25px;
    left: 0;
    z-index: 99;
    display: none;
    padding: 8px;
    width: 100%;
    max-width: 300px;
    position: absolute;
    border-radius: 8px;
    flex-direction: column;
    background-color: var(--component-highlight);
    border: solid 1px var(--component-dim);
    animation: drop-slide 0.2s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.model-dropdown::before {
    content: '';
    position: absolute;
    top: -8px; left: 0; right: 0;
    height: 8px;
}
.model-dropdown[flow="up"] {
    top: auto;
    bottom: 50px;
}
.model-dropdown[flow="up"]::before {
    top: auto;
    bottom: -8px;
}
.model-section-label {
    font-size: 11px;
    font-weight: 600;
    padding: 8px 6px 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
}
.model-dropdown-item {
    gap: 10px;
    display: flex;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    align-items: center;
    transition: all 0.1s linear;
    border: 1px solid transparent;
}
html:not(.touch) .model-dropdown-item:not(.selected):hover {
    background-color: var(--component-dim);
}
.model-dropdown-item:active { 
    transform: translateY(1px); 
}
.model-dropdown-item.selected { 
    background-color: var(--component-dim);
}
.model-dropdown-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.model-dropdown-info strong,
.model-dropdown-info span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.model-dropdown-info span { font-size: 11px; color: var(--text-dim); }
.model-icon-provider {
    position: relative;
    width: 32px; height: 32px; min-width: 32px;
    border-radius: 6px;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}
.model-icon-provider img { opacity: 0.8; width: 22px; height: 22px; border-radius: 2px; object-fit: contain; }
.model-dropdown-item .model-icon-provider { width: 28px; height: 28px; min-width: 28px; padding: 3px; }
.model-dropdown-item .model-icon-provider img { width: 20px; height: 20px; }
.tier-dot {
    position: absolute;
    top: 2px;
    left: -7px;
    width: 3px;
    height: 24px;
}
.tier-dot.fast { background: linear-gradient(136deg, #8CC69D, #66B5E0); }
.tier-dot.pro { background: linear-gradient(136deg, #E07DAB, #9359CC); }
.tier-dot.ultra { background: linear-gradient(136deg, #E9E090, #B6923C); }
.model-icon {
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
     min-width: 32px;
}
.model-dropdown-item .model-icon { width: 28px; height: 28px; min-width: 28px; }
.model-icon.fast { background-color: #8CC69D; background-image: linear-gradient(136deg, #8CC69D, #66B5E0); }
.model-icon.pro { background-color: #E07DAB; background-image: linear-gradient(136deg, #E07DAB, #9359CC); }
.model-icon.ultra { background-color: #E9E090; background-image: linear-gradient(136deg, #E9E090, #B6923C); }
.model-icon.more { background-color: #888; background-image: linear-gradient(136deg, #999, #666); }
.model-icon img { 
    width: 18px; 
    height: 18px;
    opacity: 0.8;
}
.model-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-right: 8px;
    border-right: 2px solid var(--component-dim);
    overflow: hidden;
    min-width: 0;
}
.model-details strong,
.model-details span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.model-details span { font-size: 12px; color: var(--text-dim); text-transform: capitalize; }
.model-cost {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    gap: 6px;
    color:var(--text-dim);
}
.model-list-item .model-cost { grid-area: cost; }
.model-cost img { width: 16px; height: 16px; opacity: var(--normal-opacity); }
.model-dropdown-item .model-cost img { width: 14px; height: 14px; }

.model-view-all::after {
    content: '';
    width: 6px; height: 6px;
    border-right: 2px solid var(--text-dim);
    border-bottom: 2px solid var(--text-dim);
    transform: rotate(-45deg);
    margin-left: auto;
}
/* Model list (full modal) */
.model-list {
    gap: 4px;
    display: flex;
    flex-direction: column;
}
.model-list-item {
    display: grid;
    grid-template-columns: 32px 1fr auto auto;
    grid-template-rows: auto auto;
    grid-template-areas:
        "icon name plates cost"
        "icon desc desc  desc";
    gap: 2px 10px;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: background 0.1s;
    align-items: center;
}
html:not(.touch) .model-list-item:hover {
    background: var(--component-dim);
}
.model-list-item.selected {
    background: var(--component-dim);
    border-color: var(--component-dim);
}
.model-list-item .model-icon-provider {
    grid-area: icon;
    align-self: center;
}
.model-name {
    grid-area: name;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-weight: 600;
}
.model-description {
    grid-area: desc;
    font-size: 11px;
    color: var(--text-dim);
}
.model-plates {
    grid-area: plates;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.model-list-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
    flex: 1;
    min-width: 0;
}
.model-list-tag {
    font-size: 10px;
    line-height: 14px;
    padding: 4px 6px;
    border-radius: 4px;
    background: var(--component-shade);
    color: var(--text-dim);
    white-space: nowrap;
}
.model-list-tag.featured { border-color: #e08a3a; color: #e08a3a; }
.model-list-tag.new { border-color: #5aab5a; color: #5aab5a; }
.tier-badge {
    font-size: 10px;
    line-height: 12px;
    font-weight: 600;
    padding: 4px 8px 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    white-space: nowrap;
}
.tier-badge.fast { background: #3d7d97; color: #fff; }
.tier-badge.pro { background: #8d538c; color: #fff; }
.tier-badge.ultra { background: #998849; color: #fff; }

.play-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.15s;
}
*:hover > .play-badge {
    opacity: 0;
}

@media only screen and (max-width: 825px) {
    .model-trigger,
    .model-dropdown {
        width: 100%;
        max-width: 100%;
    }
    /* --- Sheet becomes bottom drawer on mobile --- */
    .modal {
        align-items: flex-end;
        padding: 0;
        overflow: hidden;
    }
    .sheet,
    .sheet.wide {
        width: 100%;
        max-width: 100%;
        min-height: 0;
        max-height: 90dvh;
        border-radius: 20px 20px 0 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        transform: translateY(100%);
        opacity: 1;
        transition: transform 0.25s ease;
        background: var(--page-color);
    }
    .sheet.ani {
        transform: translateY(0);
    }
    .sheet::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        border-radius: 2px;
        margin: 12px auto 10px;
        flex-shrink: 0;
        background: var(--text-dim);
    }
    .sheet-close {
        display: none;
    }
    .sheet-header {
        padding: 5px 20px 5px 20px;
    }
    .sheet-layout {
        flex-direction: column;
    }
    .sheet-nav {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--component-dim);
        padding: 0 12px 10px;
        min-width: 0;
        overflow-x: auto;
        background: transparent;
    }
    .sheet-nav::after {
        display: none;
    }
    .model-list-item {
        display: grid;
        grid-template-columns: 28px 1fr auto;
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "icon name cost"
            "icon desc desc"
            "icon plates plates";
        gap: 2px 8px;
        padding: 8px 4px;
        border-top: 1px solid var(--component-dim);
        border-radius: 0;
    }
    .model-list-item .model-icon-provider { grid-area: icon; align-self: center; }
    .model-name { grid-area: name; }
    .model-description { grid-area: desc; }
    .model-plates { grid-area: plates; }
    .model-cost { grid-area: cost; }
    .model-list-tags { justify-content: flex-start; }
    .sheet-content { padding: 0 10px 10px; }
    .sheet-pane { padding: 10px; }

}

/* ------------- Notification ------------- */

#notification {
    color: #fff;
    display: none;
    position: absolute;
    z-index: 9999;
}
#notification .spinner,
#notification .message,
#notification .legend {
    height: 28px;
    line-height: 28px;
    padding: 0px 20px;
    border-radius: 15px;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: capitalize;
    background-color: rgba(0, 0, 0, 0.7);
}
#notification .message {
    animation: noti_bounce 1.5s;
    animation-fill-mode: forwards;
}
#notification .spinner {
    animation: noti_appear .25s;
    animation-fill-mode: forwards;
}
#notification label.working {
    padding-left:25px;
    margin-left:-14px;
}
@keyframes noti_bounce {
    0% { transform: scale(.5); opacity: 0; }
    15% { transform: scale(1.1); opacity: 1; }
    20% { transform: scale(.9); }
    25% { transform: scale(1.03); }
    30% { transform: scale(.97); }
    35% { transform: scale(1); }
    80% { transform: scale(1); opacity: 1; }
    100% { transform: scale(.5); opacity: 0; }
}
@keyframes noti_appear {
    0% { transform: scale(.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* -------- Loading (three-dot animation) --------- */

.loading,
.loading:before,
.loading:after {
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation-fill-mode: both;
    animation: load 1.8s infinite ease-in-out;
}
.loading {
    color: var(--text-dim);
    font-size: 10px;
    margin: 80px auto;
    position: relative;
    text-indent: -9999em;
    transform: translateZ(0);
    animation-delay: -0.16s;
}
.loading:before,
.loading:after {
    content: '';
    position: absolute;
    top: 0;
}
.loading:before {
    left: -40px;
    animation-delay: -0.32s;
}
.loading:after {
    left: 40px;
}
.loading.small:before {
    left: -12px;
}
.loading.small:after {
    left: 12px;
}
@keyframes load {
    0%, 80%,100% { box-shadow: 0 2.5em 0 -1.3em; }
    40% { box-shadow: 0 2.5em 0 0; }
}

/* --------------------- Loader (spinner) ------------------- */

.loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(217, 217, 217, 1);
    border-bottom-color: rgba(217, 217, 217, 0.3);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}
@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ---- Component Responsive Overrides ---- */

@media only screen and (max-height: 825px) and (min-width: 826px) {
    .modal {
        padding:20px 0;
        align-items: flex-start;
    }
    .sheet,
    .announce {
        align-self: center;
    }
}
@media only screen and (max-width: 825px) {

    .wrap {
        width: calc(100% - 30px);
    }
    header {
        background-color: var(--title-color);
    }
    .header-bar {
        padding-top:10px;
        padding-bottom:10px;
    }

    #app-logo {
        font-size: 20px;
        margin-left: 0px;
    }
    .head-text-button {
        gap:30px;
        width: 42px;
        height: 42px;
        min-width: 42px;
        padding-left: 11px;
        background-color: var(--component-dim);
    }
    .news-dialog .news-menu {
        display: none;
    }
    h1 { font-size: 1.6em; }
    h2 { font-size: 1.3em; }
    h3 { font-size: 1.1em; }
    footer .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        justify-items: center;
        text-align: center;
    }
    footer .footer-bottom {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    .top-50 { margin-top: 30px !important; }
    .top-80 { margin-top: 40px !important; }
    .top-100 { margin-top: 50px !important; }
    .top-200 { margin-top: 100px !important; }
}
@media only screen and (max-width: 650px) {

    html, body {
        overscroll-behavior-y: contain; /* or 'none' */
    }
    .announce .content {
        flex: 1;
    }
    .announce .hero {
        display: none;
    }
    .announce .half {
        flex:1;
        width: unset;
        padding: 40px 20px;
        min-height: 400px;
    }
    .head-text-button {
        display: none;
    }
    .news-dialog .news-content {
        padding: 30px;
    }
}
