/* ==========================================
   Generator Workspace — Premium UI Redesign
   SmartPinMaker
   ========================================== */

/* ==========================================
   Mobile Navigation + Filter Bar
   ========================================== */
.mobile-nav-bar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-subtle);
}

.mobile-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 10px 12px 6px;
}

.mobile-tab-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 9px 12px;
    font-weight: 700;
    font-size: 0.84rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mobile-tab-btn.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 2px 12px rgba(var(--accent-rgb), 0.3);
}

.pin-count-badge {
    display: inline-flex;
    min-width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    border-radius: 99px;
    background: rgba(255,255,255,0.18);
    font-size: 0.72rem;
    font-weight: 800;
}

.mobile-tab-btn.active .pin-count-badge {
    background: rgba(255,255,255,0.2);
}

.mobile-nav-bar .filter-chip .chip-icon {
    display: none;
}

/* ==========================================
   Generator Page — Header Separation
   ========================================== */
body.generator-page .site-header {
    box-shadow: var(--header-shadow-scrolled);
    border-bottom-color: var(--border-color);
}

/* ==========================================
   App Container — Two-Column Layout
   ========================================== */
body.generator-page .app-container {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    min-height: 0;
    flex: 1;
}

/* ==========================================
   Sidebar — Premium Control Panel
   ========================================== */
.sidebar {
    overflow-y: auto;
    background: var(--bg-card);
    border-right: 1px solid var(--border-subtle);
    padding: 16px 18px 12px;
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 99px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==========================================
   Quick Start Tip Banner
   ========================================== */
.quick-start-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.08), rgba(var(--accent-rgb), 0.03));
    border: 1px solid rgba(var(--accent-rgb), 0.15);
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.quick-start-tip i {
    font-size: 0.85rem;
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 2px;
    animation: tipPulse 2s ease-in-out infinite;
}

@keyframes tipPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.quick-start-tip strong {
    color: var(--text-primary);
}

/* ==========================================
   Step-Numbered Section Groups
   ========================================== */
.sidebar-section-group {
    margin-bottom: 6px;
    position: relative;
}

.sidebar-section-group + .sidebar-section-group {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
}

.section-group-header {
    padding: 10px 0 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Step number badge — premium gradient */
.section-step-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #ff4d6d);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.35);
    letter-spacing: -0.5px;
    position: relative;
}

.section-step-badge::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: rgba(var(--accent-rgb), 0.15);
    z-index: -1;
    animation: stepGlow 3s ease-in-out infinite;
}

@keyframes stepGlow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.section-group-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-primary);
    margin-bottom: 0;
    flex: 1;
}

.section-group-label i {
    font-size: 0.85rem;
    color: var(--accent);
    width: 16px;
    text-align: center;
}

.section-group-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0 0 10px;
    padding-left: 40px;
}

/* Sidebar Sections — Glassmorphic Cards */
.sidebar-section {
    position: relative;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s, transform 0.2s;
}

.sidebar-section::before {
    content: '';
    position: absolute;
    top: 8px;
    left: -1px;
    width: 3px;
    height: calc(100% - 16px);
    border-radius: 0 3px 3px 0;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-section:hover {
    border-color: rgba(var(--accent-rgb), 0.25);
    box-shadow:
        0 4px 20px rgba(var(--accent-rgb), 0.08),
        0 1px 3px rgba(0,0,0,0.04);
    background: color-mix(in srgb, var(--bg-input) 98%, var(--accent));
}

.sidebar-section:hover::before {
    opacity: 0.8;
}

/* Image upload section — subtle accent gradient */
.image-upload-section {
    border-color: rgba(var(--accent-rgb), 0.15);
    background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.05), var(--bg-input) 60%);
}

.image-upload-section::before {
    background: var(--accent);
    opacity: 0.5;
}

.image-upload-section:hover {
    background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.08), var(--bg-input) 50%);
}

/* Section Divider (legacy) */
.sidebar-divider {
    height: 1px;
    margin: 8px 0;
    background: var(--border-subtle);
    position: relative;
    opacity: 0.4;
}

/* Subsections */
.sidebar-subsection {
    margin-bottom: 10px;
}

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

.sidebar-subsection .sidebar-section {
    margin-bottom: 6px;
    background: var(--bg-card);
    border-color: var(--border-subtle);
    padding: 12px;
}

.sidebar-subsection .sidebar-section::before {
    display: none;
}

.subsection-label {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 2px 8px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    cursor: default;
}

.subsection-label i {
    font-size: 0.75rem;
    color: var(--accent);
    opacity: 0.7;
    width: 16px;
    text-align: center;
}

/* Accordion Subsection */
.accordion-toggle {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.accordion-toggle:hover {
    color: var(--text-primary);
}

.accordion-chevron {
    margin-left: auto;
    font-size: 0.65rem !important;
    width: auto !important;
    transition: transform 0.3s ease;
    color: var(--text-muted) !important;
}

.accordion-chevron.collapsed {
    transform: rotate(-90deg);
}

.accordion-content {
    overflow: hidden;
    transition: opacity 0.25s ease, max-height 0.35s ease, margin-bottom 0.3s ease;
    max-height: 500px;
    opacity: 1;
    margin-bottom: 0;
}

.accordion-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    padding: 0 14px;
    border: none;
    pointer-events: none;
}

.accordion-content.collapsed > * {
    opacity: 0;
}

.accordion-content:not(.collapsed) {
    padding: 14px;
}

/* ==========================================
   Brand Kit Section
   ========================================== */
.brand-kit-section {
    border-color: rgba(var(--accent-rgb), 0.2);
    background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.08), var(--bg-input));
}

.brand-kit-section::before {
    background: var(--accent);
    opacity: 1;
}

.brand-kit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sidebar-section-title {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    line-height: 1.35;
}

.chip-pro,
.chip-free {
    display: inline-block;
    vertical-align: middle;
    font-size: 0.55rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.chip-pro {
    background: linear-gradient(135deg, var(--accent), #ff6b6b);
    color: white;
}

.chip-free {
    background: var(--success);
    color: white;
}

/* Brand Kit Toggle */
.brand-kit-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.brand-kit-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    position: relative;
    transition: all 0.2s ease;
}

.toggle-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-muted);
    position: absolute;
    left: 2px;
    top: 2px;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-kit-toggle input:checked + .toggle-track {
    background: rgba(var(--accent-rgb), 0.2);
    border-color: var(--accent);
}

.brand-kit-toggle input:checked + .toggle-track .toggle-thumb {
    transform: translateX(16px);
    background: var(--accent);
}

.toggle-label {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--text-muted);
    min-width: 24px;
}

/* Brand Kit Body */
.brand-kit-body {
    padding-top: 2px;
}

.brand-kit-fields {
    padding-top: 4px;
}

/* ==========================================
   Form Controls
   ========================================== */
.form-group {
    margin-bottom: 10px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group > label,
.headline-item label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

input[type="text"],
textarea,
select {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-main);
    color: var(--text-primary);
    padding: 9px 12px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    font-family: inherit;
}

textarea {
    min-height: 72px;
    resize: vertical;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
    background: var(--bg-main);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

/* ==========================================
   Premium Dropzone — Pulse Animation
   ========================================== */
.dropzone {
    min-height: 140px;
    border: 2px dashed var(--border-color);
    border-radius: 14px;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    padding: 24px 20px;
    position: relative;
    overflow: hidden;
}

.dropzone > * {
    position: relative;
    z-index: 1;
}

.dropzone:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: rgba(var(--accent-rgb), 0.05);
    border-style: solid;
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.15), 0 0 30px rgba(var(--accent-rgb), 0.06);
    transform: translateY(-1px);
}

.dropzone:active {
    transform: translateY(0) scale(0.99);
}

/* Tooltip on hover */
.dropzone::after {
    content: "💡" attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 16px);
    right: 0;
    transform: translateY(6px);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 0.78rem;
    line-height: 1.65;
    width: 290px;
    text-align: left;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 0 1px var(--border-color), 0 0 30px rgba(230,0,35,0.08);
    z-index: 100;
    pointer-events: none;
    white-space: normal;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 3px solid var(--accent);
    font-weight: 450;
}
.dropzone:hover::after {
    opacity: 1;
    transform: translateY(0);
}

/* Tooltip arrow via a CSS-only approach using the dropzone's inline arrow */
.dropzone .dropzone-tooltip-arrow {
    content: '';
    position: absolute;
    bottom: calc(100% + 10px);
    right: 24px;
    transform: translateY(3px);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--border-color);
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    filter: drop-shadow(0 2px 4px rgba(230,0,35,0.15));
}
.dropzone:hover .dropzone-tooltip-arrow {
    opacity: 1;
    transform: translateY(0);
}

.dropzone-icon {
    font-size: 1.8rem;
    color: var(--accent);
    opacity: 0.9;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dropzone:hover .dropzone-icon {
    transform: scale(1.1) translateY(-2px);
}

.dropzone-text {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.dropzone-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================
   Image List / Thumbs
   ========================================== */
.image-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-top: 8px;
}

.image-thumb-wrapper {
    aspect-ratio: 1;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.image-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.65);
    color: white;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
}

.image-thumb-wrapper:hover .thumb-delete {
    opacity: 1;
}

.thumb-delete:hover {
    background: var(--error);
}

/* ==========================================
   Headline Items
   ========================================== */
.headline-item {
    display: grid;
    grid-template-columns: 1fr 36px;
    gap: 6px;
    margin-bottom: 6px;
}

.btn-remove-text {
    border: none;
    border-radius: 8px;
    font-weight: 800;
    transition: all 0.2s;
    background: rgba(239, 68, 68, 0.08);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.15);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-remove-text:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: var(--error);
}

/* Headline Format Bar */
.headline-format-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.format-group {
    display: flex;
    gap: 3px;
    background: var(--bg-input);
    border-radius: 8px;
    padding: 3px;
}
.format-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    font-family: inherit;
}
.format-btn:hover {
    background: rgba(128,128,128,0.1);
    color: var(--text-primary);
}
.format-btn.active {
    background: var(--accent);
    color: #fff;
}
.format-group:first-child .format-btn:nth-child(1) {
    font-size: 0.68rem;
    text-transform: none;
    letter-spacing: 0.3px;
}
.format-group:first-child .format-btn:nth-child(2) {
    text-transform: uppercase;
    font-size: 0.6rem;
    letter-spacing: 0.5px;
}
.format-group:first-child .format-btn:nth-child(3) {
    text-transform: lowercase;
    font-size: 0.68rem;
    letter-spacing: 0.5px;
}
.format-group:first-child .format-btn:nth-child(4) {
    text-transform: capitalize;
    font-size: 0.72rem;
    font-weight: 800;
}

.btn-add-text {
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-add-text:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.04);
}

/* ==========================================
   Buttons — Premium Hierarchy
   ========================================== */
