* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0a0a;
    --surface: #141414;
    --surface2: #1c1c1c;
    --border: #2a2a2a;
    --border-hover: #444;
    --gold: #f97316;
    --gold-bright: #fb923c;
    --text: #ececec;
    --text-muted: #8a9ab0;
    --text-dim: #576070;
    --danger: #e05555;
    --radius: 14px;
    /* 3D shadow system — bold clay morphism */
    --sh-raised: 6px 6px 16px rgba(0,0,0,0.90), -3px -3px 10px rgba(255,255,255,0.10);
    --sh-card:   4px 4px 12px rgba(0,0,0,0.80), -2px -2px 8px rgba(255,255,255,0.07);
    --sh-inset:  inset 3px 3px 9px rgba(0,0,0,0.65), inset -1px -1px 4px rgba(255,255,255,0.05);
    --sh-orange: 0 14px 40px rgba(180,55,0,0.80),
                 0 5px 14px rgba(255,195,100,0.70) inset,
                 0 -4px 8px rgba(0,0,0,0.55) inset;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

header {
    text-align: center;
    padding: 28px 0 28px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 36px;
}

.header-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    position: relative;
}

.header-logo {
    height: 72px;
    width: auto;
    object-fit: contain;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.5px;
}

header h1 span {
    font-weight: 400;
    color: var(--text-muted);
}

.headline-text {
    color: var(--text);
    margin-top: 10px;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.4;
}

.tagline {
    color: var(--text-muted);
    margin-top: 6px;
    font-size: 0.88rem;
    line-height: 1.5;
}

.banner {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.banner.error {
    background: #1f1010;
    border: 1px solid #662222;
    color: var(--danger);
}

.banner.warning {
    background: #1f1a10;
    border: 1px solid #664422;
    color: #d4a843;
}

.upload-section {
    background: var(--surface);
    border-radius: 20px;
    padding: 32px 28px;
    border: 1px solid rgba(255,255,255,0.07);
    box-shadow: var(--sh-raised);
}

.simple-row {
    margin-bottom: 0;
}

.simple-fields {
    margin-bottom: 8px;
}

/* Marketing content mode selector */
.marketing-mode-section {
    margin-bottom: 4px;
}

.section-label-heading {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text);
    margin-bottom: 12px;
}

.marketing-mode-toggle {
    display: flex;
    gap: 10px;
}

.marketing-mode-option {
    flex: 1;
    position: relative;
}

.marketing-mode-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.marketing-mode-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.07);
    background: var(--surface2);
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s, border-color 0.18s;
    box-shadow: var(--sh-card);
}

.marketing-mode-card:hover {
    transform: translateY(-2px);
    border-color: rgba(249,115,22,0.30);
    box-shadow: var(--sh-card), 0 0 0 1px rgba(249,115,22,0.20);
}

.marketing-mode-icon {
    font-size: 1.3rem;
    line-height: 1;
    margin-bottom: 2px;
}

.marketing-mode-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.marketing-mode-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
    opacity: 0.7;
}

.marketing-mode-option input:checked + .marketing-mode-card {
    background: linear-gradient(180deg, #ff8533 0%, #d95f00 100%);
    border-color: transparent;
    box-shadow: var(--sh-orange);
    transform: translateY(-1px);
}

.marketing-mode-option input:checked + .marketing-mode-card .marketing-mode-name,
.marketing-mode-option input:checked + .marketing-mode-card .marketing-mode-desc {
    color: var(--bg);
    opacity: 1;
}

.optional-hint {
    font-weight: 400;
    color: var(--text-dim);
    font-size: 0.75rem;
    text-transform: none;
    letter-spacing: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--text);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.05);
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: var(--sh-inset);
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: var(--sh-inset), 0 0 0 2px rgba(249,115,22,0.18);
}

.cta-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cta-custom-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(249,115,22,0.35);
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: var(--sh-inset);
    box-sizing: border-box;
}

.cta-custom-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: var(--sh-inset), 0 0 0 2px rgba(249,115,22,0.18);
}

.drop-zone {
    border: 1.5px dashed rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 44px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
    box-shadow: var(--sh-inset);
    background: rgba(0,0,0,0.2);
}

