:root {
    --panel-bg: rgba(255, 255, 255, 0.85);
    --panel-border: rgba(255, 255, 255, 0.4);
    --panel-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-tertiary: #999;
    --accent: #1a1a1a;
    --border-subtle: rgba(0, 0, 0, 0.08);
    --hover-bg: rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: "JetBrains Mono", monospace;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    background: #fafafa;
}

body.dark-mode {
    background: #171717;
}

#gradient-canvas {
    position: fixed;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0;
}

body.aspect-portrait #gradient-canvas,
body.aspect-square #gradient-canvas {
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Frosted glass panel */
.controls {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 10;
    background: var(--panel-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 24px;
    width: 320px;
    box-shadow: var(--panel-shadow);
    animation: panelIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(10px);
}

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

/* Header with logo */
.panel-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.logo {
    font-family: "JetBrains Mono", monospace;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.tagline {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 400;
    line-height: 1.4;
}

.save-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-tertiary);
    transition:
        color 0.2s,
        background 0.2s;
}

.save-btn:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.save-btn svg {
    width: 18px;
    height: 18px;
}

.mode-section {
    margin-bottom: 24px;
}

/* Aspect ratio toggle */
.aspect-section {
    margin-bottom: 24px;
}

.aspect-toggle {
    display: flex;
    gap: 8px;
}

.aspect-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-tertiary);
    transition:
        background 0.2s,
        border-color 0.2s,
        color 0.2s;
}

.aspect-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
}

.aspect-btn.active {
    background: white;
    border: 2px solid var(--border-subtle);
    color: var(--text-primary);
}

.aspect-btn svg {
    width: 24px;
    height: 24px;
}

.mode-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mode-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    transition: color 0.2s;
}

.mode-toggle:hover svg {
    color: var(--text-secondary);
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 28px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-switch.active {
    background: var(--accent);
}

.toggle-switch::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active::after {
    transform: translateX(20px);
}

/* Section labels */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.section-header .section-label {
    margin-bottom: 0;
}

.section-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-tertiary);
    transition:
        color 0.2s,
        background 0.2s;
}

.section-action:hover {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.05);
}

.section-action:active {
    color: var(--text-primary);
}

.section-action svg {
    width: 14px;
    height: 14px;
}

/* Color grid */
.color-section {
    margin-bottom: 24px;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.color-slot {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
}

.color-swatch {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition:
        transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.2s;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.color-swatch:hover {
    transform: scale(1.05);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.color-swatch:hover .color-actions {
    opacity: 1;
}

.color-actions {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.color-actions button {
    padding: 6px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background 0.15s,
        transform 0.15s;
}

.color-actions button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.color-actions svg {
    width: 14px;
    height: 14px;
}

.empty-slot {
    width: 100%;
    height: 100%;
    border: 2px dashed rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    transition: border-color 0.2s;
}

.add-slot {
    width: 100%;
    height: 100%;
    border: 2px dashed rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        border-color 0.2s,
        background 0.2s,
        transform 0.2s;
}

.add-slot:hover {
    border-color: rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.03);
    transform: scale(1.05);
}

.add-slot svg {
    width: 18px;
    height: 18px;
    color: rgba(0, 0, 0, 0.3);
    transition: color 0.2s;
}

.add-slot:hover svg {
    color: rgba(0, 0, 0, 0.5);
}

/* Color Picker Popup */
.color-picker {
    position: fixed;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.1);
    width: 280px;
    z-index: 100;
    display: none;
    animation: pickerIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.color-picker.open {
    display: block;
}

@keyframes pickerIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.picker-hue-bar {
    position: relative;
    width: 100%;
    height: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    cursor: pointer;
    background: linear-gradient(
        to right,
        hsl(0, 100%, 50%),
        hsl(60, 100%, 50%),
        hsl(120, 100%, 50%),
        hsl(180, 100%, 50%),
        hsl(240, 100%, 50%),
        hsl(300, 100%, 50%),
        hsl(360, 100%, 50%)
    );
}

.picker-hue-handle {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.picker-satval {
    position: relative;
    width: 100%;
    height: 160px;
    border-radius: 8px;
    margin-bottom: 16px;
    cursor: crosshair;
    background:
        linear-gradient(to bottom, transparent, #000),
        linear-gradient(to right, #fff, transparent);
    background-color: hsl(0, 100%, 50%);
}

.picker-satval-handle {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.picker-hex-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

.picker-hex-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
}

.picker-hex-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    font-family: "JetBrains Mono", monospace;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
}

.picker-hex-input:focus {
    border-color: var(--accent);
}

/* Slider section */
.slider-section {
    margin-bottom: 24px;
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.slider-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 40px;
}

.slider-wrapper {
    flex: 1;
    position: relative;
    height: 32px;
    display: flex;
    align-items: center;
}

.slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    outline: none;
    transition: background 0.2s;
}

.slider:hover {
    background: rgba(0, 0, 0, 0.15);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition:
        transform 0.15s,
        box-shadow 0.15s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider-value {
    min-width: 36px;
    text-align: right;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
}

/* Action buttons */
.button-row {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.06);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    transition:
        background 0.2s,
        transform 0.15s;
}

.btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: scale(0.98);
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: #333;
}

/* Dropdown */
.dropdown {
    position: relative;
    flex: 1;
}

.dropdown-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: white;
    border-radius: 14px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 6px;
    display: none;
    z-index: 20;
    animation: dropdownIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.dropdown-menu.open {
    display: block;
}

.dropdown-label {
    padding: 8px 12px 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
}

.dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    border-radius: 10px;
    transition: background 0.15s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    white-space: nowrap;
}

.dropdown-item:hover {
    background: var(--hover-bg);
}

.dropdown-item-highlight {
    background: linear-gradient(
        135deg,
        rgba(255, 200, 50, 0.15),
        rgba(255, 150, 50, 0.1)
    );
    font-weight: 600;
}

.dropdown-item-highlight:hover {
    background: linear-gradient(
        135deg,
        rgba(255, 200, 50, 0.25),
        rgba(255, 150, 50, 0.18)
    );
}

.dropdown-item-icon {
    width: 14px;
    height: 14px;
    color: #e6a700;
    flex-shrink: 0;
    margin-right: 6px;
}

.dropdown-item span {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 400;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 6px 0;
}

/* Keyboard hint */
.hint {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--panel-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--panel-border);
    padding: 14px 18px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--panel-shadow);
    animation: hintIn 0.6s 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(10px);
    transition: bottom 0.3s ease;
    z-index: 5;
}