.btn,
.btn-sm {
    border: none;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.82rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn {
    width: 100%;
    padding: 11px 16px;
}

.btn-primary,
.btn-sm-primary {
    background: var(--gradient-accent);
    color: white;
    box-shadow: 0 2px 12px rgba(var(--accent-rgb), 0.3);
}

.btn-primary:hover,
.btn-sm-primary:hover {
    background: linear-gradient(135deg, #ff1a3d 0%, #ff6b8a 50%, #ffb3c6 100%);
    box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.4);
    transform: translateY(-1px);
}

.btn-primary:active,
.btn-sm-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 6px rgba(var(--accent-rgb), 0.25);
}

.btn-secondary,
.btn-sm-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover,
.btn-sm-secondary:hover {
    border-color: var(--text-muted);
    background: var(--bg-elevated);
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.8rem;
}

.btn-sm-danger {
    padding: 6px 10px;
    font-size: 0.7rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.06);
    color: var(--error);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    font-weight: 700;
}

.btn-sm-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--error);
}

/* ==========================================
   Enhanced Color Controls
   ========================================== */
.color-control-group {
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(var(--accent-rgb), 0.1);
    background: rgba(var(--accent-rgb), 0.02);
}

.control-group-heading {
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.control-kicker {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.control-group-heading h4 {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
}

.control-group-heading p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

.color-swatch-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.color-swatch-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.color-picker-wrap {
    position: relative;
    width: 100%;
}

.color-picker-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.color-swatch-btn {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    height: 56px;
    padding: 6px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    position: relative;
    overflow: hidden;
}

.color-swatch-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: var(--btn-bg, #000);
    transition: background 0.2s ease;
}

.color-swatch-btn:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
    transform: scale(1.02);
}

.color-swatch-btn:active {
    transform: scale(0.97);
}

.color-swatch-btn .swatch-hex {
    display: none;
    position: relative;
    z-index: 1;
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1.3;
    transition: background 0.2s ease, color 0.2s ease;
}

.swatch-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    margin-top: 2px;
}

.color-presets {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}

.preset-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
}

.preset-dot:hover {
    transform: scale(1.3);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.preset-dot:active {
    transform: scale(0.9);
}

.preset-dot.is-active {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 1.5px var(--text-primary);
}

input[type="color"] {
    width: 40px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: transparent;
    overflow: hidden;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 7px;
}

/* ==========================================
   Logo Upload
   ========================================== */
.logo-upload-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.logo-preview-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    overflow: hidden;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.logo-preview-circle.has-logo {
    border-style: solid;
    border-color: var(--accent);
}

/* Custom Font Upload */
.custom-font-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
}

.font-status-text {
    font-size: 0.72rem;
    color: var(--text-secondary);
    word-break: break-all;
}

/* ==========================================
    Sidebar Footer (Sticky Floating Action Bar)
    ========================================== */
.sidebar-footer {
    position: sticky;
    bottom: 0;
    padding: 16px 0 12px;
    margin-top: auto;
    background: linear-gradient(to top, var(--bg-card) 55%, transparent);
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--border-color);
    z-index: 5;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.sidebar-footer::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to top, var(--bg-card), transparent);
    pointer-events: none;
}

.sidebar-footer .btn {
    margin-top: 0;
}

.sidebar-footer .btn-primary {
    padding: 13px 16px;
    font-size: 0.88rem;
    letter-spacing: 0.02em;
    border-radius: 12px;
}

.sidebar-footer .btn-secondary {
    padding: 9px 16px;
    font-size: 0.78rem;
    border-radius: 10px;
}

/* ==========================================
   Workspace — Main Area
   ========================================== */
.workspace {
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
}

/* Workspace canvas overflow fix */
.app-container.show-workspace .workspace {
    overflow: auto;
}

/* Workspace Toolbar */
.workspace-toolbar {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-card);
    flex-shrink: 0;
    overflow: hidden;
    transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.toolbar-left {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}

.filter-chips-desktop {
    flex: 1;
    min-width: 0;
    display: flex;
    overflow: hidden;
}

.filter-chips-desktop .filter-chips {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.toolbar-btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-pin-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    white-space: nowrap;
}

.toolbar-btn-primary {
    background: var(--gradient-accent);
    color: white;
    box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.25);
}

.toolbar-btn-primary:hover {
    box-shadow: 0 4px 18px rgba(var(--accent-rgb), 0.35);
    transform: translateY(-1px);
}

.toolbar-btn-primary:active {
    transform: translateY(0);
}

/* ==========================================
   Premium Filter Chips — Pill Style
   ========================================== */
.filter-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 2px;
    flex-wrap: nowrap;
    align-items: center;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 100px;
    padding: 7px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
    font-family: inherit;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.filter-chip:hover {
    border-color: rgba(var(--accent-rgb), 0.35);
    color: var(--text-primary);
    background: color-mix(in srgb, var(--bg-card) 95%, var(--accent));
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}

.filter-chip:active {
    transform: translateY(0) scale(0.97);
}

.filter-chip .filter-check {
    display: none;
    font-size: 0.6rem;
}

.filter-chip.active {
    background: var(--gradient-accent, linear-gradient(135deg, var(--accent), #ff4d6d));
    border-color: transparent;
    color: white;
    box-shadow: 0 3px 12px rgba(var(--accent-rgb), 0.3);
}

.filter-chip.active:hover {
    box-shadow: 0 5px 18px rgba(var(--accent-rgb), 0.4);
    transform: translateY(-1px);
    background: var(--gradient-accent, linear-gradient(135deg, var(--accent), #ff4d6d));
}

.filter-chip.active .filter-check {
    display: inline-flex;
}

/* Chip count badge */
.chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 16px;
    padding: 0 5px;
    border-radius: 99px;
    background: rgba(255,255,255,0.15);
    font-size: 0.65rem;
    font-weight: 800;
    margin-left: 2px;
}

.filter-chip:not(.active) .chip-count {
    background: rgba(0,0,0,0.08);
    color: var(--text-muted);
}

/* ==========================================
   Canvas & Pin Grid
   ========================================== */
.canvas-container {
    flex: 1;
    overflow: auto;
    padding: 24px;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    background-color: var(--bg-main);
}

.canvas-container::-webkit-scrollbar {
    width: 6px;
}

.canvas-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

[data-theme="light"] .canvas-container {
    background-image:
        radial-gradient(circle, rgba(0,0,0,0.04) 1px, transparent 1px);
}

.pins-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Canvas SEO — content below generated pins */
.canvas-seo {
    margin: 48px auto 0;
    padding: 40px 0 20px;
    border-top: 1px solid var(--border-subtle);
    max-width: 820px;
    text-align: center;
}

/* --- Header --- */
.canvas-seo-header {
    margin-bottom: 32px;
}

.canvas-seo-badge {
    display: inline-flex;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: var(--accent-bg);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.canvas-seo-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 auto 12px;
    letter-spacing: -0.025em;
    line-height: 1.35;
    max-width: 640px;
}

.canvas-seo-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.75;
    margin: 0 auto;
    max-width: 580px;
}

.canvas-seo-desc strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* --- Stats row --- */
.canvas-seo-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 40px;
}

.cstat {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 22px 12px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 0.25s, transform 0.25s;
}

.cstat:hover {
    border-color: var(--accent-dim);
    transform: translateY(-2px);
}

.cstat-num {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.1;
}

.cstat-label {
    font-size: 0.73rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- How it works --- */
.canvas-seo-how {
    margin-bottom: 40px;
    text-align: left;
}

.canvas-seo-subtitle {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 20px;
    letter-spacing: -0.02em;
    text-align: center;
}

.canvas-seo-steps {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.cstep {
    display: flex;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 20px;
    transition: border-color 0.25s, transform 0.25s;
}

.cstep:hover {
    border-color: var(--accent-dim);
    transform: translateY(-2px);
}

.cstep-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #ff4d6a);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
    box-shadow: 0 2px 8px rgba(230, 0, 35, 0.25);
}

.cstep-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cstep-body strong {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.cstep-body span {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* --- Feature cards --- */
.canvas-seo-features {
    margin-bottom: 40px;
}

.canvas-seo-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.cscard {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 28px 24px 24px;
    transition: border-color 0.25s, transform 0.25s;
}

.cscard:hover {
    border-color: var(--accent-dim);
    transform: translateY(-2px);
}

.cscard i {
    font-size: 1.3rem;
    color: var(--accent);
    margin-bottom: 14px;
    display: block;
}

.cscard h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

.cscard p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

/* --- FAQ --- */
.canvas-seo-faq {
    margin-bottom: 12px;
    text-align: left;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.cfaq {
    border-bottom: 1px solid var(--border-subtle);
    padding: 16px 0;
}

.cfaq:first-of-type {
    border-top: 1px solid var(--border-subtle);
}

.cfaq-q {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    user-select: none;
}

.cfaq-q::-webkit-details-marker {
    display: none;
}

.cfaq-q::after {
    content: '+';
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-muted);
    transition: transform 0.25s;
    flex-shrink: 0;
}

details[open] .cfaq-q::after {
    content: '−';
    transform: rotate(180deg);
}

.cfaq-a {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 10px 0 0;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .canvas-seo {
        margin-top: 32px;
        padding: 24px 0 12px;
    }
    .canvas-seo-title {
        font-size: 1.1rem;
    }
    .canvas-seo-desc {
        font-size: 0.84rem;
    }
    .canvas-seo-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .canvas-seo-steps {
        grid-template-columns: 1fr;
    }
    .canvas-seo-cards {
        grid-template-columns: 1fr;
    }
    .cstat-num {
        font-size: 1.2rem;
    }
    .cscard {
        padding: 22px 18px 20px;
    }
}


/* ==========================================
   Headline Sections
   ========================================== */
.headline-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.headline-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    border-left: 3px solid var(--accent);
    position: relative;
}

.headline-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.headline-section-label i {
    font-size: 0.75rem;
    color: var(--accent);
}

.headline-section-count {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    background: var(--accent-bg);
    padding: 2px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.headline-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    word-break: break-word;
    flex: 1;
    min-width: 0;
}

.headline-section-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 5px 12px;
    background: var(--bg-main);
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.headline-section-meta i {
    font-size: 0.7rem;
    color: var(--accent);
}

.headline-pin-subgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

/* ==========================================
   Empty Workspace — Premium Illustration
   ========================================== */
.empty-workspace {
    min-height: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-secondary);
    border: 1.5px dashed var(--border-color);
    border-radius: 20px;
    background: radial-gradient(circle at 50% 40%, rgba(var(--accent-rgb), 0.03), transparent 60%);
    padding: 44px 24px;
    transition: border-color 0.3s, background 0.3s;
}

.empty-workspace:hover {
    border-color: rgba(var(--accent-rgb), 0.15);
    background: radial-gradient(circle at 50% 40%, rgba(var(--accent-rgb), 0.05), transparent 60%);
}

.empty-workspace-icon {
    color: var(--accent);
    font-size: 2.6rem;
    margin-bottom: 16px;
    opacity: 0.5;
    animation: emptyIconFloat 3s ease-in-out infinite;
}

@keyframes emptyIconFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(-4deg); }
}

.empty-workspace h2,
.empty-workspace h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-workspace p {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 300px;
    line-height: 1.55;
}