.drop-zone:hover {
    border-color: var(--gold);
    background: rgba(249,115,22,0.04);
    box-shadow: var(--sh-inset), 0 0 0 1px rgba(249,115,22,0.2);
}

.drop-zone.has-file {
    border-color: var(--gold);
    border-style: solid;
}

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.drop-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.drop-text {
    color: var(--text-dim);
    font-size: 0.88rem;
}

.drop-filename {
    color: var(--gold);
    font-weight: 600;
    margin-top: 6px;
    font-size: 0.9rem;
}

.thumb-preview {
    max-width: 180px;
    max-height: 140px;
    margin: 10px auto 0;
    border-radius: 8px;
    display: none;
}

/* ── Style selector cards ─────────────────────────────── */
.style-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.style-option {
    position: relative;
}

.style-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.style-option .style-card {
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.07);
    background: var(--surface2);
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.18s;
    box-shadow: var(--sh-card);
}

.style-option .style-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 8px 12px 26px rgba(0,0,0,0.90), -3px -3px 10px rgba(255,255,255,0.10),
                0 0 0 1.5px rgba(249,115,22,0.45);
}

.style-option input:checked + .style-card {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 8px 12px 28px rgba(0,0,0,0.90), -3px -3px 10px rgba(255,255,255,0.10),
                0 0 0 2.5px var(--gold), 0 0 32px rgba(249,115,22,0.40);
    border-color: transparent;
}

/* Style preview thumbnails */
.style-thumb {
    width: 100%;
    height: 120px;
    object-fit: cover;
    object-position: center;
    display: block;
    flex-shrink: 0;
    transition: filter 0.2s;
}


.style-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 8px 11px;
    text-align: center;
}

.style-card .style-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.2px;
}

.style-card .style-tagline {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.style-option input:checked + .style-card .style-name {
    color: var(--gold);
}

/* ── Photo Enhancement pill segment ─────────────────── */
.enh-segment {
    display: flex;
    background: var(--bg);
    border-radius: 50px;
    padding: 4px;
    gap: 4px;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: var(--sh-inset);
}

.enh-pill {
    flex: 1;
    position: relative;
}

.enh-pill input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.enh-pill-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    letter-spacing: 0.2px;
}

.enh-pill-label:hover {
    color: var(--text);
    background: rgba(249, 115, 22, 0.08);
}

.enh-pill input:checked + .enh-pill-label {
    background: linear-gradient(180deg, #ff8533 0%, #d95f00 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(195,70,0,0.45),
                0 1px 0 rgba(255,155,80,0.35) inset;
}

/* Locked Boost pill for Standard users */
.enh-pill-pro.locked .enh-pill-label {
    opacity: 0.45;
    cursor: not-allowed;
}
.enh-pill-pro.locked .enh-pill-label:hover {
    background: none;
    color: var(--text-muted);
}
.pro-badge {
    font-size: 0.62rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f97316, #d95f00);
    color: #fff;
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 5px;
    letter-spacing: 0.3px;
    vertical-align: middle;
}

.enh-caption {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
    line-height: 1.45;
    min-height: 1.2em;
    transition: opacity 0.2s;
}

.promo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.promo-option {
    position: relative;
}

.promo-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.promo-option .promo-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 11px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.07);
    background: var(--surface2);
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s, border-color 0.18s;
    text-align: center;
    box-shadow: var(--sh-card);
}

.promo-option .promo-card:hover {
    transform: translateY(-2px);
    border-color: rgba(249,115,22,0.35);
    box-shadow: var(--sh-card), 0 0 0 1px rgba(249,115,22,0.25);
}

.promo-option input:checked + .promo-card {
    border-color: transparent;
    background: rgba(249,115,22,0.10);
    box-shadow: var(--sh-card), 0 0 0 2px var(--gold), 0 0 18px rgba(249,115,22,0.25);
    transform: translateY(-2px);
}

.promo-card .promo-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.promo-option input:checked + .promo-card .promo-name {
    color: var(--gold);
}

