:root {
    --bg: #f7efe6;
    --panel: rgba(255, 250, 245, 0.82);
    --panel-strong: #fffaf5;
    --line: rgba(139, 94, 60, 0.14);
    --text: #2a211a;
    --muted: #75685b;
    --accent: #b8643c;
    --accent-strong: #8f4726;
    --soft: #ead3c3;
    --danger: #b44141;
    --shadow: 0 24px 70px rgba(68, 38, 19, 0.14);
    --radius: 24px;
    --radius-sm: 16px;
    --heading-font: "Playfair Display", "Cormorant Garamond", Georgia, serif;
    --body-font: "DM Sans", "Segoe UI", Tahoma, sans-serif;
    --header-h: 82px;
    --footer-h: 66px;
    --dashboard-footer-h: 66px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; height: 100%; }
body {
    margin: 0;
    min-height: 100%;
    font-family: var(--body-font);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255,255,255,0.9), transparent 28%),
        linear-gradient(135deg, #f9f1e8 0%, #f0e4d6 50%, #f5ede6 100%);
}
.theme-shell:not(.editor-home-body) {
    padding-bottom: calc(var(--footer-h) + 18px);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.site-header, .panel-shell, .editor-shell { width: min(1380px, calc(100% - 28px)); margin: 0 auto; }
.site-header {
    display: flex; justify-content: space-between; align-items: center; gap: 20px;
    height: var(--header-h); padding: 12px 0; position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    backdrop-filter: blur(18px); background: #2c2016; color: rgba(255, 245, 236, 0.94);
    border-bottom: 1px solid rgba(255, 228, 205, 0.12); box-shadow: 0 10px 30px rgba(25, 16, 10, 0.18);
}
.brand { display: inline-flex; align-items: center; gap: 14px; }
.brand strong, .hero-copy h1, .section-heading h1, .section-heading h2, .auth-card h1 { font-family: var(--heading-font); }
.brand-logo {
    display: block; font-family: "Dancing Script", cursive !important; font-size: 2rem; line-height: 1; font-weight: 700;
    color: #fff7ef; letter-spacing: .01em;
}
.brand small, .muted { color: var(--muted); }
.site-nav, .toolbar-actions, .card-actions, .cookie-actions, .hero-actions, .site-nav-editor { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.nav-link { color: rgba(255, 235, 221, 0.78); font-weight: 600; }
.nav-link:hover { color: #ffffff; }
.nav-link-icon { display: inline-flex; align-items: center; gap: 8px; }
.nav-chip {
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 228, 205, 0.1);
}
.nav-icon, .btn-icon {
    width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.nav-icon svg, .btn-icon svg, .module-symbol svg { width: 100%; height: 100%; }
.site-nav { justify-content: flex-end; }
.site-nav-editor { padding-right: 8px; margin-right: 4px; border-right: 1px solid rgba(255, 228, 205, 0.12); }

.btn {
    border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 700; transition: .22s ease;
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-with-icon { gap: 10px; }
.btn-compact {
    padding: 9px 14px;
    font-size: .92rem;
    line-height: 1.2;
    letter-spacing: .01em;
}
.btn-header-primary {
    box-shadow: 0 12px 22px rgba(184, 100, 60, .2);
}
.btn-header-soft {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 244, 236, 0.92);
    border: 1px solid rgba(255, 228, 205, 0.12);
}
.btn-header-soft:hover,
.nav-chip:hover {
    background: rgba(255, 255, 255, 0.12);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: #fff; box-shadow: 0 18px 30px rgba(184, 100, 60, .26); }
.btn-soft { background: rgba(255,255,255,.78); color: var(--text); border: 1px solid rgba(117,104,91,.18); }
.btn-danger { background: rgba(180, 65, 65, .12); color: var(--danger); border: 1px solid rgba(180, 65, 65, .15); }
.account-menu {
    position: relative;
}
.account-menu summary {
    list-style: none;
}
.account-menu summary::-webkit-details-marker {
    display: none;
}
.account-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 999px;
    color: rgba(255, 245, 236, 0.92);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 228, 205, 0.12);
    cursor: pointer;
    user-select: none;
    font-weight: 700;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.account-trigger:hover,
.account-menu[open] .account-trigger {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 228, 205, 0.18);
}
.account-caret {
    width: 14px;
    height: 14px;
    display: inline-flex;
    transition: transform .18s ease;
}
.account-caret svg {
    width: 100%;
    height: 100%;
}
.account-menu[open] .account-caret {
    transform: rotate(180deg);
}
.account-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    padding: 10px;
    border-radius: 18px;
    background: rgba(49, 35, 25, 0.96);
    border: 1px solid rgba(255, 228, 205, 0.12);
    box-shadow: 0 18px 38px rgba(16, 10, 6, 0.28);
    display: grid;
    gap: 4px;
}
.account-item-form {
    margin: 0;
}
.account-item-form-separate {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 228, 205, 0.1);
}
.account-dropdown-user {
    padding: 8px 12px 10px;
    margin-bottom: 4px;
}
.account-dropdown-user strong {
    display: block;
    color: #fff7ef;
    font-size: .94rem;
    line-height: 1.35;
}
.account-item {
    width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 14px;
    color: rgba(255, 244, 236, 0.92);
    background: transparent;
    border: 0;
    text-align: left;
    font-weight: 600;
}
.account-item:hover,
.account-item-button:hover {
    background: rgba(255, 255, 255, 0.08);
}
.account-item-button {
    cursor: pointer;
}
.account-menu-dashboard .account-trigger {
    max-width: 220px;
}

