/* Wizard Battles Card Editor v3 - compact accordion layout */

body[data-page="editor"] #tab-cards.cards-editor-view {
    --bg: #0f1424;
    --surface: #161d30;
    --surface-2: #1d253b;
    --border: rgba(148, 163, 184, 0.25);
    --text: #eef2ff;
    --muted: #b5bfd8;
    --primary: #7c85ff;
    --primary-2: #9f7aea;
    --danger: #f87171;
    --success: #34d399;
    --ring: rgba(124, 133, 255, 0.34);
    --acc-header-bg: color-mix(in srgb, var(--surface) 92%, #070c17);
    --acc-body-bg: color-mix(in srgb, #5e809d 36%, var(--surface-2) 64%);
    --acc-body-divider: color-mix(in srgb, #8fb3d4 42%, var(--border));
    position: relative;
    width: 100%;
    height: 100%;
    padding: clamp(8px, 1vw, 12px);
    overflow: hidden;
    color: var(--text);
    background:
        radial-gradient(90% 110% at 0% 0%, rgba(124, 133, 255, 0.22), transparent 58%),
        radial-gradient(85% 95% at 100% 100%, rgba(167, 139, 250, 0.2), transparent 62%),
        linear-gradient(165deg, #0d1322 0%, #101728 38%, #0c1321 100%);
}

body[data-set="hp"] #tab-cards.cards-editor-view {
    --primary: #7b2d26;
    --primary-2: #c4a35a;
    --ring: rgba(196, 163, 90, 0.3);
}

body[data-set="hk"] #tab-cards.cards-editor-view {
    --primary: #ff69b4;
    --primary-2: #f8b7d7;
    --ring: rgba(255, 105, 180, 0.32);
}

body[data-set="af"] #tab-cards.cards-editor-view {
    --primary: #1f8a3d;
    --primary-2: #8fd79f;
    --ring: rgba(31, 138, 61, 0.3);
}

body[data-page="editor"] #tab-cards.cards-editor-view,
body[data-page="editor"] #tab-cards.cards-editor-view * {
    min-width: 0;
}

body[data-page="editor"] #tab-cards.cards-editor-view [hidden] {
    display: none !important;
}

body[data-page="editor"] #tab-cards.cards-editor-view .cards-editor-shell {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(520px, 1fr) minmax(320px, 420px);
    gap: 10px;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

body[data-page="editor"] #tab-cards.cards-editor-view .cards-editor-shell > * {
    min-width: 0;
    min-height: 0;
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-browser-panel,
body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel,
body[data-page="editor"] #tab-cards.cards-editor-view .card-editor-panel {
    border: 1px solid var(--border);
    border-radius: 14px;
    background:
        linear-gradient(162deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01)),
        color-mix(in srgb, var(--surface) 92%, #0d1322);
    box-shadow: 0 14px 30px rgba(4, 8, 17, 0.38);
}

body[data-page="editor"] #tab-cards.cards-editor-view .input-premium,
body[data-page="editor"] #tab-cards.cards-editor-view .select,
body[data-page="editor"] #tab-cards.cards-editor-view textarea,
body[data-page="editor"] #tab-cards.cards-editor-view input[type="text"],
body[data-page="editor"] #tab-cards.cards-editor-view input[type="number"] {
    width: 100%;
    min-height: 34px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
    background: rgba(7, 10, 18, 0.66);
    color: var(--text);
    font-size: 0.84rem;
    line-height: 1.2;
    padding: 6px 10px;
}

body[data-page="editor"] #tab-cards.cards-editor-view textarea {
    min-height: 84px;
    resize: vertical;
}

body[data-page="editor"] #tab-cards.cards-editor-view .input-premium:focus,
body[data-page="editor"] #tab-cards.cards-editor-view .select:focus,
body[data-page="editor"] #tab-cards.cards-editor-view textarea:focus,
body[data-page="editor"] #tab-cards.cards-editor-view input:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--primary-2) 78%, #fff);
    box-shadow: 0 0 0 2px var(--ring);
}

body[data-page="editor"] #tab-cards.cards-editor-view .browser-top,
body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel,
body[data-page="editor"] #tab-cards.cards-editor-view .card-editor-panel {
    padding: 10px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-browser-panel {
    overflow: hidden;
}

body[data-page="editor"] #tab-cards.cards-editor-view .browser-top {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
    scrollbar-width: thin;
}

body[data-page="editor"] #tab-cards.cards-editor-view .browser-top::-webkit-scrollbar {
    width: 5px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .browser-top::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .browser-heading {
    display: grid;
    gap: 3px;
    padding: 2px 2px 0;
}

