:root, html[data-theme="dark"] {
    --ink: #eef1ff;
    --paper: #07070d;
    --card: #12121c;
    --line: rgba(140, 150, 220, .18);
    --muted: #8b90b3;
    --accent: #3ecbff;
    --accent-2: #c84bff;
    --grad: linear-gradient(135deg, #2ec5ff 0%, #4d6bff 48%, #c84bff 100%);
    --ok: #4ade9b;
    --danger: #ff6b7a;
    --side: #08080f;
    --side-text: #d7dbf5;
    --input: #0c0c14;
    --nav: #b8bdd8;
    --nav-hover: rgba(255, 255, 255, .06);
    --nav-hover-text: #fff;
    --nav-on: linear-gradient(135deg, rgba(46, 197, 255, .28), rgba(200, 75, 255, .24));
    --nav-on-text: #fff;
    --nav-on-ring: rgba(160, 170, 255, .22);
    --block-bar: #161622;
    --login-wash: #050508;
    --login-card: rgba(12, 12, 20, .92);
    --login-shadow: 0 24px 80px rgba(0, 0, 0, .45), 0 0 80px rgba(80, 70, 220, .12);
    --panel-shadow: 0 16px 40px rgba(0, 0, 0, .25);
    --media-bg: #0a0a12;
    --radius: 16px;
    --glow: 0 10px 40px rgba(80, 90, 255, .28);
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    color-scheme: dark;
}

html[data-theme="light"] {
    --ink: #171728;
    --paper: #f2f0fa;
    --card: #ffffff;
    --line: rgba(40, 45, 90, .12);
    --muted: #5c6182;
    --accent: #3b6bff;
    --accent-2: #9a4dff;
    --ok: #1b8a58;
    --danger: #c43b4a;
    --side: #f7f6fd;
    --side-text: #171728;
    --input: #ffffff;
    --nav: #3a3f63;
    --nav-hover: rgba(60, 80, 200, .08);
    --nav-hover-text: #171728;
    --nav-on: linear-gradient(135deg, rgba(46, 140, 255, .22), rgba(120, 80, 255, .2));
    --nav-on-text: #171728;
    --nav-on-ring: rgba(70, 80, 190, .28);
    --block-bar: #eef0fb;
    --login-wash: #eceaf8;
    --login-card: #ffffff;
    --login-shadow: 0 20px 50px rgba(40, 40, 90, .1);
    --panel-shadow: 0 10px 28px rgba(40, 40, 80, .07);
    --media-bg: #eceaf6;
    --glow: 0 8px 24px rgba(80, 90, 255, .18);
    color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body.admin {
    min-height: 100vh;
    background:
        radial-gradient(900px 420px at 0% -10%, rgba(46, 197, 255, .12), transparent 55%),
        radial-gradient(800px 380px at 100% 0%, rgba(200, 75, 255, .1), transparent 50%),
        var(--paper);
    color: var(--ink);
    display: grid;
    grid-template-columns: 268px 1fr;
}

.sidebar {
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 140px),
        var(--side);
    color: var(--side-text);
    padding: 18px 14px 14px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--line);
}
.side-top { flex: 0 0 auto; }
.logo {
    display: block;
    text-decoration: none;
    margin: 0 6px 12px;
    outline: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.logo:focus, .logo:focus-visible { outline: none; }
.logo img {
    display: block;
    width: 100%;
    max-width: 196px;
    height: auto;
    border: 0;
    outline: none;
    border-radius: 0;
    box-shadow: none;
}
.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow: auto;
    padding: 2px 2px 8px 0;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--muted) 35%, transparent) transparent;
}
.sidebar nav::-webkit-scrollbar { width: 6px; }
.sidebar nav::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--muted) 32%, transparent);
    border-radius: 99px;
}
.sidebar nav a,
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--nav);
    text-decoration: none;
    padding: 8px 10px 8px 12px;
    border-radius: 12px;
    font-weight: 550;
    line-height: 1.25;
    font-size: .92rem;
    position: relative;
}
.sidebar nav a:hover,
.nav-link:hover { background: var(--nav-hover); color: var(--nav-hover-text); }
.sidebar nav a.is-on,
.nav-link.is-on {
    background: var(--nav-on);
    color: var(--nav-on-text);
    font-weight: 700;
    box-shadow: inset 0 0 0 1px var(--nav-on-ring);
}
.sidebar nav a.is-on::before,
.nav-link.is-on::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    bottom: 7px;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: var(--grad);
}
.nav-ico {
    display: inline-flex;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    opacity: .88;
}
.nav-svg { width: 18px; height: 18px; display: block; }
.nav-link.is-on .nav-ico { opacity: 1; }
.nav-txt { min-width: 0; flex: 1; }
.nav-badge {
    margin-left: auto;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 6px;
    border-radius: 99px;
    background: var(--accent, #e11d48);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.table tr.is-unread td { background: color-mix(in srgb, var(--accent, #2563eb) 8%, transparent); }
.rev-list { list-style: none; margin: 0; padding: 0; }
.rev-list li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
    font-size: .85rem;
}
.rev-list li:last-child { border-bottom: 0; }
.role-pill {
    display: inline-flex;
    align-items: center;
    margin: 0 6px 12px;
    padding: 4px 10px;
    font-size: .68rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--card) 70%, transparent);
}
.site-switch {
    margin: 0 0 14px;
    padding: 10px 10px 12px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--accent) 10%, var(--card));
    box-shadow:
        inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 50%, var(--accent-2, #c84bff) 50%),
        0 8px 22px color-mix(in srgb, var(--accent) 16%, transparent);
}
.site-switch label {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
    font-size: .68rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.site-switch label .nav-ico { opacity: .7; }
.site-switch select {
    flex: 1 1 100%;
    margin-top: 4px;
    background: var(--input);
    color: var(--ink);
    font-weight: 700;
    border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}
.nav-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 8px 6px;
    font-size: .66rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted);
}
.nav-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}
.nav-label:first-child { margin-top: 2px; }
.side-foot {
    font-size: .85rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 4px 2px;
    border-top: 1px solid var(--line);
    margin-top: 8px;
}
.side-foot a { color: var(--ink); text-decoration: none; }
.side-view {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: .85rem;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--card) 80%, transparent);
}
.side-view:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.side-view .nav-ico { color: var(--accent); }
.side-user {
    display: grid;
    grid-template-columns: 36px 1fr 34px;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--card) 85%, transparent);
    border: 1px solid var(--line);
}
.side-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: .95rem;
    color: #fff;
    background: var(--grad);
    box-shadow: var(--glow);
}
.side-user-meta { min-width: 0; }
.side-user-meta strong {
    display: block;
    color: var(--ink);
    font-size: .86rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.side-user-meta a {
    display: block;
    color: var(--muted);
    font-size: .72rem;
    margin-top: 1px;
}
.side-user-meta a:hover { color: var(--ink); }
.side-logout {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: var(--muted);
}
.side-logout:hover { background: var(--nav-hover); color: var(--danger); }
.side-logout .nav-svg { width: 16px; height: 16px; }
.view-site { font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.theme-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    margin: 0 0 10px;
    background: var(--input);
    border: 1px solid var(--line);
    border-radius: 999px;
}
.theme-switch button {
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: .78rem;
    font-weight: 700;
    padding: 7px 8px;
    border-radius: 999px;
    cursor: pointer;
}
.theme-switch button.is-on {
    background: var(--grad);
    color: #fff;
    box-shadow: var(--glow);
}

.main { padding: 36px 40px 64px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
h1, h2, h3 { font-family: inherit; font-weight: 700; margin: 0 0 .4rem; letter-spacing: -.02em; }
h1 { font-size: 1.85rem; }
.muted { color: var(--muted); }
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--grad); color: #fff; border: 0; border-radius: 999px;
    padding: 10px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
    box-shadow: var(--glow);
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost {
    background: transparent; color: var(--ink); border: 1px solid var(--line);
    box-shadow: none;
}
.btn.small { padding: 7px 12px; font-size: .9rem; }
.btn:disabled { opacity: .5; }

.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; }
.flash.ok { background: rgba(74, 222, 155, .12); color: var(--ok); }
.flash.err { background: rgba(255, 107, 122, .12); color: var(--danger); }

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--panel-shadow);
}
label { display: block; font-weight: 600; margin: 12px 0 6px; font-size: .92rem; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number],
input[type=url], input[type=tel], input[type=date], input[type=file], select, textarea {
    width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px;
    font: inherit; background: var(--input); color: var(--ink);
}
input:not([type]):focus, input[type=text]:focus, input[type=email]:focus, input[type=password]:focus,
input[type=number]:focus, input[type=url]:focus, input[type=tel]:focus, input[type=date]:focus,
select:focus, textarea:focus {
    outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 1px;
    border-color: var(--accent);
}
textarea { min-height: 88px; resize: vertical; }
.feat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    margin: 8px 0 4px;
}
label.check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
}
.feat-grid .check { margin: 0; }
label.check input[type=checkbox] {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    accent-color: #6d7cff;
}
.feat-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.feat-pills .pill { margin-left: 0; }
.quota-wrap { margin: 0 0 18px; }
.quota-bar {
    height: 8px;
    background: var(--line);
    border-radius: 99px;
    overflow: hidden;
}
.quota-bar span {
    display: block;
    height: 100%;
    background: var(--grad);
}
.quota-bar.is-full span { background: var(--danger); }
.login-card .hint { margin: -8px 0 14px; }
@media (max-width: 640px) {
    .feat-grid { grid-template-columns: 1fr; }
}
.hint { font-size: .85rem; color: var(--muted); }
.hint a { color: var(--accent); }
.subpanel {
    margin: 14px 0 0;
    padding: 14px;
    border: 1px dashed var(--line);
    border-radius: 12px;
}
.subpanel legend { font-weight: 700; padding: 0 6px; }
.filters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px 16px;
    margin-bottom: 1.5rem;
    align-items: end;
}
.filters label { margin-top: 0; }
.filters .filter-search { grid-column: span 2; }
.status-select { width: auto; min-width: 148px; padding: 7px 10px; font-weight: 600; }
.pill.due, .status-select.due { color: #ffd27a; }
.pill.pending { background: rgba(62, 203, 255, .16); color: var(--accent); }
.pill.paid { background: rgba(74, 222, 155, .16); color: var(--ok); }
@media (max-width: 900px) {
    .filters { grid-template-columns: 1fr 1fr; }
    .filters .filter-search { grid-column: 1 / -1; }
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stats article {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
}
.stats span { color: var(--muted); font-size: .9rem; }
.stats strong {
    display: block;
    font-size: 2rem;
    margin-top: 4px;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.plain-list a { color: inherit; font-weight: 600; text-decoration: none; }
.pill { font-size: .75rem; border-radius: 999px; padding: 2px 8px; background: rgba(140, 150, 220, .16); margin-left: 6px; }
.pill.published { background: rgba(74, 222, 155, .16); color: var(--ok); }
.pill.draft { background: rgba(255, 196, 90, .14); color: #ffd27a; }
.pill.home { background: linear-gradient(135deg, rgba(46, 197, 255, .22), rgba(200, 75, 255, .22)); color: #fff; }
.pill.platform { background: var(--grad); color: #fff; margin-left: 8px; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table a { color: inherit; }
.mono { font-family: ui-monospace, monospace; font-size: .85rem; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; text-decoration: underline; }
.linkish.danger, a.danger { color: var(--danger); }
.row-actions form { display: inline; }
.icon-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
}
.icon-actions form { display: inline; margin: 0; }
.icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--input);
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    font: inherit;
}
.icon-action svg { width: 18px; height: 18px; display: block; }
.icon-action:hover { background: var(--nav-hover); }
.icon-action.danger { color: var(--danger); }
.icon-action.danger:hover { background: color-mix(in srgb, var(--danger) 14%, transparent); }

.color-row { display: grid; grid-template-columns: 1fr 56px auto; gap: 10px; align-items: center; }
.color-row input[type=color] { width: 56px; height: 36px; padding: 0; border: 0; background: none; }
.logo-preview { max-height: 64px; }
.favicon-preview { width: 32px; height: 32px; }
.preview-swatch { margin-top: 18px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.swatch-head { background: var(--p); color: #fff; padding: 12px 16px; font-weight: 700; }
.swatch-body { background: var(--b); color: var(--t); padding: 16px; }
.swatch-body span { display: inline-block; margin-top: 8px; background: var(--a); color: #fff; padding: 6px 12px; border-radius: 999px; font-size: .85rem; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.theme-card {
    display: block; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; cursor: pointer;
}
.theme-card.is-on { border-color: #6d7cff; box-shadow: 0 0 0 1px rgba(80, 100, 255, .35); }
.theme-card input { margin-bottom: 8px; }
.theme-card p { margin: 8px 0 0; font-size: .88rem; color: var(--muted); font-weight: 400; }
.swatch-row { display: flex; gap: 4px; margin-bottom: 10px; }
.swatch-row i { display: block; flex: 1; height: 10px; border-radius: 99px; }

.ind-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.ind-card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 2px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--panel-shadow);
    min-width: 0;
    position: relative;
}
.ind-card:not(label) { cursor: default; }
.ind-card.is-on,
.ind-card:has(input:checked) {
    border-color: #6d7cff;
    box-shadow: 0 0 0 1px rgba(80, 100, 255, .35);
}
.ind-card input[type=radio] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.ind-cover {
    display: block;
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--media-bg);
    overflow: hidden;
}
.ind-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ind-cover .swatch-row {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    margin: 0;
    gap: 5px;
}
.ind-cover .swatch-row i {
    height: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.ind-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.ind-body strong,
.ind-body h2 {
    font-size: 1.02rem;
    margin: 0;
}
.ind-body p { margin: 0; font-size: .86rem; color: var(--muted); font-weight: 400; }
.ind-body .hint { margin-top: 4px; }
.ind-body .row-actions { margin-top: 8px; }

.section-title { font-size: 1.05rem; margin: 8px 0 14px; }
.danger-text { color: var(--danger) !important; }

.theme-lib {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.theme-lib-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--panel-shadow);
    display: flex;
    flex-direction: column;
}
.theme-lib-card.is-on { border-color: #6d7cff; box-shadow: 0 0 0 1px rgba(80, 100, 255, .35); }
.theme-lib-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.theme-lib-body h2 { font-size: 1.1rem; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.theme-lib-body .muted { margin: 0; font-size: .9rem; }
.theme-lib-body .hint { margin: 0; }
.theme-mini {
    height: 118px;
    background: var(--b, #f6f1ea);
    position: relative;
}
.theme-mini-head {
    height: 28px;
    background: var(--h, #1f3a34);
    box-shadow: inset 0 -2px 0 var(--a, #c45c26);
}
.theme-mini-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.theme-mini-body span:first-child {
    display: block; height: 10px; width: 62%;
    background: var(--p, #1f3a34); border-radius: 99px; opacity: .9;
}
.theme-mini-body span:last-child {
    display: block; height: 8px; width: 38%;
    background: var(--a, #c45c26); border-radius: 99px;
}

.theme-studio {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(260px, 400px);
    gap: 20px;
    align-items: start;
}
.studio-preview { position: sticky; top: 20px; }
.studio-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 12px; }
.studio-tab {
    border: 1px solid var(--line); background: var(--input); color: var(--ink);
    border-radius: 999px; padding: 6px 12px; font: inherit; font-weight: 600; font-size: .85rem; cursor: pointer;
}
.studio-tab.is-on { background: var(--grad); color: #fff; border-color: transparent; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 0 0 16px; }
.choice-grid.fonts { grid-template-columns: 1fr; }
.choice {
    display: flex; flex-direction: column; gap: 8px; margin: 0; position: relative;
    border: 1px solid var(--line); border-radius: 14px; padding: 10px;
    background: var(--input); cursor: pointer; font-weight: 600; font-size: .82rem;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice.is-on, .choice:has(input:checked) { border-color: #6d7cff; box-shadow: 0 0 0 1px rgba(80, 100, 255, .35); }
.choice-lab { color: var(--ink); }
.font-choice strong { font-size: 1.15rem; }
.choice-mod {
    display: block; height: 44px; border-radius: 8px; background: #d9d3cc;
    position: relative; overflow: hidden;
}
.ch-split { background: linear-gradient(#2a3d38, #2a3d38) 0 0 / 100% 14px no-repeat, #efe8df; }
.ch-split::after { content: ""; position: absolute; left: 8px; top: 4px; width: 18px; height: 6px; background: #fff; border-radius: 2px; }
.ch-split::before { content: ""; position: absolute; right: 8px; top: 5px; width: 36px; height: 4px; background: #c45c26; border-radius: 2px; }
.ch-stacked { background: linear-gradient(#2a3d38, #2a3d38) 0 0 / 100% 22px no-repeat, #efe8df; }
.ch-stacked::after { content: ""; position: absolute; left: 50%; top: 4px; transform: translateX(-50%); width: 22px; height: 5px; background: #fff; }
.ch-stacked::before { content: ""; position: absolute; left: 50%; top: 12px; transform: translateX(-50%); width: 40px; height: 4px; background: #c45c26; }
.ch-under { background: #2a3d38; }
.ch-under::before { content: ""; position: absolute; left: 10px; right: 10px; bottom: 10px; height: 3px; background: #c45c26; }
.ch-pills { background: #2a3d38; }
.ch-pills::before { content: ""; position: absolute; left: 10px; top: 16px; width: 40px; height: 12px; border-radius: 99px; background: #c45c26; }
.ch-ghost { background: #2a3d38; }
.ch-ghost::before { content: ""; position: absolute; left: 10px; top: 14px; width: 44px; height: 14px; border-radius: 99px; border: 1px solid #fff; }
.ch-ftr-split { background: linear-gradient(#171311, #171311) 0 100% / 100% 16px no-repeat, #efe8df; }
.ch-ftr-center { background: linear-gradient(#171311, #171311) 0 100% / 100% 22px no-repeat, #efe8df; }
.ch-ftr-menu { background: linear-gradient(#171311, #171311) 0 100% / 100% 16px no-repeat, #efe8df; }
.ch-rad-0, .ch-rad-s, .ch-rad-r, .ch-rad-p { background: #efe8df; }
.ch-rad-0::before, .ch-rad-s::before, .ch-rad-r::before, .ch-rad-p::before {
    content: ""; position: absolute; inset: 12px 16px; background: #c45c26;
}
.ch-rad-0::before { border-radius: 0; }
.ch-rad-s::before { border-radius: 8px; }
.ch-rad-r::before { border-radius: 14px; }
.ch-rad-p::before { border-radius: 99px; height: 12px; inset: 16px 18px; }
.ch-den-c, .ch-den-n, .ch-den-a { background: #efe8df; }
.ch-den-c::before, .ch-den-n::before, .ch-den-a::before {
    content: ""; position: absolute; left: 10px; right: 10px; background: #2a3d38; border-radius: 3px;
}
.ch-den-c::before { top: 8px; bottom: 8px; }
.ch-den-n::before { top: 12px; bottom: 12px; }
.ch-den-a::before { top: 16px; bottom: 16px; }
.ch-w-n::before, .ch-w-m::before, .ch-w-w::before, .ch-w-f::before {
    content: ""; position: absolute; top: 12px; bottom: 12px; background: #2a3d38; border-radius: 3px;
}
.ch-w-n { background: #efe8df; } .ch-w-n::before { left: 28%; right: 28%; }
.ch-w-m { background: #efe8df; } .ch-w-m::before { left: 18%; right: 18%; }
.ch-w-w { background: #efe8df; } .ch-w-w::before { left: 10%; right: 10%; }
.ch-w-f { background: #efe8df; } .ch-w-f::before { left: 4%; right: 4%; }

.range-row {
    display: grid;
    grid-template-columns: 1fr minmax(72px, auto);
    grid-template-areas: "lab out" "rng rng";
    gap: 4px 10px;
    align-items: center;
    margin: 0 0 14px;
    font-weight: 600;
    font-size: .88rem;
}
.range-row span { grid-area: lab; }
.range-row output {
    grid-area: out;
    justify-self: end;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    font-weight: 700;
    font-size: .85rem;
}
.range-row input[type=range] {
    grid-area: rng;
    width: 100%;
    accent-color: #6d7cff;
    cursor: pointer;
}

.ch-nav-in { background: linear-gradient(#2a3d38, #2a3d38) 0 0 / 100% 22px no-repeat, #efe8df; }
.ch-nav-in::after { content: ""; position: absolute; left: 8px; top: 7px; width: 16px; height: 6px; background: #fff; border-radius: 2px; }
.ch-nav-in::before { content: ""; position: absolute; right: 8px; top: 8px; width: 34px; height: 4px; background: #c45c26; border-radius: 2px; }
.ch-nav-above { background: linear-gradient(#c45c26, #c45c26) 0 0 / 100% 8px no-repeat, linear-gradient(#2a3d38, #2a3d38) 0 8px / 100% 16px no-repeat, #efe8df; }
.ch-nav-below { background: linear-gradient(#2a3d38, #2a3d38) 0 0 / 100% 16px no-repeat, linear-gradient(#c45c26, #c45c26) 0 16px / 100% 8px no-repeat, #efe8df; }
.ch-al-l, .ch-al-c, .ch-al-r, .ch-al-s { background: #2a3d38; }
.ch-al-l::before, .ch-al-c::before, .ch-al-r::before, .ch-al-s::before {
    content: ""; position: absolute; top: 18px; height: 6px; border-radius: 99px; background: #c45c26;
}
.ch-al-l::before { left: 8px; width: 36px; }
.ch-al-c::before { left: 50%; width: 36px; transform: translateX(-50%); }
.ch-al-r::before { right: 8px; width: 36px; }
.ch-al-s::before { left: 8px; right: 8px; }

.theme-canvas {
    border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
    font-family: var(--fb, system-ui); background: var(--b, #f6f1ea); color: var(--t, #241c18);
    min-height: 280px; display: flex; flex-direction: column;
}
.theme-canvas .tc-header {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    background: var(--h); color: var(--ht); padding: 0 14px;
    min-height: var(--hh, 48px); height: var(--hh, 48px);
}
.theme-canvas.hdr-stacked.navpos-in .tc-header {
    flex-direction: column; height: auto; min-height: calc(var(--hh, 48px) + var(--nh, 32px));
    padding: 8px 14px;
}
.theme-canvas .tc-brand {
    font-family: var(--fh, Georgia, serif); font-weight: 700;
    display: flex; align-items: center; gap: 8px;
    font-size: clamp(11px, calc(var(--ls, 24px) * .42), 22px);
    line-height: 1;
}
.theme-canvas .tc-logo {
    display: block; flex: 0 0 auto;
    height: var(--ls, 24px); width: calc(var(--ls, 24px) * 1.35);
    border-radius: 4px;
    background: linear-gradient(135deg, #2ec5ff, #c84bff);
}
.theme-canvas .tc-nav { display: flex; gap: 10px; font-size: .78rem; font-weight: 600; min-height: var(--nh, 32px); align-items: center; }
.theme-canvas .tc-bar {
    display: none; align-items: center; background: var(--h); color: var(--ht);
    min-height: var(--nh, 32px); padding: 0 14px;
}
.theme-canvas.navpos-above .tc-nav-slot-above,
.theme-canvas.navpos-below .tc-nav-slot-below { display: flex; }
.theme-canvas.navpos-above .tc-nav-in,
.theme-canvas.navpos-below .tc-nav-in { display: none; }
.theme-canvas.naval-left .tc-bar .tc-nav { justify-content: flex-start; width: 100%; }
.theme-canvas.naval-center .tc-bar .tc-nav { justify-content: center; width: 100%; }
.theme-canvas.naval-right .tc-bar .tc-nav { justify-content: flex-end; width: 100%; }
.theme-canvas.naval-spread .tc-nav { justify-content: space-between; width: 100%; }
.theme-canvas.navpos-in.naval-left .tc-header { justify-content: flex-start; }
.theme-canvas.navpos-in.naval-center .tc-header { justify-content: center; position: relative; }
.theme-canvas.navpos-in.naval-right .tc-header { justify-content: space-between; }
.theme-canvas.navpos-in.naval-center .tc-brand { position: absolute; left: 14px; }
.theme-canvas .tc-nav a { color: var(--ht); }
.theme-canvas.nav-underline .tc-nav a.on { box-shadow: inset 0 -2px 0 var(--a); }
.theme-canvas.nav-pills .tc-nav a { border-radius: 99px; padding: 3px 8px; }
.theme-canvas.nav-pills .tc-nav a.on { background: var(--a); color: #fff; }
.theme-canvas.nav-ghost .tc-nav a { border: 1px solid color-mix(in srgb, var(--ht) 40%, transparent); border-radius: 99px; padding: 2px 8px; }
.theme-canvas.nav-ghost .tc-nav a.on { background: var(--ht); color: var(--h); }
.theme-canvas .tc-main { padding: 22px 18px 28px; flex: 1; }
.theme-canvas.home-w-narrow .tc-main { padding-inline: 28%; }
.theme-canvas.home-w-medium .tc-main { padding-inline: 16%; }
.theme-canvas.home-w-wide .tc-main { padding-inline: 10%; }
.theme-canvas.den-compact .tc-main { padding-block: 12px; }
.theme-canvas.den-airy .tc-main { padding-block: 36px; }
.theme-canvas .tc-main h3 { font-family: var(--fh, Georgia, serif); margin: 0 0 8px; font-size: 1.25rem; }
.theme-canvas .tc-main p { margin: 0 0 12px; color: var(--m); font-size: .88rem; line-height: 1.45; }
.theme-canvas .tc-btn {
    display: inline-block; background: var(--a); color: #fff; padding: 7px 14px; font-size: .8rem; font-weight: 700;
}
.theme-canvas.rad-sharp .tc-btn { border-radius: 0; }
.theme-canvas.rad-soft .tc-btn { border-radius: 10px; }
.theme-canvas.rad-round .tc-btn { border-radius: 16px; }
.theme-canvas.rad-pill .tc-btn { border-radius: 99px; }
.theme-canvas .tc-footer {
    display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
    background: var(--f); color: var(--ft); padding: 12px 14px; font-size: .75rem;
}
.theme-canvas .tc-fnav { display: none; }
.theme-canvas.ftr-center .tc-footer { flex-direction: column; text-align: center; }
.theme-canvas.ftr-center .tc-fnav, .theme-canvas.ftr-menu .tc-fnav { display: inline; }
.theme-canvas.ftr-split .tc-fnav { display: none; }

@media (max-width: 980px) {
    .theme-studio { grid-template-columns: 1fr; }
    .studio-preview { position: static; }
}
.theme-edit .theme-mini { border-radius: 12px; overflow: hidden; margin: 8px 0 4px; border: 1px solid var(--line); }
.theme-pick-card { cursor: pointer; position: relative; }
.theme-pick-card input {
    position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; width: 100%; height: 100%; z-index: 1;
}
.theme-pick-card:has(input:checked),
.theme-pick-card:has(input:focus-visible) {
    border-color: #6d7cff;
    box-shadow: 0 0 0 1px rgba(80, 100, 255, .35);
}

.file-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.file-tabs a {
    padding: 6px 12px; border-radius: 999px; text-decoration: none;
    border: 1px solid var(--line); color: var(--ink); font-size: .85rem; font-weight: 600;
}
.file-tabs a.is-on { background: var(--grad); color: #fff; border-color: transparent; }
.code-label { font-weight: 600; }
.code-editor {
    min-height: 420px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .82rem; line-height: 1.5; tab-size: 4; resize: vertical;
}

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.media-card { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.media-card img, .media-card video { width: 100%; height: 140px; object-fit: cover; display: block; background: var(--media-bg); }
.media-card figcaption { padding: 10px; font-size: .85rem; display: flex; flex-direction: column; gap: 4px; }
.upload-panel, .upload-row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 18px; }
.upload-panel label, .upload-row input { flex: 1; min-width: 180px; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar div { width: 100%; background: var(--grad); border-radius: 6px 6px 0 0; min-height: 2px; }
.bar small { font-size: .7rem; color: var(--muted); margin-top: 4px; }

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
    background:
        radial-gradient(700px 380px at 18% 0%, rgba(46, 197, 255, .2), transparent 58%),
        radial-gradient(640px 360px at 92% 8%, rgba(200, 75, 255, .18), transparent 52%),
        var(--login-wash);
    color: var(--ink);
}
.login-card {
    width: min(420px, 92vw);
    background: var(--login-card);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 36px 32px 28px;
    box-shadow: var(--login-shadow);
}
.login-card .brand {
    margin: 0 0 8px;
    text-align: center;
    outline: none;
    border: 0;
    border-radius: 0;
}
.login-card .brand img {
    display: block;
    width: min(280px, 100%);
    height: auto;
    margin: 0 auto;
}
.login-card h1 {
    font-size: .95rem;
    font-weight: 600;
    color: var(--muted);
    margin: 4px 0 22px;
    text-align: center;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.login-card .muted { margin: 8px 0 18px; }
.login-card label { margin: 0 0 6px; }
.login-card input { margin-bottom: 14px; }
.login-card .btn {
    width: 100%;
    margin-top: 8px;
    padding: 12px 18px;
}
.login-card .back {
    display: block;
    text-align: center;
    margin-top: 18px;
    color: var(--muted);
    text-decoration: none;
    font-size: .92rem;
}
.login-card .back:hover { color: var(--ink); }
.login-card .sso-or {
    text-align: center;
    color: var(--muted);
    margin: 18px 0 8px;
    font-size: .85rem;
}
.login-card .sso-btn {
    margin-top: 8px;
    text-decoration: none;
    text-align: center;
}
.totp-setup {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    margin: 1rem 0;
}
.totp-qr {
    background: #fff;
    padding: 8px;
    border-radius: 12px;
}
.totp-secret {
    font-family: ui-monospace, monospace;
    font-size: 1.15rem;
    letter-spacing: .08em;
    margin: .3rem 0 0;
}
.stack-form .btn { margin-top: 12px; }

body.editor-body { grid-template-columns: 268px 1fr; }
.editor-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.editor-canvas { min-width: 0; }
.editor-top { display: flex; gap: 12px; align-items: center; }
.editor-top input { font-size: 1.45rem; font-weight: 700; border: 0; background: transparent; padding-left: 0; color: var(--ink); }
.editor-top-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; white-space: nowrap; }
.permalink { color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: 6px; }
.permalink input { width: 180px; padding: 4px 8px; }
.add-blocks {
    margin-top: 16px; padding: 16px; border: 1px dashed var(--line); border-radius: 12px;
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.add-blocks button {
    border: 1px solid var(--line); background: var(--card); color: var(--ink);
    border-radius: 999px; padding: 8px 12px; font: inherit; cursor: pointer;
}
.block {
    background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin: 12px 0; overflow: visible;
}
.block-bar { display: flex; justify-content: space-between; padding: 8px 12px; background: var(--block-bar); border-bottom: 1px solid var(--line); }
.block-tools button { border: 0; background: transparent; cursor: pointer; font: inherit; margin-left: 6px; color: var(--ink); }
.block-body { padding: 14px; }
.ql-host { min-height: 140px; background: #f6f4ff; color: #1a1a28; border-radius: 10px; overflow: visible; }
.ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid #ddd5f0; background: #efeafc; }
.ql-container.ql-snow { border: 0; font-family: inherit; font-size: 1rem; }
.ql-host table, .ql-editor table {
    width: 100%;
    border-collapse: collapse;
    margin: .6rem 0;
    background: #fff;
}
.ql-host th, .ql-host td, .ql-editor th, .ql-editor td {
    border: 1px solid #cfc6e6;
    padding: 8px 10px;
    min-width: 64px;
    vertical-align: top;
}
.ql-toolbar .ql-table-better { width: auto; }
.ql-table-menus-container,
.ql-table-select-container,
.ql-table-properties-form { z-index: 30 !important; }
.page-thumb {
    position: relative;
    height: 210px;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
}
.page-thumb iframe {
    width: 1280px;
    height: 900px;
    border: 0;
    transform: scale(0.23);
    transform-origin: top left;
    pointer-events: none;
    background: #fff;
}
.preview-modal .preview-stage {
    width: min(1200px, 94vw);
    height: min(88vh, 900px);
    background: var(--card);
    border-radius: 16px;
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.preview-modal .preview-stage header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
}
.preview-modal .preview-stage h3 { margin: 0; font-size: 1rem; }
.preview-modal iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.media-preview img, .slides-list img { max-width: 100%; border-radius: 8px; display: block; }
.slides-list { display: grid; gap: 10px; margin-bottom: 10px; }
.slide-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 8px; align-items: center; }
.slide-row img { width: 90px; height: 60px; object-fit: cover; border-radius: 6px; }
.editor-side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 14px; }
.editor-side section { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.inline { display: flex; gap: 8px; align-items: center; font-weight: 500; }

.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; background: rgba(5, 5, 10, .72); display: grid; place-items: center; z-index: 40; }
.modal-card { width: min(760px, 92vw); max-height: 80vh; overflow: auto; background: var(--card); border-radius: 16px; padding: 16px; border: 1px solid var(--line); }
.modal-card header { display: flex; justify-content: space-between; align-items: center; }
.modal-card .stack-form label { display: block; margin: 10px 0; }
.modal-card .stack-form input, .modal-card .stack-form textarea { width: 100%; }
.icon-btn { border: 0; background: none; font-size: 1.4rem; cursor: pointer; color: var(--ink); }
.video-preview iframe, .video-preview video { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 8px; margin-top: 8px; }

@media (max-width: 980px) {
    body.admin { grid-template-columns: 1fr; }
    .sidebar { height: auto; position: relative; }
    .editor-layout, .grid-2, .stats, .theme-edit { grid-template-columns: 1fr; }
    .main { padding: 20px; }
}

.invoice-sheet {
    background: #fff;
    color: #1a1a1a;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 32px;
    max-width: 820px;
    --inv: #1a1440;
}
.invoice-sheet.inv-mini { padding: 16px; font-size: .85rem; }
.inv-logo { max-height: 56px; display: block; margin-bottom: 8px; }
.inv-head { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.inv-brand { font-size: 1.2rem; color: var(--inv); }
.inv-meta h2 { margin: 0 0 8px; color: var(--inv); }
.inv-meta p { margin: 0 0 4px; }
.inv-party { margin-bottom: 20px; }
.inv-party h3 { margin: 0 0 6px; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.inv-lines { width: 100%; border-collapse: collapse; margin: 12px 0 16px; }
.inv-lines th { text-align: left; border-bottom: 2px solid var(--inv); padding: 8px 6px; }
.inv-lines td { padding: 10px 6px; border-bottom: 1px solid #eee; }
.inv-total { text-align: right; font-size: 1.25rem; font-weight: 800; color: var(--inv); }
.inv-notes, .inv-foot { margin-top: 18px; color: #444; font-size: .92rem; }
.inv-compact { padding: 18px 20px; }
.inv-compact .inv-head { margin-bottom: 12px; }
.inv-banded { padding-top: 0; overflow: hidden; }
.inv-banded .inv-head {
    background: var(--inv); color: #fff; margin: 0 -32px 24px; padding: 22px 32px;
}
.inv-banded .inv-brand, .inv-banded .inv-meta h2, .inv-banded .inv-meta p { color: #fff; }
.inv-banded.inv-mini .inv-head { margin: 0 -16px 12px; padding: 12px 16px; }

@media print {
    .sidebar { display: none; }
    body.admin { display: block; background: #fff; color: #111; }
    .panel { box-shadow: none; border-color: #ccc; }
    .btn, .no-print, .page-head.no-print { display: none !important; }
    .invoice-sheet { border: 0; box-shadow: none; max-width: none; }
}
