.editor-main {
    height: calc(100vh - 80px);
    overflow: hidden;
    background: #f5f7fa;
}

.editor-mobile-tabs {
    display: none;
}

.editor-layout {
    display: flex;
    height: 100%;
    background: white;
}

.editor-sidebar {
    width: 420px;
    background: #fff6f6;
    border-right: 1px solid rgba(168, 216, 234, 0.3);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.sidebar-header h2 {
    font-size: 1.3rem;
    color: #475569;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(168, 216, 234, 0.3);
    background: #fafafa;
    flex-shrink: 0;
}

.editor-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    overflow: hidden;
}

.preview-header h3 {
    font-size: 1.2rem;
    color: #475569;
}

.preview-container {
    position: relative;
    height: 100%;
    width: 100%;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    padding: 40px;
    display: block;
    scroll-behavior: smooth;
    scroll-padding-bottom: 35vh;
    box-sizing: border-box;
}

.preview-container .preview-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: repeat;
    pointer-events: none;
    z-index: 1;
}

.preview-container .preview-content-layer {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 2;
    background: transparent;
}

.invitation-card {
    width: 500px;
    min-width: 500px;
    max-width: 500px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background: white;
    transition: all 0.3s;
    transform-origin: center top;
    overflow: visible;
}

.invitation-card.clip-decorations {
    overflow: hidden;
}

.card-header,
.card-footer {
    text-align: center;
    margin-bottom: 1rem;
}

.card-footer {
    margin-top: 1rem;
    margin-bottom: 0;
}

.event-type {
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0.5rem 0;
}

.card-body {
    text-align: center;
}

.names {
    margin: 0.5rem 0;
    line-height: 1.2;
    font-weight: normal;
}

.greeting {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    font-style: italic;
}

.details p {
    margin: 0.3rem 0;
    font-size: 1.1rem;
}

.place {
    font-weight: 600;
    margin-top: 0.5rem;
}

.message {
    margin-top: 2rem;
    font-size: 1rem;
    line-height: 1.5;
    white-space: pre-line;
}

.card-header,
.card-body,
.card-footer,
.event-type,
.names,
.greeting,
.details,
.message,
.card-header *,
.card-body *,
.card-footer * {
    position: relative;
    z-index: 10;
}

.accordion-item {
    border: 1px solid rgba(168, 216, 234, 0.3);
    border-radius: 12px;
    margin-bottom: 0.8rem;
    overflow: hidden;
    background: white;
}

.accordion-header {
    width: 100%;
    padding: 0.5rem;
    background: #f8fafc;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
}

.accordion-header:hover {
    background: #edf2f7;
}

.accordion-content {
    padding: 1.2rem;
    background: white;
    border-top: 1px solid rgba(168, 216, 234, 0.3);
    max-height: 1400px;
    overflow-y: auto;
}

.accordion-item:not(.active) .accordion-content {
    display: none;
}

.setting-group {
    margin-bottom: 0.2rem;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 0.4rem;
}

.setting-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 500;
}

.setting-group input[type="text"],
.setting-group input[type="number"],
.setting-group select,
.setting-group textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.7rem;
}

.setting-group input[type="range"] {
    width: 100%;
}

.setting-group input[type="color"] {
    width: 30%;
    height: 80px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
}

.setting-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin-right: 0.5rem;
}

.setting-group textarea {
    min-height: 80px;
    resize: vertical;
}

.text-format-row {
    display: flex;
    gap: 0.5rem;
    margin: 0.5rem 0;
    flex-wrap: wrap;
}

.text-format-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.2s;
}

.text-format-btn.active {
    background: #A8D8EA;
    border-color: #A8D8EA;
    color: white;
}

.text-format-btn:hover {
    background: #f0f9ff;
}

.text-format-select {
    flex: 1;
    min-width: 150px;
}

.size-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.size-control input[type="range"] {
    flex: 1;
}

.size-control span {
    min-width: 40px;
    text-align: right;
}