.hint.footer-visible {
    bottom: 140px;
}

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

.hint-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.hint-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.hint-divider {
    width: 1px;
    height: 16px;
    background: var(--border-subtle);
    margin: 0 4px;
}

/* Saved Gradients Footer */
.saved-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--panel-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--panel-border);
    padding: 16px 24px;
    z-index: 10;
    display: none;
}

.saved-footer.has-items {
    display: block;
    animation: footerIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.saved-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.saved-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
}

.clear-all-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-tertiary);
    opacity: 0.6;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition:
        color 0.2s,
        background 0.2s;
}

.clear-all-btn:hover {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.05);
}

.saved-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.saved-list::-webkit-scrollbar {
    height: 6px;
}

.saved-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.saved-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

.saved-item {
    position: relative;
    flex-shrink: 0;
    width: 80px;
    height: 50px;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.saved-item canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.saved-item-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition:
        opacity 0.2s,
        background 0.15s;
}

.saved-item:hover .saved-item-delete {
    opacity: 1;
}

.saved-item-delete:hover {
    background: rgba(0, 0, 0, 0.7);
}

.saved-item-delete svg {
    width: 12px;
    height: 12px;
    color: white;
}

/* Payment Modal */
.payment-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.payment-overlay.open {
    display: flex;
}

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