.flash {
    width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 14px 18px; border-radius: 18px; font-weight: 600;
    position: fixed; top: calc(var(--header-h) + 10px); left: 50%; transform: translateX(-50%); z-index: 55;
}
.flash-success { background: rgba(67, 151, 96, .13); color: #225b35; border: 1px solid rgba(67,151,96,.12); }
.flash-error { background: rgba(180,65,65,.12); color: #7b2727; border: 1px solid rgba(180,65,65,.15); }

.hero-copy, .hero-meta, .card, .module-card, .auth-card, .stat-card, .a4-stage, .modal-card {
    background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(20px);
}
.hero-copy p, .hero-meta span, .preview-footnote, .site-footer p { color: var(--muted); line-height: 1.7; }
.eyebrow, .pill {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px;
    background: rgba(184,100,60,.1); color: var(--accent-strong); font-size: .86rem; font-weight: 700;
}
.editor-home-body { height: 100vh; overflow: hidden; }
.customer-dashboard-body {
    min-height: 100vh;
    padding-top: calc(var(--header-h) + 20px);
    padding-bottom: calc(var(--footer-h) + 18px);
}
.customer-dashboard-body .panel-shell {
    padding-top: 12px;
    padding-bottom: 36px;
}
.customer-dashboard-body .cookie-bar {
    bottom: calc(var(--footer-h) + 12px);
}
.dashboard-header {
    width: 100%;
    max-width: none;
    margin: 0;
    gap: 18px;
    padding-left: 32px;
    padding-right: 32px;
}
.dashboard-header-brand,
.dashboard-header-actions,
.dashboard-primary-nav,
.dashboard-footer-links,
.dashboard-footer-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}
.dashboard-footer-meta {
    flex-direction: column;
    justify-content: center;
    text-align: left;
    align-items: flex-start;
}
.dashboard-header-brand {
    min-width: 0;
}
.dashboard-primary-nav {
    flex: 1 1 auto;
    justify-content: center;
    flex-wrap: wrap;
}
.dashboard-nav-link {
    padding: 11px 16px;
    border-radius: 999px;
    color: rgba(255, 235, 221, 0.78);
    font-weight: 700;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}
.dashboard-nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}
.dashboard-nav-link.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(184, 100, 60, 0.34), rgba(143, 71, 38, 0.5));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.dashboard-header-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
}
.dashboard-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    width: 100%;
    max-width: none;
    margin: 0;
    min-height: var(--dashboard-footer-h);
    padding: 10px 16px 12px;
    background: #2c2016;
    color: rgba(255, 245, 236, 0.92);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 228, 205, 0.12);
    box-shadow: 0 -10px 30px rgba(25, 16, 10, 0.28);
}
.dashboard-footer-inner {
    width: min(1380px, calc(100% - 28px));
    margin: 0 auto;
    display: flex;
    align-content: center;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    text-align: left;
}
.dashboard-footer strong {
    color: #fff7ef;
}
.dashboard-footer p {
    margin: 0;
    color: rgba(255, 235, 221, 0.72);
}
.dashboard-footer-links {
    justify-content: center;
    flex-wrap: wrap;
    color: rgba(255, 235, 221, 0.76);
    gap: 16px;
    font-size: .92rem;
}
.dashboard-footer-links a {
    transition: color .18s ease;
}
.dashboard-footer-links a:hover {
    color: #ffffff;
}
.editor-home-body .site-header,
.editor-home-body .editor-shell,
.editor-home-body .site-footer {
    width: 100%;
    max-width: none;
    margin: 0;
    padding-left: 32px;
    padding-right: 32px;
}
.editor-home-body .brand small { display: none; }
.editor-home-body .site-footer {
    padding-top: 10px;
    padding-bottom: 12px;
}
.editor-home-body .footer-links {
    gap: 18px;
    color: rgba(255, 235, 221, 0.76);
}
.editor-home-body .footer-links a {
    transition: color .18s ease, opacity .18s ease;
}
.editor-home-body .footer-links a:hover {
    color: #ffffff;
}
.editor-home-body .cookie-bar { bottom: calc(var(--footer-h) + 12px); }
.editor-shell {
    padding: calc(var(--header-h) + 12px) 0 calc(var(--footer-h) + 12px);
    height: 100vh;
}
.editor-grid {
    display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; align-items: stretch;
    height: 100%;
    width: 100%;
}
.editor-sidebar {
    display: grid; gap: 14px; height: 100%; overflow: auto; padding-right: 6px;
}
.editor-sidebar-head {
    padding: 14px 4px 6px; display: grid; gap: 4px;
}
.editor-sidebar-head strong { font-size: 1.05rem; }
.editor-sidebar-head span { color: var(--muted); font-size: .92rem; }
.module-card, .card, .auth-card, .stat-card { border-radius: var(--radius); padding: 22px; }
.module-head, .card-head, .section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 16px; }
.module-head h3, .card-head h2, .section-heading h1, .section-heading h2 { margin: 0; }
.module-title {
    display: inline-flex; align-items: center; gap: 10px; font-size: 1.02rem;
}
.module-symbol {
    width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    border-radius: 10px; background: rgba(184,100,60,.12); color: var(--accent-strong);
}
.module-note { color: var(--muted); margin: 12px 0 0; }
.field-row, .two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-row.align-end { align-items: end; }
.field-stack {
    display: grid;
    gap: 8px;
}
.field-stack.compact {
    gap: 6px;
}
.field-tools-row {
    display: flex;
    align-items: end;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: nowrap;
}
.field-tools-row .field-stack {
    min-width: 0;
}
.field-tools-row .field-stack:first-child {
    flex: 0 1 auto;
}
.field-tools-row .compact-toggle {
    flex: 0 0 auto;
    position: relative;
    padding-left: 14px;
    margin-left: 2px;
}
.field-tools-row .compact-toggle::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 38px;
    background: rgba(139, 94, 60, 0.14);
}
.field-label {
    font-weight: 600;
    color: var(--text);
}
.stack-form, .module-card { display: grid; gap: 12px; }
.stack-form label, .module-card label { display: grid; gap: 8px; font-weight: 600; color: var(--text); }
.stack-form input, .stack-form select, .stack-form textarea, .module-card input, .module-card select, .module-card textarea {
    width: 100%; border: 1px solid rgba(117,104,91,.18); background: rgba(255,255,255,.82); color: var(--text);
    border-radius: 14px; padding: 12px 14px;
}
.stack-form input[type="color"],
.module-card input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    inline-size: 100%;
    block-size: 48px;
    padding: 6px;
    min-height: 46px;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(139, 94, 60, 0.08);
}
.stack-form input[type="color"]::-webkit-color-swatch-wrapper,
.module-card input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}
.stack-form input[type="color"]::-webkit-color-swatch,
.module-card input[type="color"]::-webkit-color-swatch {
    border: 0;
    border-radius: 10px;
}
.stack-form input[type="color"]::-moz-color-swatch,
.module-card input[type="color"]::-moz-color-swatch {
    border: 0;
    border-radius: 10px;
}
.range-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}
.range-field input[type="range"] {
    padding: 0;
    border: 0;
    background: transparent;
    accent-color: var(--accent);
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(184,100,60,.26), rgba(212,163,115,.42));
}
.range-field input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--accent);
    box-shadow: 0 6px 14px rgba(68, 38, 19, 0.16);
}
.range-field input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid var(--accent);
    box-shadow: 0 6px 14px rgba(68, 38, 19, 0.16);
}
.range-field input[type="range"]::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(184,100,60,.26), rgba(212,163,115,.42));
}
.range-value {
    min-width: 64px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(184,100,60,.1);
    color: var(--accent-strong);
    font-size: .84rem;
    font-weight: 800;
    text-align: center;
}
.choice-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.choice-chip {
    position: relative;
    display: block;
}
.choice-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.choice-chip span {
    display: inline-flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,.86);
    border: 1px solid rgba(139, 94, 60, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
    transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.choice-chip input:checked + span {
    background: linear-gradient(135deg, rgba(184,100,60,.16), rgba(143,71,38,.2));
    border-color: rgba(184,100,60,.34);
    color: var(--accent-strong);
    box-shadow: 0 10px 20px rgba(68, 38, 19, 0.08);
}
.choice-chip:hover span {
    transform: translateY(-1px);
}
.stack-form textarea, .module-card textarea { resize: vertical; min-height: 88px; }
.inline-check { display: flex !important; align-items: center; gap: 10px; }
.inline-check input { width: auto !important; }
.icon-toggle,
.icon-choice {
    position: relative;
    display: inline-flex;
}
.icon-toggle input,
.icon-choice input {
    position: absolute;
    opacity: 0;
    inset: 0;
    pointer-events: none;
}
.icon-toggle span,
.icon-choice span {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.86);
    border: 1px solid rgba(139, 94, 60, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
    color: var(--muted);
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.icon-toggle svg,
.icon-choice svg {
    width: 20px;
    height: 20px;
}
.icon-toggle input:checked + span,
.icon-choice input:checked + span {
    background: linear-gradient(135deg, rgba(184,100,60,.16), rgba(143,71,38,.2));
    border-color: rgba(184,100,60,.34);
    color: var(--accent-strong);
    box-shadow: 0 10px 20px rgba(68, 38, 19, 0.08);
}
.icon-toggle:hover span,
.icon-choice:hover span {
    transform: translateY(-1px);
}
.icon-choice-group {
    display: inline-flex;
    gap: 10px;
    flex-wrap: wrap;
}
.icon-choice-group-wide {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.icon-choice-wide span {
    width: 100%;
    min-width: 62px;
}
.icon-choice-text span {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .02em;
}
.icon-choice-wide svg {
    width: 24px;
    height: 24px;
}
.upload-dropzone {
    position: relative;
    display: grid !important;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px dashed rgba(184, 100, 60, 0.34);
    background:
        linear-gradient(135deg, rgba(255,255,255,.94), rgba(248, 239, 230, .9));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.26);
    overflow: hidden;
    cursor: pointer;
    order: -1;
}
.upload-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.upload-dropzone.is-dragover {
    border-color: rgba(184, 100, 60, 0.58);
    background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(241, 224, 207, .96));
}
.upload-dropzone-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(184,100,60,.12);
    color: var(--accent-strong);
}
.upload-dropzone-icon svg {
    width: 22px;
    height: 22px;
}
.upload-dropzone-copy {
    display: grid;
    gap: 2px;
}
.upload-dropzone-copy strong {
    color: var(--text);
    font-size: .98rem;
}
.upload-dropzone-copy span {
    color: var(--muted);
    font-size: .92rem;
}
.upload-dropzone-copy small {
    color: rgba(117, 104, 91, 0.84);
    font-size: .78rem;
}
.background-library-field,
.module-card label:has(> details[data-background-picker]) {
    display: grid !important;
    gap: 10px;
}
.media-select {
    position: relative;
}
.module-card:has(.media-select[open]) {
    position: relative;
    z-index: 30;
}
.module-card.background-picker-open {
    position: relative;
    z-index: 30;
}
.media-select[open] {
    z-index: 40;
}
.media-select-trigger {
    list-style: none;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(139, 94, 60, 0.14);
    background: rgba(255,255,255,.88);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
    cursor: pointer;
}
.media-select-trigger::-webkit-details-marker {
    display: none;
}
.media-select-thumb,
.media-option-thumb {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(184,100,60,.1);
    color: var(--accent-strong);
    flex-shrink: 0;
}
.media-select-thumb img,
.media-option-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.media-select-thumb svg,
.media-option-thumb svg {
    width: 22px;
    height: 22px;
}
.media-select-thumb.is-empty,
.media-option-thumb.is-empty {
    background: rgba(184,100,60,.08);
    border: 1px dashed rgba(184,100,60,.24);
}
.media-select-copy,
.media-option-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}
.media-select-copy strong,
.media-option-copy strong {
    color: var(--text);
    font-size: .98rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.media-select-copy small,
.media-option-copy small {
    color: var(--muted);
    font-size: .82rem;
}
.media-select-caret {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    background: rgba(184,100,60,.08);
    transition: transform .18s ease, background .18s ease;
}
.media-select-caret svg {
    width: 18px;
    height: 18px;
}
.media-select[open] .media-select-caret {
    transform: rotate(180deg);
    background: rgba(184,100,60,.14);
}
.media-select-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 45;
    display: grid;
    gap: 8px;
    max-height: 280px;
    padding: 10px;
    overflow: auto;
    border-radius: 20px;
    border: 1px solid rgba(139, 94, 60, 0.14);
    background: rgba(255, 250, 245, 0.98);
    box-shadow: 0 24px 48px rgba(44, 32, 22, 0.16);
    backdrop-filter: blur(10px);
}
.media-option {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 16px;
    background: rgba(255,255,255,.76);
    text-align: left;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.media-option:hover,
.media-option.is-active {
    background: linear-gradient(135deg, rgba(184,100,60,.14), rgba(143,71,38,.12));
    box-shadow: 0 10px 22px rgba(68, 38, 19, 0.08);
    transform: translateY(-1px);
}
.module-card label:has(> input[data-upload="logo"]):not(.upload-dropzone) {
    display: none !important;
}
.module-card label:has(> select[data-bind="logo.align"]) {
    display: none !important;
}
.module-card label:has(> input[data-upload="background"]):not(.upload-dropzone) {
    display: none !important;
}
.logo-align-tools {
    order: 3;
}
.compact-toggle .icon-toggle span {
    width: 44px;
    height: 44px;
}
.form-span { grid-column: 1 / -1; }
.form-note { color: var(--muted); font-size: .95rem; }

.toggle { position: relative; width: 52px; height: 30px; display: inline-flex; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span {
    position: absolute; inset: 0; background: rgba(117,104,91,.22); border-radius: 999px; transition: .2s;
}
.toggle span::after {
    content: ""; position: absolute; width: 22px; height: 22px; top: 4px; left: 4px; border-radius: 50%;
    background: #fff; transition: .2s; box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.toggle input:checked + span { background: linear-gradient(135deg, var(--accent), var(--accent-strong)); }
.toggle input:checked + span::after { transform: translateX(22px); }

.editor-preview-wrap {
    position: relative; min-height: 0; border-radius: 34px; overflow: hidden;
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,.75), transparent 28%),
        linear-gradient(140deg, rgba(223, 189, 162, 0.55), rgba(240, 223, 209, 0.24) 38%, rgba(191, 147, 111, 0.2));
    border: 1px solid rgba(139, 94, 60, 0.12);
    box-shadow: var(--shadow);
}
.preview-toolbar {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(255, 250, 245, 0.86);
    border: 1px solid rgba(139, 94, 60, 0.12);
    backdrop-filter: blur(16px);
    box-shadow: 0 16px 28px rgba(68, 38, 19, 0.08);
}
.preview-toolbar-label {
    font-size: .82rem;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: .04em;
    text-transform: uppercase;
}
.preview-zoom-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.preview-zoom-btn,
.preview-zoom-value {
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255,255,255,.92);
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(139, 94, 60, 0.08);
    transition: background .18s ease, transform .18s ease, color .18s ease;
}
.preview-zoom-btn {
    width: 36px;
    height: 36px;
}
.preview-zoom-btn svg {
    width: 18px;
    height: 18px;
}
.preview-zoom-value {
    min-width: 78px;
    height: 36px;
    padding: 0 12px;
    font-weight: 700;
}
.preview-zoom-btn:hover,
.preview-zoom-value:hover {
    background: #ffffff;
    transform: translateY(-1px);
}
.preview-scene, .preview-scene-bg, .preview-scene-glow { position: absolute; inset: 0; }
.preview-scene-bg {
    background:
        linear-gradient(130deg, rgba(255,255,255,.22), rgba(255,255,255,0) 32%),
        radial-gradient(circle at 82% 18%, rgba(184,100,60,.18), transparent 23%),
        radial-gradient(circle at 8% 92%, rgba(212, 163, 115, .28), transparent 24%);
}
.preview-scene-glow {
    inset: auto auto 5% 6%; width: 28%; aspect-ratio: 1; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.55), transparent 70%);
    filter: blur(18px);
}
.a4-stage {
    position: relative; z-index: 1; height: 100%; display: grid; place-items: center;
    padding: clamp(18px, 2.4vw, 30px); overflow: hidden;
    cursor: grab;
    touch-action: none;
    user-select: none;
}
.a4-stage.is-panning {
    cursor: grabbing;
}
.a4-stage.is-panning .a4-paper {
    transition: none;
}
.a4-paper {
    width: min(100%, 640px); max-height: 100%; aspect-ratio: 210 / 297; margin: 0 auto; position: relative; border-radius: 8px;
    background-size: cover; background-position: center; background-repeat: no-repeat;
    box-shadow: 0 28px 60px rgba(48, 27, 13, .2);
    transform-origin: center center;
    transition: transform .18s ease;
    will-change: transform;
}
.a4-content {
    position: absolute; inset: 7.15% 7.15% 7.15% 7.15%; display: grid;
    grid-template-rows: auto auto 1fr auto auto; gap: 0;
}
.preview-title,
.preview-description,
.preview-grid,
.preview-logo,
.preview-sample { margin: 0; }
.preview-title, .preview-description { text-wrap: balance; }
.preview-title { font-family: var(--heading-font); font-size: clamp(1.6rem, 2.8vw, 2.65rem); }
.preview-description { font-size: clamp(.9rem, 1.4vw, 1.05rem); line-height: 1.55; }
.preview-grid { display: grid; gap: 0; align-self: start; width: 100%; min-height: 320px; box-sizing: border-box; }
.preview-cell {
    position: relative;
    min-height: 86px;
    outline: none;
    display: block;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: rgba(255,255,255,.64);
    transition: background .2s ease;
}
.preview-cell:focus { background: rgba(255,255,255,.94); box-shadow: inset 0 0 0 2px rgba(184,100,60,.12); }
.preview-cell::after {
    content: "";
    position: absolute;
    left: var(--signature-inset, 10px);
    right: var(--signature-inset, 10px);
    bottom: var(--signature-bottom, 10px);
    border-bottom-width: var(--signature-width, 1px);
    border-bottom-style: var(--signature-style, solid);
    border-bottom-color: var(--signature-color, rgba(44, 32, 22, 0.46));
    pointer-events: none;
}
.preview-logo img { max-height: 100px; width: auto; object-fit: contain; }
.preview-sample { color: var(--muted); font-style: italic; font-size: .92rem; }