.empty-workspace .btn-generate-ready {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: auto;
    padding: 14px 36px;
    font-size: 0.95rem;
    font-weight: 800;
    font-family: inherit;
    letter-spacing: 0.3px;
    border-radius: 99px;
    margin-top: 24px;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, #e60023 0%, #ff4d6d 50%, #ff8fa3 100%);
    box-shadow: 0 4px 20px rgba(230, 0, 35, 0.35), 0 1px 3px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.15);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.2s ease,
                background 0.3s ease;
}

/* Shimmer sweep effect */
.empty-workspace .btn-generate-ready::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
    transform: skewX(-20deg);
    animation: btn-shimmer 2.4s ease-in-out infinite;
}

@keyframes btn-shimmer {
    0%   { left: -100%; }
    50%  { left: 160%; }
    100% { left: 160%; }
}

.empty-workspace .btn-generate-ready:hover {
    background: linear-gradient(135deg, #c8001f 0%, #ff1a3d 50%, #ff6b8a 100%);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 28px rgba(230, 0, 35, 0.45), 0 2px 6px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.18);
}

.empty-workspace .btn-generate-ready:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 3px 12px rgba(230, 0, 35, 0.3);
}

.empty-workspace .btn-generate-ready i {
    font-size: 0.9rem;
    animation: sparkle-pulse 2s ease-in-out infinite;
}

@keyframes sparkle-pulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    30%       { transform: scale(1.2) rotate(-8deg); }
    60%       { transform: scale(0.95) rotate(4deg); }
}

/* ==========================================
   Pin Cards — Premium Hover States
   ========================================== */
.pin-card-wrapper {
    display: flex;
    min-width: 0;
    position: relative;
    cursor: pointer;
    border-radius: 12px;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.pin-card-wrapper:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* Category label on card */
.pin-card-wrapper::after {
    content: attr(data-template);
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 5;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: rgba(255,255,255,0.9);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: capitalize;
    letter-spacing: 0.03em;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s;
}

.pin-card-wrapper:hover::after {
    opacity: 1;
}

.pin-scale-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
}

.pin-scale-content {
    width: 600px;
    height: var(--pin-height, 900px);
    transform-origin: top left;
}

/* Pin actions overlay — premium glassmorphic */
.pin-actions-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 6px;
    padding: 10px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent 45%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

.pin-card-wrapper:hover .pin-actions-overlay {
    opacity: 1;
}

@media (hover: none) {
    .pin-actions-overlay {
        opacity: 1;
        background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 50%, transparent 70%, rgba(0,0,0,0.2) 100%);
    }

    .pin-card-wrapper::after {
        display: none;
    }
}

.action-circle-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    color: #222;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    border: 1px solid rgba(255,255,255,0.3);
}

.action-circle-btn:hover {
    background: #fff;
    transform: scale(1.08);
}

.action-circle-btn:active {
    transform: scale(0.95);
}

/* ==========================================
   Pin Template Base
   ========================================== */
.pin-container {
    width: 600px;
    height: var(--pin-height, 900px);
    position: relative;
    overflow: hidden;
    background: var(--pin-secondary, #fff);
    color: var(--pin-text, #000);
    font-family: var(--pin-font-body, 'Inter', sans-serif);
}

.pin-bg-image {
    background-repeat: no-repeat;
}

.pin-overlay-text-wrapper {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: calc(44px * var(--pin-pad-mult, 1));
}

.pt-title {
    color: var(--pin-text, #000);
    font-family: var(--pin-font-title, 'Poppins', sans-serif);
    font-size: var(--pin-title-size, 52px);
    line-height: 0.98;
    letter-spacing: -0.035em;
    margin: 0;
    text-align: var(--pin-text-align, left);
    text-transform: var(--pin-text-transform, none);
}

.pt-desc {
    color: var(--pin-text, #000);
    font-size: var(--pin-desc-size, 20px);
    line-height: 1.38;
    margin: 16px 0 0;
    text-align: var(--pin-text-align, left);
}

.pt-brand-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    color: var(--pin-text, #000);
    font-size: 17px;
    font-weight: 800;
}

.frame-text-container,
.clean-text,
.side-content,
.strip-text-area,
.corner-text-card,
.moder-editorial-text,
.glass-card,
.bold-dark-block,
.split-text,
.brutalist-text,
.top-accent-header,
.bottom-banner-box,
.arch-text,
.polaroid-caption,
.blog-card,
.sleek-content {
    text-align: var(--pin-text-align, left);
}

.pt-logo {
    width: calc(30px * var(--pin-logo-scale, 1) / 100);
    height: calc(30px * var(--pin-logo-scale, 1) / 100);
    object-fit: cover;
    border-radius: 50%;
}

.pt-badge,
.pt-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ==========================================
   Modal
   ========================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(10px);
}

.modal.active {
    display: flex;
}

.modal-content {
    width: min(1200px, 92vw);
    height: min(85vh, 780px);
    display: grid;
    grid-template-columns: 1fr 380px;
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
    transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-left {
    padding: 28px;
    display: grid;
    place-items: center;
    background: var(--bg-main);
    overflow: auto;
    position: relative;
}

.modal-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(128,128,128,0.06) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

.edit-pin-preview-container {
    width: min(380px, 95%);
    position: relative;
    overflow: hidden;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    z-index: 1;
}

.modal-right {
    display: flex;
    min-height: 0;
    height: 100%;
    flex-direction: column;
    border-left: 1px solid var(--border-subtle);
    overflow: hidden;
}

.modal-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.modal-header-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

.modal-template-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    background: rgba(var(--accent-rgb), 0.08);
    border: 1px solid rgba(var(--accent-rgb), 0.15);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: capitalize;
    width: fit-content;
}

.modal-template-badge i {
    font-size: 0.6rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* Full Preview Overlay (all devices) */
.btn-full-preview {
    display: none;
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: background 0.2s, transform 0.2s;
}
.btn-full-preview:hover {
    background: rgba(0,0,0,0.75);
    transform: scale(1.1);
}

.full-preview-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
}
.full-preview-overlay.active {
    opacity: 1;
    background: rgba(0,0,0,0.92);
    pointer-events: auto;
}
.full-preview-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    z-index: 2;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}
.full-preview-overlay.active .full-preview-header {
    opacity: 1;
    transform: translateY(0);
}
.full-preview-title {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.full-preview-actions {
    display: flex;
    gap: 8px;
}
.full-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.full-preview-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}
.full-preview-btn:active {
    transform: scale(0.95);
}
.full-preview-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}
.full-preview-close:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}
.full-preview-body {
    width: 100%;
    max-width: min(90vw, 500px);
    max-height: 85vh;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.3s ease 0.05s, transform 0.3s ease 0.05s;
}
.full-preview-overlay.active .full-preview-body {
    opacity: 1;
    transform: scale(1);
}
.full-preview-body .pin-scale-content {
    width: 600px;
    height: var(--pin-height, 900px);
}

/* Show full preview button only on touch devices */
@media (hover: none) and (pointer: coarse) {
    .btn-full-preview {
        display: flex;
    }
}

@media (max-width: 480px) {
    .full-preview-actions {
        gap: 4px;
    }
    .full-preview-btn {
        padding: 5px 10px;
        font-size: 0.7rem;
    }
    .full-preview-btn span {
        display: none;
    }
}

.modal-body {
    padding: 12px 16px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

.modal-body::-webkit-scrollbar {
    width: 4px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.modal-body .form-group {
    margin-bottom: 10px;
}

.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.modal-footer .btn {
    margin-top: 0;
    width: auto;
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
}

.modal-footer .btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
}

.modal-footer .btn-primary:hover {
    filter: brightness(1.1);
}

.modal-footer .btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.modal-footer .btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ==========================================
   Modal Range Inputs
   ========================================== */
.modal-body input[type="range"] {
    width: 100%;
    height: 6px;
    cursor: pointer;
    border-radius: 4px;
    background: var(--bg-main);
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    transition: background 0.2s;
}

.modal-body input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 4px;
}

.modal-body input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-card);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    margin-top: -7px;
}

.modal-body input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0.15), 0 2px 6px rgba(0,0,0,0.25);
}

.modal-body input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.2);
    box-shadow: 0 0 0 10px rgba(var(--accent-rgb), 0.2), 0 2px 6px rgba(0,0,0,0.25);
}

.modal-body input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 4px;
    background: var(--bg-main);
    border: none;
}

.modal-body input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-card);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.modal-body input[type="range"]::-moz-range-progress {
    height: 6px;
    border-radius: 4px;
    background: var(--accent);
}

.modal-body input[type="range"]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ==========================================
   Edit Sections
   ========================================== */
.edit-section {
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    margin-bottom: 6px;
    background: var(--bg-card);
    overflow: hidden;
    transition: border-color 0.2s;
}

.edit-section:hover {
    border-color: rgba(var(--accent-rgb), 0.2);
}

.edit-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 8px;
    cursor: default;
    user-select: none;
}

.edit-section-title-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.edit-section-title-left i {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 6px;
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent);
    font-size: 0.65rem;
    flex-shrink: 0;
}

.edit-section-title-left span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Section Reset Button (icon-only) */
.edit-section-reset {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.edit-section-reset:hover {
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent);
}

/* Section Body */
.edit-section-body {
    padding: 10px 12px 12px;
}

.edit-section-body .form-group:last-child {
    margin-bottom: 0;
}

/* Input Rows (side-by-side) */
.modal-body .input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Form Group Labels */
.modal-body .form-group > label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.modal-body .form-group > label span {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.7rem;
    background: rgba(var(--accent-rgb), 0.06);
    padding: 1px 7px;
    border-radius: 4px;
}

/* Reset All Button */
.edit-reset-all-btn {
    width: 100%;
    margin-top: 4px;
    padding: 9px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
}

.edit-reset-all-btn:hover {
    border-color: var(--error);
    color: var(--error);
    background: rgba(239, 68, 68, 0.04);
}

/* ==========================================
   Confirmation Dialog
   ========================================== */
.confirm-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.confirm-dialog-overlay.active {
    opacity: 1;
    visibility: visible;
}

.confirm-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px 32px;
    max-width: 380px;
    width: 90%;
    text-align: center;
}