body[data-page="editor"] #tab-cards.cards-editor-view .browser-title,
body[data-page="editor"] #tab-cards.cards-editor-view .preview-title {
    font-family: var(--font-body);
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
}

body[data-page="editor"] #tab-cards.cards-editor-view .browser-subtitle,
body[data-page="editor"] #tab-cards.cards-editor-view .preview-subtitle {
    font-size: 0.72rem;
    line-height: 1.28;
    color: var(--muted);
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-list-scroll {
    display: none !important;
}

body[data-page="editor"] #tab-cards.cards-editor-view .browser-selectors {
    display: grid;
    gap: 8px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .browser-set,
body[data-page="editor"] #tab-cards.cards-editor-view .form-group,
body[data-page="editor"] #tab-cards.cards-editor-view .preview-control {
    display: grid;
    gap: 5px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .text-style-controls {
    display: grid;
    gap: 8px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .text-style-row {
    display: grid;
    gap: 5px;
    padding: 6px;
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
    border-radius: 10px;
    background: rgba(5, 10, 18, 0.28);
}

body[data-page="editor"] #tab-cards.cards-editor-view .text-style-toggles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .text-style-toggles label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 0 8px;
    border-radius: 9px;
    border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
    background: rgba(3, 6, 12, 0.35);
    font-size: 0.73rem;
    line-height: 1;
    text-transform: none;
    color: var(--text);
}

body[data-page="editor"] #tab-cards.cards-editor-view .text-style-size {
    display: flex;
    align-items: center;
    gap: 8px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .text-style-size input[type="range"] {
    flex: 1;
    min-width: 0;
    height: 6px;
    accent-color: var(--primary, #60a5fa);
}

body[data-page="editor"] #tab-cards.cards-editor-view .text-style-size-label {
    min-width: 38px;
    text-align: right;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted, rgba(255,255,255,0.6));
}

body[data-page="editor"] #tab-cards.cards-editor-view .browser-set label,
body[data-page="editor"] #tab-cards.cards-editor-view .preview-controls label,
body[data-page="editor"] #tab-cards.cards-editor-view .editor-section-body label {
    margin: 0;
    font-size: 0.68rem;
    line-height: 1.1;
    letter-spacing: 0.18px;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--primary-2) 68%, #fff);
}

body[data-page="editor"] #tab-cards.cards-editor-view #card-count-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 16px;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--primary-2) 48%, var(--border));
    font-family: var(--font-numeric);
    font-size: 0.64rem;
    line-height: 1;
    text-transform: none;
    color: color-mix(in srgb, var(--primary-2) 84%, #fff);
    background: rgba(0, 0, 0, 0.22);
}

body[data-page="editor"] #tab-cards.cards-editor-view .browser-new-btn {
    width: 100%;
    min-height: 34px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-mobile-sheet-close,
body[data-page="editor"] #tab-cards.cards-editor-view .editor-mobile-sheet-backdrop {
    display: none;
}

body[data-page="editor"] #tab-cards.cards-editor-view .wb-acc,
body[data-page="editor"] #tab-cards.cards-editor-view .editor-section {
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
    border-radius: 12px;
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.038), rgba(255, 255, 255, 0.01)),
        color-mix(in srgb, var(--surface-2) 85%, #11182a);
    overflow: hidden;
    flex-shrink: 0;
}

body[data-page="editor"] #tab-cards.cards-editor-view .wb-acc > summary,
body[data-page="editor"] #tab-cards.cards-editor-view .editor-section > summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 36px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text);
    background: var(--acc-header-bg);
    border-bottom: 1px solid transparent;
}

body[data-page="editor"] #tab-cards.cards-editor-view .wb-acc > summary::-webkit-details-marker,
body[data-page="editor"] #tab-cards.cards-editor-view .editor-section > summary::-webkit-details-marker {
    display: none;
}

body[data-page="editor"] #tab-cards.cards-editor-view .wb-acc > summary::after,
body[data-page="editor"] #tab-cards.cards-editor-view .editor-section > summary::after {
    content: '▾';
    font-size: 0.72rem;
    color: var(--muted);
    transition: transform 140ms ease;
}

body[data-page="editor"] #tab-cards.cards-editor-view .wb-acc[open] > summary::after,
body[data-page="editor"] #tab-cards.cards-editor-view .editor-section[open] > summary::after {
    transform: rotate(180deg);
}

body[data-page="editor"] #tab-cards.cards-editor-view .wb-acc[open] > summary,
body[data-page="editor"] #tab-cards.cards-editor-view .editor-section[open] > summary {
    border-bottom-color: color-mix(in srgb, var(--primary) 22%, var(--border));
}