.brand-kit-badge {
    font-size: 0.7rem;
    color: var(--gold);
    background: rgba(212, 168, 67, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    flex-shrink: 0;
    pointer-events: none;
}

.color-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-picker-row input[type="color"] {
    width: 50px;
    height: 38px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    padding: 2px;
}

.color-hex {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: monospace;
}

.logo-upload-area {
    min-height: 80px;
}

.logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-dim);
    font-size: 0.82rem;
    transition: border-color 0.2s;
}

.logo-placeholder:hover {
    border-color: var(--gold);
    color: var(--text-muted);
}

.logo-preview {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-preview img {
    max-height: 60px;
    max-width: 120px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.05);
    padding: 4px;
}

.logo-remove-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.logo-remove-btn:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

/* Logo controls row — holds position grid + size slider side by side */
.logo-controls-row {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.logo-ctrl-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.logo-position-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 3×3 grid picker */
.logo-grid-picker {
    display: grid;
    grid-template-columns: repeat(3, 28px);
    grid-template-rows: repeat(3, 28px);
    gap: 5px;
    background: var(--bg);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 6px;
}

.lgp-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lgp-cell input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.lgp-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.12);
    transition: background 0.15s, transform 0.15s, border-color 0.15s;
}

.lgp-cell:hover .lgp-dot {
    background: rgba(249,115,22,0.45);
    border-color: var(--gold);
    transform: scale(1.25);
}

.lgp-cell input[type="radio"]:checked + .lgp-dot {
    background: var(--gold);
    border-color: var(--gold);
    transform: scale(1.3);
    box-shadow: 0 0 6px rgba(249,115,22,0.6);
}

/* Size slider re-uses the existing range-wrapper styles */
.logo-ctrl-block .range-wrapper {
    min-width: 130px;
}

.brand-kit-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.btn-save-brand {
    background: var(--gold);
    color: var(--bg);
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-save-brand:hover {
    opacity: 0.9;
}

.brand-save-status {
    font-size: 0.78rem;
    color: var(--text-dim);
}

.brand-save-status.saved {
    color: #2ecc71;
}

.brand-save-status.error {
    color: #e74c3c;
}

.font-cards-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.font-cards {
    display: flex;
    gap: 10px;
    padding-bottom: 4px;
}

.font-card-option {
    flex: 0 0 auto;
    position: relative;
    cursor: pointer;
}

.font-card-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.font-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 90px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.06);
    background: var(--surface2);
    transition: box-shadow 0.2s, transform 0.15s;
    padding: 8px 10px;
    text-align: center;
    gap: 6px;
    box-shadow: var(--sh-card);
}

.font-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh-raised), 0 0 0 1.5px rgba(249,115,22,0.3);
}

.font-card-option input:checked + .font-card {
    border-color: transparent;
    background: rgba(249,115,22,0.08);
    box-shadow: var(--sh-card), 0 0 0 2px var(--gold), 0 0 14px rgba(249,115,22,0.18);
    transform: translateY(-1px);
}

.font-sample {
    font-size: 1.15rem;
    color: var(--text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.font-card-option input:checked + .font-card .font-sample {
    color: var(--gold);
}

.font-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: system-ui, sans-serif;
}

.font-card-option input:checked + .font-card .font-label {
    color: var(--gold);
}

.advanced-section {
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.advanced-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    background: var(--surface2);
    transition: background 0.2s;
}

.advanced-header:hover {
    background: rgba(249, 115, 22, 0.06);
}

.advanced-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    pointer-events: none;
}

.toggle-arrow {
    font-size: 0.7rem;
    color: var(--text-dim);
    transition: transform 0.25s;
}

.toggle-arrow.open {
    transform: rotate(180deg);
}

.advanced-body {
    display: none;
    padding: 0 16px;
}

.advanced-body.open {
    display: block;
    padding: 16px;
}

.subsection {
    margin-bottom: 14px;
}

.subsection:last-child {
    margin-bottom: 0;
}

.subsection-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.range-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-wrapper input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
}

.range-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gold);
    cursor: pointer;
}

.range-wrapper input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gold);
    cursor: pointer;
    border: none;
}