.confirm-dialog-icon {
    font-size: 2rem;
    color: var(--warning, #f59e0b);
    margin-bottom: 10px;
}

.confirm-dialog-message {
    font-size: 0.92rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 22px;
}

.confirm-dialog-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.confirm-dialog-actions .btn {
    min-width: 90px;
    margin: 0;
}

/* ==========================================
   Toast Notifications
   ========================================== */
.toast-container {
    position: fixed;
    right: 16px;
    top: 16px;
    z-index: 3000;
    display: grid;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    animation: toastIn 0.2s ease both;
}

.toast.success i { color: var(--success); }
.toast.warning i { color: var(--warning); }
.toast.error i { color: var(--error); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   Export Hidden Container
   ========================================== */
#export-hidden-container {
    position: fixed;
    left: -99999px;
    top: 0;
    pointer-events: none;
}

/* Auto-generated template CSS */
.temp-minimalist-zen .pin-container { }
.temp-minimalist-zen .pin-img { background-image: var(--pin-img); }

.temp-minimalist-nordic .pin-container { }
.temp-minimalist-nordic .pin-img { background-image: var(--pin-img); }

.temp-minimalist-slate .pin-container { }
.temp-minimalist-slate .pin-img { background-image: var(--pin-img); }

.temp-minimalist-sleek .pin-container { }
.temp-minimalist-sleek .pin-img { background-image: var(--pin-img); }

.temp-minimalist-draft .pin-container { }
.temp-minimalist-draft .pin-img { background-image: var(--pin-img); }

.temp-minimalist-ember .pin-container { }
.temp-minimalist-ember .pin-img { background-image: var(--pin-img); }

.temp-minimalist-miso .pin-container { }
.temp-minimalist-miso .pin-img { background-image: var(--pin-img); }

.temp-minimalist-aether .pin-container { }
.temp-minimalist-aether .pin-img { background-image: var(--pin-img); }

.temp-minimalist-solace .pin-container { }
.temp-minimalist-solace .pin-img { background-image: var(--pin-img); }

.temp-minimalist-linear .pin-container { }
.temp-minimalist-linear .pin-img { background-image: var(--pin-img); }

.temp-modern-prism .pin-container { }
.temp-modern-prism .pin-img { background-image: var(--pin-img); }

.temp-modern-gleam .pin-container { }
.temp-modern-gleam .pin-img { background-image: var(--pin-img); }

.temp-modern-flux .pin-container { }
.temp-modern-flux .pin-img { background-image: var(--pin-img); }

.temp-modern-glide .pin-container { }
.temp-modern-glide .pin-img { background-image: var(--pin-img); }

.temp-modern-shift .pin-container { }
.temp-modern-shift .pin-img { background-image: var(--pin-img); }

.temp-modern-apex .pin-container { }
.temp-modern-apex .pin-img { background-image: var(--pin-img); }

.temp-modern-core .pin-container { }
.temp-modern-core .pin-img { background-image: var(--pin-img); }

.temp-modern-pulse .pin-container { }
.temp-modern-pulse .pin-img { background-image: var(--pin-img); }

.temp-modern-veer .pin-container { }
.temp-modern-veer .pin-img { background-image: var(--pin-img); }

.temp-modern-rise .pin-container { }
.temp-modern-rise .pin-img { background-image: var(--pin-img); }

.temp-bold-thunder .pin-container { }
.temp-bold-thunder .pin-img { background-image: var(--pin-img); }

.temp-bold-blaze .pin-container { }
.temp-bold-blaze .pin-img { background-image: var(--pin-img); }

.temp-bold-impact .pin-container { }
.temp-bold-impact .pin-img { background-image: var(--pin-img); }

.temp-bold-volt .pin-container { }
.temp-bold-volt .pin-img { background-image: var(--pin-img); }

.temp-bold-crush .pin-container { }
.temp-bold-crush .pin-img { background-image: var(--pin-img); }

.temp-bold-surge .pin-container { }
.temp-bold-surge .pin-img { background-image: var(--pin-img); }

.temp-bold-clash .pin-container { }
.temp-bold-clash .pin-img { background-image: var(--pin-img); }

.temp-bold-mighty .pin-container { }
.temp-bold-mighty .pin-img { background-image: var(--pin-img); }

.temp-bold-heavy .pin-container { }
.temp-bold-heavy .pin-img { background-image: var(--pin-img); }

.temp-bold-boom .pin-container { }
.temp-bold-boom .pin-img { background-image: var(--pin-img); }

.temp-luxury-crown .pin-container { }
.temp-luxury-crown .pin-img { background-image: var(--pin-img); }

.temp-luxury-regal .pin-container { }
.temp-luxury-regal .pin-img { background-image: var(--pin-img); }

.temp-luxury-opulent .pin-container { }
.temp-luxury-opulent .pin-img { background-image: var(--pin-img); }

.temp-luxury-noble .pin-container { }
.temp-luxury-noble .pin-img { background-image: var(--pin-img); }

.temp-luxury-majestic .pin-container { }
.temp-luxury-majestic .pin-img { background-image: var(--pin-img); }

.temp-luxury-grand .pin-container { }
.temp-luxury-grand .pin-img { background-image: var(--pin-img); }

.temp-luxury-elite .pin-container { }
.temp-luxury-elite .pin-img { background-image: var(--pin-img); }

.temp-luxury-prestige .pin-container { }
.temp-luxury-prestige .pin-img { background-image: var(--pin-img); }

.temp-luxury-platinum .pin-container { }
.temp-luxury-platinum .pin-img { background-image: var(--pin-img); }

.temp-luxury-luxe .pin-container { }
.temp-luxury-luxe .pin-img { background-image: var(--pin-img); }

.temp-business-forge .pin-container { }
.temp-business-forge .pin-img { background-image: var(--pin-img); }

.temp-business-titan .pin-container { }
.temp-business-titan .pin-img { background-image: var(--pin-img); }

.temp-business-vertex .pin-container { }
.temp-business-vertex .pin-img { background-image: var(--pin-img); }

.temp-business-summit .pin-container { }
.temp-business-summit .pin-img { background-image: var(--pin-img); }

.temp-business-pivot .pin-container { }
.temp-business-pivot .pin-img { background-image: var(--pin-img); }

.temp-business-harbor .pin-container { }
.temp-business-harbor .pin-img { background-image: var(--pin-img); }

.temp-business-anchor .pin-container { }
.temp-business-anchor .pin-img { background-image: var(--pin-img); }

.temp-business-bridge .pin-container { }
.temp-business-bridge .pin-img { background-image: var(--pin-img); }

.temp-business-clarity .pin-container { }
.temp-business-clarity .pin-img { background-image: var(--pin-img); }

.temp-business-apex .pin-container { }
.temp-business-apex .pin-img { background-image: var(--pin-img); }

.temp-lifestyle-vivid .pin-container { }
.temp-lifestyle-vivid .pin-img { background-image: var(--pin-img); }

.temp-lifestyle-bloom .pin-container { }
.temp-lifestyle-bloom .pin-img { background-image: var(--pin-img); }

.temp-lifestyle-radiance .pin-container { }
.temp-lifestyle-radiance .pin-img { background-image: var(--pin-img); }

.temp-lifestyle-glow .pin-container { }
.temp-lifestyle-glow .pin-img { background-image: var(--pin-img); }

.temp-lifestyle-breeze .pin-container { }
.temp-lifestyle-breeze .pin-img { background-image: var(--pin-img); }

.temp-lifestyle-serene .pin-container { }
.temp-lifestyle-serene .pin-img { background-image: var(--pin-img); }

.temp-lifestyle-vibrant .pin-container { }
.temp-lifestyle-vibrant .pin-img { background-image: var(--pin-img); }

.temp-lifestyle-fresh .pin-container { }
.temp-lifestyle-fresh .pin-img { background-image: var(--pin-img); }

.temp-lifestyle-aura .pin-container { }
.temp-lifestyle-aura .pin-img { background-image: var(--pin-img); }

.temp-lifestyle-zest .pin-container { }
.temp-lifestyle-zest .pin-img { background-image: var(--pin-img); }

.temp-educational-learn .pin-container { }
.temp-educational-learn .pin-img { background-image: var(--pin-img); }

.temp-educational-wise .pin-container { }
.temp-educational-wise .pin-img { background-image: var(--pin-img); }

.temp-educational-guide .pin-container { }
.temp-educational-guide .pin-img { background-image: var(--pin-img); }

.temp-educational-path .pin-container { }
.temp-educational-path .pin-img { background-image: var(--pin-img); }

.temp-educational-insight .pin-container { }
.temp-educational-insight .pin-img { background-image: var(--pin-img); }

.temp-educational-clarity .pin-container { }
.temp-educational-clarity .pin-img { background-image: var(--pin-img); }

.temp-educational-spark .pin-container { }
.temp-educational-spark .pin-img { background-image: var(--pin-img); }

.temp-educational-nova .pin-container { }
.temp-educational-nova .pin-img { background-image: var(--pin-img); }

.temp-educational-aha .pin-container { }
.temp-educational-aha .pin-img { background-image: var(--pin-img); }

.temp-educational-eureka .pin-container { }
.temp-educational-eureka .pin-img { background-image: var(--pin-img); }

.temp-ecommerce-deal .pin-container { }
.temp-ecommerce-deal .pin-img { background-image: var(--pin-img); }

.temp-ecommerce-flash .pin-container { }
.temp-ecommerce-flash .pin-img { background-image: var(--pin-img); }

.temp-ecommerce-offer .pin-container { }
.temp-ecommerce-offer .pin-img { background-image: var(--pin-img); }

.temp-ecommerce-hot .pin-container { }
.temp-ecommerce-hot .pin-img { background-image: var(--pin-img); }

.temp-ecommerce-sale .pin-container { }
.temp-ecommerce-sale .pin-img { background-image: var(--pin-img); }

.temp-ecommerce-prime .pin-container { }
.temp-ecommerce-prime .pin-img { background-image: var(--pin-img); }

.temp-ecommerce-value .pin-container { }
.temp-ecommerce-value .pin-img { background-image: var(--pin-img); }

.temp-ecommerce-smart .pin-container { }
.temp-ecommerce-smart .pin-img { background-image: var(--pin-img); }

.temp-ecommerce-quick .pin-container { }
.temp-ecommerce-quick .pin-img { background-image: var(--pin-img); }

.temp-ecommerce-buzz .pin-container { }
.temp-ecommerce-buzz .pin-img { background-image: var(--pin-img); }

.temp-creative-canvas .pin-container { }
.temp-creative-canvas .pin-img { background-image: var(--pin-img); }

.temp-creative-mosaic .pin-container { }
.temp-creative-mosaic .pin-img { background-image: var(--pin-img); }

.temp-creative-fusion .pin-container { }
.temp-creative-fusion .pin-img { background-image: var(--pin-img); }

.temp-creative-spiral .pin-container { }
.temp-creative-spiral .pin-img { background-image: var(--pin-img); }

.temp-creative-pixels .pin-container { }
.temp-creative-pixels .pin-img { background-image: var(--pin-img); }

.temp-creative-doodle .pin-container { }
.temp-creative-doodle .pin-img { background-image: var(--pin-img); }

.temp-creative-splash .pin-container { }
.temp-creative-splash .pin-img { background-image: var(--pin-img); }

.temp-creative-nova .pin-container { }
.temp-creative-nova .pin-img { background-image: var(--pin-img); }

.temp-creative-zigzag .pin-container { }
.temp-creative-zigzag .pin-img { background-image: var(--pin-img); }

.temp-creative-kaleido .pin-container { }
.temp-creative-kaleido .pin-img { background-image: var(--pin-img); }

.temp-dark-night .pin-container { }
.temp-dark-night .pin-img { background-image: var(--pin-img); }

.temp-dark-shadow .pin-container { }
.temp-dark-shadow .pin-img { background-image: var(--pin-img); }

.temp-dark-phantom .pin-container { }
.temp-dark-phantom .pin-img { background-image: var(--pin-img); }

.temp-dark-eclipse .pin-container { }
.temp-dark-eclipse .pin-img { background-image: var(--pin-img); }

.temp-dark-void .pin-container { }
.temp-dark-void .pin-img { background-image: var(--pin-img); }

.temp-dark-obsidian .pin-container { }
.temp-dark-obsidian .pin-img { background-image: var(--pin-img); }

.temp-dark-onyx .pin-container { }
.temp-dark-onyx .pin-img { background-image: var(--pin-img); }

.temp-dark-umbra .pin-container { }
.temp-dark-umbra .pin-img { background-image: var(--pin-img); }

.temp-dark-dusk .pin-container { }
.temp-dark-dusk .pin-img { background-image: var(--pin-img); }

.temp-dark-midnight .pin-container { }
.temp-dark-midnight .pin-img { background-image: var(--pin-img); }

.temp-editorial-story .pin-container { }
.temp-editorial-story .pin-img { background-image: var(--pin-img); }

.temp-editorial-feature .pin-container { }
.temp-editorial-feature .pin-img { background-image: var(--pin-img); }

.temp-editorial-column .pin-container { }
.temp-editorial-column .pin-img { background-image: var(--pin-img); }

.temp-editorial-spread .pin-container { }
.temp-editorial-spread .pin-img { background-image: var(--pin-img); }

.temp-editorial-article .pin-container { }
.temp-editorial-article .pin-img { background-image: var(--pin-img); }

.temp-editorial-review .pin-container { }
.temp-editorial-review .pin-img { background-image: var(--pin-img); }

.temp-editorial-profile .pin-container { }
.temp-editorial-profile .pin-img { background-image: var(--pin-img); }

.temp-editorial-report .pin-container { }
.temp-editorial-report .pin-img { background-image: var(--pin-img); }

.temp-editorial-essay .pin-container { }
.temp-editorial-essay .pin-img { background-image: var(--pin-img); }

.temp-editorial-chapter .pin-container { }
.temp-editorial-chapter .pin-img { background-image: var(--pin-img); }

.temp-social-trend .pin-container { }
.temp-social-trend .pin-img { background-image: var(--pin-img); }

.temp-social-viral .pin-container { }
.temp-social-viral .pin-img { background-image: var(--pin-img); }

.temp-social-engage .pin-container { }
.temp-social-engage .pin-img { background-image: var(--pin-img); }

.temp-social-post .pin-container { }
.temp-social-post .pin-img { background-image: var(--pin-img); }

.temp-social-feed .pin-container { }
.temp-social-feed .pin-img { background-image: var(--pin-img); }

.temp-social-reel .pin-container { }
.temp-social-reel .pin-img { background-image: var(--pin-img); }

.temp-social-story .pin-container { }
.temp-social-story .pin-img { background-image: var(--pin-img); }

.temp-social-scope .pin-container { }
.temp-social-scope .pin-img { background-image: var(--pin-img); }

.temp-social-wave .pin-container { }
.temp-social-wave .pin-img { background-image: var(--pin-img); }

.temp-social-flash .pin-container { }
.temp-social-flash .pin-img { background-image: var(--pin-img); }

.temp-seasonal-festive .pin-container { }
.temp-seasonal-festive .pin-img { background-image: var(--pin-img); }

.temp-seasonal-joy .pin-container { }
.temp-seasonal-joy .pin-img { background-image: var(--pin-img); }

.temp-seasonal-wonder .pin-container { }
.temp-seasonal-wonder .pin-img { background-image: var(--pin-img); }

.temp-seasonal-cozy .pin-container { }
.temp-seasonal-cozy .pin-img { background-image: var(--pin-img); }

.temp-seasonal-magic .pin-container { }
.temp-seasonal-magic .pin-img { background-image: var(--pin-img); }

.temp-seasonal-sparkle .pin-container { }
.temp-seasonal-sparkle .pin-img { background-image: var(--pin-img); }

.temp-seasonal-celebrate .pin-container { }
.temp-seasonal-celebrate .pin-img { background-image: var(--pin-img); }

.temp-seasonal-bliss .pin-container { }
.temp-seasonal-bliss .pin-img { background-image: var(--pin-img); }

.temp-seasonal-frost .pin-container { }
.temp-seasonal-frost .pin-img { background-image: var(--pin-img); }

.temp-seasonal-harvest .pin-container { }
.temp-seasonal-harvest .pin-img { background-image: var(--pin-img); }

.temp-food-savory .pin-container { }
.temp-food-savory .pin-img { background-image: var(--pin-img); }

.temp-food-zest .pin-container { }
.temp-food-zest .pin-img { background-image: var(--pin-img); }

.temp-food-recipe .pin-container { }
.temp-food-recipe .pin-img { background-image: var(--pin-img); }

.temp-food-feast .pin-container { }
.temp-food-feast .pin-img { background-image: var(--pin-img); }

.temp-food-flavor .pin-container { }
.temp-food-flavor .pin-img { background-image: var(--pin-img); }

.temp-food-spice .pin-container { }
.temp-food-spice .pin-img { background-image: var(--pin-img); }

.temp-food-plated .pin-container { }
.temp-food-plated .pin-img { background-image: var(--pin-img); }

.temp-food-savor .pin-container { }
.temp-food-savor .pin-img { background-image: var(--pin-img); }

.temp-food-bake .pin-container { }
.temp-food-bake .pin-img { background-image: var(--pin-img); }

.temp-food-bite .pin-container { }
.temp-food-bite .pin-img { background-image: var(--pin-img); }

.temp-realestate-address .pin-container { }
.temp-realestate-address .pin-img { background-image: var(--pin-img); }

.temp-realestate-estate .pin-container { }
.temp-realestate-estate .pin-img { background-image: var(--pin-img); }

.temp-realestate-home .pin-container { }
.temp-realestate-home .pin-img { background-image: var(--pin-img); }

.temp-realestate-view .pin-container { }
.temp-realestate-view .pin-img { background-image: var(--pin-img); }

.temp-realestate-space .pin-container { }
.temp-realestate-space .pin-img { background-image: var(--pin-img); }

.temp-realestate-loft .pin-container { }
.temp-realestate-loft .pin-img { background-image: var(--pin-img); }

.temp-realestate-villa .pin-container { }
.temp-realestate-villa .pin-img { background-image: var(--pin-img); }

.temp-realestate-haven .pin-container { }
.temp-realestate-haven .pin-img { background-image: var(--pin-img); }

.temp-realestate-prime .pin-container { }
.temp-realestate-prime .pin-img { background-image: var(--pin-img); }

.temp-realestate-oasis .pin-container { }
.temp-realestate-oasis .pin-img { background-image: var(--pin-img); }
/* ==========================================
   Progress Popup Overlay
   ========================================== */
.progress-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: fadeInOverlay 0.3s ease both;
}

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

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ==========================================
   Popup Card — 75% viewport, two-column
   ========================================== */