body[data-page="editor"] #tab-cards.cards-editor-view .acc-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .acc-label > span:last-child {
    font-size: 0.84rem;
    line-height: 1.1;
    font-weight: 700;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0.02px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .acc-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 0.62rem;
    color: color-mix(in srgb, var(--primary-2) 62%, #fff);
    border: 1px solid color-mix(in srgb, var(--primary) 36%, var(--border));
    background: rgba(255, 255, 255, 0.02);
    line-height: 1;
}

body[data-page="editor"] #tab-cards.cards-editor-view .wb-acc .editor-section-body,
body[data-page="editor"] #tab-cards.cards-editor-view .editor-section .editor-section-body {
    display: grid;
    gap: 7px;
    padding: 8px 10px 10px;
    background: var(--acc-body-bg);
    border-top: 1px solid var(--acc-body-divider);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body[data-page="editor"] #tab-cards.cards-editor-view .wb-acc:not([open]) > .editor-section-body,
body[data-page="editor"] #tab-cards.cards-editor-view .editor-section:not([open]) > .editor-section-body {
    display: none !important;
}

body[data-page="editor"] #tab-cards.cards-editor-view .preview-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 1px 2px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .preview-top-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .preview-top-actions .btn,
body[data-page="editor"] #tab-cards.cards-editor-view .editor-slim-top .btn {
    min-height: 34px;
    border-radius: 10px;
    padding: 0 10px;
    font-size: 0.78rem;
    line-height: 1;
}

body[data-page="editor"] #tab-cards.cards-editor-view #editor-mobile-jump-preview,
body[data-page="editor"] #tab-cards.cards-editor-view #editor-mobile-jump-form,
body[data-page="editor"] #tab-cards.cards-editor-view #editor-mobile-list-toggle {
    display: none;
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel {
    --preview-options-col: minmax(286px, 340px);
    display: grid;
    grid-template-columns: var(--preview-options-col) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    grid-template-areas:
        "top top"
        "options preview"
        "nav nav"
        "strip strip";
    gap: 8px;
    min-height: 0;
    overflow: hidden;
}

body[data-page="editor"] #tab-cards.cards-editor-view .preview-top {
    grid-area: top;
}

body[data-page="editor"] #tab-cards.cards-editor-view .preview-options {
    grid-area: options;
    margin: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

body[data-page="editor"] #tab-cards.cards-editor-view .preview-options > summary {
    min-height: 34px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .preview-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

body[data-page="editor"] #tab-cards.cards-editor-view #editor-preview-options > .editor-section-body {
    min-height: 0;
    overflow: visible;
}

body[data-page="editor"] #tab-cards.cards-editor-view .preview-toggle {
    display: grid;
    align-items: end;
}

body[data-page="editor"] #tab-cards.cards-editor-view .preview-toggle label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 0 8px;
    border-radius: 9px;
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
    background: rgba(3, 6, 12, 0.35);
    font-size: 0.73rem;
    line-height: 1;
    text-transform: none;
    color: var(--text);
}

body[data-page="editor"] #tab-cards.cards-editor-view .preview-toggle input {
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
}