.range-val {
    font-size: 0.78rem;
    color: var(--gold);
    font-weight: 600;
    min-width: 42px;
    text-align: right;
}

/* ── Live Preview Panel ───────────────────────────── */
.live-preview-wrap {
    margin: 20px 0 20px;
}

.lp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.lp-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text);
}

.lp-live-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(46,204,113,0.12);
    border: 1px solid rgba(46,204,113,0.25);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.62rem;
    font-weight: 700;
    color: #2ecc71;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.lp-pulse-dot {
    width: 6px;
    height: 6px;
    background: #2ecc71;
    border-radius: 50%;
    animation: lp-pulse 1.6s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes lp-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.75); }
}

/* Summary confirmation card */
.lp-summary-card {
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.09);
    background: #13161e;
    overflow: hidden;
}

.lp-you-chose {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--gold);
    margin: 0;
    padding: 12px 16px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.lp-rows {
    padding: 6px 0;
}

.lp-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 16px;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.lp-row:last-child {
    border-bottom: none;
}

.lp-row-label {
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.lp-row-val {
    color: var(--text);
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

.lp-val-muted {
    color: rgba(138,154,176,0.45);
    font-weight: 400;
    font-style: italic;
}

/* Text preview strip at bottom of summary card */
.lp-text-preview {
    padding: 12px 16px;
    background: rgba(249,115,22,0.05);
    border-top: 1px solid rgba(249,115,22,0.12);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lp-preview-dish {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    transition: font-family 0.2s;
}

.lp-preview-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.lp-preview-price {
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    transition: color 0.2s, font-family 0.2s;
    display: none;
}

.lp-preview-price.lp-visible { display: block; }

.lp-preview-cta {
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
    transition: background-color 0.2s, color 0.2s, font-family 0.2s;
    display: none;
}

.lp-preview-cta.lp-visible { display: block; }

.lp-placeholder-hint {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.45);
    text-align: center;
    font-style: italic;
}

/* ── Generate button ──────────────────────────────── */
.generate-btn {
    width: 100%;
    padding: 20px 28px;
    border-radius: 50px;
    border: none;
    background: linear-gradient(180deg, #ffaa44 0%, #f07010 35%, #cc5000 100%);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    margin-top: 8px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    box-shadow: var(--sh-orange);
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    border-top: 2px solid rgba(255,215,140,0.55);
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 50px rgba(180,55,0,0.90),
                0 5px 14px rgba(255,210,120,0.80) inset,
                0 -4px 8px rgba(0,0,0,0.60) inset;
}

.generate-btn:active {
    transform: translateY(2px);
    box-shadow: 0 4px 14px rgba(180,55,0,0.50),
                0 3px 8px rgba(255,195,100,0.50) inset,
                0 -2px 4px rgba(0,0,0,0.50) inset;
}

.generate-btn:disabled {
    opacity: 0.40;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--sh-card);
}

.progress-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

.progress-overlay.active {
    display: flex;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--gold);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.progress-msg {
    color: var(--gold);
    font-weight: 600;
    font-size: 0.95rem;
}

.results {
    margin-top: 36px;
    display: none;
}

.results.visible {
    display: block;
}

.results h2 {
    color: var(--gold);
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 4px;
}

.results-meta {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.82rem;
    margin-bottom: 24px;
}

.comparison {
    background: var(--surface);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 24px;
    box-shadow: var(--sh-raised);
}

.comparison h3 {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
    text-align: center;
}

.slider-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 10px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.slider-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.slider-container .after-img {
    clip-path: inset(0 0 0 50%);
}

.slider-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    background: var(--gold);
    z-index: 2;
    pointer-events: none;
}

.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: var(--gold);
    border-radius: 50%;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--bg);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    cursor: ew-resize;
}

.slider-label {
    position: absolute;
    bottom: 10px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(0,0,0,0.7);
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 600;
    z-index: 2;
    pointer-events: none;
}

.slider-label.left { left: 10px; }
.slider-label.right { right: 10px; }

.exports-section {
    margin-bottom: 28px;
}