.progress-popup {
    width: 75vw;
    height: 75vh;
    max-width: 1100px;
    max-height: 700px;
    min-height: 420px;
    position: relative;
    border-radius: 28px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.55), rgba(168, 85, 247, 0.45), rgba(var(--accent-rgb), 0.55));
    background-size: 200% 200%;
    animation: popupSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both,
               borderShift 4s ease infinite;
    box-shadow:
        0 36px 100px rgba(0, 0, 0, 0.6),
        0 0 100px rgba(var(--accent-rgb), 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

@keyframes borderShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Inner card surface */
.progress-popup::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 27px;
    background: var(--bg-card);
    z-index: 0;
}

.progress-popup > * {
    position: relative;
    z-index: 1;
}

/* Two-column body */
.progress-popup-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100%;
    gap: 0;
}

/* LEFT: Progress section */
.progress-left {
    display: flex;
    flex-direction: column;
    padding: 40px 36px 36px 40px;
    border-right: 1px solid var(--border-subtle);
}

/* RIGHT: Donate section */
.progress-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 32px;
}

/* Floating sparkle decorations */
.popup-sparkle {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    animation: sparkleFloat 3.5s ease-in-out infinite;
}

.popup-sparkle i {
    font-size: 0.7rem;
    color: rgba(var(--accent-rgb), 0.6);
}

.popup-sparkle-1 {
    top: 18px;
    left: 18px;
    animation-delay: 0s;
}
.popup-sparkle-1 i { color: #f59e0b; font-size: 0.65rem; }

.popup-sparkle-2 {
    top: 12px;
    right: 70px;
    animation-delay: 1.2s;
}
.popup-sparkle-2 i { color: #a855f7; font-size: 0.8rem; }

.popup-sparkle-3 {
    bottom: 16px;
    left: 24px;
    animation-delay: 2.4s;
}
.popup-sparkle-3 i { color: #ec4899; font-size: 0.6rem; }

@keyframes sparkleFloat {
    0%   { opacity: 0; transform: translateY(6px) scale(0.6) rotate(0deg); }
    25%  { opacity: 1; transform: translateY(-4px) scale(1) rotate(90deg); }
    75%  { opacity: 0.7; transform: translateY(-8px) scale(0.9) rotate(270deg); }
    100% { opacity: 0; transform: translateY(-14px) scale(0.5) rotate(360deg); }
}

/* Close button */
.progress-popup-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 10;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-input);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    padding: 0;
    opacity: 0.75;
}

.progress-popup-close:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--error);
    color: var(--error);
    transform: rotate(90deg) scale(1.1);
}

/* ==========================================
   Header
   ========================================== */
.progress-popup-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 16px;
}

/* Icon container — working state */
.progress-popup-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background:
        radial-gradient(circle at 30% 30%, rgba(var(--accent-rgb), 0.25), rgba(var(--accent-rgb), 0.08));
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.25);
}

.progress-popup-icon::after {
    content: '';
    position: absolute;
    inset: -50%;
    background: conic-gradient(from 0deg, transparent 60%, rgba(var(--accent-rgb), 0.35) 100%);
    animation: iconSpin 2.5s linear infinite;
    opacity: 0.6;
}

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

.progress-popup-icon i {
    font-size: 1.5rem;
    color: var(--accent);
    position: relative;
    z-index: 2;
    animation: iconBounce 1.8s ease-in-out infinite;
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.15); }
}

/* Done icon state */
.progress-popup-icon-done {
    display: none;
    background: radial-gradient(circle at 30% 30%, rgba(16, 185, 129, 0.3), rgba(16, 185, 129, 0.1));
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 4px 24px rgba(16, 185, 129, 0.3);
}

.progress-popup-icon-done::after {
    background: conic-gradient(from 0deg, transparent 60%, rgba(16, 185, 129, 0.35) 100%);
}