.pattern-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.2rem 0.7rem;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    background: white;
    color: #475569;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    flex: 1 1 auto;
    min-width: 50px;
}

.filter-btn:hover {
    background: #f0f9ff;
    border-color: #A8D8EA;
}

.filter-btn.active {
    background: linear-gradient(135deg, #A8D8EA, #FAC0C0);
    color: #475569;
    font-weight: 400;
    border-color: transparent;
}

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.2rem;
    margin-top: 0.5rem;
}

.pattern-item {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    background-size: cover;
    background-repeat: repeat;
    transition: all 0.2s;
}

.pattern-item:hover {
    transform: scale(1.05);
}

.pattern-item.selected {
    border-color: #A8D8EA;
    box-shadow: 0 0 0 2px #A8D8EA;
}

.scrollable-grid {
    max-height: 350px;
    overflow-y: auto;
    padding: 0.5rem;
    background: #e6f3ff;
    border-radius: 8px;
}

.color-presets {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.color-preset {
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.color-preset:hover {
    transform: scale(1.1);
    border-color: #A8D8EA;
}

.color-preset.selected {
    border-color: #A8D8EA;
    box-shadow: 0 0 0 2px #A8D8EA;
}

.slug-input {
    margin-top: 0.3rem;
}

.slug-input label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.7rem;
    color: #94a3b8;
}

.slug-input input {
    width: 100%;
    padding: 0.3rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
}

.animation-colors {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 8px;
}

.animation-colors label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #475569;
    cursor: pointer;
}

.animation-colors input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.message-line {
    display: block;
    width: 100%;
    text-align: center;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message-line-decor {
    display: block;
    width: 430px;
    height: 2px;
    background: currentColor;
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.3s;
}

.glow-controls {
    margin-top: 1rem;
    padding: 0.2rem 1rem 1rem 0.2rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #A8D8EA;
}

.glow-controls .setting-group {
    border-bottom: none;
    padding-bottom: 0;
}


.btn .spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

.user-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.user-notification-success {
    background: #4CAF50;
    color: white;
}

.user-notification-error {
    background: #F44336;
    color: white;
}

.user-notification-warning {
    background: #FF9800;
    color: white;
}

.user-notification-info {
    background: #2196F3;
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.decor-library-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-height: 350px;
    overflow-y: auto;
    padding: 0.5rem;
    background: #e6f3ff;
    border-radius: 8px;
}

.decor-library-item {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: white;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.decor-library-item:hover {
    transform: scale(1.05);
    border-color: #A8D8EA;
}

.decor-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.decor-list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.decor-list-item:hover {
    background: #f0f9ff;
}

.decor-list-item.active {
    border-color: #A8D8EA;
    background: #e6f3ff;
}

.decor-list-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #f0f0f0;
    flex-shrink: 0;
}

.decor-list-info {
    flex: 1;
    font-size: 0.9rem;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.decor-list-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.decor-list-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: all 0.2s;
}

.decor-list-btn:hover {
    background: #f0f0f0;
    color: #475569;
}

.decor-list-btn.delete:hover {
    background: #fee2e2;
    color: #ef4444;
}

.decor-controls {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #A8D8EA;
}

.decor-rotation-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.decor-rotate-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.decor-rotate-btn:hover {
    background: #A8D8EA;
    color: white;
}

.decor-angle {
    font-size: 1.1rem;
    font-weight: 600;
    color: #475569;
    min-width: 50px;
    text-align: center;
}

.invitation-decor {
    position: absolute;
    pointer-events: none;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: all 0.1s;
    z-index: 5;
}

.invitation-decor.above-text {
    z-index: 20;
}

.color-palette-container {
    position: relative;
    margin-bottom: 20px;
}

#colorPalette {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    cursor: crosshair;
}