.editor-actions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.editor-actions-grid .btn:last-child { grid-column: 1 / -1; }
.editor-action-btn {
    justify-content: flex-start;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(184,100,60,.16);
    box-shadow: 0 10px 22px rgba(68, 38, 19, 0.08);
}
.editor-action-btn .btn-icon {
    width: 20px; height: 20px; color: var(--accent-strong);
}
.editor-action-btn-wide { grid-column: 1 / -1; }

.section-heading { margin-bottom: 20px; }
.section-heading p { color: var(--muted); margin: 6px 0 0; }
.panel-shell { padding: 30px 0 48px; }
.panel-shell.narrow { width: min(720px, calc(100% - 32px)); }
.dashboard-grid, .admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 20px; }
.stat-card strong { font-size: clamp(1.6rem, 2.4vw, 2.4rem); display: block; margin-bottom: 8px; }
.stat-card span { color: var(--muted); }
.design-card-grid, .media-grid, .module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.design-card, .media-card {
    display: grid; gap: 10px; background: rgba(255,255,255,.72); padding: 14px; border-radius: 20px; border: 1px solid var(--line);
}
.design-card img, .media-card img { border-radius: 16px; aspect-ratio: 4 / 5; object-fit: cover; background: #f7efe6; }
.design-card span, .design-card small, .simple-list-item span, .simple-list-item small { color: var(--muted); }
.simple-list, .admin-main { display: grid; gap: 12px; }
.simple-list-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.simple-list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.simple-list-item-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dashboard-overview-shell {
    display: grid;
    gap: 20px;
}
.dashboard-hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) auto;
    gap: 24px;
    align-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at top right, rgba(184, 100, 60, 0.14), transparent 28%),
        linear-gradient(135deg, rgba(255,255,255,0.94), rgba(245, 236, 227, 0.92));
}
.dashboard-hero-copy {
    display: grid;
    gap: 10px;
}
.dashboard-hero-copy h1 {
    margin: 0;
    font-size: clamp(1.9rem, 3vw, 2.7rem);
}
.dashboard-hero-copy p {
    margin: 0;
    max-width: 720px;
    color: var(--muted);
}
.dashboard-hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}
.dashboard-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.dashboard-summary-card {
    display: grid;
    gap: 8px;
}
.dashboard-summary-card strong {
    margin-bottom: 0;
}
.dashboard-summary-card small {
    color: var(--muted);
    line-height: 1.5;
}
.dashboard-summary-label {
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--accent-strong);
    font-weight: 800;
}
.dashboard-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .9fr);
    gap: 20px;
    align-items: start;
}
.dashboard-side-stack {
    display: grid;
    gap: 20px;
}
.dashboard-focus-card .card-head p {
    margin: 6px 0 0;
    color: var(--muted);
}
.dashboard-design-list {
    display: grid;
    gap: 14px;
}
.dashboard-design-item {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 20px;
    background: rgba(255,255,255,.72);
    border: 1px solid var(--line);
}
.dashboard-design-thumb img {
    width: 88px;
    aspect-ratio: 4 / 5;
    border-radius: 16px;
    object-fit: cover;
    background: #f7efe6;
}
.dashboard-design-body {
    min-width: 0;
    display: grid;
    gap: 8px;
}
.dashboard-design-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.dashboard-design-top strong,
.dashboard-order-item strong {
    font-size: 1rem;
}
.dashboard-design-body small,
.dashboard-order-item small {
    color: var(--muted);
}
.dashboard-status-pill {
    padding: 7px 11px;
    font-size: .74rem;
    white-space: nowrap;
}
.dashboard-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.dashboard-quick-link {
    display: grid;
    gap: 10px;
    padding: 16px;
    border-radius: 20px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(139, 94, 60, 0.1);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.dashboard-quick-link:hover {
    transform: translateY(-2px);
    border-color: rgba(184, 100, 60, 0.22);
    box-shadow: 0 16px 28px rgba(68, 38, 19, 0.08);
}
.dashboard-quick-link strong {
    font-size: .98rem;
}
.dashboard-quick-link small {
    color: var(--muted);
    line-height: 1.5;
}
.dashboard-quick-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(184,100,60,.12);
    color: var(--accent-strong);
}
.dashboard-quick-icon svg {
    width: 20px;
    height: 20px;
}
.dashboard-order-list {
    gap: 0;
}
.dashboard-order-item {
    display: grid;
    gap: 8px;
}

