/* ======================
   Component Styles
   ====================== */

/* Archetype Card */
.archetype-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin: 12px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 2px solid transparent;
    animation: fadeIn 0.5s ease-in;
    max-width: 320px;
}

.archetype-card.selected {
    border-color: #6F7B55;
    box-shadow: 0 6px 20px rgba(111, 123, 85, 0.2);
}

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

.archetype-emoji {
    font-size: 32px;
}

.archetype-title {
    flex: 1;
}

.archetype-title h3 {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.archetype-confidence {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.confidence-label {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.confidence-bar {
    position: relative;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.confidence-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Цвета на основе уровня уверенности */
.confidence-fill.level-low {
    background: #ff4444; /* 0-33% - красный */
}

.confidence-fill.level-medium {
    background: #ffa726; /* 34-66% - оранжевый/желтый */
}

.confidence-fill.level-high {
    background: #4caf50; /* 67-100% - зеленый */
}

.confidence-note {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    font-size: 13px;
}

.confidence-note p {
    margin: 0;
    color: #856404;
}

.confidence-segments {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
}

.segment {
    flex: 1;
    border-right: 2px solid rgba(255, 255, 255, 0.3);
}

.segment:last-child {
    border-right: none;
}

.confidence-value {
    font-size: 11px;
    color: #333;
    font-weight: 600;
    text-align: right;
}

/* Animation for confidence fill */
@keyframes fillAnimation {
    0% {
        width: 0%;
    }
    100% {
        width: var(--final-width);
    }
}

.archetype-highlights {
    margin-bottom: 16px;
}

.archetype-reasoning {
    margin-bottom: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #6F7B55;
}

.archetype-reasoning p {
    margin: 0;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

.archetype-highlights h4 {
    font-size: 14px;
    font-weight: 600;
    color: #6F7B55;
    margin-bottom: 8px;
}

.archetype-markers {
    margin-bottom: 16px;
}

.archetype-markers h4 {
    font-size: 14px;
    font-weight: 600;
    color: #6F7B55;
    margin-bottom: 8px;
}

.marker-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.marker-tag {
    background: linear-gradient(135deg, #6F7B55, #556B2F);
    color: white;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.archetype-note {
    margin-top: 12px;
    padding: 8px 12px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
}

.archetype-note p {
    margin: 0;
    font-size: 12px;
    color: #856404;
}

.highlight-list {
    list-style: none;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.highlight-list li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 4px;
}

.highlight-list li::before {
    content: '✨';
    position: absolute;
    left: 0;
    top: 0;
}

.archetype-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    flex: 1;
    text-align: center;
    transition: all 0.2s ease;
}

.btn-accept {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
}

.btn-accept:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.btn-clarify {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.btn-clarify:hover {
    background: #eeeeee;
}

/* Gift Sets Container */
.gift-sets-container {
    margin: 20px 0;
}

.gift-sets-header {
    text-align: center;
    margin-bottom: 20px;
}

.gift-sets-header h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 700;
}

.gift-sets-header p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.gift-sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    max-width: 100%;
}

/* Gift Set Cards */
.gift-set-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: slideUp 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.gift-set-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6F7B55, #556B2F);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.gift-set-card:hover {
    border-color: #6F7B55;
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}

.gift-set-card:hover::before {
    transform: translateX(0);
}

/* Selected gift set card */
.gift-set-card.selected {
    border-color: #4caf50;
    background: linear-gradient(to bottom right, #f0fff4, #ffffff);
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.2);
}

.gift-set-card.selected::before {
    background: linear-gradient(90deg, #4caf50, #2e7d32);
    transform: translateX(0);
}

.selected-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #4caf50;
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: fadeIn 0.3s ease;
}

/* Collapsed gift set cards */
.gift-set-card.collapsed {
    padding: 16px;
    min-height: auto;
    opacity: 0.7;
    transform: scale(0.98);
}

.gift-set-card.collapsed:hover {
    opacity: 0.85;
    transform: scale(0.99) translateY(-2px);
}

.gift-set-card.collapsed .gift-set-header {
    margin-bottom: 0;
}

.collapsed-hint {
    margin-top: 8px;
    text-align: center;
}

.collapsed-hint span {
    font-size: 12px;
    color: #999;
    font-style: italic;
}

.gift-set-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
}

.gift-set-emoji {
    font-size: 32px;
    flex-shrink: 0;
}

.gift-set-info {
    flex: 1;
}

.gift-set-name {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
}

.gift-set-price {
    font-size: 16px;
    font-weight: 600;
    color: #6F7B55;
}

.gift-set-reasoning {
    margin-bottom: 16px;
}

.gift-set-reasoning p {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

.gift-set-products {
    margin-bottom: 16px;
}

.gift-set-products h4 {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-list {
    list-style: none;
    font-size: 13px;
    color: #555;
    margin: 0;
    padding: 0;
}

.product-list li {
    padding: 3px 0;
    position: relative;
    padding-left: 16px;
}

.product-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #4caf50;
    font-weight: bold;
    font-size: 12px;
}

.product-more {
    color: #999;
    font-style: italic;
}

/* Product Grid for Gift Sets */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.product-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.product-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e9ecef;
}

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

.product-name {
    font-size: 10px;
    color: #666;
    line-height: 1.2;
    font-weight: 500;
    max-width: 100%;
    word-wrap: break-word;
    hyphens: auto;
}

.product-more .product-image {
    background: linear-gradient(135deg, #6F7B55, #556B2F);
    color: white;
    font-weight: 600;
    font-size: 12px;
}

.more-indicator {
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.gift-set-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.gift-tag {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #666;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 500;
    border: 1px solid #dee2e6;
}

.gift-set-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.gift-set-rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rating-stars {
    color: #ffc107;
    font-size: 14px;
}

.rating-text {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.gift-set-action {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Pattern Grid */
.pattern-grid {
    display: flex;
    gap: 12px;
    margin: 16px 0;
    max-width: 320px;
    justify-content: center;
}

.pattern-grid .pattern-item {
    flex: 0 0 calc(50% - 6px);
    max-width: 150px;
}

.pattern-item {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
    background: #f5f5f5;
    position: relative;
}

.pattern-item:hover {
    border-color: #6F7B55;
    transform: scale(1.05);
}

.pattern-item.selected {
    border-color: #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.pattern-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pattern-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 12px;
    text-align: center;
    padding: 8px;
}

/* Gift Messages */
.gift-messages-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
    max-width: 320px;
}

.gift-message-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.gift-message-item:hover {
    border-color: #6F7B55;
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(111, 123, 85, 0.15);
}

.gift-message-item .message-text {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    margin-bottom: 8px;
}

.gift-message-item .message-number {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Final Summary Card */
.final-card {
    background: linear-gradient(135deg, #6F7B55, #556B2F);
    color: white;
    border-radius: 16px;
    padding: 24px;
    margin: 16px 0;
    animation: fadeIn 0.5s ease-in;
    max-width: 320px;
}

.final-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    text-align: center;
}

.final-summary {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
    opacity: 0.9;
}

.final-actions {
    display: flex;
    gap: 12px;
}

.btn-white {
    background: white;
    color: #6F7B55;
    border: none;
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    transition: all 0.2s ease;
}

.btn-white:hover {
    background: #f8f8f8;
    transform: translateY(-1px);
}

/* Error States */
.error-card {
    background: #fff3f3;
    border: 2px solid #ffcdd2;
    border-radius: 16px;
    padding: 20px;
    margin: 12px 0;
    animation: fadeIn 0.3s ease-in;
    max-width: 320px;
}

.error-card h3 {
    color: #d32f2f;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-card p {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 16px;
}

.error-actions {
    display: flex;
    gap: 8px;
}

.btn-retry {
    background: #d32f2f;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    flex: 1;
    transition: all 0.2s ease;
}

.btn-retry:hover {
    background: #b71c1c;
}

/* Loading Content */
.loading-content {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 16px 0;
}

.loading-content h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 16px;
}

.loading-content p {
    color: #666;
    margin-bottom: 16px;
    font-size: 14px;
}

/* Loading Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #6F7B55;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* Progress Indicator */
.progress-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 8px 0;
    font-size: 13px;
    color: #666;
}

.progress-steps {
    display: flex;
    gap: 4px;
}

.progress-step {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    transition: all 0.2s ease;
}

.progress-step.active {
    background: #6F7B55;
}

.progress-step.completed {
    background: #4CAF50;
}

/* Action buttons layout */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Responsive Adjustments */
@media (min-width: 768px) {
    .archetype-card,
    .gift-set-card,
    .final-card,
    .error-card {
        max-width: 400px;
    }
    
    .pattern-grid {
        max-width: 400px;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    
    .pattern-cards-grid {
        max-width: 500px;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    
    .gift-sets-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .gift-set-card {
        flex: 0 0 auto;
        width: 300px;
    }
}

@media (min-width: 1024px) {
    .archetype-card,
    .gift-set-card,
    .final-card,
    .error-card {
        max-width: 450px;
    }
    
    .pattern-grid {
        max-width: 450px;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    
    .pattern-cards-grid {
        max-width: 600px;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* ======================
   Pattern Cards (A6 Card Style)
   ====================== */

.pattern-cards-container {
    margin: 20px 0;
    text-align: center;
}

.pattern-cards-container h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.pattern-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto;
}

.pattern-card {
    position: relative;
    aspect-ratio: 3/4; /* A6-like proportions */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.pattern-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.pattern-card.selected {
    border: 2px solid #6F7B55;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(111, 123, 85, 0.3);
}

.pattern-card.selected:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(111, 123, 85, 0.4);
}

.pattern-card-front {
    width: 100%;
    height: 100%;
    position: relative;
}

.pattern-card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.pattern-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pattern-card:hover .pattern-card-overlay {
    opacity: 1;
}

.pattern-select-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.pattern-card:hover .pattern-select-btn {
    transform: scale(1);
}

.pattern-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #999;
    font-size: 12px;
}

/* ======================
   Bot Messages Compact Design
   ====================== */

.bot-message {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 12px;
    margin: 0;
}

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

.bot-header .message-avatar {
    font-size: 16px;
}

.bot-label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bot-text {
    margin: 0;
}

.bot-text p {
    margin: 0;
    line-height: 1.4;
}

.bot-text h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
}

/* Selection Message */
.selection-message {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #e8f5e8;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #4caf50;
}

.selection-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.selection-message p {
    margin: 0;
    color: #2e7d32;
    font-weight: 500;
}

/* ======================
   Step Navigation
   ====================== */

.step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}


/* ======================
   Gift Set Recommendation
   ====================== */

.gift-set-recommendation {
    margin: 20px 0;
}

.recommendation-text h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 8px;
}

.set-intro {
    color: #666;
    font-style: italic;
    margin-bottom: 20px;
}

.product-showcase {
    margin: 20px 0;
}

.product-photos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.product-photo {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    background: #f8f9fa;
}

.product-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.product-photo:hover img {
    transform: scale(1.05);
}

.product-details-list {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
}

.product-details-list h4 {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 16px;
}

.product-description {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.product-description:last-of-type {
    border-bottom: none;
}

.product-name {
    font-weight: 500;
    color: #333;
}

.product-details {
    font-size: 12px;
    color: #999;
}

.set-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 0 0;
    margin-top: 12px;
    border-top: 2px solid #6F7B55;
    font-weight: 600;
}

.total-price {
    color: #6F7B55;
    font-size: 18px;
}

.set-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 16px;
}

.action-button.primary {
    background: #6F7B55;
    color: white;
}

.action-button.primary:hover {
    background: #556B2F;
}

.action-button.secondary {
    background: white;
    color: #6F7B55;
    border: 2px solid #6F7B55;
}

.action-button.secondary:hover {
    background: #fce4ec;
}

@media (min-width: 480px) {
    .set-actions {
        flex-direction: row;
    }
    
    .product-photos-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 400px;
    }
}

@media (min-width: 768px) {
    .product-photos-grid {
        grid-template-columns: repeat(6, 1fr);
        max-width: 600px;
    }
}

/* ======================
   User Photos Message
   ====================== */

.photos-message {
    background: #f0f8ff;
    border-radius: 12px;
    padding: 12px;
    border-left: 4px solid #2196f3;
}

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

.photos-icon {
    font-size: 16px;
}

.photos-count {
    font-size: 14px;
    font-weight: 500;
    color: #1976d2;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
    max-width: 400px;
}

.uploaded-photo-preview {
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: #f5f5f5;
}

.uploaded-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* User messages styling */
.message-user {
    margin-left: auto;
    max-width: 85%;
}

.message-user .message-content {
    background: #e3f2fd;
    border-radius: 12px 12px 4px 12px;
    padding: 12px;
    margin-left: auto;
}

@media (min-width: 480px) {
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

/* ======================
   Card Preview Styles
   ====================== */

.preview-header {
    text-align: center;
    margin-bottom: 20px;
}

.preview-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.preview-format {
    font-size: 14px;
    color: #666;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-hint {
    color: #666;
    font-size: 14px;
    text-align: center;
    margin: 16px 0;
    font-style: italic;
}

/* ======================
   Final Order Summary
   ====================== */

.final-order-summary {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    max-width: 450px;
}

.order-header {
    text-align: center;
    margin-bottom: 24px;
}

.order-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px 0;
}

.order-subtitle {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.order-content {
    margin-bottom: 24px;
}

/* Order Card Preview */
.order-card-preview {
    margin-bottom: 20px;
}

.preview-card-container {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.preview-card-front,
.preview-card-back {
    flex: 1;
    aspect-ratio: 3/4;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
}

.preview-card-front {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.card-pattern-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(111, 123, 85, 0.1), rgba(85, 107, 47, 0.1));
}

.preview-card-back {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.card-greeting-content {
    text-align: center;
    font-size: 10px;
    line-height: 1.2;
}

.greeting-archetype {
    margin-bottom: 8px;
}

.greeting-archetype .archetype-emoji {
    font-size: 16px;
    display: block;
    margin-bottom: 4px;
}

.greeting-archetype h4 {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.greeting-highlights {
    margin-bottom: 8px;
}

.greeting-highlights p {
    margin: 0 0 2px 0;
    color: #555;
    font-size: 9px;
}

.greeting-message {
    margin-bottom: 8px;
}

.greeting-message p {
    margin: 0;
    font-style: italic;
    color: #6F7B55;
    font-size: 9px;
    font-weight: 500;
}

.card-brand {
    font-size: 8px;
    color: #999;
    font-weight: 500;
}

.card-description {
    text-align: center;
    font-size: 12px;
    color: #666;
    margin: 0;
    font-style: italic;
}

/* Order Gift Set */
.order-gift-set h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
}

.gift-set-summary {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
}

.set-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.product-thumb {
    text-align: center;
}

.product-thumb img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 4px;
}

.product-thumb.more-products img {
    display: none;
}

.product-thumb.more-products .more-indicator {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: linear-gradient(135deg, #6F7B55, #556B2F);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-label {
    font-size: 10px;
    color: #666;
    line-height: 1.2;
    display: block;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.set-price-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #dee2e6;
}

.price-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.price-value {
    font-size: 16px;
    color: #6F7B55;
    font-weight: 600;
}

/* Order Total */
.order-total {
    background: #f0f8ff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    border-left: 4px solid #2196f3;
}

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

.total-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.total-amount {
    font-size: 20px;
    font-weight: 700;
    color: #6F7B55;
}

.total-note {
    font-size: 12px;
    color: #666;
    margin: 0;
    font-style: italic;
}

/* Order Actions */
.order-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 480px) {
    .order-actions {
        flex-direction: row;
    }
    
    .set-products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .preview-card-container {
        gap: 16px;
    }
}

/* ======================
   Element Selection UI
   ====================== */

.element-selection-container {
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.element-option {
    background: white;
    border: 2px solid #f1f3f4;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.element-option-header {
    display: flex;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.element-option-header:hover {
    background: #f8f9fa;
}

.element-option.active {
    border-color: #6F7B55;
    box-shadow: 0 2px 8px rgba(111, 123, 85, 0.15);
}

.element-option.active .element-option-header {
    background: #fdf2f8;
}

.element-option-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    transition: all 0.2s ease;
}

.element-option.active .element-option-radio {
    border-color: #6F7B55;
}

.element-option.active .element-option-radio::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    background: #6F7B55;
    border-radius: 50%;
}

.element-option-title {
    flex: 1;
}

.element-option-content {
    padding: 0 16px 16px 48px;
    display: none;
}

.element-option.active .element-option-content {
    display: block;
}

.element-option-title h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.option-description {
    font-size: 14px;
    color: #666;
    margin: 8px 0 16px 0;
}

.element-selection-submit {
    margin-top: 16px;
    text-align: center;
}

.element-selection-submit button {
    background: #6F7B55;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 200px;
}

.element-selection-submit button:hover {
    background: #556B2F;
    transform: translateY(-1px);
}

.element-selection-submit button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.element-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.element-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 16px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.element-card:hover {
    border-color: #6F7B55;
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(111, 123, 85, 0.15);
}

.element-card:active {
    transform: translateY(0);
}

.element-card.selected {
    border-color: #6F7B55;
    background: white;
    box-shadow: 0 4px 12px rgba(111, 123, 85, 0.2);
    transform: translateY(-2px);
}

.element-name {
    font-size: 15px;
    font-weight: 600;
    color: #6F7B55;
    text-align: center;
    line-height: 1.3;
}



/* Custom Prompt Container */
.custom-prompt-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.custom-prompt-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.custom-prompt-input:focus {
    outline: none;
    border-color: #6F7B55;
}

.custom-prompt-input::placeholder {
    color: #999;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .element-cards {
        grid-template-columns: 1fr;
    }
}