.color-preview-current {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.color-history {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.color-history-item {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.color-history-item:hover {
    transform: scale(1.1);
    border-color: #A8D8EA;
}

.text-block {
    position: absolute;
    pointer-events: none;
    transition: all 0.1s;
    z-index: 5;
    line-height: 1.4;
    word-wrap: break-word;
    box-sizing: border-box;
}

.text-block.above-text {
    z-index: 25;
}

.text-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 500px;
    overflow-y: auto;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.text-list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.text-list-item:hover {
    background: #f0f9ff;
}

.text-list-item.active {
    border-color: #A8D8EA;
    background: #e6f3ff;
}

.text-list-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.text-list-preview {
    font-size: 0.9rem;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-list-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.text-list-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: all 0.2s;
}

.text-list-btn:hover:not(:disabled) {
    background: #f0f0f0;
    color: #475569;
}

.text-list-btn.delete:hover:not(:disabled) {
    background: #fee2e2;
    color: #ef4444;
}

.text-list-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.text-controls {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #A8D8EA;
}

.mobile-text-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    border-top: 1px solid rgba(168, 216, 234, 0.3);
    max-height: 45vh;
    overflow-y: visible;
}

.mobile-text-panel.active {
    transform: translateY(0);
}

.mobile-text-panel-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #A8D8EA, #FAC0C0);
    border-radius: 16px 16px 0 0;
    color: #475569;
    font-weight: 600;
    gap: 6px;
    font-size: 13px;
    flex-shrink: 0;
}

.mobile-text-panel-header span:first-child {
    font-size: 18px;
}

.mobile-text-panel-header span:nth-child(2) {
    flex: 1;
}

.mobile-text-close {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
}

.mobile-text-panel-content {
    padding: 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: white;
    max-height: calc(45vh - 45px);
}

.mobile-text-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mobile-text-left,
.mobile-text-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-text-control {
    margin-bottom: 0;
}

.mobile-text-control label {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.mobile-text-control input[type="text"],
.mobile-text-control select,
.mobile-text-control input[type="color"] {
    width: 100%;
    padding: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    background: white;
    height: 32px;
}

.mobile-text-control textarea {
    width: 100%;
    padding: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    background: white;
    min-height: 60px;
    resize: vertical;
}

.mobile-text-control input[type="color"] {
    height: 32px;
    padding: 2px;
}

.mobile-text-control-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
    font-size: 11px;
    color: #475569;
}

.mobile-text-control-header span:last-child {
    color: #A8D8EA;
    font-weight: 600;
}

.mobile-text-control input[type="range"] {
    width: 100%;
    height: 4px;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(90deg, #A8D8EA, #FAC0C0);
    border-radius: 2px;
    outline: none;
}

.mobile-text-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    border: 2px solid #A8D8EA;
    cursor: pointer;
    margin-top: -5px;
}

.mobile-text-row {
    display: flex;
    gap: 6px;
}

.mobile-text-format-btn {
    flex: 1;
    padding: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    min-height: 32px;
}

.mobile-text-format-btn.active {
    background: #A8D8EA;
    border-color: #A8D8EA;
    color: white;
}

.mobile-text-checkboxes {
    background: #f8fafc;
    padding: 6px;
    border-radius: 6px;
    margin: 2px 0;
}

.mobile-text-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 11px;
}

.mobile-text-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #A8D8EA;
}

.mobile-text-actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.mobile-text-btn {
    flex: 1;
    padding: 6px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    min-height: 36px;
}

.mobile-text-btn-delete {
    background: #fee2e2;
    color: #ef4444;
}