.table-responsive { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th, .data-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th { color: var(--muted); font-size: .86rem; text-transform: uppercase; letter-spacing: .06em; }
.inline-form, .toolbar-filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.site-footer {
    width: 100%;
    margin: 0;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    height: var(--footer-h);
    padding: 10px 16px 12px;
    align-content: center;
    background: #2c2016;
    color: rgba(255, 245, 236, 0.92);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 228, 205, 0.12);
    box-shadow: 0 -10px 30px rgba(25, 16, 10, 0.28);
}
.footer-inner {
    width: min(1380px, calc(100% - 28px));
    margin: 0 auto;
    display: flex;
    align-content: center;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    text-align: left;
}
.footer-meta {
    display: grid;
    gap: 6px;
    justify-items: start;
}
.footer-meta p { margin: 0; }
.footer-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: rgba(255, 235, 221, 0.76);
    justify-content: flex-end;
    align-content: center;
    align-items: center;
}
.footer-links a {
    transition: color .18s ease, opacity .18s ease;
}
.footer-links a:hover {
    color: #ffffff;
}
.footer-copyright {
    font-size: .82rem;
    color: rgba(255, 235, 221, 0.76);
}

.cookie-bar {
    position: fixed; left: 20px; right: 20px; bottom: 20px; z-index: 58; display: flex; justify-content: space-between; gap: 20px;
    align-items: center; padding: 18px 20px; border-radius: 22px; background: rgba(38, 30, 24, .92); color: #fff; box-shadow: var(--shadow);
}
.theme-shell:not(.editor-home-body) .cookie-bar {
    bottom: calc(var(--footer-h) + 12px);
}
.cookie-bar[hidden] { display: none !important; }
.cookie-bar p { margin: 0; max-width: 760px; }