body[data-page="editor"] #tab-cards.cards-editor-view .preview-toggle label.is-disabled {
    opacity: 0.56;
    cursor: not-allowed;
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-box {
    grid-area: preview;
    flex: 1;
    min-height: clamp(300px, 44vh, 620px);
    border: 1px dashed color-mix(in srgb, var(--primary) 38%, var(--border));
    border-radius: 14px;
    background:
        radial-gradient(circle at 50% 14%, rgba(255, 255, 255, 0.08), transparent 50%),
        rgba(3, 7, 15, 0.52);
    display: grid;
    place-items: center;
    padding: 8px;
    overflow: hidden;
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel:has(#editor-preview-options:not([open])),
body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel.is-options-collapsed {
    --preview-options-col: 46px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel:has(#editor-preview-options:not([open])) .preview-options,
body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel.is-options-collapsed .preview-options {
    min-width: 46px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel:has(#editor-preview-options:not([open])) .preview-options > summary,
body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel.is-options-collapsed .preview-options > summary {
    min-height: 100%;
    height: 100%;
    padding: 10px 6px;
    align-items: flex-start;
    justify-content: center;
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel:has(#editor-preview-options:not([open])) .preview-options > summary .acc-label,
body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel.is-options-collapsed .preview-options > summary .acc-label {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel:has(#editor-preview-options:not([open])) .preview-options > summary .acc-label > span:last-child,
body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel.is-options-collapsed .preview-options > summary .acc-label > span:last-child {
    display: none;
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel:has(#editor-preview-options:not([open])) .preview-options > summary::after,
body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel.is-options-collapsed .preview-options > summary::after {
    margin-top: 6px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel:has(#editor-preview-options:not([open])) .card-preview-box .layout-card.wb-card,
body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel:has(#editor-preview-options:not([open])) .card-preview-box .card-premium,
body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel:has(#editor-preview-options:not([open])) .card-preview-box .card:not(.layout-card),
body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel.is-options-collapsed .card-preview-box .layout-card.wb-card,
body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel.is-options-collapsed .card-preview-box .card-premium,
body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel.is-options-collapsed .card-preview-box .card:not(.layout-card) {
    width: min(100%, clamp(254px, 31vw, 360px));
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel:has(#editor-preview-options:not([open])) .card-preview-box .layout-card.wb-card,
body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel.is-options-collapsed .card-preview-box .layout-card.wb-card {
    --wb-card-width: min(100%, clamp(254px, 31vw, 360px));
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-box .layout-card.wb-card,
body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-box .card-premium,
body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-box .card:not(.layout-card) {
    width: min(100%, clamp(230px, 24vw, 310px));
    max-height: calc(100% - 12px);
    aspect-ratio: 63 / 88;
    height: auto;
    box-shadow: 0 22px 38px rgba(0, 0, 0, 0.46);
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-box .layout-card.wb-card {
    --wb-card-width: min(100%, clamp(230px, 24vw, 310px));
}

body[data-page="editor"] #tab-cards.cards-editor-view.is-compact-preview .card-preview-box .layout-card.wb-card {
    --wb-card-width: min(100%, clamp(192px, 21vw, 252px));
}

body[data-page="editor"] #tab-cards.cards-editor-view.is-compact-preview .card-preview-box .card-premium,
body[data-page="editor"] #tab-cards.cards-editor-view.is-compact-preview .card-preview-box .card:not(.layout-card) {
    width: min(100%, clamp(192px, 21vw, 252px));
    aspect-ratio: 63 / 88;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-card-nav {
    grid-area: nav;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-card-nav .btn {
    min-height: 34px;
    min-width: 82px;
    border-radius: 10px;
    font-size: 0.78rem;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-card-pos {
    min-width: 60px;
    text-align: center;
    font-family: var(--font-numeric);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-strip {
    grid-area: strip;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    min-height: 82px;
    margin-top: 2px;
    padding: 6px;
    border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
    border-radius: 10px;
    background: rgba(3, 8, 15, 0.42);
    scrollbar-width: thin;
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-thumb {
    width: 54px;
    height: 76px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--border));
    background: rgba(255, 255, 255, 0.04);
    padding: 4px;
    flex: 0 0 auto;
    transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-thumb:hover {
    transform: translateY(-1px);
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-thumb.is-selected {
    border-color: color-mix(in srgb, var(--primary-2) 82%, #fff);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-2) 22%, transparent);
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 7px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .card-editor-panel {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 6px;
    min-height: 0;
    overflow: hidden;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-slim-top {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-status {
    min-height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--primary-2) 44%, var(--border));
    font-size: 0.66rem;
    color: color-mix(in srgb, var(--primary-2) 84%, #fff);
    display: inline-flex;
    align-items: center;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-status.is-dirty {
    border-color: color-mix(in srgb, #f59e0b 58%, var(--border));
    color: #fcd34d;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-section-toolbar {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-section-jumps {
    display: none !important;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-section-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-chip {
    min-height: 32px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--border));
    background: rgba(8, 11, 20, 0.62);
    color: var(--text);
    padding: 0 10px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-chip.editor-chip-ghost {
    background: rgba(255, 255, 255, 0.03);
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-panel-body-v2 {
    display: grid;
    gap: 0;
    align-content: start;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 3px;
    padding-bottom: 8px;
    scroll-padding-bottom: 88px;
    scrollbar-gutter: stable;
}

body[data-page="editor"] #tab-cards.cards-editor-view #card-editor-panel .editor-section {
    border-radius: 0;
}

body[data-page="editor"] #tab-cards.cards-editor-view #card-editor-panel .editor-section + .editor-section {
    margin-top: -1px;
}

body[data-page="editor"] #tab-cards.cards-editor-view #card-editor-panel .editor-section:first-child {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

body[data-page="editor"] #tab-cards.cards-editor-view #card-editor-panel .editor-section:last-child {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

body[data-page="editor"] #tab-cards.cards-editor-view #card-editor-panel .editor-section > summary {
    min-height: 32px;
    padding: 6px 9px;
}

body[data-page="editor"] #tab-cards.cards-editor-view #card-editor-panel .editor-section:not([open]) > summary {
    background: var(--acc-header-bg);
    border-bottom-color: transparent;
}

body[data-page="editor"] #tab-cards.cards-editor-view #card-editor-panel .editor-section[open] .editor-section-body {
    animation: wb-editor-accordion-open 170ms ease-out;
    max-height: none;
    overflow: visible;
}

@keyframes wb-editor-accordion-open {
    from {
        opacity: 0.54;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-inline-2cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-bool-grid {
    display: grid;
    gap: 6px;
    align-content: end;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-bool-grid label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-transform: none;
    font-size: 0.76rem;
    color: var(--text);
}

body[data-page="editor"] #tab-cards.cards-editor-view .ability-preview {
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.24);
    padding: 8px 9px;
    display: grid;
    gap: 4px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .ability-preview-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text);
}

body[data-page="editor"] #tab-cards.cards-editor-view .ability-preview-meta,
body[data-page="editor"] #tab-cards.cards-editor-view .ability-preview-desc,
body[data-page="editor"] #tab-cards.cards-editor-view .ability-preview-live {
    font-size: 0.74rem;
    line-height: 1.3;
    color: var(--muted);
}

body[data-page="editor"] #tab-cards.cards-editor-view .ability-preview-live {
    color: color-mix(in srgb, var(--primary-2) 84%, #fff);
}

body[data-page="editor"] #tab-cards.cards-editor-view .image-actions-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .image-actions-row .btn {
    min-height: 32px;
    font-size: 0.72rem;
    font-weight: 700;
}

body[data-page="editor"] #tab-cards.cards-editor-view .image-actions-row .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

body[data-page="editor"] #tab-cards.cards-editor-view .image-preview-panel {
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    padding: 8px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .image-preview-label {
    font-size: 0.74rem;
    letter-spacing: 0.1px;
    color: var(--muted);
}

body[data-page="editor"] #tab-cards.cards-editor-view .image-preview-frame {
    margin-top: 6px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.34);
    min-height: 128px;
    display: grid;
    place-items: center;
}

body[data-page="editor"] #tab-cards.cards-editor-view .image-preview-frame img {
    width: 100%;
    height: 100%;
    max-height: 184px;
    object-fit: contain;
}

body[data-page="editor"] #tab-cards.cards-editor-view .field-hint {
    margin: 0;
    font-size: 0.68rem;
    color: var(--muted);
}

body[data-page="editor"] #tab-cards.cards-editor-view #editor-image-backup-status.is-ready {
    color: color-mix(in srgb, var(--primary-2) 78%, #fff);
}

body[data-page="editor"] #tab-cards.cards-editor-view .stat-editor-grid {
    display: grid;
    gap: 8px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .stat-control {
    --stat-fill-color: #60a5fa;
    display: grid;
    grid-template-columns: minmax(78px, 102px) minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 8px;
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface-2) 80%, rgba(255, 255, 255, 0.03));
    padding: 6px 7px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .stat-control:focus-within {
    border-color: color-mix(in srgb, var(--stat-fill-color) 56%, var(--border));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--stat-fill-color) 28%, transparent);
}

body[data-page="editor"] #tab-cards.cards-editor-view .stat-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .stat-icon {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    object-fit: contain;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.09);
}

body[data-page="editor"] #tab-cards.cards-editor-view .stat-meta-text {
    display: grid;
    gap: 1px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .stat-name {
    font-size: 0.78rem;
    line-height: 1;
    font-weight: 700;
}

body[data-page="editor"] #tab-cards.cards-editor-view .stat-code {
    font-size: 0.58rem;
    line-height: 1;
    text-transform: uppercase;
    color: var(--muted);
}

body[data-page="editor"] #tab-cards.cards-editor-view .stat-inputs {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 7px;
    align-items: center;
}

body[data-page="editor"] #tab-cards.cards-editor-view .stat-number {
    width: 50px;
    min-height: 30px !important;
    height: 30px !important;
    border-radius: 8px;
    text-align: center;
    padding: 0 4px !important;
    font-family: var(--font-numeric);
    font-size: 0.72rem !important;
    line-height: 1 !important;
    font-weight: 700;
}

body[data-page="editor"] #tab-cards.cards-editor-view .stat-range {
    height: 16px;
    accent-color: var(--stat-fill-color);
}

body[data-page="editor"] #tab-cards.cards-editor-view .stat-range::-webkit-slider-runnable-track {
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--stat-fill-color), color-mix(in srgb, var(--stat-fill-color) 40%, #fff));
}

body[data-page="editor"] #tab-cards.cards-editor-view .stat-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    margin-top: -3px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.28);
    background: #f8fbff;
}

body[data-page="editor"] #tab-cards.cards-editor-view .stat-range::-moz-range-track {
    height: 5px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--stat-fill-color), color-mix(in srgb, var(--stat-fill-color) 40%, #fff));
}

body[data-page="editor"] #tab-cards.cards-editor-view .stat-range::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 1px solid rgba(0, 0, 0, 0.28);
    border-radius: 999px;
    background: #f8fbff;
}

body[data-page="editor"] #tab-cards.cards-editor-view .stat-value {
    min-width: 34px;
    min-height: 26px;
    padding: 0 7px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--stat-fill-color) 32%, rgba(255, 255, 255, 0.22));
    background: color-mix(in srgb, var(--stat-fill-color) 12%, rgba(255, 255, 255, 0.05));
    color: var(--stat-fill-color);
    font-family: var(--font-numeric);
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-actions.editor-actions-main {
    margin-top: 2px;
    padding-top: 8px;
    position: sticky;
    bottom: 0;
    z-index: 4;
    border-top: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border));
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    background: linear-gradient(180deg, rgba(12, 16, 29, 0.52), rgba(12, 16, 29, 0.9));
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-actions .btn-primary,
body[data-page="editor"] #tab-cards.cards-editor-view .editor-actions .btn-secondary {
    width: 100%;
    min-height: 38px;
    border-radius: 11px;
    font-family: var(--font-body);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.1;
    padding: 0 10px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-actions .btn-primary {
    border: 1px solid color-mix(in srgb, var(--primary-2) 54%, transparent);
    background: linear-gradient(120deg, color-mix(in srgb, var(--primary) 92%, #1d2d58), color-mix(in srgb, var(--primary-2) 76%, var(--primary)));
    color: #fff;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-actions .btn-secondary {
    border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--border));
    background: rgba(10, 12, 20, 0.62);
    color: var(--text);
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-actions .btn-secondary.btn-danger {
    border-color: color-mix(in srgb, var(--danger) 62%, var(--border));
    color: #fecaca;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-btn-save {
    grid-column: 1;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-btn-zip {
    grid-column: 2;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-btn-runtime {
    grid-column: 3;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-btn-delete {
    grid-column: 4;
}

body[data-page="editor"] #tab-cards.cards-editor-view #editor-undo-btn,
body[data-page="editor"] #tab-cards.cards-editor-view #editor-duplicate-btn,
body[data-page="editor"] #tab-cards.cards-editor-view #editor-export-btn {
    display: none !important;
}

body[data-page="editor"] #tab-cards.cards-editor-view #editor-save-btn.is-saved {
    animation: editor-save-pulse 0.3s ease-out;
}

@keyframes editor-save-pulse {
    0% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.025);
    }

    100% {
        transform: scale(1);
    }
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-toast {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 30;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 0.82rem;
    transition: opacity 180ms ease, transform 180ms ease;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-toast.tone-success {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.45);
    color: #bff7d2;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-toast.tone-error {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.45);
    color: #fecaca;
}

body[data-page="editor"] #tab-cards.cards-editor-view .editor-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

body[data-page="editor"] #tab-cards.cards-editor-view .stats-preview-inline {
    display: grid;
    gap: 6px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .stats-preview-inline .stats-card {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    padding: 6px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .stats-preview-inline .stats-card-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

body[data-page="editor"] #tab-cards.cards-editor-view .stats-preview-inline .stats-card-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

body[data-page="editor"] #tab-cards.cards-editor-view .stats-preview-inline .stats-card-body {
    display: grid;
    gap: 1px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .stats-preview-inline .stats-card-label {
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
}

body[data-page="editor"] #tab-cards.cards-editor-view .stats-preview-inline .stats-card-key {
    font-size: 0.64rem;
    line-height: 1;
    color: var(--muted);
    text-transform: uppercase;
}

body[data-page="editor"] #tab-cards.cards-editor-view .stats-preview-inline .stats-card-desc {
    display: none;
}

body[data-page="editor"] #tab-cards.cards-editor-view .stats-preview-inline .stats-card-desc-empty {
    display: none;
}

body[data-page="editor"] #tab-cards.cards-editor-view .faction-editor-panel {
    display: grid;
    gap: 8px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .faction-editor-empty {
    padding: 8px;
    border-radius: 10px;
    border: 1px dashed color-mix(in srgb, var(--primary) 32%, var(--border));
    background: rgba(0, 0, 0, 0.18);
    font-size: 0.74rem;
    color: var(--muted);
}

body[data-page="editor"] #tab-cards.cards-editor-view .faction-editor-row {
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
    border-radius: 10px;
    background: rgba(7, 12, 20, 0.42);
    padding: 7px;
    display: grid;
    gap: 6px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .faction-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .faction-editor-id {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--border));
    background: rgba(255, 255, 255, 0.06);
    font-family: var(--font-numeric);
    font-size: 0.66rem;
    color: var(--text);
}