.section-label {
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.section-desc {
    color: var(--text-dim);
    font-size: 0.78rem;
    margin-bottom: 14px;
}

.exports-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

.export-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}

.export-card:hover {
    border-color: var(--border-hover);
}

.export-card img {
    width: 100%;
    display: block;
}

.export-card.ratio-16-9 img { aspect-ratio: 16/9; object-fit: cover; }
.export-card.ratio-1-1 img { aspect-ratio: 1; object-fit: cover; }
.export-card.ratio-4-5 img { aspect-ratio: 4/5; object-fit: cover; }
.export-card.ratio-9-16 img { aspect-ratio: 9/16; object-fit: cover; }

.export-info {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.export-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.dl-btn {
    padding: 7px 16px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(180deg, #ff8533 0%, #d95f00 100%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 3px 10px rgba(195,70,0,0.4), 0 1px 0 rgba(255,155,80,0.3) inset;
}

.dl-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(195,70,0,0.5), 0 1px 0 rgba(255,155,80,0.3) inset;
}

.export-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.post-btn {
    padding: 7px 14px;
    border-radius: 8px;
    border: 1.5px solid rgba(193,53,132,0.6);
    background: linear-gradient(135deg, rgba(64,93,230,0.15) 0%, rgba(193,53,132,0.15) 50%, rgba(253,29,29,0.15) 100%);
    color: #e06aab;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.post-btn:hover {
    background: linear-gradient(135deg, rgba(64,93,230,0.28) 0%, rgba(193,53,132,0.28) 50%, rgba(253,29,29,0.28) 100%);
    border-color: rgba(193,53,132,0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(193,53,132,0.35);
}

/* Post Now desktop modal */
.post-now-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.post-now-modal.visible {
    display: flex;
}

.post-now-box {
    background: #1a1f2e;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 32px 28px 28px;
    max-width: 380px;
    width: 90%;
    position: relative;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6);
    text-align: center;
}

.post-now-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
}

.post-now-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.post-now-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 10px;
}

.post-now-body {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0 0 16px;
}

.post-now-steps {
    text-align: left;
    color: var(--text);
    font-size: 0.82rem;
    line-height: 1.7;
    padding-left: 20px;
    margin: 0 0 22px;
}

.post-now-steps strong {
    color: var(--gold);
}