.mobile-text-btn-done {
    background: linear-gradient(135deg, #A8D8EA, #FAC0C0);
    color: #475569;
}

@media (max-width: 768px) {
    body {
        padding-top: 0;
        margin: 0;
        overflow: hidden;
    }

    .navbar {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: white;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        transition: display 0.3s;
    }

    .editor-mobile-tabs {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        top: 70px;
        z-index: 999;
        background: white;
        border-bottom: 1px solid rgba(168, 216, 234, 0.3);
        border-top: 1px solid rgba(168, 216, 234, 0.3);
        padding: 0.5rem;
        gap: 0.5rem;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
        margin: 0;
        transition: top 0.3s ease;
    }

    .mobile-tab {
        flex: 1;
        padding: 0.75rem;
        border: none;
        background: #f0f2f5;
        border-radius: 30px;
        font-weight: 600;
        color: #94a3b8;
        cursor: pointer;
        font-size: 0.9rem;
        transition: all 0.2s;
        min-height: 44px;
    }

    .mobile-tab.active {
        background: linear-gradient(135deg, #A8D8EA, #FAC0C0);
        color: #475569;
        font-weight: 700;
    }

    .editor-main {
        height: calc(100vh - 70px - 60px);
        margin-top: 60px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .editor-layout {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        min-height: 0;
    }

    .editor-sidebar {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        min-height: 0;
    }

    .editor-sidebar.hidden {
        display: none;
    }

    .sidebar-content {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1rem 5rem 1rem 0rem;
        min-height: 0;
    }

    .sidebar-footer {
        padding: 0.4rem;
        flex-shrink: 0;
        display: block;
        margin-bottom: 75px;
    }

    .editor-preview {
        width: 100%;
        height: 100%;
        display: block;
        overflow: hidden;
        position: relative;
    }

    .editor-preview.hidden {
        display: none;
    }

    .preview-container {
        height: 100%;
        width: 100%;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        padding: 20px 10px 40px;
        display: block;
        position: relative;
        scroll-behavior: smooth;
        scroll-padding-bottom: 35vh;
        box-sizing: border-box;
    }

    .invitation-card {
        width: 500px;
        min-width: 500px;
        max-width: 500px;
        position: absolute;
        left: 50%;
        top: 20px;
        transform-origin: center top;
        margin: 0;
    }

    .preview-content-layer {
        display: block !important;
        height: auto !important;
        min-height: 100%;
        width: 100%;
        position: relative;
        z-index: 2;
    }

    .mobile-decor-panel.active~.editor-preview .preview-container {
        padding-bottom: 35vh;
    }

    .color-presets {
        gap: 0.4rem;
        grid-template-columns: repeat(6, 1fr);
    }

    .color-preset {
        width: 35px;
        height: 35px;
        border-radius: 6px;
    }

    .color-preset:hover,
    .pattern-item:hover {
        transform: none;
    }

    .pattern-filters {
        overflow-x: auto;
        flex-wrap: wrap;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }

    .filter-btn {
        flex: 0 0 auto;
        min-height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .setting-group input[type="range"] {
        height: 10px;
        padding: 0;
    }

    .setting-group input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    .btn {
        min-height: 30px;
        padding: 0.4rem 0.5rem;
    }

    .slug-input input {
        min-height: 30px;
        font-size: 15px;
    }

    .accordion-content {
        max-height: 1500px;
        padding: 1rem;
    }

    .setting-group textarea {
        min-height: 250px;
        font-size: 12px;
    }

    .text-format-btn {
        width: 35px;
        height: 35px;
    }

    .animation-colors {
        grid-template-columns: 1fr;
    }

    .animation-colors label {
        min-height: 24px;
    }

    .animation-colors input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    .message-line-decor {
        width: 80%;
    }

    .decor-library-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .decor-list-thumb {
        width: 35px;
        height: 35px;
    }

    .decor-list-btn {
        width: 28px;
        height: 28px;
    }

    .decor-rotate-btn {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    .color-presets {
        grid-template-columns: repeat(6, 1fr);
    }

    .mobile-decor-panel-content {
        padding: 5px;
    }

    .mobile-decor-grid {
        gap: 8px;
    }

    .mobile-decor-rotate-btn {
        width: 35px;
        height: 35px;
    }

    .decor-library-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .decor-controls {
        display: none !important;
    }

    .mobile-decor-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
        border-top: 1px solid rgba(168, 216, 234, 0.3);
        max-height: 35vh;
        overflow-y: visible;
    }

    .mobile-decor-panel.active {
        transform: translateY(0);
    }

    .mobile-decor-panel-header {
        display: flex;
        align-items: center;
        padding: 8px 12px;
        background: linear-gradient(135deg, #A8D8EA, #FAC0C0);
        border-radius: 16px 16px 0 0;
        color: #475569;
        font-weight: 600;
        gap: 6px;
        font-size: 13px;
        flex-shrink: 0;
    }

    .mobile-decor-panel-header span:first-child {
        font-size: 18px;
    }

    .mobile-decor-panel-header span:nth-child(2) {
        flex: 1;
    }

    .mobile-decor-close {
        background: none;
        border: none;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #475569;
    }

    .mobile-decor-close span {
        font-size: 18px;
    }

    .mobile-decor-panel-content {
        padding: 10px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: white;
        display: flex;
        flex-direction: column;
        gap: 8px;
        max-height: calc(35vh - 50px);
    }

    .mobile-decor-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .mobile-decor-left {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mobile-decor-right {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mobile-decor-control {
        margin-bottom: 0;
    }

    .mobile-decor-control-header {
        display: flex;
        justify-content: space-between;
        margin-bottom: 2px;
        font-size: 10px;
        color: #475569;
    }

    .mobile-decor-control-header span:first-child {
        font-weight: 500;
    }

    .mobile-decor-control-header span:last-child {
        color: #A8D8EA;
        font-weight: 600;
        font-size: 10px;
    }

    .mobile-decor-control input[type="range"] {
        width: 100%;
        height: 4px;
        appearance: none;
        -webkit-appearance: none;
        background: linear-gradient(90deg, #A8D8EA, #FAC0C0);
        border-radius: 2px;
        outline: none;
    }

    .mobile-decor-control input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 14px;
        height: 14px;
        background: white;
        border-radius: 50%;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
        border: 2px solid #A8D8EA;
        cursor: pointer;
        margin-top: -5px;
    }

    .mobile-decor-rotation {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 4px;
        margin-top: 2px;
    }

    .mobile-decor-rotate-btn {
        width: 40px;
        height: 40px;
        border: 1px solid #e2e8f0;
        background: white;
        border-radius: 8px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #475569;
        flex-shrink: 0;
    }

    .mobile-decor-rotate-btn:active {
        background: #A8D8EA;
        color: white;
    }

    .mobile-decor-rotate-btn span {
        font-size: 18px;
    }

    .mobile-decor-angle-display {
        font-size: 14px;
        font-weight: 600;
        color: #475569;
        min-width: 40px;
        text-align: center;
        background: #f8fafc;
        padding: 8px 0;
        border-radius: 6px;
        flex: 1;
    }

    .mobile-decor-checkboxes {
        background: #f8fafc;
        padding: 8px;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .mobile-decor-checkbox {
        display: flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        font-size: 11px;
    }

    .mobile-decor-checkbox input[type="checkbox"] {
        width: 16px;
        height: 16px;
        cursor: pointer;
        accent-color: #A8D8EA;
        margin: 0;
    }

    .mobile-decor-checkbox span {
        font-size: 11px;
        color: #475569;
    }

    .mobile-decor-actions {
        display: flex;
        gap: 6px;
        margin-top: 4px;
    }

    .mobile-decor-btn {
        flex: 1;
        padding: 8px 4px;
        border: none;
        border-radius: 6px;
        font-weight: 600;
        font-size: 11px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        cursor: pointer;
        min-height: 36px;
    }

    .mobile-decor-btn-delete {
        background: #fee2e2;
        color: #ef4444;
    }

    .mobile-decor-btn-delete span {
        font-size: 16px;
    }

    .mobile-decor-btn-done {
        background: linear-gradient(135deg, #A8D8EA, #FAC0C0);
        color: #475569;
    }

    .mobile-decor-btn-done span {
        font-size: 16px;
    }
}

@media (min-width: 769px) {

    .mobile-decor-panel,
    .mobile-decor-overlay,
    .mobile-text-panel {
        display: none !important;
    }
}