.progress-popup-icon-done i {
    color: #10b981;
    font-size: 1.5rem;
    animation: doneCheckPop 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes doneCheckPop {
    from { transform: scale(0) rotate(-45deg); opacity: 0; }
    to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Completed state toggles */
.progress-popup.completed .progress-popup-icon { display: none; }
.progress-popup.completed .progress-popup-icon-done { display: flex; }
.progress-popup.completed .progress-popup-icon-done i { animation: doneCheckPop 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; }
.progress-popup.completed .progress-popup-close { opacity: 1; }
.progress-popup.completed .progress-bar-shimmer { animation-play-state: paused; opacity: 0; }
.progress-popup.completed .progress-popup-count {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.35);
    color: #10b981;
}
.progress-popup.completed .popup-sparkle { animation: none; opacity: 0; }

.progress-popup-title {
    flex: 1;
    min-width: 0;
}

.progress-popup-title h3 {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.progress-popup-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 6px;
    display: block;
    line-height: 1.3;
}

.progress-popup-count {
    display: inline-block;
    align-self: flex-start;
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
    border: 1px solid rgba(var(--accent-rgb), 0.22);
    border-radius: 100px;
    padding: 10px 22px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    margin-bottom: 24px;
}

/* ==========================================
   Progress Bar
   ========================================== */
.progress-bar-outer {
    position: relative;
    margin-bottom: 16px;
    margin-top: auto;
}

.progress-bar-track {
    width: 100%;
    height: 18px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #ec4899, #a855f7);
    background-size: 200% 100%;
    border-radius: 99px;
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    z-index: 2;
    animation: fillGradientShift 2.5s ease infinite;
    box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.6);
}

@keyframes fillGradientShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* Shimmer sweep over bar */
.progress-bar-shimmer {
    position: absolute;
    top: 0;
    left: -30%;
    width: 30%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.5),
        transparent
    );
    border-radius: 99px;
    z-index: 3;
    animation: shimmerSweep 1.6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmerSweep {
    0%   { left: -30%; opacity: 0; }
    30%  { opacity: 1; }
    100% { left: 110%; opacity: 0; }
}

/* Bar labels row */
.progress-bar-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

.progress-label-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-spin-icon {
    font-size: 1rem;
    color: var(--accent);
    animation: progressSpinIcon 1.2s linear infinite;
}

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

.progress-popup.completed .progress-spin-icon {
    animation: none;
    color: #10b981;
}

#progressPercent {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

#progressStatus {
    font-size: 1rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    font-weight: 600;
}

/* ==========================================
   Donate Card — right column
   ========================================== */
.progress-donate-card {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
    width: 100%;
}

/* Animated gradient glow background */
.donate-card-glow {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background:
        linear-gradient(135deg,
            rgba(var(--accent-rgb), 0.12) 0%,
            rgba(236, 72, 153, 0.1) 30%,
            rgba(168, 85, 247, 0.12) 70%,
            rgba(var(--accent-rgb), 0.1) 100%);
    background-size: 200% 200%;
    animation: glowShift 4s ease infinite;
    z-index: 0;
}

@keyframes glowShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* Border ring */
.progress-donate-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1.5px;
    background: linear-gradient(135deg,
        rgba(var(--accent-rgb), 0.5),
        rgba(236, 72, 153, 0.3),
        rgba(168, 85, 247, 0.5));
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: 1;
    pointer-events: none;
}

.donate-card-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    padding: 40px 28px 32px;
}

/* Floating emoji icon */
.donate-card-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: emojiFloat 2.5s ease-in-out infinite;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

@keyframes emojiFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-4px); }
}

.donate-emoji {
    font-size: 2.2rem;
    line-height: 1;
}

/* Text */
.donate-card-heading {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin: 0;
    line-height: 1;
}

.donate-card-msg {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
    max-width: 340px;
}

.donate-card-fine {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: -8px 0 0;
    font-style: italic;
}

/* Donate CTA button */
.donate-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    color: white;
    font-size: 1rem;
    font-weight: 800;
    border-radius: 12px;
    text-decoration: none;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 22px rgba(168, 85, 247, 0.4);
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    letter-spacing: 0.02em;
}

.donate-card-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 10px 32px rgba(168, 85, 247, 0.55);
    filter: brightness(1.08);
}

.donate-card-btn i {
    font-size: 0.95rem;
    animation: heartBeatSoft 1.6s ease-in-out infinite;
}

@keyframes heartBeatSoft {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.18); }
}

/* Donate card dismiss */
.donate-card-dismiss {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.22);
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.7rem;
    padding: 0;
}

.donate-card-dismiss:hover {
    background: rgba(239, 68, 68, 0.35);
    color: white;
    transform: rotate(90deg);
}

/* Hide donate card */
.progress-donate-card.dismissed {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    max-height: 0;
    margin: 0;
    overflow: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.3s ease;
}

/* Light theme — progress popup */
[data-theme="light"] .progress-popup-overlay {
    background: rgba(0, 0, 0, 0.42);
}

[data-theme="light"] .progress-popup {
    box-shadow:
        0 36px 100px rgba(0, 0, 0, 0.18),
        0 0 80px rgba(var(--accent-rgb), 0.12);
}

[data-theme="light"] .progress-popup::before {
    background: var(--bg-card);
}

[data-theme="light"] .progress-popup-close {
    background: var(--bg-input);
}

[data-theme="light"] .donate-card-glow {
    background: linear-gradient(135deg,
        rgba(var(--accent-rgb), 0.08) 0%,
        rgba(236, 72, 153, 0.06) 30%,
        rgba(168, 85, 247, 0.08) 70%,
        rgba(var(--accent-rgb), 0.06) 100%);
}

[data-theme="light"] .donate-card-icon-wrap {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .donate-card-dismiss {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-muted);
}

[data-theme="light"] .donate-card-msg {
    color: var(--text-primary);
}

/* ==========================================
   Responsive — Generator
   ========================================== */
@media (max-width: 1100px) {
    .progress-popup {
        width: 82vw;
        height: 75vh;
    }

    .progress-popup-title h3 {
        font-size: 1.35rem;
    }

    .progress-popup-subtitle {
        font-size: 0.9rem;
    }
}