.post-now-dismiss {
    padding: 10px 28px;
    border-radius: 50px;
    border: none;
    background: linear-gradient(180deg, #ff8533 0%, #d95f00 100%);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: transform 0.15s;
}

.post-now-dismiss:hover {
    transform: translateY(-1px);
}

.actions-row {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.actions-row button,
.actions-row a {
    flex: 1;
    padding: 13px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}

.btn-regen {
    border: 1px solid rgba(249,115,22,0.35);
    background: rgba(249,115,22,0.06);
    color: var(--gold);
    box-shadow: var(--sh-card);
}

.btn-regen:hover {
    background: rgba(249,115,22,0.12);
    transform: translateY(-1px);
    box-shadow: var(--sh-raised);
}

.btn-zip {
    border: none;
    background: linear-gradient(180deg, #ff8533 0%, #d95f00 100%);
    color: #fff;
    box-shadow: var(--sh-orange);
}

.btn-zip:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(195,70,0,0.6),
                0 2px 0 rgba(255,155,80,0.40) inset,
                0 -2px 0 rgba(0,0,0,0.30) inset;
}

footer {
    text-align: center;
    padding: 28px 0 16px;
    color: var(--text-dim);
    font-size: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.brand-preview-section {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.brand-preview-label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.brand-preview-frame {
    display: flex;
    justify-content: center;
}

.brand-preview-poster {
    position: relative;
    width: 240px;
    height: 300px; /* Instagram 4:5 ratio at 240px wide (1080×1350 at 0.222 scale) */
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a1a;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.bp-gradient-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
    z-index: 1;
    pointer-events: none;
}

.bp-gradient-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    z-index: 1;
    pointer-events: none;
}

.bp-food-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.bp-food-img img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    opacity: 0.85;
}

.bp-text-stack {
    position: relative;
    z-index: 2;
    padding: 16px 17px 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bp-headline {
    font-size: 0.875rem;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    transition: font-family 0.3s ease;
}

.bp-dish-name {
    font-size: 2.05rem;
    color: #fff;
    font-weight: 800;
    line-height: 1.1;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    transition: font-family 0.3s ease;
}

.bp-top-area {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 16px 0;
    gap: 6px;
}

.bp-bottom-area {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* bottom_margin = h*0.11 = 1350*0.11 = 148px → scaled to preview: 148*(300/1350) = 33px */
    padding: 0 16px 33px;
    gap: 6px;
}

.bp-price {
    /* Font size set dynamically by JS: 120 * (240/1080) = 27px — matches Python compositor */
    font-size: 1.65rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    transition: font-family 0.3s ease;
}

.bp-cta {
    /* pad_x = 80*0.65*(240/1080) = 12px, pad_y = 30*0.65*(240/1080) = 4px — Instagram scale */
    padding: 4px 12px;
    white-space: nowrap;
    border-radius: 999px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #000;
    letter-spacing: 0.3px;
    transition: background-color 0.3s ease, font-family 0.3s ease;
}

.bp-logo-area {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* default: bottom-right — sits in the sub-CTA strip (~6px from edge) */
    bottom: 6px;
    right: 7px;
    pointer-events: none;
    transition: top 0.2s, bottom 0.2s, left 0.2s, right 0.2s, transform 0.2s;
}

.bp-logo-area img {
    max-height: 22px;
    max-width: 55px;
    object-fit: contain;
    opacity: 0.9;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
    transition: max-height 0.2s, max-width 0.2s;
}

@media (max-width: 600px) {
    .container { padding: 12px 12px 32px; }
    header h1 { font-size: 1.6rem; }
    .upload-section { padding: 20px 16px; }
    .style-grid { grid-template-columns: repeat(2, 1fr); }
    .enh-segment { max-width: 100%; }
    .promo-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .exports-grid { grid-template-columns: 1fr; }
    .actions-row { flex-direction: column; }
    .brand-preview-poster { width: 200px; height: 250px; } /* 4:5 at 200px wide */
    .bp-food-img img { width: 120px; height: 120px; }
    .bp-cta { padding: 3px 10px; }
}

/* ── Usage bar ── */
.usage-bar-row {
    display: flex; align-items: center; gap: 12px;
    background: #131313; border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px; padding: 10px 16px;
    margin-bottom: 16px; flex-wrap: wrap;
}
.usage-bar-info { display: flex; gap: 10px; align-items: center; }
.usage-plan-label {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.07em; color: #f97316;
    background: rgba(249,115,22,0.1); border: 1px solid rgba(249,115,22,0.2);
    padding: 2px 10px; border-radius: 99px;
}
.usage-count { font-size: 0.82rem; color: #8a9ab0; }
.usage-bar-track {
    flex: 1; min-width: 80px; height: 5px;
    background: #1f2937; border-radius: 99px; overflow: hidden;
}
.usage-bar-fill {
    height: 100%; border-radius: 99px; background: #f97316;
    transition: width 0.4s;
}
.usage-upgrade-link {
    font-size: 0.8rem; font-weight: 700; color: #f97316;
    text-decoration: none; white-space: nowrap;
}
.usage-upgrade-link:hover { color: #fb923c; }

/* ── App nav bar ── */
.app-nav {
    background: rgba(10,10,10,0.92); border-bottom: 1px solid rgba(255,255,255,0.07);
    padding: 0 20px; display: flex; align-items: center; justify-content: space-between;
    height: 52px; position: sticky; top: 0; z-index: 50;
}
.app-nav-logo {
    display: flex; align-items: center; gap: 8px; text-decoration: none;
    color: #ececec; font-weight: 700; font-size: 1rem;
}
.app-nav-logo img { height: 28px; }
.app-nav-logo em { color: #f97316; font-style: normal; }
.app-nav-right { display: flex; align-items: center; gap: 16px; }
.app-nav-billing {
    font-size: 0.82rem; color: #8a9ab0; text-decoration: none; font-weight: 600;
}
.app-nav-billing:hover { color: #ececec; }