body[data-page="editor"] #tab-cards.cards-editor-view .faction-editor-id strong {
    margin-right: 4px;
    color: var(--muted);
    font-weight: 600;
}

body[data-page="editor"] #tab-cards.cards-editor-view .faction-editor-reset {
    min-height: 24px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, #f59e0b 55%, var(--border));
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
    padding: 0 8px;
    font-size: 0.67rem;
    line-height: 1;
}

body[data-page="editor"] #tab-cards.cards-editor-view .faction-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px;
    gap: 6px;
    align-items: start;
}

body[data-page="editor"] #tab-cards.cards-editor-view .faction-editor-fields {
    display: grid;
    gap: 6px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .faction-editor-preview {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
    background: rgba(255, 255, 255, 0.05);
}

body[data-page="editor"] #tab-cards.cards-editor-view .faction-editor-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body[data-page="editor"] #tab-cards.cards-editor-view .faction-editor-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
}

body[data-page="editor"] #tab-cards.cards-editor-view .faction-editor-actions .btn {
    min-height: 30px;
    border-radius: 8px;
    font-size: 0.7rem;
    line-height: 1;
}

body[data-page="editor"] #tab-cards.cards-editor-view .faction-editor-source {
    font-size: 0.62rem;
    color: var(--muted);
    line-height: 1.25;
    word-break: break-all;
}

