:root {
    --bg: #ffffff;
    --surface: #fcfcfc;
    --border: #e2e8f0;
    --primary: #111111;
    --accent: #6366f1;
    --text-muted: #71717a;
    --code-bg: #0f172a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: 'Inter', -apple-system, sans-serif; 
    background: var(--bg); 
    display: grid; 
    grid-template-columns: 1fr 380px; 
    height: 100vh; 
    overflow: hidden; 
}

/* --- Workspace --- */
.workspace { 
    padding: 24px; 
    display: flex; 
    flex-direction: column; 
    border-right: 1px solid var(--border); 
    position: relative; 
    overflow: hidden;
    background: #f8fafc;
}

/* Liquid Background System */
.liquid-bg {
    position: absolute; inset: 0; overflow: hidden;
    background: #f8fafc;
    z-index: 0;
}
.blob {
    position: absolute; border-radius: 50%;
    filter: blur(80px); opacity: 0.8;
    animation: float 20s infinite ease-in-out alternate;
}
.blob-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; background: #c7d2fe; animation-delay: 0s; }
.blob-2 { bottom: -10%; right: -10%; width: 50vw; height: 50vw; background: #fbcfe8; animation-delay: -5s; }
.blob-3 { top: 30%; left: 30%; width: 40vw; height: 40vw; background: #a5f3fc; animation-delay: -10s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33% { transform: translate(50px, -50px) scale(1.1) rotate(10deg); }
    66% { transform: translate(-20px, 20px) scale(0.9) rotate(-5deg); }
    100% { transform: translate(0, 0) scale(1) rotate(0deg); }
}

.glass-overlay {
    position: absolute; inset: 0;
    backdrop-filter: blur(60px);
    background-image: radial-gradient(#94a3b8 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.4;
    z-index: 0;
    pointer-events: none;
}

.header-ui { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
    position: relative; z-index: 10;
    flex-wrap: nowrap; gap: 12px;
}

/* Modern Brand */
.brand { display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.brand-name { 
    font-family: 'Outfit', sans-serif;
    font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: #0f172a;
    display: flex; align-items: center; gap: 10px;
}
.brand-by { font-size: 11px; font-weight: 500; color: #64748b; margin-left: 34px; letter-spacing: -0.2px; }

/* Aspect Ratio Switcher */
.aspect-switcher {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    padding: 6px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    align-self: center;
    position: relative; z-index: 1;
    flex-wrap: wrap; justify-content: center;
}
.aspect-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    color: var(--text-muted);
    transition: 0.2s;
}
.aspect-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.canvas { 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    overflow: auto;
    width: 100%;
    position: relative; z-index: 1;
}

/* Dynamic Grid Container */
#scale-container {
    margin: auto;
    position: relative;
    transition: width 0.1s, height 0.1s;
    display: flex; /* Ensures child centering if needed, though margin:auto handles it */
}

#grid-wrapper { 
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    flex-shrink: 0; 
    /* margin: auto; Removed, handled by scale-container */
    position: relative;
    transform-origin: 0 0; /* Scale from top-left */
    padding-top: 24px; 
    padding-left: 24px;
    background: #fff;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border-radius: 4px;
}
#grid { 
    display: grid; 
    grid-template-columns: repeat(12, 1fr); 
    gap: 1px; 
    background: var(--border); 
    border: 1px solid var(--border); 
    user-select: none; 
    width: 100%;
    height: 100%;
}

/* Aspect Ratio Variations */
.desktop-aspect { width: 864px; height: 496px; }
.mobile-aspect { 
    width: 288px; height: 496px; 
}
.free-aspect { 
    width: 724px; 
    height: 524px; 
    /* resize: both; Removed native resize */
}
#grid-wrapper.free-aspect { transition: none; }

/* New Ratios */
.ratio-16-9 { width: 864px; height: 486px; }
.ratio-4-3 { width: 800px; height: 600px; }
.ratio-1-1 { width: 600px; height: 600px; }
.ratio-9-16 { width: 375px; height: 667px; transform: scale(0.85); transform-origin: top center; }
.ratio-21-9 { width: 864px; height: 370px; }
.long-aspect { width: 864px; height: 2400px; }

