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

body {
    background-color: var(--site-body-bg);
    color: var(--site-text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: var(--site-body-bg-image, none);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.container {
    display: flex;
    justify-content: center;
    flex: 1;
    background: transparent;
}

/* Main Preview Area - Centered */
.preview-panel {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

/* Design Prompt Input Area - Centered */
.prompt-input-area {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.prompt-input-area h3 {
    margin: 0 0 0.75rem 0;
    color: #1a3a5c;
    font-size: 1rem;
    font-weight: 600;
}

.prompt-textarea-wrapper {
    position: relative;
}

.prompt-textarea {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fafbfc;
    color: #1a3a5c;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.prompt-textarea:focus {
    outline: none;
    border-color: #1a3a5c;
    box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.1);
    background: #ffffff;
}

.prompt-textarea::placeholder {
    color: #999;
}

.prompt-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn-generate {
    background: var(--site-accent-gradient);
    color: #ffffff;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-generate:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.btn-generate:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-generate svg {
    width: 20px;
    height: 20px;
}

.btn-cancel {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #ffffff;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-cancel:hover {
    background: linear-gradient(135deg, #e04555 0%, #dc3545 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

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

.btn-cancel svg {
    width: 20px;
    height: 20px;
}

.char-count {
    font-size: 0.75rem;
    color: #999;
    text-align: right;
    margin-top: 0.5rem;
}

.prompt-suggestions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
}

.suggestions-label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

.suggestion-chip {
    background: #f0f4f8;
    border: 1px solid #d0d7de;
    color: var(--site-text-color);
    padding: 0.4rem 0.75rem;
    border-radius: 16px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-chip:hover {
    background: #e1e8ed;
    border-color: var(--site-accent);
    transform: translateY(-1px);
}

.suggestion-chip:active {
    transform: translateY(0);
}

/* Style Selector (Prompt Selection) */
.style-selector {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.style-label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

.style-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #f0f4f8;
    border: 2px solid #d0d7de;
    color: var(--site-text-color);
    padding: 0.4rem 0.75rem;
    border-radius: 16px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.style-chip input[type="radio"] {
    display: none;
}

.style-chip:hover {
    background: #e1e8ed;
    border-color: var(--site-accent);
}

.style-chip.active {
    background: var(--site-accent);
    border-color: var(--site-accent);
    color: white;
}

.style-chip.active .style-price {
    color: rgba(255, 255, 255, 0.9);
}

.style-price {
    font-size: 0.7rem;
    color: #2e7d32;
    font-weight: 600;
}

/* Refinement Input Area - Inside Image Container */
.refinement-area {
    grid-column: 1 / -1;
    background: #ffffff;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.refinement-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.refinement-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fafbfc;
    color: #1a3a5c;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.refinement-input:focus {
    outline: none;
    border-color: #1a3a5c;
    box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.1);
    background: #ffffff;
}

.refinement-input::placeholder {
    color: #999;
}

.btn-refine {
    background: var(--site-accent-gradient);
    color: #ffffff;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-refine:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.btn-refine:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

.refinement-hint {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.5rem;
    text-align: center;
}

.image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
    border-radius: 8px;
    min-height: 250px;
    position: relative;
    border: 1px solid #e0e0e0;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.image-placeholder {
    color: #999;
    text-align: center;
}

.image-placeholder .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.generation-meta {
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: #666;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.order-button-container {
    margin-top: 0.75rem;
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-order {
    background: linear-gradient(135deg, #28a745 0%, #20863d 100%);
    color: #ffffff;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-order:hover {
    background: linear-gradient(135deg, #34ce57 0%, #28a745 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

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

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

.btn-update {
    background: linear-gradient(135deg, #1a3a5c 0%, #2a4a6c 100%);
    color: #ffffff;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-update:hover {
    background: linear-gradient(135deg, #2a4a6c 0%, #3a5a7c 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(26, 58, 92, 0.3);
}

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

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


/* Timeline */
.timeline {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    overflow-x: auto;
    background: #f0f2f5;
    border-radius: 8px;
    margin-top: 0.5rem;
    border: 1px solid #e0e0e0;
}

.timeline-item {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.timeline-item:hover {
    border-color: #1a3a5c;
}

.timeline-item.active {
    border-color: #1a3a5c;
}

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

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #1a3a5c;
    color: #ffffff;
}

.btn-primary:hover {
    background: #2a4a6c;
}

.btn-primary:disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
}

.btn-secondary {
    background: #e0e0e0;
    color: #1a3a5c;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* Loading State - Button */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Loading Overlay - Image Container */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top-color: #1a3a5c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 1rem;
    color: #1a3a5c;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.loading-subtext {
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.75rem;
}

/* Central Loading - Creative Jersey Spinner */
.central-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    min-width: 280px;
}

.jersey-loader {
    position: relative;
    width: 100px;
    height: 100px;
}

.jersey-loader .ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid transparent;
}

.jersey-loader .ring:nth-child(1) {
    border-top-color: #1a3a5c;
    animation: spin 1.2s linear infinite;
}

.jersey-loader .ring:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-right-color: #28a745;
    animation: spin 1.5s linear infinite reverse;
}

.jersey-loader .ring:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-bottom-color: #ffc107;
    animation: spin 1s linear infinite;
}

.jersey-loader .center-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    animation: pulse 1.5s ease-in-out infinite;
}

.central-loading-text {
    margin-top: 1.5rem;
    color: #1a3a5c;
    font-size: 1rem;
    font-weight: 600;
}

.central-loading-subtext {
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.85rem;
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
    margin-left: 4px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background: #1a3a5c;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

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

@keyframes pulse {
    0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.7; transform: translate(-50%, -50%) scale(0.9); }
}

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
}

/* Status Messages */
.status {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: var(--font-size-sm);
    margin-bottom: 1rem;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.retry-link {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    margin-left: 0.5rem;
    cursor: pointer;
}

.retry-link:hover {
    text-decoration: none;
}

/* ========================================
   RESULT SECTION (inline after generation)
   ======================================== */
.result-section {
    margin-top: 1.5rem;
}

.result-section .result-image-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.result-section .result-image-container img {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 8px;
    object-fit: contain;
}

.result-section .result-meta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.result-section .result-meta span {
    background: #f0f2f5;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
}

.result-section .result-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.result-section .result-timeline {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    justify-content: center;
    border: 2px solid #dee2e6;
}

.result-section .result-timeline:empty {
    display: none;
}

.result-section .timeline-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    text-align: center;
}

.result-section .timeline-item {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid #dee2e6;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.result-section .timeline-item:hover {
    border-color: var(--site-accent);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.result-section .timeline-item.active {
    border-color: var(--site-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.result-section .timeline-item.active::after {
    content: '✓';
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: var(--site-accent);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-section .timeline-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-section .timeline-item .iteration-label {
    position: absolute;
    top: 2px;
    left: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 600;
}

.result-section .refinement-area {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
}

.result-section .refinement-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* ========================================
   LOADING OVERLAY
   ======================================== */
.results-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.overlay-content {
    background: #ffffff;
    border-radius: 16px;
    width: 95%;
    max-width: 700px;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(30px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.results-overlay.active .overlay-content {
    transform: translateY(0);
}

.overlay-body {
    padding: 1.5rem;
}

/* Overlay Loading State */
.overlay-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    min-height: 400px;
}

.video-placeholder {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #1a3a5c 0%, #2a5a8c 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.video-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% { left: 100%; }
}

.video-placeholder .placeholder-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    text-align: center;
    z-index: 1;
}

.overlay-loading-text {
    color: #1a3a5c;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.overlay-loading-subtext {
    color: #666;
    font-size: 0.9rem;
}

.overlay-timer {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a3a5c;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    margin: 1rem 0;
    letter-spacing: 2px;
}

.overlay-cancel-btn {
    margin-top: 1.5rem;
    background: transparent;
    border: 2px solid #dc3545;
    color: #dc3545;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.overlay-cancel-btn:hover {
    background: #dc3545;
    color: #fff;
}

/* Loading Video (in modal) */
.loading-video {
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

/* Truncated prompt in loading modal */
.loading-prompt-preview {
    background: rgba(26, 58, 92, 0.08);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #1a3a5c;
    max-width: 400px;
    margin-bottom: 1.5rem;
    text-align: center;
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Initial promo video (below input) */
.promo-video-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.promo-video-container video {
    width: 100%;
    border-radius: 8px;
}

.promo-video-container.hidden {
    display: none;
}

/* Prompt History */
.prompt-history-container {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.prompt-history-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prompt-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.prompt-history-item {
    background: #f5f7fa;
    padding: 0.6rem 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.prompt-history-item:hover {
    background: #eef2f7;
    border-color: var(--site-accent);
}

.prompt-history-text {
    font-size: 0.85rem;
    color: #333;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.prompt-history-meta {
    font-size: 0.7rem;
    color: #888;
    margin-top: 0.25rem;
}

/* Result Prompt History (chronological) */
.result-prompt-history {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid #e0e0e0;
}

.result-prompt-history:empty {
    display: none;
}

.result-prompt-history .history-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-prompt-history .history-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.result-prompt-history .history-item:last-child {
    border-bottom: none;
}

.result-prompt-history .history-number {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: var(--site-accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.result-prompt-history .history-content {
    flex: 1;
    min-width: 0;
}

.result-prompt-history .history-label {
    font-size: 0.7rem;
    color: #888;
    margin-bottom: 0.2rem;
}

.result-prompt-history .history-text {
    font-size: 0.85rem;
    color: #333;
    line-height: 1.4;
}

/* Refine Button Style */
.btn-refine-action {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: #ffffff;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-refine-action:hover {
    background: linear-gradient(135deg, #7c868f 0%, #6c757d 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.btn-refine-action:active {
    transform: translateY(0);
}

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

/* Responsive */
@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }
}

/* Mobile responsive - generated images */
@media (max-width: 600px) {
    .preview-panel {
        padding: 1rem;
        max-width: 100%;
    }

    .image-container {
        min-height: 200px;
        max-height: 70vh;
    }

    .image-container img {
        max-width: 100%;
        max-height: 70vh;
        width: auto;
        height: auto;
    }

    .order-button-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-order,
    .btn-update {
        width: 100%;
        justify-content: center;
    }

    .prompt-input-area {
        padding: 1rem;
    }

    .prompt-textarea {
        min-height: 80px;
    }

    .prompt-actions {
        flex-direction: column;
    }

    .btn-generate,
    .btn-cancel {
        width: 100%;
        justify-content: center;
    }

    .refinement-input-wrapper {
        flex-direction: column;
    }

    .btn-refine {
        width: 100%;
        justify-content: center;
    }

    .header {
        padding: 0.75rem 1rem;
    }

    .header h1 {
        font-size: 1.25rem;
    }

    .timeline-item {
        width: 40px;
        height: 40px;
    }

    /* Overlay mobile */
    .overlay-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .overlay-body {
        padding: 1rem;
    }

    .video-placeholder {
        max-width: 100%;
    }

    /* Result section mobile */
    .result-section .result-actions {
        flex-direction: column;
    }

    .result-section .result-actions .btn-order {
        width: 100%;
        justify-content: center;
    }

    .result-section .refinement-input-wrapper {
        flex-direction: column;
    }

    .result-section .btn-refine {
        width: 100%;
        justify-content: center;
    }

    .result-section .timeline-item {
        width: 50px;
        height: 50px;
    }
}