@media (max-width: 1024px) {
    body.generator-page {
        overflow: auto;
    }

    body.generator-page .page-body {
        height: auto;
        min-height: 100vh;
        padding-top: var(--header-height);
    }

    body.generator-page .app-container {
        height: auto;
    }

    .mobile-nav-bar {
        display: block;
    }

    body.generator-page .app-container {
        display: block;
    }

    .sidebar,
    .workspace {
        display: none;
        min-height: calc(100vh - var(--header-height) - 54px - 128px);
    }

    .app-container.show-sidebar .sidebar,
    .app-container.show-workspace .workspace {
        display: flex;
        flex-direction: column;
        animation: mobileFadeIn 0.2s ease both;
    }

    @keyframes mobileFadeIn {
        from { opacity: 0; transform: translateY(4px); }
        to { opacity: 1; transform: translateY(0); }
    }

    /* Tab bar */
    .mobile-tabs {
        display: flex;
        gap: 6px;
        padding: 10px 12px;
        background: var(--bg-main);
        border-bottom: 1px solid var(--border-subtle);
        position: relative;
    }

    .mobile-tab-btn {
        flex: 1;
        border: none;
        background: var(--bg-input);
        color: var(--text-secondary);
        border-radius: 12px;
        padding: 12px 12px;
        font-weight: 700;
        font-size: 0.85rem;
        transition: all 0.25s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 48px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        position: relative;
        overflow: hidden;
    }

    .mobile-tab-btn i {
        font-size: 0.9rem;
    }

    .mobile-tab-btn:active {
        transform: scale(0.97);
    }

    .mobile-tab-btn.active {
        color: #fff;
        background: var(--accent);
        box-shadow: 0 2px 12px rgba(var(--accent-rgb), 0.3);
    }

    .pin-count-badge {
        display: inline-flex;
        min-width: 22px;
        height: 22px;
        align-items: center;
        justify-content: center;
        border-radius: 99px;
        background: rgba(255,255,255,0.2);
        font-size: 0.72rem;
        font-weight: 800;
        padding: 0 6px;
    }

    /* Unified bottom bar */
    .mobile-bottom-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 30;
        background: var(--bg-card);
        border-top: 1px solid var(--border-subtle);
        box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
        padding: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .mobile-bottom-bar .filter-chips {
        display: flex;
        align-items: center;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
        padding: 8px 12px;
        margin: 0;
        background: transparent;
        border: none;
    }

    .mobile-bottom-bar .filter-chips::-webkit-scrollbar {
        display: none;
    }

    .mobile-bottom-bar .filter-chip {
        flex: 0 0 auto;
        padding: 7px 14px;
        font-size: 0.78rem;
        font-weight: 600;
        white-space: nowrap;
        border-radius: 8px;
        min-height: 36px;
        border: 1px solid var(--border-color);
        background: var(--bg-main);
        color: var(--text-secondary);
        cursor: pointer;
        transition: all 0.2s ease;
        display: inline-flex;
        align-items: center;
        gap: 5px;
        font-family: inherit;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
    }

    .mobile-bottom-bar .filter-chip:active {
        transform: scale(0.95);
    }

    .mobile-bottom-bar .filter-chip.active {
        background: var(--accent);
        border-color: var(--accent);
        color: white;
    }

    .mobile-bottom-bar .filter-chip .chip-icon {
        display: none;
    }

    .mobile-bottom-bar .filter-check {
        display: none;
        font-size: 0.6rem;
    }

    .mobile-bottom-bar .filter-chip.active .filter-check {
        display: inline-flex;
    }



    .mobile-bottom-bar .chip-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        height: 16px;
        padding: 0 5px;
        border-radius: 99px;
        background: rgba(255,255,255,0.12);
        font-size: 0.65rem;
        font-weight: 800;
        margin-left: 2px;
    }

    .mobile-bottom-bar .filter-chip:not(.active) .chip-count {
        background: rgba(0,0,0,0.08);
        color: var(--text-muted);
    }

    /* Divider between chips and buttons */
    .mobile-bottom-bar .mobile-bottom-actions {
        border-top: 1px solid var(--border-color);
        padding: 8px 12px 12px;
        display: flex;
        gap: 8px;
        background: var(--bg-card);
    }

    .mobile-bottom-bar .mobile-bottom-actions .btn {
        flex: 1;
        width: auto;
        padding: 12px 12px;
        font-size: 0.85rem;
        min-height: 48px;
        margin: 0;
        border-radius: 12px;
        font-weight: 800;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: all 0.2s ease;
        border: none;
        font-family: inherit;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-bottom-bar .mobile-bottom-actions .btn:active {
        transform: scale(0.97);
    }

    .mobile-bottom-bar .mobile-bottom-actions .btn-primary {
        background: var(--gradient-accent);
        color: white;
    }

    .mobile-bottom-bar .mobile-bottom-actions .btn-secondary {
        background: var(--bg-input);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }

    .sidebar-footer {
        display: none;
    }

    .app-container {
        padding-bottom: 80px;
    }

    .app-container.show-workspace .canvas-container {
        padding-bottom: calc(24px + 80px);
    }

    /* Sidebar: proper scroll containment on mobile */
    .app-container.show-sidebar .sidebar {
        max-height: calc(100vh - var(--header-height) - 54px - 80px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        display: flex;
        flex-direction: column;
        padding-bottom: 88px;
    }

    .app-container.show-workspace .workspace {
        max-height: calc(100vh - var(--header-height) - 54px - 80px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        display: flex;
        flex-direction: column;
    }

    .workspace {
        flex-direction: column;
    }

    .workspace .canvas-container {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .workspace-toolbar {
        align-items: flex-start;
        flex-direction: column;
        border-top: 1px solid var(--border-subtle);
        border-bottom: none;
        flex-shrink: 0;
    }

    .toolbar-left {
        width: 100%;
        display: none;
    }

    .toolbar-right {
        width: 100%;
    }

    .toolbar-right .toolbar-btn-primary {
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }

    /* Modal mobile — preview fixed at top, form scrolls below */
    .modal {
        padding: 0;
        align-items: flex-start;
    }

    .modal-content {
        display: flex;
        flex-direction: column;
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
        border-radius: 0;
        width: 100vw;
    }

    .modal-left {
        padding: 14px;
        flex-shrink: 0;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }

    .edit-pin-preview-container {
        width: min(280px, 85%);
        box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    }

    .modal-right {
        border-left: none;
        border-top: 1px solid var(--border-subtle);
        flex: 1;
        min-height: 0;
        height: auto;
        overflow: hidden;
    }

    .modal-body {
        padding: 10px 12px;
        -webkit-overflow-scrolling: touch;
    }

    .modal-footer {
        padding: 10px 14px;
    }
}

@media (max-width: 768px) {
    /* Pin grid spacing */
    .pins-grid {
        gap: 32px;
    }

    .headline-pin-subgrid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .canvas-container {
        padding: 16px;
    }

    /* Sidebar refinements for smaller tablets */
    .sidebar {
        padding: 20px 14px 12px;
    }

    .sidebar-section-group:first-child {
        margin-top: 0;
    }

    .sidebar-section {
        padding: 12px;
    }

    .section-group-header {
        padding: 10px 4px 10px;
    }

    .section-group-label {
        font-size: 0.78rem;
    }

    .subsection-label {
        font-size: 0.7rem;
    }

    .form-group > label,
    .headline-item label {
        font-size: 0.72rem;
    }

    input[type="text"],
    textarea,
    select {
        padding: 8px 10px;
        font-size: 0.88rem;
    }

    .dropzone {
        min-height: 110px;
        padding: 16px;
    }

    .dropzone-text {
        font-size: 0.88rem;
    }

    .dropzone-subtext {
        font-size: 0.72rem;
    }

    /* Brand kit compact */
    .brand-kit-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .brand-kit-toggle {
        min-height: 36px;
    }

    /* Color swatch row compact */
    .color-swatch-btn {
        height: 48px;
    }

    .color-swatch-btn .swatch-hex {
        font-size: 0.55rem;
    }

    .swatch-label {
        font-size: 0.6rem;
    }

    .preset-dot {
        width: 14px;
        height: 14px;
    }

    /* Stack two-column form rows on tablets */
    .input-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 100vw;
        border-radius: 0;
    }

    .modal-left {
        padding: 12px;
        max-height: 30vh;
    }

    .edit-pin-preview-container {
        width: min(220px, 75%);
    }

    .edit-section-title {
        padding: 7px 10px;
    }

    .edit-section-title-left i {
        width: 20px;
        height: 20px;
        font-size: 0.6rem;
    }

    .edit-section-body {
        padding: 8px 10px 10px;
    }

    .modal-header {
        padding: 12px 14px;
    }

    .modal-body {
        padding: 10px 12px;
    }

    .modal-footer {
        padding: 10px 12px;
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* Progress popup single-column on phones */
    .progress-popup {
        width: 94vw;
        height: auto;
        min-height: unset;
        max-height: 90vh;
        overflow-y: auto;
    }

    .progress-popup-overlay {
        padding: 12px;
    }

    .progress-popup-body {
        grid-template-columns: 1fr;
    }

    .progress-left {
        padding: 28px 24px 20px;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }

    .progress-right {
        padding: 24px 18px 28px;
    }

    .progress-popup-header {
        gap: 14px;
        margin-bottom: 14px;
    }

    .progress-popup-icon {
        width: 52px;
        height: 52px;
        border-radius: 14px;
    }

    .progress-popup-icon i,
    .progress-popup-icon-done i {
        font-size: 1.25rem;
    }

    .progress-popup-title h3 {
        font-size: 1.25rem;
    }

    .progress-popup-subtitle {
        font-size: 0.85rem;
    }

    .progress-popup-count {
        font-size: 0.95rem;
        padding: 8px 18px;
        margin-bottom: 18px;
    }

    .progress-bar-track {
        height: 14px;
    }

    #progressPercent {
        font-size: 1rem;
    }

    #progressStatus {
        font-size: 0.88rem;
    }

    .donate-card-inner {
        padding: 28px 20px 24px;
        gap: 16px;
    }

    .donate-card-icon-wrap {
        width: 58px;
        height: 58px;
    }

    .donate-emoji {
        font-size: 1.8rem;
    }

    .donate-card-heading {
        font-size: 0.78rem;
    }

    .donate-card-msg {
        font-size: 0.95rem;
        max-width: none;
    }

    .donate-card-btn {
        padding: 12px 28px;
        font-size: 0.9rem;
    }

    .donate-card-fine {
        font-size: 0.75rem;
    }

    .progress-popup-close {
        top: 14px;
        right: 14px;
        width: 36px;
        height: 36px;
    }

    /* Confirm dialog */
    .confirm-dialog {
        padding: 22px 20px;
        max-width: 320px;
    }

    .confirm-dialog-actions {
        flex-direction: column;
    }

    .confirm-dialog-actions .btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    /* Sidebar full mobile treatment */
    .sidebar {
        padding: 18px 10px 10px;
    }

    .sidebar-section-group:first-child {
        margin-top: 0;
    }

    .sidebar-section {
        padding: 10px;
        border-radius: 8px;
    }

    .sidebar-subsection .sidebar-section {
        padding: 10px;
    }

    .section-group-header {
        padding: 10px 2px 8px;
        margin-bottom: 6px;
    }

    .section-group-label {
        font-size: 0.75rem;
        gap: 6px;
    }

    .section-group-label i {
        font-size: 0.8rem;
    }

    /* Compact form elements */
    .form-group {
        margin-bottom: 8px;
    }

    .form-group > label,
    .headline-item label {
        font-size: 0.68rem;
        margin-bottom: 4px;
    }

    input[type="text"],
    textarea,
    select {
        padding: 8px 10px;
        font-size: 0.85rem;
        border-radius: 8px;
    }

    textarea {
        min-height: 60px;
    }

    .input-row {
        grid-template-columns: 1fr;
    }

    /* Dropzone compact */
    .dropzone {
        min-height: 100px;
        padding: 14px;
        gap: 4px;
    }

    .dropzone-icon {
        font-size: 1.4rem;
    }

    .dropzone-text {
        font-size: 0.82rem;
    }

    /* Image list 3 cols on small phones */
    .image-list {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Headline items */
    .headline-item {
        grid-template-columns: 1fr 32px;
        gap: 4px;
    }

    .btn-remove-text {
        font-size: 0.75rem;
    }

    .btn-add-text {
        padding: 7px;
        font-size: 0.78rem;
        min-height: 38px;
    }

    /* Sidebar footer sticky */
    .sidebar-footer {
        padding: 12px 0 6px;
        gap: 6px;
    }

    .sidebar-footer .btn-primary {
        padding: 10px 14px;
        font-size: 0.82rem;
        min-height: 44px;
    }

    .sidebar-footer .btn-secondary {
        padding: 8px 14px;
        font-size: 0.75rem;
        min-height: 40px;
    }

    /* Canvas and pins */
    .canvas-container {
        padding: 10px;
    }

    .pins-grid {
        gap: 28px;
    }

    .headline-section-header {
        padding-bottom: 12px;
    }

    .headline-section-title {
        font-size: 1rem;
    }

    .headline-pin-subgrid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .pin-card-wrapper::after {
        font-size: 0.55rem;
        padding: 2px 7px;
    }

    .pin-actions-overlay {
        padding: 6px;
        gap: 4px;
    }

    .action-circle-btn {
        width: 32px;
        height: 32px;
        font-size: 0.7rem;
    }

    /* Mobile nav bar compact */
    .mobile-nav-bar {
        padding: 0;
    }

    .mobile-tabs {
        padding: 8px 10px;
        gap: 4px;
    }

    .mobile-tab-btn {
        padding: 10px 10px;
        font-size: 0.82rem;
        min-height: 44px;
        border-radius: 10px;
    }

    .mobile-bottom-bar {
        box-shadow: 0 -3px 16px rgba(0,0,0,0.1);
    }

    .mobile-bottom-bar .filter-chips {
        padding: 6px 10px;
        gap: 4px;
    }

    .mobile-bottom-bar .filter-chip {
        padding: 6px 12px;
        font-size: 0.75rem;
        min-height: 34px;
        border-radius: 7px;
    }

    .mobile-bottom-bar .mobile-bottom-actions {
        padding: 6px 10px 10px;
        gap: 6px;
    }

    .mobile-bottom-bar .mobile-bottom-actions .btn {
        padding: 11px 10px;
        font-size: 0.82rem;
        min-height: 44px;
        border-radius: 10px;
    }

    .app-container {
        padding-bottom: 76px;
    }

    .app-container.show-workspace .canvas-container {
        padding-bottom: calc(24px + 76px);
    }

    .app-container.show-sidebar .sidebar {
        padding-bottom: 84px;
    }

    .mobile-filter-section .filter-chip {
        padding: 6px 11px;
        font-size: 0.74rem;
    }

    /* Modal full-bleed on phones */
    .modal {
        padding: 0;
    }

    .modal-content {
        width: 100vw;
        max-height: 100dvh;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .modal-left {
        padding: 10px;
    }

    .edit-pin-preview-container {
        width: min(180px, 70%);
    }

    .edit-section-title {
        padding: 7px 10px;
    }

    .edit-section-title-left span {
        font-size: 0.78rem;
    }

    .edit-section-title-left i {
        width: 20px;
        height: 20px;
        font-size: 0.6rem;
    }

    .edit-section-reset {
        width: 24px;
        height: 24px;
        font-size: 0.6rem;
    }

    .empty-workspace {
        min-height: 220px;
        padding: 24px 16px;
    }

    .empty-workspace-icon {
        font-size: 1.8rem;
    }

    .empty-workspace h3 {
        font-size: 1rem;
    }

    .empty-workspace p {
        font-size: 0.85rem;
    }

    /* Color swatch row compact on small phones */
    .color-swatch-row {
        gap: 5px;
    }

    .color-swatch-btn {
        height: 40px;
        border-radius: 8px;
    }

    .color-swatch-btn::before {
        border-radius: 6px;
    }

    .swatch-label {
        font-size: 0.55rem;
    }

    .color-presets {
        gap: 3px;
    }

    .preset-dot {
        width: 12px;
        height: 12px;
    }

    /* Brand kit compact on small phones */
    .brand-kit-section {
        padding: 10px;
    }

    .brand-kit-header {
        gap: 8px;
    }

    .sidebar-section-title {
        font-size: 0.8rem;
    }

    .logo-upload-wrapper {
        flex-wrap: wrap;
    }

    /* Custom font upload */
    .custom-font-wrapper {
        padding: 8px;
        gap: 6px;
    }

    .font-status-text {
        font-size: 0.68rem;
    }

    /* Range inputs larger touch area */
    .modal-body input[type="range"] {
        height: 8px;
    }

    .modal-body input[type="range"]::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }

    .modal-body input[type="range"]::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }

    /* Workspace toolbar */
    .workspace-toolbar {
        padding: 8px 12px;
        min-height: 48px;
    }

    /* Filter chips in mobile view */
    #filterPills {
        padding: 8px 12px;
        gap: 6px;
    }

    .filter-chip {
        padding: 8px 14px;
        font-size: 0.8rem;
        min-height: 38px;
    }
}