body[data-page="editor"] #tab-cards.cards-editor-view .faction-editor-source strong {
    color: color-mix(in srgb, var(--primary-2) 72%, #fff);
    font-weight: 600;
}

/* Editable stat card overrides */
body[data-page="editor"] .stats-card-icon--clickable {
    cursor: pointer;
    position: relative;
}

body[data-page="editor"] .stats-card-icon-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 8px;
    font-size: 0.7rem;
    color: #fff;
    opacity: 0;
    transition: opacity 150ms ease;
    pointer-events: none;
}

body[data-page="editor"] .stats-card-icon--clickable:hover .stats-card-icon-overlay {
    opacity: 1;
}

body[data-page="editor"] .stat-display-name-input {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 2px 6px;
    width: 100%;
    line-height: 1.3;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

body[data-page="editor"] .stat-display-name-input:focus {
    outline: none;
    border-color: var(--primary, #60a5fa);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.18);
}

body[data-page="editor"] .stat-display-name-input.stat-input--saved {
    border-color: rgba(34, 197, 94, 0.6);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15);
}

body[data-page="editor"] .stat-display-name-input.stat-input--error {
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

body[data-page="editor"] #tab-cards.cards-editor-view button:focus-visible,
body[data-page="editor"] #tab-cards.cards-editor-view input:focus-visible,
body[data-page="editor"] #tab-cards.cards-editor-view select:focus-visible,
body[data-page="editor"] #tab-cards.cards-editor-view textarea:focus-visible,
body[data-page="editor"] #tab-cards.cards-editor-view summary:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary-2) 78%, #fff);
    outline-offset: 1px;
}

@media (max-width: 1400px) {
    body[data-page="editor"] #tab-cards.cards-editor-view .cards-editor-shell {
        grid-template-columns: minmax(260px, 320px) minmax(480px, 1fr) minmax(300px, 380px);
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-box {
        min-height: clamp(280px, 42vh, 520px);
    }
}

@media (max-width: 1200px) {
    body[data-page="editor"] #tab-cards.cards-editor-view .cards-editor-shell {
        grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) minmax(320px, 42%);
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .card-browser-panel {
        grid-column: 1;
        grid-row: 1 / span 2;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel {
        grid-column: 2;
        grid-row: 1;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .card-editor-panel {
        grid-column: 2;
        grid-row: 2;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .editor-panel-body-v2 {
        padding-right: 2px;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel {
        grid-template-columns: minmax(248px, 292px) minmax(0, 1fr);
    }
}

@media (max-width: 1024px) {
    body[data-page="editor"] #tab-cards.cards-editor-view {
        display: block;
        height: auto;
        overflow-y: auto;
        overflow-x: hidden;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .cards-editor-shell {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .card-browser-panel,
    body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel,
    body[data-page="editor"] #tab-cards.cards-editor-view .card-editor-panel {
        grid-column: auto;
        grid-row: auto;
        width: 100%;
        height: auto;
        overflow: hidden;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .card-browser-panel {
        order: 1;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel {
        display: flex;
        flex-direction: column;
        order: 2;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .card-editor-panel {
        order: 3;
        grid-template-rows: auto auto auto auto;
        height: auto;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .editor-panel-body-v2 {
        overflow-y: visible;
        padding-right: 0;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view #editor-mobile-jump-form {
        display: inline-flex;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .preview-controls {
        grid-template-columns: 1fr;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .text-style-toggles {
        grid-template-columns: 1fr;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-box {
        min-height: clamp(236px, 36vh, 440px);
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .editor-actions.editor-actions-main {
        position: static;
    }
}

@media (max-width: 767px) {
    body[data-page="editor"] #tab-cards.cards-editor-view {
        padding: 8px;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .cards-editor-shell {
        gap: 8px;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .browser-top,
    body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-panel,
    body[data-page="editor"] #tab-cards.cards-editor-view .card-editor-panel {
        padding: 8px;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .browser-title,
    body[data-page="editor"] #tab-cards.cards-editor-view .preview-title {
        font-size: 0.96rem;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .wb-acc > summary,
    body[data-page="editor"] #tab-cards.cards-editor-view .editor-section > summary {
        min-height: 36px;
        padding: 8px 9px;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .acc-label > span:last-child {
        font-size: 0.82rem;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .preview-top-actions .btn,
    body[data-page="editor"] #tab-cards.cards-editor-view .editor-slim-top .btn {
        min-height: 36px;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .preview-controls {
        grid-template-columns: 1fr;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view #editor-preview-options > .editor-section-body {
        overflow: visible;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .input-premium,
    body[data-page="editor"] #tab-cards.cards-editor-view .select,
    body[data-page="editor"] #tab-cards.cards-editor-view textarea,
    body[data-page="editor"] #tab-cards.cards-editor-view input[type="text"],
    body[data-page="editor"] #tab-cards.cards-editor-view input[type="number"] {
        min-height: 36px;
        font-size: 0.86rem;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-box {
        min-height: clamp(224px, 34vh, 390px);
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-box .layout-card.wb-card,
    body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-box .card-premium,
    body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-box .card:not(.layout-card) {
        width: min(100%, clamp(188px, 64vw, 242px));
        aspect-ratio: 63 / 88;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-box .layout-card.wb-card {
        --wb-card-width: min(100%, clamp(188px, 64vw, 242px));
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .editor-inline-2cols {
        grid-template-columns: 1fr;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view #card-editor-panel .editor-section[open] .editor-section-body {
        overflow: visible;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .editor-section-actions {
        grid-template-columns: 1fr;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .image-actions-row {
        grid-template-columns: 1fr;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .stat-control {
        grid-template-columns: minmax(72px, 88px) minmax(0, 1fr) auto;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .stat-inputs {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .stat-number {
        width: 44px;
        font-size: 0.68rem !important;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .stat-value {
        min-width: 30px;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .editor-actions.editor-actions-main {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .editor-btn-save,
    body[data-page="editor"] #tab-cards.cards-editor-view .editor-btn-zip,
    body[data-page="editor"] #tab-cards.cards-editor-view .editor-btn-runtime,
    body[data-page="editor"] #tab-cards.cards-editor-view .editor-btn-delete {
        grid-column: 1;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .editor-card-nav {
        gap: 6px;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .editor-card-nav .btn {
        min-width: 72px;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .card-preview-thumb {
        width: 48px;
        height: 68px;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view .editor-mobile-sheet-close,
    body[data-page="editor"] #tab-cards.cards-editor-view .editor-mobile-sheet-backdrop,
    body[data-page="editor"] #tab-cards.cards-editor-view #editor-mobile-list-toggle {
        display: none !important;
    }

    body[data-page="editor"] #tab-cards.cards-editor-view.is-mobile-focus-preview .card-editor-panel,
    body[data-page="editor"] #tab-cards.cards-editor-view.is-mobile-focus-editor .card-preview-panel {
        display: block;
    }
}

@media (prefers-reduced-motion: reduce) {
    body[data-page="editor"] #tab-cards.cards-editor-view *,
    body[data-page="editor"] #tab-cards.cards-editor-view *::before,
    body[data-page="editor"] #tab-cards.cards-editor-view *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