.modal {
    position: fixed; inset: 0; background: rgba(32, 21, 15, .52); display: grid; place-items: center; padding: 20px; z-index: 60;
}
.modal[hidden] { display: none !important; }
.modal-card { width: min(860px, 100%); border-radius: 30px; padding: 28px; position: relative; }
.modal-close {
    position: absolute; top: 18px; right: 18px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(117,104,91,.12);
}

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px; }
.auth-card { width: min(540px, 100%); }
.auth-card-wide { width: min(760px, 100%); }
.auth-links { margin-top: 12px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.theme-admin {
    display: grid; grid-template-columns: 292px minmax(0, 1fr); min-height: 100vh;
    background: #f4f1ec;
}
.admin-sidebar {
    padding: 24px 18px; background: linear-gradient(180deg, #2c2016 0%, #39291d 100%); border-right: 1px solid rgba(255,255,255,.05);
    position: sticky; top: 0; height: 100vh;
    color: rgba(255, 241, 230, 0.88);
}
.brand-admin {
    margin-bottom: 24px; padding: 12px 12px 18px; border-bottom: 1px solid rgba(117,104,91,.12);
}
.brand-admin .brand-logo { color: #fff7ef; }
.brand-admin small { color: rgba(255, 235, 221, 0.66); }
.admin-nav { display: grid; gap: 16px; }
.admin-nav-group {
    display: grid; gap: 6px; padding: 6px 0;
}
.admin-nav-group-footer {
    margin-top: 6px; padding-top: 16px; border-top: 1px solid rgba(117,104,91,.12);
}
.admin-nav-label {
    padding: 0 14px 8px; color: rgba(255, 230, 208, 0.48); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.admin-nav-link {
    display: inline-flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; color: rgba(255, 236, 222, 0.74); font-weight: 700;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}
.admin-nav-link:hover {
    background: rgba(255,255,255,.08); color: #ffffff; transform: translateX(2px);
}
.admin-nav-link.is-active {
    background: linear-gradient(135deg, rgba(184,100,60,.28), rgba(143,71,38,.42));
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.admin-nav-icon {
    width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.admin-nav-icon svg { width: 100%; height: 100%; }
.admin-main { padding: 34px; background: linear-gradient(180deg, rgba(255,255,255,.4), rgba(255,255,255,0)); }
.admin-section { margin-bottom: 32px; }
.admin-hero {
    display: grid; grid-template-columns: 1.4fr .8fr; gap: 24px; align-items: stretch;
    padding: 28px 30px; border-radius: 26px; background: linear-gradient(135deg, #fffdf9, #f5ece3);
    border: 1px solid rgba(139, 94, 60, 0.08); box-shadow: 0 22px 50px rgba(61, 37, 20, 0.08);
}
.admin-hero h1 { margin: 10px 0 8px; font-size: clamp(2rem, 4vw, 3.2rem); }
.admin-hero p { margin: 0; color: var(--muted); max-width: 720px; line-height: 1.65; }
.admin-hero-side {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}
.admin-kpi {
    padding: 18px; border-radius: 22px; background: rgba(255,255,255,.72); border: 1px solid rgba(139, 94, 60, 0.1);
    display: grid; align-content: center;
}
.admin-kpi strong { font-size: 1.6rem; margin-bottom: 6px; }
.admin-kpi span { color: var(--muted); font-size: .92rem; }
.admin-section-group { display: grid; gap: 22px; margin-bottom: 36px; }
.admin-group-head {
    display: grid; gap: 6px; padding: 0 4px;
}
.admin-group-head h2 { margin: 0; }
.admin-group-head p { margin: 0; color: var(--muted); }
.admin-group-badge {
    display: inline-flex; width: fit-content; padding: 8px 12px; border-radius: 999px; background: rgba(184,100,60,.1);
    color: var(--accent-strong); font-size: .82rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
.admin-two-col {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px;
}
.section-heading.compact { margin-bottom: 14px; }
.admin-inline-form { margin-bottom: 18px; }
.admin-module-card {
    align-content: start; background: rgba(255,255,255,.72);
}
.admin-module-card small { color: var(--muted); }
.admin-page-head {
    display: flex; justify-content: space-between; gap: 18px; align-items: end;
    margin-bottom: 22px;
}
.admin-page-head h1 { margin: 0 0 6px; }
.admin-page-head p { margin: 0; color: var(--muted); }
.admin-dashboard-stats { margin-top: 0; }
.admin-mini-stats {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
}
.admin-mini-stats > div {
    padding: 18px; border-radius: 18px; background: rgba(255,255,255,.7); border: 1px solid rgba(139, 94, 60, 0.08);
}
.admin-mini-stats strong { display: block; font-size: 1.5rem; margin-bottom: 6px; }
.admin-mini-stats span { color: var(--muted); }

.empty-state { color: var(--muted); padding: 16px 0; }
.hidden-form { display: none; }

@media (max-width: 1100px) {
    .editor-grid, .dashboard-grid, .admin-grid, .theme-admin { grid-template-columns: 1fr; }
    .editor-home-body { overflow: auto; }
    .editor-home-body .site-footer, .site-header { position: static; height: auto; }
    .customer-dashboard-body {
        padding-top: 18px;
        padding-bottom: calc(var(--footer-h) + 18px);
    }
    .customer-dashboard-body .site-header {
        position: static;
        height: auto;
    }
    .editor-shell { height: auto; min-height: 100vh; padding-top: 18px; padding-bottom: 90px; }
    .editor-sidebar { max-height: none; overflow: visible; padding-right: 0; }
    .editor-preview-wrap { min-height: 900px; }
    .admin-sidebar { position: static; height: auto; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-hero-card,
    .dashboard-overview-grid,
    .dashboard-quick-grid {
        grid-template-columns: 1fr;
    }
    .site-nav-editor { padding-right: 0; margin-right: 0; border-right: 0; }
    .admin-hero, .admin-two-col, .admin-hero-side { grid-template-columns: 1fr; }
    .dashboard-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    .dashboard-footer-inner {
        width: 100%;
    }
    .dashboard-header {
        align-items: flex-start;
    }
    .dashboard-header-brand,
    .dashboard-header-actions,
    .dashboard-primary-nav,
    .dashboard-footer-links,
    .dashboard-footer-meta {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .site-header, .cookie-bar, .site-nav, .footer-inner, .dashboard-footer-inner { flex-direction: column; align-items: stretch; }
    .hero-copy, .hero-meta, .card, .module-card, .auth-card, .stat-card, .modal-card { padding: 20px; }
    .field-row, .two-columns, .editor-actions-grid, .stats-grid { grid-template-columns: 1fr; }
    .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .a4-content { inset: 6%; }
    .preview-cell { min-height: 64px; }
    .editor-preview-wrap { min-height: 620px; }
    .preview-toolbar {
        top: 14px;
        right: 14px;
        padding: 9px 10px;
    }
    .editor-home-body .site-header,
    .editor-home-body .editor-shell,
    .editor-home-body .site-footer { padding-left: 16px; padding-right: 16px; }
    .dashboard-primary-nav,
    .dashboard-header-actions,
    .dashboard-footer-links,
    .dashboard-footer-cta {
        width: 100%;
    }
    .dashboard-design-item {
        grid-template-columns: 1fr;
        justify-items: start;
    }
    .dashboard-design-thumb img {
        width: 100%;
        max-width: 128px;
    }
    .dashboard-design-top,
    .simple-list-item-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .account-menu,
    .account-trigger,
    .nav-chip,
    .site-nav-editor .btn,
    .dashboard-header-actions .btn {
        width: 100%;
    }
    .account-dropdown {
        position: static;
        margin-top: 8px;
        min-width: 0;
    }
}