.payment-modal {
    background: white;
    border-radius: 24px;
    width: 400px;
    max-width: 90vw;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

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

.payment-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition:
        background 0.15s,
        transform 0.15s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.payment-close:hover {
    background: white;
    transform: scale(1.05);
}

.payment-close svg {
    width: 18px;
    height: 18px;
    color: var(--text-primary);
}

.payment-preview {
    width: 100%;
    height: 200px;
    background: #f0f0f0;
}

.payment-preview canvas {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.payment-content {
    padding: 28px;
    text-align: center;
}

.payment-title {
    font-family: "JetBrains Mono", monospace;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.payment-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

.payment-price {
    font-family: "JetBrains Mono", monospace;
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.payment-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: var(--accent);
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    outline: none;
    transition:
        background 0.2s,
        transform 0.15s;
}

.payment-btn:hover {
    background: #333;
}

.payment-btn:active {
    transform: scale(0.98);
}

.payment-btn svg {
    width: 18px;
    height: 18px;
}

.payment-note {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 16px;
}

/* Mobile elements - hidden on desktop */
.mobile-toolbar,
.mobile-share-btn {
    display: none;
}

/* Mobile styles */
@media (max-width: 768px) {
    /* Hide keyboard hints on mobile */
    .hint {
        display: none !important;
    }

    /* Mobile floating share button - top right */
    .mobile-share-btn {
        display: flex;
        position: fixed;
        top: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
        align-items: center;
        justify-content: center;
        background: var(--accent);
        border: none;
        border-radius: 16px;
        cursor: pointer;
        color: white;
        z-index: 15;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
        transition:
            transform 0.2s,
            box-shadow 0.2s;
    }

    .mobile-share-btn:active {
        transform: scale(0.92);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .mobile-share-btn svg {
        width: 24px;
        height: 24px;
    }


    /* Mobile toolbar */
    .mobile-toolbar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 20px 24px calc(20px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-radius: 28px 28px 0 0;
        align-items: center;
        justify-content: center;
        z-index: 15;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
    }

    .mobile-toolbar.hidden {
        transform: translateY(100%);
    }

    .mobile-handle {
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 32px;
        height: 4px;
        background: rgba(0, 0, 0, 0.1);
        border-radius: 2px;
    }

    .mobile-colors {
        display: flex;
        gap: 12px;
    }

    .mobile-color {
        width: 52px;
        height: 52px;
        border-radius: 16px;
        flex-shrink: 0;
        box-shadow:
            0 2px 8px rgba(0, 0, 0, 0.12),
            inset 0 0 0 1px rgba(0, 0, 0, 0.05);
        transition:
            transform 0.15s ease,
            box-shadow 0.15s ease;
    }

    .mobile-color:active {
        transform: scale(0.92);
        box-shadow:
            0 1px 4px rgba(0, 0, 0, 0.1),
            inset 0 0 0 1px rgba(0, 0, 0, 0.05);
    }

    .mobile-shuffle-btn {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        cursor: pointer;
        color: var(--text-secondary);
        transition:
            color 0.2s,
            transform 0.15s;
        position: absolute;
        right: 20px;
    }

    .mobile-shuffle-btn:active {
        transform: scale(0.88);
        color: var(--text-primary);
    }

    .mobile-shuffle-btn svg {
        width: 26px;
        height: 26px;
    }

    /* Hide main controls by default, show when expanded */
    .controls {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 28px 28px 0 0;
        padding: 24px 24px calc(28px + env(safe-area-inset-bottom));
        max-height: 70vh;
        overflow-y: auto;
        transform: translateY(100%);
        opacity: 1;
        animation: none;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 20;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);
    }

    .controls.expanded {
        transform: translateY(0);
    }

    /* Drag handle */
    .controls::before {
        content: "";
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(0, 0, 0, 0.12);
        border-radius: 2px;
    }

    /* Hide color section label on mobile */
    .color-section .section-label {
        display: none;
    }

    .color-section {
        margin-bottom: 24px;
    }

    .panel-header {
        padding-top: 8px;
    }

    /* Hide aspect toggle on mobile */
    .aspect-section {
        display: none;
    }

    /* Simplified color grid for mobile - single row of 4 */
    .color-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .color-slot {
        aspect-ratio: 1;
    }

    .color-swatch {
        border-radius: 16px;
    }

    /* Hide empty slots on mobile */
    .color-slot:nth-child(n + 5) {
        display: none;
    }

    /* Hide save button on mobile */
    .save-btn {
        display: none;
    }

    /* Hide panel header on mobile */
    .panel-header {
        display: none;
    }

    /* Hide dropdown menu on mobile - direct download */
    .dropdown-menu {
        display: none !important;
    }

    /* Hide button row in drawer on mobile */
    .button-row {
        display: none;
    }

    /* Compact section labels */
    .section-label {
        font-size: 10px;
        margin-bottom: 10px;
    }

    /* Compact mode section */
    .mode-section {
        margin-bottom: 20px;
    }

    /* Compact slider section */
    .slider-section {
        margin-bottom: 20px;
    }

    .slider-label {
        font-size: 12px;
        min-width: 36px;
    }

    .slider-value {
        font-size: 11px;
        min-width: 32px;
    }

    /* Compact buttons */
    .button-row {
        gap: 8px;
    }

    .btn {
        padding: 14px 16px;
        font-size: 13px;
        border-radius: 14px;
    }

    /* Full width canvas on mobile */
    #gradient-canvas {
        border-radius: 0 !important;
        box-shadow: none !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
    }

    body {
        overflow: hidden;
        background: #fafafa;
    }

    body.dark-mode {
        background: #171717;
    }

    html {
        overflow: hidden;
    }

    /* Adjust saved footer for mobile */
    .saved-footer {
        padding: 12px 16px;
    }

    .saved-item {
        width: 60px;
        height: 38px;
    }

    /* Payment modal mobile */
    .payment-modal {
        width: 100%;
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        position: fixed;
        bottom: 0;
        max-height: 90vh;
    }

    /* Color picker mobile - position above toolbar */
    .color-picker {
        bottom: calc(100px + env(safe-area-inset-bottom)) !important;
        top: auto !important;
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
        max-width: none;
    }
}