.aspect-input {
    width: 36px;
    padding: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 11px;
    text-align: center;
    background: white;
    color: var(--primary);
}
.aspect-input:focus { outline: none; border-color: var(--accent); }
.aspect-input::-webkit-outer-spin-button,
.aspect-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* FIX: Cells now have a light background and subtle border to be visible */
.cell { 
    background: #fff; 
    border: 0.5px solid #f1f5f9;
    cursor: crosshair; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 9px; 
    font-weight: 700; 
    color: #cbd5e1; 
    transition: background 0.1s; 
}

/* Smart Intelligence Cursor */
#smart-cursor {
    position: absolute; pointer-events: none; padding: 6px 12px;
    background: var(--primary); color: white; border-radius: 4px;
    font-size: 10px; font-weight: 800; z-index: 1000; display: none;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transform: translate(10px, 10px);
}

/* Animations & States */
@keyframes blockPop {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes slideRight { from { transform: translateX(-20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes liquid {
    0% { transform: scale(0.6) translateY(20px); opacity: 0; border-radius: 40px; filter: blur(8px); }
    40% { transform: scale(1.05) translateY(-5px); opacity: 0.8; border-radius: 10px; filter: blur(0); }
    70% { transform: scale(0.95) translateY(2px); opacity: 1; border-radius: 4px; }
    100% { transform: scale(1) translateY(0); opacity: 1; border-radius: 0; }
}

.active-block { 
    z-index: 5; 
    animation: blockPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; 
    cursor: pointer !important;
    color: white !important;
}
.active-block:hover { filter: brightness(0.9); }
.preview-selection { background: rgba(99, 102, 241, 0.1) !important; border: 1px dashed var(--accent) !important; }
.conflict-selection { background: rgba(239, 68, 68, 0.1) !important; border: 1px dashed #ef4444 !important; }
.selected-block {
    box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px #64748b, 0 8px 20px -4px rgba(100, 116, 139, 0.4) !important;
    z-index: 10 !important;
}

/* --- Inspector --- */
.inspector { padding: 24px; background: white; display: flex; flex-direction: column; border-left: 1px solid var(--border); overflow-y: auto; }
.output-box { 
    background: var(--code-bg); 
    color: #94a3b8; 
    padding: 20px; 
    border-radius: 8px; 
    min-height: 200px;
    overflow: auto; 
    font-family: 'Fira Code', monospace; 
    font-size: 11px; 
    margin: 20px 0; 
    border: 1px solid #334155; 
    white-space: pre;
    width: 100%;
}

/* Enhanced UI Elements */
button { 
    padding: 10px 16px; 
    border-radius: 8px; 
    font-size: 12px; 
    font-weight: 600; 
    cursor: pointer; 
    border: 1px solid var(--border); 
    background: white; 
    color: var(--text-muted);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    white-space: nowrap;
}
button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
    color: var(--primary);
}
button:active { transform: translateY(0); box-shadow: none; }

button.primary { 
    background: var(--primary); 
    color: white; 
    border: 1px solid var(--primary); 
}
button.primary:hover { 
    background: #222; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.2); 
}

.btn-ai {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%) !important;
    background-size: 200% auto !important;
    color: white !important; 
    border: none !important;
    font-weight: 700 !important;
    position: relative; overflow: hidden;
    transition: all 0.3s ease !important;
}
.btn-ai:hover { background-position: right center !important; box-shadow: 0 8px 20px -4px rgba(124, 58, 237, 0.5); transform: translateY(-2px); }

/* Inputs */
input[type="text"], select { transition: border-color 0.2s, box-shadow 0.2s; }
input[type="text"]:focus, select:focus { outline: none; border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }

/* Modern Range Slider */
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; margin: 8px 0; cursor: pointer; }
input[type=range]:focus { outline: none; }

/* Track */
input[type=range]::-webkit-slider-runnable-track {
    width: 100%; height: 6px; cursor: pointer;
    background: #f1f5f9; border-radius: 99px; border: 1px solid #e2e8f0;
}
input[type=range]::-moz-range-track {
    width: 100%; height: 6px; cursor: pointer;
    background: #f1f5f9; border-radius: 99px; border: 1px solid #e2e8f0;
}

/* Thumb */
input[type=range]::-webkit-slider-thumb {
    height: 18px; width: 18px; border-radius: 50%;
    background: white; border: 1px solid #cbd5e1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: grab; -webkit-appearance: none;
    margin-top: -7px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.1); border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}
input[type=range]:active::-webkit-slider-thumb { cursor: grabbing; transform: scale(0.95); border-color: var(--accent); }

input[type=range]::-moz-range-thumb {
    height: 18px; width: 18px; border: 1px solid #cbd5e1;
    border-radius: 50%; background: white; cursor: grab;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
input[type=range]::-moz-range-thumb:hover {
    transform: scale(1.1); border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Modern AI Bar */
.ai-container {
    display: flex; align-items: center; gap: 6px;
    background: white; padding: 4px 4px 4px 12px; border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%; max-width: 340px; min-width: 200px;
    position: relative; overflow: hidden;
}
.ai-container:focus-within {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}
.ai-input {
    border: none !important; background: transparent !important; padding: 8px 0 !important;
    font-size: 13px !important; width: 100%; color: var(--primary);
    font-weight: 500; box-shadow: none !important;
}
.ai-input::placeholder { color: #94a3b8; font-weight: 400; }

.btn-magic {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    color: white; border: none; border-radius: 8px;
    padding: 8px 16px; font-size: 12px; font-weight: 700;
    cursor: pointer; transition: all 0.3s ease;
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}
.btn-magic:hover { transform: translateY(-1px); box-shadow: 0 6px 15px rgba(99, 102, 241, 0.4); filter: brightness(1.1); }
.btn-magic:active { transform: translateY(0); }
.btn-magic svg { width: 14px; height: 14px; }

/* Generating Animation */
@keyframes gradient-border { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.ai-container.generating {
    border-color: transparent;
    background: linear-gradient(white, white) padding-box, linear-gradient(45deg, #6366f1, #ec4899, #6366f1) border-box;
    border: 1px solid transparent;
    background-size: 200% 200%; animation: gradient-border 2s ease infinite;
}

/* Custom Dropdown */
.custom-dropdown { position: relative; display: inline-block; }
.dropdown-trigger {
    padding: 0 32px 0 12px; height: 39px; 
    border-radius: 8px; 
    border: 1px solid var(--border); 
    cursor: pointer; 
    font-size: 11px; font-weight: 700; 
    color: var(--primary); 
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
    text-transform: uppercase;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    display: flex; align-items: center;
    min-width: 110px;
}
.dropdown-trigger:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-color: #cbd5e1; }

.dropdown-menu {
    position: absolute; top: 100%; left: 0; margin-top: 8px;
    background: white; border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 10px 30px -5px rgba(0,0,0,0.1);
    width: 180px; z-index: 200;
    opacity: 0; transform: translateY(-10px); pointer-events: none;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    padding: 6px;
}
.dropdown-menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.dropdown-item {
    padding: 8px 12px; font-size: 12px; font-weight: 500; color: var(--text-muted);
    border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 8px;
    transition: all 0.1s;
}
.dropdown-item:hover { background: #f1f5f9; color: var(--primary); }
.dropdown-item svg { width: 14px; height: 14px; opacity: 0.5; }

/* Loading Spinner */
.spinner {
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Tabs */
.tab-container { display: flex; gap: 15px; margin-bottom: 0; border-bottom: 1px solid #334155; background: var(--code-bg); padding: 0 20px; border-radius: 8px 8px 0 0; margin-top: 20px; }
.tab-btn { 
    background: none; border: none; border-bottom: 2px solid transparent; 
    padding: 12px 0; font-size: 11px; font-weight: 700; color: #64748b; 
    cursor: pointer; border-radius: 0; box-shadow: none; margin-bottom: -1px;
}
.tab-btn:hover { color: #94a3b8; transform: none; box-shadow: none; border-color: transparent; }
.tab-btn.active { color: #fff; border-bottom-color: var(--accent); }

/* --- Review Modal & Mockups --- */
#review {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.9); backdrop-filter: blur(8px);
    z-index: 2000; padding: 40px; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s ease;
}
#review.open { opacity: 1; }

.mockup-container {
    background: #fff; overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 50px 100px -20px rgba(50,50,93,0.25), 0 30px 60px -30px rgba(0,0,0,0.3);
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    transform: scale(0.95); opacity: 0;
}
#review.open .mockup-container { transform: scale(1); opacity: 1; }

/* Desktop / Free Mockup */
.mockup-container.desktop-view { 
    width: 85vw; 
    aspect-ratio: 16/9; 
    max-height: 85vh; 
    max-width: 1400px; 
    border-radius: 12px; 
    border: 1px solid #e2e8f0; 
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.browser-bar { height: 44px; background: #f1f5f9; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; padding: 0 16px; gap: 16px; }
.address-bar {
    flex: 1; background: white; height: 28px; border-radius: 6px; border: 1px solid #e2e8f0;
    display: flex; align-items: center; padding: 0 12px; font-size: 11px; color: #64748b; gap: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }

/* Mobile Mockup */
.mockup-container.mobile-view { 
    width: auto; height: 85vh; max-height: 812px; 
    aspect-ratio: 375 / 812;
    border-radius: 40px; border: 12px solid #1e293b; 
    position: relative;
}
.mockup-container.mobile-view .browser-bar { display: none; }
/* Notch for Mobile */
.mockup-container.mobile-view::after {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 40%; height: 24px; background: #1e293b;
    border-bottom-left-radius: 16px; border-bottom-right-radius: 16px;
    z-index: 10;
}

/* --- Visual Announcements (Toasts) --- */
#toast-container {
    position: fixed; bottom: 24px; right: 24px; z-index: 3000;
    display: flex; flex-direction: column; gap: 12px; pointer-events: none;
}
.toast {
    background: var(--primary); color: white; padding: 14px 20px;
    border-radius: 8px; font-size: 12px; font-weight: 600;
    box-shadow: 0 10px 30px -5px rgba(0,0,0,0.2);
    animation: toastSlide 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    display: flex; align-items: center; gap: 10px;
    pointer-events: auto; min-width: 240px; border-left: 4px solid var(--accent);
}
.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }

@keyframes toastSlide {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateY(-10px); }
}

/* Enhanced Hover Effects */
.cell:not(.active-block):hover {
    background: #f8fafc;
    box-shadow: inset 0 0 0 1px #cbd5e1;
    z-index: 2;
}
.color-swatch { width: 24px; height: 24px; border-radius: 4px; cursor: pointer; transition: transform 0.1s; border: 2px solid transparent; }
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.active { border-color: var(--primary); transform: scale(1.1); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* Rulers */
.ruler-x {
    position: absolute; top: 0; left: 24px; right: 0; height: 24px;
    display: grid; gap: 1px; padding: 0 1px; /* Match grid border */
    z-index: 20;
}
.ruler-y {
    position: absolute; left: 0; top: 24px; bottom: 0; width: 24px;
    display: grid; gap: 1px; padding: 1px 0; /* Match grid border */
    z-index: 20;
}
.ruler-num {
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; color: var(--text-muted); font-weight: 700;
    background: #f8fafc;
}

/* Size Badge */
#size-badge {
    position: absolute; bottom: 12px; right: 12px;
    background: rgba(15, 23, 42, 0.9); color: white;
    padding: 6px 12px; border-radius: 20px;
    font-size: 11px; font-weight: 600; font-feature-settings: "tnum";
    pointer-events: none; opacity: 0; transition: opacity 0.2s;
    z-index: 40; backdrop-filter: blur(4px); box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.free-aspect #size-badge { opacity: 1; }

/* Custom Resize Handle */
.resize-handle {
    position: absolute; bottom: 0; right: 0;
    width: 20px; height: 20px;
    background: linear-gradient(135deg, transparent 50%, var(--accent) 50%);
    cursor: nwse-resize;
    z-index: 50;
    display: none;
}

/* --- Auth & Subscription UI --- */
.user-auth-area { display: flex; align-items: center; gap: 12px; margin-left: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; border: 2px solid var(--border); object-fit: cover; }
.premium-badge { 
    background: linear-gradient(135deg, #f59e0b, #d97706); color: white; 
    font-size: 9px; padding: 2px 6px; border-radius: 4px; font-weight: 800; 
    text-transform: uppercase; letter-spacing: 0.5px; display: none;
}
.premium-badge.active { display: inline-block; }

/* Subscription Modal */
#sub-modal { 
    display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.8); 
    z-index: 5000; align-items: center; justify-content: center; backdrop-filter: blur(8px); 
    opacity: 0; transition: opacity 0.3s ease;
}
#sub-modal.open { opacity: 1; }
.sub-content { 
    background: white; padding: 40px; border-radius: 24px; width: 90%; max-width: 850px; 
    text-align: center; position: relative; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); 
    transform: scale(0.95); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#sub-modal.open .sub-content { transform: scale(1); }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 40px; }
.plan-card { 
    border: 1px solid var(--border); padding: 32px; border-radius: 16px; 
    transition: 0.3s; cursor: pointer; position: relative; overflow: hidden; text-align: left;
    display: flex; flex-direction: column;
}
.plan-card:hover { border-color: var(--accent); transform: translateY(-8px); box-shadow: 0 20px 40px -5px rgba(99, 102, 241, 0.15); }
.plan-card.featured { border: 2px solid var(--accent); background: #f8fafc; }
.plan-price { font-size: 36px; font-weight: 800; color: var(--primary); margin: 16px 0; display: flex; align-items: baseline; gap: 4px; }
.plan-price span { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.plan-features { margin: 24px 0; list-style: none; flex-grow: 1; }
.plan-features li { margin-bottom: 12px; font-size: 13px; color: #475569; display: flex; gap: 10px; align-items: center; }
.check-icon { color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }

.free-aspect .resize-handle { display: block; }

/* --- Responsive Mobile Design --- */
@media (max-width: 1024px) {
    body { 
        display: flex; flex-direction: column; 
        height: auto; overflow-y: auto; 
        background: #f8fafc;
    }
    
    /* Workspace Adjustments */
    .workspace { 
        width: 100%; height: auto; min-height: 65vh;
        border-right: none; border-bottom: 1px solid var(--border);
        padding: 20px;
        overflow: visible;
    }
    
    /* Header Stacking */
    .header-ui { 
        flex-direction: column; align-items: stretch; gap: 16px; flex-wrap: nowrap;
        margin-bottom: 20px;
    }
    .header-ui > div:last-child { 
        display: flex; flex-wrap: wrap; gap: 10px; width: 100%;
    }
    
    /* Full width elements */
    .ai-container { width: 100%; order: -1; }
    .custom-dropdown { flex-grow: 1; }
    .dropdown-trigger { width: 100%; justify-content: space-between; }
    button { flex-grow: 1; }
    #btn-undo, #btn-redo { flex-grow: 0; width: 44px; }
    
    /* Inspector Adjustments */
    .inspector { 
        width: 100%; height: auto; 
        border-left: none; 
        padding: 30px 20px 80px 20px;
        overflow: visible;
    }
    
    /* Scrollable Aspect Switcher */
    .aspect-switcher {
        width: 100%; justify-content: flex-start;
        overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px;
        -webkit-overflow-scrolling: touch; scrollbar-width: none;
    }
    .aspect-switcher::-webkit-scrollbar { display: none; }
    .aspect-btn { flex-shrink: 0; }
    
    /* Canvas & Grid Scaling */
    .canvas { display: flex; justify-content: center; align-items: flex-start; overflow: visible; }
    #scale-container { transform-origin: top center; margin-top: 10px; }
    
    /* Toast position */
    #toast-container { bottom: 20px; right: 20px; left: 20px; }
    .toast { width: 100%; justify-content: center; }
    .user-auth-area { width: 100%; justify-content: space-between; margin-left: 0; order: -2; }
}