/* ==========================================
    Very small phones (iPhone SE, etc.)
    ========================================== */
@media (max-width: 400px) {
    :root {
        --header-height: 60px;
    }

    .header-inner {
        padding: 0 12px;
        gap: 8px;
    }

    .brand-icon {
        width: 32px;
        height: 32px;
        font-size: 15px;
        border-radius: 8px;
    }

    .brand-name {
        font-size: 0.88rem;
    }

    .brand-tagline {
        display: none;
    }

    .theme-toggle {
        width: 48px;
        height: 26px;
    }

    .menu-toggle {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    /* Mobile nav bar ultra-compact */
    .mobile-nav-bar {
        padding: 0;
    }

    .mobile-tabs {
        padding: 6px 8px;
        gap: 3px;
    }

    .mobile-tab-btn {
        padding: 8px 8px;
        font-size: 0.76rem;
        border-radius: 8px;
        gap: 4px;
        min-height: 40px;
    }

    .mobile-bottom-bar .filter-chips {
        padding: 4px 8px;
        gap: 3px;
    }

    .mobile-bottom-bar .filter-chip {
        padding: 5px 10px;
        font-size: 0.7rem;
        min-height: 30px;
        border-radius: 6px;
    }

    .mobile-bottom-bar .mobile-bottom-actions {
        padding: 4px 8px 8px;
        gap: 4px;
    }

    .mobile-bottom-bar .mobile-bottom-actions .btn {
        padding: 10px 8px;
        font-size: 0.78rem;
        min-height: 40px;
        border-radius: 8px;
    }

    .app-container {
        padding-bottom: 64px;
    }

    .app-container.show-workspace .canvas-container {
        padding-bottom: calc(24px + 64px);
    }

    .app-container.show-sidebar .sidebar {
        padding-bottom: 72px;
    }

    .mobile-filter-section .filter-chip {
        padding: 5px 9px;
        font-size: 0.7rem;
        min-height: 32px;
    }

    /* Sidebar ultra-compact */
    .sidebar {
        padding: 16px 8px 8px;
    }

    .sidebar-section-group:first-child {
        margin-top: 0;
    }

    .sidebar-section {
        padding: 8px;
        border-radius: 8px;
    }

    .section-group-label {
        font-size: 0.7rem;
    }

    .subsection-label {
        font-size: 0.66rem;
    }

    .form-group > label,
    .headline-item label {
        font-size: 0.64rem;
    }

    input[type="text"],
    textarea,
    select {
        padding: 7px 8px;
        font-size: 0.82rem;
    }

    /* Image list 2 cols on tiny phones */
    .image-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .dropzone {
        min-height: 90px;
        padding: 12px;
    }

    .dropzone-icon {
        font-size: 1.2rem;
    }

    .dropzone-text {
        font-size: 0.78rem;
    }

    .dropzone-subtext {
        font-size: 0.68rem;
    }

    /* Pin grid sections */
    .pins-grid {
        gap: 28px;
    }

    .headline-section {
        gap: 14px;
    }

    .headline-section-header {
        flex-wrap: wrap;
        padding: 12px 14px;
    }

    .headline-section-title {
        font-size: 0.9rem;
        order: 3;
        width: 100%;
    }

    .headline-section-meta {
        font-size: 0.72rem;
        padding: 3px 10px;
    }

    .headline-pin-subgrid {
        gap: 10px;
    }

    .canvas-container {
        padding: 8px;
    }

    .action-circle-btn {
        width: 28px;
        height: 28px;
        font-size: 0.65rem;
    }

    /* Modal */
    .modal {
        padding: 0;
    }

    .modal-content {
        border-radius: 0;
        max-height: 100dvh;
    }

    .modal-header {
        padding: 10px 12px;
    }

    .modal-title {
        font-size: 0.9rem;
    }

    .modal-body {
        padding: 8px 10px;
    }

    .edit-section-title {
        padding: 6px 8px;
        gap: 6px;
    }

    .edit-section-title-left span {
        font-size: 0.72rem;
    }

    .edit-section-body {
        padding: 6px 8px 8px;
    }

    .edit-section-reset {
        width: 22px;
        height: 22px;
        font-size: 0.55rem;
    }

    /* Progress popup */
    .progress-popup {
        width: 98vw;
        border-radius: 16px;
    }

    .progress-left {
        padding: 20px 16px 16px;
    }

    .progress-popup-title h3 {
        font-size: 1.1rem;
    }

    .progress-popup-count {
        font-size: 0.88rem;
        padding: 6px 14px;
    }

    .donate-card-inner {
        padding: 20px 14px 18px;
    }

    /* Sidebar footer */
    .sidebar-footer .btn-primary {
        padding: 9px 12px;
        font-size: 0.78rem;
    }

    .sidebar-footer .btn-secondary {
        padding: 7px 12px;
        font-size: 0.72rem;
    }

    /* Filter chips */
    .filter-chip {
        padding: 7px 12px;
        font-size: 0.75rem;
    }

    /* Color swatch row */
    .color-swatch-btn {
        height: 34px;
    }

    .color-swatch-btn .swatch-hex {
        font-size: 0.5rem;
    }

    .swatch-label {
        font-size: 0.5rem;
    }

    .preset-dot {
        width: 10px;
        height: 10px;
    }

    /* Confirm dialog */
    .confirm-dialog {
        padding: 18px 16px;
        max-width: 280px;
    }

    .confirm-dialog-message {
        font-size: 0.85rem;
    }
}

/* ==========================================
    Light Theme — Generator Overrides
    ========================================== */

/* ==========================================
    Landscape phones — horizontal orientation
    ========================================== */
@media (max-height: 500px) and (orientation: landscape) {
    body.generator-page .page-body {
        overflow: auto;
    }

    .mobile-nav-bar {
        position: sticky;
        top: var(--header-height);
        z-index: 20;
    }

    .sidebar {
        max-height: none !important;
    }

    .modal-left {
        padding: 10px;
    }

    .edit-pin-preview-container {
        width: min(160px, 65%);
    }

    .progress-popup {
        max-height: 96vh;
        overflow-y: auto;
    }
}

/* ==========================================
    Touch device improvements
    ========================================== */
@media (hover: none) and (pointer: coarse) {
    .filter-chip {
        min-height: 40px;
        padding: 10px 16px;
    }

    .mobile-bottom-bar .filter-chip {
        min-height: 40px;
        padding: 8px 14px;
    }

    .mobile-tab-btn {
        min-height: 44px;
    }

    .btn-add-text {
        min-height: 44px;
    }

    .sidebar-footer .btn {
        min-height: 44px;
    }

    .mobile-bottom-bar .mobile-bottom-actions .btn {
        min-height: 50px;
    }

    .action-circle-btn {
        width: 40px;
        height: 40px;
        font-size: 0.8rem;
    }

    .nav-link {
        min-height: 44px;
    }

    .menu-toggle {
        min-height: 44px;
        min-width: 44px;
    }

    .brand-kit-toggle {
        min-height: 40px;
    }

    .theme-toggle {
        min-height: 36px;
    }
}
[data-theme="light"] .sidebar {
    background: var(--bg-card);
}

[data-theme="light"] .sidebar-section {
    background: var(--bg-input);
    border-color: var(--border-subtle);
}

[data-theme="light"] .sidebar-section:hover {
    border-color: rgba(var(--accent-rgb), 0.15);
}

[data-theme="light"] .sidebar-subsection .sidebar-section {
    background: rgba(255,255,255,0.5);
    border-color: rgba(0,0,0,0.06);
}

[data-theme="light"] .image-upload-section {
    background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.02), var(--bg-input));
}

[data-theme="light"] .workspace-toolbar {
    background: rgba(255,255,255,0.75);
    border-bottom-color: var(--border-subtle);
}

[data-theme="light"] .filter-chip:not(.active) .chip-count {
    background: rgba(0,0,0,0.06);
}

[data-theme="light"] .pin-actions-overlay {
    background: var(--pin-actions-bg);
}

[data-theme="light"] .action-circle-btn {
    background: rgba(255,255,255,0.95);
    color: #333;
}

[data-theme="light"] .thumb-delete {
    background: rgba(0,0,0,0.55);
}

[data-theme="light"] .pin-count-badge {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

[data-theme="light"] .empty-workspace {
    background: rgba(0,0,0,0.008);
}

[data-theme="light"] .edit-section {
    background: rgba(255,255,255,0.6);
}

[data-theme="light"] .edit-section:hover {
    border-color: rgba(var(--accent-rgb), 0.25);
}

[data-theme="light"] .color-control-group {
    background: rgba(var(--accent-rgb), 0.02);
}

[data-theme="light"] .btn-add-text {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="light"] .btn-add-text:hover {
    color: var(--accent);
    border-color: var(--accent);
}

[data-theme="light"] .modal {
    background: rgba(0,0,0,0.3);
}

[data-theme="light"] .sidebar-footer {
    background: linear-gradient(to top, var(--bg-card) 60%, transparent);
}

[data-theme="light"] .brand-kit-section {
    background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.02), var(--bg-input));
}

[data-theme="light"] .dropzone {
    background: var(--bg-input);
}

[data-theme="light"] .dropzone:hover {
    background: rgba(var(--accent-rgb), 0.03);
}

[data-theme="light"] .pin-scale-container {
    border-color: rgba(0,0,0,0.06);
}

[data-theme="light"] .custom-font-wrapper {
    background: var(--bg-input);
}

[data-theme="light"] .brand-kit-toggle .toggle-track {
    background: var(--bg-main);
}

[data-theme="light"] .brand-kit-toggle input:checked + .toggle-track {
    background: rgba(var(--accent-rgb), 0.12);
}

[data-theme="light"] .control-group-heading {
    border-bottom-color: var(--border-subtle);
}

[data-theme="light"] .edit-reset-all-btn:hover {
    border-color: var(--error);
    color: var(--error);
}

[data-theme="light"] .confirm-dialog {
    border-color: var(--border-color);
}

[data-theme="light"] .toast {
    border-color: var(--border-color);
    background: var(--bg-elevated);
}
