/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1a202c;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 35%, #f093fb 100%);
    min-height: 100vh;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

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

.header-controls {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.header-user-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-project-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Current Project Indicator */
.current-project-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.375rem;
    backdrop-filter: blur(5px);
}

.current-project-indicator .project-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 500;
}

.current-project-indicator .project-name {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.875rem;
    font-weight: 600;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Authentication Styles */
.auth-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-name {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 0.9rem;
}

.guest-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Header Model Selector */
.header-model-selector {
    display: flex;
    align-items: center;
}

.header-model-selector select {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(5px);
}

.header-model-selector select option {
    background: #1a202c;
    color: white;
}

/* Admin Button */
.admin-access {
    display: flex;
    align-items: center;
}

.admin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
    transform: scale(1.05);
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: inherit;
}

.profile-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-arrow {
    font-size: 0.7rem;
    opacity: 0.7;
    transition: transform 0.2s;
}

.profile-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.profile-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    min-width: 200px;
    overflow: hidden;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.profile-dropdown.open .profile-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-menu-header {
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.profile-username {
    font-weight: 600;
    font-size: 0.9rem;
}

.profile-menu-divider {
    height: 1px;
    background: #e2e8f0;
}

.profile-menu-item {
    display: block;
    padding: 0.75rem 1rem;
    color: #2d3748;
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 0.9rem;
    transition: background-color 0.2s;
    cursor: pointer;
}

.profile-menu-item:hover {
    background: #f7fafc;
    color: #2d3748;
}

.profile-signout:hover {
    background: #fed7d7;
    color: #c53030;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
}

/* Registration Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay .modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-overlay .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-overlay .modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
}

.modal-overlay .modal-close {
    background: rgba(71, 85, 105, 0.1);
    border: 1px solid rgba(71, 85, 105, 0.2);
    font-size: 1.5rem;
    color: #475569;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-weight: 500;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modal-overlay .modal-close:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.modal-overlay .modal-body {
    margin-bottom: 1.5rem;
}

.modal-overlay .modal-body p {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.registration-benefits ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.registration-benefits li {
    padding: 0.5rem 0;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-overlay .modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

@media (max-width: 640px) {
    .modal-overlay .modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .modal-overlay .modal-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .guest-actions {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .header-controls {
        justify-content: center;
    }
    
    .header-user-nav,
    .header-project-nav {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .current-project-indicator .project-name {
        max-width: 150px;
    }
    
    .profile-menu {
        right: -1rem;
        min-width: 180px;
    }
}

.title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 10px;
}

.title-section {
    text-align: center;
}

.logo {
    height: 120px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2));
}

.title {
    font-size: 3.5rem;
    font-weight: 900;
    margin: 0;
    letter-spacing: -0.025em;
    color: #ffffff;
    line-height: 1;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.85;
    font-weight: 400;
    color: #f7fafc;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    margin: 0.25rem 0 0 0;
    font-style: italic;
}



.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 20px;
    }
    
    .project-title-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .project-meta {
        flex-wrap: wrap;
    }
    
    .project-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .project-actions .model-selector {
        min-width: auto;
        width: 100%;
        max-width: 300px;
        align-self: flex-start;
    }
    
    .project-actions .btn {
        align-self: flex-end;
    }
}

/* Progress Indicator - Now Primary Navigation */
.progress-container {
    margin-bottom: 40px;
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    width: 16.66%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px;
    border-radius: 8px;
}

.step:hover {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.1);
    cursor: pointer;
}

.step:not(.disabled):hover::before {
    transform: scale(1.05);
}

.step.active {
    color: white;
    font-weight: 600;
}

.step.completed {
    color: #4facfe;
}

.step.completed:hover {
    color: #2e86de;
}

.step.fully-complete {
    color: #48bb78;
}

.step.fully-complete:hover {
    color: #38a169;
}

.step.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.step.disabled:hover {
    color: rgba(255,255,255,0.6);
    background: none;
}

.step.disabled:hover::before {
    transform: none;
}

.step::before {
    content: attr(data-step);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    color: rgba(255,255,255,0.6);
}

.step.active::before {
    background: #4facfe;
    border-color: #4facfe;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.3);
}

.step.completed::before {
    background: rgba(255,255,255,0.4);
    border-color: rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.8);
}

.step.fully-complete::before {
    content: "✓";
    background: #48bb78;
    border-color: #48bb78;
    color: white;
    font-size: 1rem;
    font-weight: 700;
}

.step.disabled::before {
    background: transparent;
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.4);
}

/* Progress Meter Styles */
.progress-meter {
    display: inline-block;
    width: 40px;
    height: 40px;
    margin-left: 15px;
    position: relative;
    vertical-align: middle;
}

/* Progress meters in headers */
h2 .progress-meter {
    margin-left: 20px;
    vertical-align: text-top;
}

.progress-meter svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg); /* Start from top */
}

.progress-meter .progress-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 3;
}

.progress-meter .progress-fill {
    fill: none;
    stroke: #4facfe;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 0.3s ease, stroke 0.3s ease;
}

.progress-meter .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Complete state styling */
.progress-meter.complete .progress-bg {
    fill: #48bb78;
    stroke: #48bb78;
}

.progress-meter.complete .progress-fill {
    stroke: #48bb78;
}

.progress-meter.complete .progress-text {
    opacity: 0;
}

/* Checkmark for completed state */
.progress-checkmark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease 0.15s;
    pointer-events: none;
}

.progress-meter.complete .progress-checkmark {
    opacity: 1;
}

/* Completed text label */
.progress-completed-label {
    margin-left: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #48bb78;
    opacity: 0;
    transition: opacity 0.3s ease 0.15s;
    white-space: nowrap;
}

.progress-meter.complete + .progress-completed-label {
    opacity: 1;
}

/* Current step enhancement */
.step.active .progress-meter .progress-fill {
    stroke: #4facfe;
    filter: drop-shadow(0 0 4px rgba(79, 172, 254, 0.4));
}

/* Completed step styling */
.step.completed .progress-meter .progress-fill {
    stroke: #6b7280;
}

.step.fully-complete .progress-meter .progress-fill {
    stroke: #48bb78;
}

/* Progress meter responsive adjustments */
@media (max-width: 768px) {
    .progress-meter {
        width: 36px;
        height: 36px;
        margin-left: 8px;
    }
    
    .progress-meter .progress-text {
        font-size: 10px;
    }
    
    .progress-checkmark {
        font-size: 14px;
    }
    
    .progress-completed-label {
        font-size: 11px;
        margin-left: 6px;
    }
}

@media (max-width: 480px) {
    .progress-meter {
        width: 32px;
        height: 32px;
        margin-left: 6px;
    }
    
    .progress-meter .progress-text {
        font-size: 9px;
    }
    
    .progress-checkmark {
        font-size: 12px;
    }
    
    .progress-completed-label {
        font-size: 10px;
        margin-left: 4px;
    }
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.15), 0 10px 30px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #2d3748;
}

.step-description {
    color: #718096;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* Workflow Steps */
.workflow-step {
    display: none;
}

.workflow-step.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* Forms */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.4;
}

.form-help em {
    font-style: italic;
    color: #4b5563;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Form Row Styles */
.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Influence Container Styles */
.influence-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.influence-select {
    flex: 2;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    transition: border-color 0.2s ease;
}

.influence-select:focus {
    outline: none;
    border-color: #4facfe;
}

.custom-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.custom-input:focus {
    outline: none;
    border-color: #4facfe;
}

.add-influence-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #4facfe;
    background: #4facfe;
    color: white;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-influence-btn:hover {
    background: #3182ce;
    border-color: #3182ce;
    transform: scale(1.05);
}

.add-new-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.add-new-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Influence Tags */
.influence-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.influence-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #4facfe;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.influence-tag .remove-tag {
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.influence-tag .remove-tag:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Clickable tags for editing */
.influence-tag.clickable-tag {
    transition: all 0.2s ease;
    cursor: pointer;
}

.influence-tag.clickable-tag:hover {
    background: #3d8bfe;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}

.influence-tag.clickable-tag span {
    transition: all 0.2s ease;
}

.influence-tag.clickable-tag:hover span {
    font-weight: 600;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 2rem;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    text-decoration: none;
    display: inline-block;
    margin-right: 10px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 172, 254, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Generate All Button - Special styling for master generation buttons */
.btn-generate-all {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: white;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    border: 2px solid transparent;
    /* Ensure no layout disruption */
    display: inline-block;
    vertical-align: top;
    margin: 0 !important;
    position: static !important;
    overflow: visible !important;
    backdrop-filter: none !important;
    box-sizing: border-box;
}

.btn-generate-all:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #9333ea 100%);
}

.btn-generate-all:active {
    background: linear-gradient(135deg, #5b21b6 0%, #7c2d12 100%);
}

/* Shine effect temporarily removed to fix layout issues */

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #4facfe;
    border-color: #4facfe;
}

.btn-outline:hover {
    background: #4facfe;
    color: white;
    transform: translateY(-2px);
}

.btn-dialogue {
    background: #8b5cf6 !important;
    border-color: #8b5cf6 !important;
    color: white !important;
}

.btn-dialogue:hover {
    background: #7c3aed !important;
    border-color: #7c3aed !important;
    color: white !important;
    transform: translateY(-2px);
}

/* Voice generation button styles */
.btn-voice {
    background: #f59e0b !important;
    border-color: #f59e0b !important;
    color: white !important;
}

.btn-voice:hover {
    background: #d97706 !important;
    border-color: #d97706 !important;
    color: white !important;
    transform: translateY(-2px);
}

/* Template Grid */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.template-option {
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.template-option:hover {
    border-color: #4facfe;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.template-option.selected {
    border-color: #4facfe;
    background: rgba(79, 172, 254, 0.05);
}

.template-option h3 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.template-option p {
    color: #718096;
    line-height: 1.5;
}

/* Template Category Styles */
.template-category {
    margin-bottom: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.category-header {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
}

.category-header h3 {
    margin: 0 0 8px 0;
    color: #2d3748;
    font-size: 1.4rem;
    font-weight: 600;
}

.category-description {
    margin: 0;
    color: #718096;
    font-size: 0.95rem;
    line-height: 1.5;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    padding: 20px;
}

.template-option h4 {
    margin: 0 0 10px 0;
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 600;
}

.template-description {
    color: #718096;
    line-height: 1.5;
    margin: 0 0 10px 0;
    font-size: 0.9rem;
}

.template-examples {
    color: #4a5568;
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
    padding-top: 10px;
    border-top: 1px solid #f1f3f4;
}

.template-examples strong {
    color: #4facfe;
    font-weight: 600;
}

/* Structure Content */
.structure-element {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #4facfe;
}

.structure-element h3 {
    color: #2d3748;
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.structure-element p {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 10px;
}

.structure-element .elements {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.structure-element .element-tag {
    background: #4facfe;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Scene Content */
.scene-group {
    margin-bottom: 30px;
}

.scene-group h3 {
    color: #2d3748;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.scene-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    position: relative;
}

.scene-item h4 {
    color: #2d3748;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.scene-number {
    background: #4facfe;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.scene-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #718096;
}

.scene-description {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Enhanced scene content formatting for better space usage */
.editable-content-display p {
    margin: 8px 0;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.editable-content-display p:first-child {
    margin-top: 0;
}

.editable-content-display p:last-child {
    margin-bottom: 0;
}

/* Compact scene metadata line */
.editable-content-display p strong {
    font-weight: 600;
}

/* Scene content compact mode - tighter spacing */
.scene-content-compact p {
    margin: 6px 0 !important;
    line-height: 1.4;
}

.scene-content-compact p:first-child {
    margin-top: 0 !important;
}

.scene-characters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.character-tag {
    background: #ed8936;
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
}

.generate-dialogue-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.generate-scene-btn {
    margin-left: 15px;
    padding: 6px 12px;
    font-size: 0.8rem;
    background: #28a745;
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.generate-scene-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* Dialogue Content */
.dialogue-scene {
    background: #f7fafc;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
}

.dialogue-scene h4 {
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.script-content {
    background: white;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

/* Script Preview */
.script-preview {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    max-height: 500px;
    overflow-y: auto;
}

.script-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 12px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4facfe;
}

.export-options {
    margin-top: 2rem;
}

.export-options h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.export-formats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.export-category {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.export-category h4 {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.export-category .btn {
    width: 100%;
    margin-bottom: 0.75rem;
    text-align: left;
    justify-content: flex-start;
}

.export-category .btn:last-child {
    margin-bottom: 0;
}

.export-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #4facfe;
}

.export-info p {
    margin-bottom: 1rem;
    font-weight: 600;
    color: #4facfe;
}

.export-info ul {
    margin: 0;
    padding-left: 1.5rem;
}

.export-info li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.export-info li strong {
    color: #2d3748;
}

/* Step Actions */
.step-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid #4facfe;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Hierarchical progress display */
.hierarchical-progress {
    text-align: center;
    min-width: 300px;
}

.hierarchical-progress .progress-text {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
    line-height: 1.4;
}

.hierarchical-progress .progress-bar-container {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    height: 8px;
    margin: 12px 0;
    overflow: hidden;
}

.hierarchical-progress .progress-bar {
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    height: 100%;
    border-radius: 8px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}

.hierarchical-progress .progress-details {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 8px;
}

.hierarchical-progress .progress-actions {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.hierarchical-progress .cancel-generation-btn {
    background: rgba(239, 68, 68, 0.9) !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    backdrop-filter: blur(8px) !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 9999 !important;
}

.hierarchical-progress .cancel-generation-btn:hover {
    background: rgba(239, 68, 68, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 0;
    min-width: 300px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1001;
}

.toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
}

.toast-message {
    font-weight: 500;
    color: #2d3748;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #718096;
    margin-left: 15px;
}

.toast.success {
    border-left: 4px solid #48bb78;
}

.toast.error {
    border-left: 4px solid #f56565;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo {
        height: 80px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .card {
        padding: 25px;
    }
    
    .progress-steps {
        display: none;
    }
    
    .step-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .export-options {
        flex-direction: column;
    }
    
    .script-stats {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .template-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .toast {
        left: 20px;
        right: 20px;
        min-width: auto;
    }
    
    .script-content,
    .script-preview {
        font-size: 11px;
        padding: 15px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
    margin: auto; /* Ensure horizontal centering */
}

/* 🔧 Enhanced styling for Act Details Modal */
#actDetailsModal .modal-content {
    max-width: 650px; /* Slightly wider for form content */
    width: 95%; /* More space on mobile */
}

#actDetailsModal .form-group {
    margin-bottom: 20px;
}

#actDetailsModal .form-help {
    margin-top: 5px;
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.4;
}

#actDetailsModal .form-help strong {
    color: #4facfe;
}

#actDetailsModal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 30px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 20px 20px;
    margin: 0 -30px -30px -30px;
}

@keyframes slideIn {
    from { opacity: 0; transform: scale(0.9) translateY(-20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 30px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #2d3748;
}

.modal-close {
    background: rgba(71, 85, 105, 0.1);
    border: 1px solid rgba(71, 85, 105, 0.2);
    font-size: 1.5rem;
    cursor: pointer;
    color: #475569;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modal-close:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.modal-body {
    padding: 20px 30px 30px;
}

.project-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    background: #fafafa;
    transition: all 0.2s ease;
    cursor: pointer;
}

.project-item:hover {
    border-color: #4facfe;
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.15);
}

.project-item h4 {
    margin: 0 0 10px 0;
    color: #2d3748;
    font-size: 1.2rem;
}

.project-meta {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 10px;
}

.project-logline {
    font-style: italic;
    color: #4a5568;
    margin-bottom: 15px;
}

.project-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.load-project-btn {
    background: #4facfe;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    flex: 1;
}

.load-project-btn:hover {
    background: #2e86de;
    transform: translateY(-1px);
}

.duplicate-project-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    flex: 0 0 auto;
}

.duplicate-project-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.duplicate-project-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.delete-project-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    flex: 0 0 auto;
}

.delete-project-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.delete-project-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

/* Breadcrumb Navigation */
.step-breadcrumb {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.breadcrumb-btn {
    background: none;
    border: none;
    color: #4facfe;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.breadcrumb-btn:hover {
    background: #f0f9ff;
    color: #2e86de;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #a0aec0;
    font-size: 0.8rem;
}

.breadcrumb-current {
    color: #2d3748;
    font-weight: 600;
    font-size: 0.9rem;
}

.breadcrumb-disabled {
    color: rgba(45, 55, 72, 0.4);
    font-weight: 400;
    font-size: 0.9rem;
}

/* Scene Generation Options */
.scene-generation-options {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.scene-generation-options h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
}

.generation-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.generation-buttons .btn {
    flex: 1;
    min-width: 200px;
}

.generation-info {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

.generation-info strong {
    color: #333;
}

#totalScenesDisplay {
    font-weight: bold;
    color: #007bff;
}

/* Scene Group Styles for Individual Generation */
.scene-group-header {
    background: #f8fafc;
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scene-group-header h3 {
    margin: 0;
    color: #333;
}

.scene-group-actions {
    display: flex;
    gap: 10px;
}

.structure-description {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    background: white;
}

.structure-description p {
    margin: 5px 0;
    font-size: 0.9em;
    line-height: 1.4;
}

.scenes-container {
    padding: 15px;
    background: white;
}

.no-scenes {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
    margin: 0;
}

.scene-emotions {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
    margin-top: 10px;
}

/* Plot Point Styles */
.scene-actions {
    display: flex;
    gap: 10px;
    margin-left: 15px;
}

.generate-plot-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    background: #6c757d;
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.generate-plot-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.scene-plot-point {
    margin-top: 10px;
    padding: 10px;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
    font-style: italic;
}

.scene-plot-point-placeholder {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-left: 4px solid #dee2e6;
    border-radius: 4px;
    color: #6c757d;
    font-style: italic;
}

.plot-generation-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.plot-info {
    font-style: italic;
}

/* Prompt Preview Modal Styles */
.prompt-modal .modal-content {
    max-width: 90vw;
    max-height: 90vh;
    width: 1000px;
}

.prompt-section {
    margin-bottom: 25px;
}

.prompt-section h4 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 5px;
}

.prompt-content {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
    color: #4a5568;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #e2e8f0;
    background: #f7fafc;
}

/* Prompt Review Section */
.prompt-review-section {
    background: linear-gradient(135deg, #e6fffa 0%, #f0fff4 100%);
    border: 1px solid #68d391;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.prompt-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.prompt-review-header h3 {
    margin: 0;
    color: #2f855a;
    font-size: 1.2rem;
    font-weight: 600;
}

.prompt-summary {
    color: #2d3748;
    font-size: 0.9rem;
}

.prompt-summary p {
    margin: 5px 0;
    line-height: 1.4;
}

.prompt-summary strong {
    color: #2f855a;
    font-weight: 600;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-success {
    background: #28a745;
    color: white;
    border: 1px solid #28a745;
}

.btn-success:hover {
    background: #218838;
    border-color: #1e7e34;
}

/* Prompt Editor Styles */
.prompt-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
    background: #f7fafc;
}

.prompt-editor {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #4facfe;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    background: white;
    color: #2d3748;
    resize: vertical;
}

.prompt-editor:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.custom-prompt-notice {
    background: linear-gradient(135deg, #fef5e7 0%, #fff5d6 100%);
    border: 1px solid #f6ad55;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.custom-prompt-notice p {
    margin: 0;
    color: #744210;
    font-size: 0.9rem;
}

.custom-prompt-notice strong {
    color: #c05621;
}

/* Plot Points Generation Styles */
.plot-points-generation {
    margin-top: 20px;
}

.structure-element-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.element-header {
    background: #f8fafc;
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.element-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.2rem;
}

.element-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.plot-points-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.plot-points-count-select {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.85rem;
    color: #374151;
    min-width: 120px;
    font-weight: 500;
}

.plot-points-count-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

@media (max-width: 768px) {
    .element-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .plot-points-controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .plot-points-count-select {
        width: 100%;
        min-width: auto;
    }
}

.element-description {
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: white;
}

.element-description p {
    margin: 5px 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.creative-direction-section {
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #fefce8;
    border-left: 4px solid #eab308;
}

.creative-direction-section .creative-direction-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.creative-direction-section .creative-direction-controls button {
    align-self: flex-start;
}

.creative-direction-placeholder {
    font-size: 0.9rem;
    color: #6b7280;
    font-style: italic;
}

.creative-directions-preview {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.creative-directions-preview strong {
    color: #92400e;
}

.plot-points-container {
    padding: 20px;
    background: white;
}

/* Scene Layout - Plot Point Header Row */
.plot-point-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 15px;
}

.plot-point-number-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.plot-point-number-badge {
    background: #3b82f6;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
}

.plot-point-label {
    font-weight: 600;
    color: #374151;
}

.scene-count {
    font-size: 0.85rem;
    color: #6b7280;
    font-style: italic;
}

.plot-point-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.plot-point-description-section {
    margin-bottom: 15px;
}

.plot-point-text {
    color: #4b5563;
    line-height: 1.5;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .plot-point-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .plot-point-controls {
        width: 100%;
    }
    
    .plot-point-controls button {
        width: 100%;
    }
}

/* Dialogue Scene Layout - Scene Header Row (exactly matching plot point layout) */
.scene-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 15px;
}

.scene-number-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scene-number-badge {
    background: #3b82f6;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
}

.scene-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
}

.scene-title-section {
    flex: 1;
}

.scene-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Scene description row (used in dialogue step) */
.scene-description-row {
    margin: 0.5rem 0;
    padding: 0.75rem;
    background: #f8f9fa;
    border-left: 3px solid #dee2e6;
    border-radius: 0 4px 4px 0;
}

.scene-description {
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

/* Scene controls section (for dialogue step) */
.scene-controls-section {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.scene-controls-section .scene-actions {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.scene-controls-section .creative-direction-section {
    margin: 0;
}

@media (max-width: 768px) {
    .scene-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .scene-number-section {
        gap: 8px;
    }
    
    .scene-controls {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .scene-controls button {
        flex: 1;
        min-width: 120px;
    }
    
    .scene-description-row {
        margin: 0.5rem 0;
        padding: 0.5rem;
    }
    
    .scene-description {
        font-size: 0.85rem;
    }
    
    .scene-controls-section {
        margin: 0.75rem 0;
        padding: 0.75rem;
    }
    
    .scene-controls-section .scene-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

.no-plot-points {
    color: #64748b;
    font-style: italic;
    text-align: center;
    padding: 20px;
    margin: 0;
    background: #f8fafc;
    border-radius: 4px;
}

.plot-points-list h4 {
    color: #1e293b;
    margin-bottom: 15px;
    font-size: 1rem;
}

.plot-point-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.plot-point-item:last-child {
    border-bottom: none;
}

.plot-point-number {
    background: #3b82f6;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.plot-point-content {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #334155;
}

.plot-point-actions {
    display: flex;
    gap: 5px;
}

.plot-point-actions .btn {
    padding: 4px 8px;
    font-size: 0.8rem;
}

/* Hierarchical Plot Points Styles */
.hierarchical-plot-points {
    list-style: none;
    padding: 0;
    margin: 15px 0;
    counter-reset: none;
}

.hierarchical-plot-points li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
}

.hierarchical-plot-points li:last-child {
    border-bottom: none;
}

.hierarchical-plot-points .plot-point-number {
    background: #3b82f6;
    color: white;
    min-width: 35px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Plot Points Reference in Scenes */
.plot-points-reference {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

.plot-points-reference h4 {
    color: #0369a1;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.plot-points-reference ol {
    margin: 0;
    padding-left: 20px;
}

.plot-points-reference li {
    color: #0369a1;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 5px;
}

.plot-points-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

.plot-points-warning p {
    color: #92400e;
    margin: 0;
    font-size: 0.9rem;
}

/* Update scene group header to accommodate new actions */
.scene-group-header {
    background: #f8fafc;
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scene-group-actions {
    display: flex;
    gap: 10px;
}

/* Selected Template Display on Template Page - Enhanced */
.selected-template-display {
    margin-bottom: 25px;
    animation: slideInFromTop 0.4s ease-out;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.selected-template-card {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none !important;
    box-shadow: 0 8px 32px rgba(79, 172, 254, 0.3);
}

.selected-template-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.selected-template-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.selected-template-card h3 {
    color: white;
    margin-bottom: 16px;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.5px;
}

.selected-template-card h3::before {
    content: "✓ ";
    font-size: 1.2rem;
    margin-right: 8px;
}

.selected-template-card .template-description {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 16px;
    text-align: center;
    max-width: 600px;
    font-weight: 400;
}

.selected-template-card .template-category {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 8px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.selected-template-actions {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

.selected-template-actions .btn {
    background: white;
    color: #4facfe;
    border: 2px solid white;
    backdrop-filter: blur(10px);
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

.selected-template-actions .btn:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: white;
    color: #2d87e8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Template options - collapsed state */
.template-options-collapsed {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s ease-out;
    margin-bottom: 0 !important;
}

.template-options-expanded {
    max-height: none;
    opacity: 1;
    transition: all 0.4s ease-out;
}

/* NEW: Enhanced Template Selection - Horizontal Act Cards */
.act-cards-container {
    margin-top: 25px;
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

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

.act-cards-header h4 {
    margin: 0 0 8px 0;
    color: #2d3748;
    font-size: 1.2rem;
    font-weight: 600;
}

.act-cards-description {
    margin: 0;
    color: #718096;
    font-size: 0.9rem;
}

.act-cards-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 8px 0 16px 0;
}

/* Individual Act Cards */
.act-card {
    flex: 1 1 calc(25% - 12px);
    min-width: 160px;
    max-width: 200px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.act-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.act-card-number {
    display: inline-block;
    background: #4facfe;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
    vertical-align: middle;
}

.act-card-title {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 8px;
    height: 1.4rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    width: 100%;
}

.act-card-description {
    color: #718096;
    font-size: 0.8rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.act-card-edit-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    background: #f7fafc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #a0aec0;
    transition: all 0.2s ease;
    opacity: 0;
}

.act-card-plot-points {
    position: absolute;
    bottom: 4px;
    right: 4px;
    display: inline-block;
    background: rgba(107, 114, 128, 0.08);
    color: #9ca3af;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.55rem;
    font-weight: 400;
    white-space: nowrap;
    border: 1px solid rgba(107, 114, 128, 0.15);
    line-height: 1.2;
}

.act-card-plot-points.editable {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 32px;
    text-align: center;
    background: white;
    color: #333;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    padding: 1px 3px;
    font-family: inherit;
    font-size: 0.55rem;
    font-weight: 400;
    line-height: 1.2;
}

.act-card-plot-points.editable:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 2px rgba(79, 172, 254, 0.1);
}



/* Editing state styles */
.act-card.editing {
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    background: #f0fdf4;
}

.act-card.editing .act-card-edit-icon {
    opacity: 1;
    color: white;
    background: #10b981;
    border-color: #10b981;
    transform: rotate(45deg);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.act-card.editing .act-card-edit-icon:hover {
    background: #059669;
    border-color: #059669;
    transform: rotate(45deg) scale(1.1);
}

/* Editable text areas */
.act-card-title.editable,
.act-card-description.editable {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 4px 8px;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    resize: vertical;
    min-height: auto;
    display: block;
    width: 100%;
    box-sizing: border-box;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
}

.act-card-title.editable {
    font-weight: 600;
    min-height: 20px;
}

.act-card-description.editable {
    min-height: 60px;
    margin-top: 4px;
}

.act-card-title.editable:focus,
.act-card-description.editable:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 2px rgba(79, 172, 254, 0.1);
}

/* Edit controls */
.act-card-edit-controls {
    display: none;
    gap: 8px;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
    justify-content: space-between;
}

.act-card.editing .act-card-edit-controls {
    display: flex;
}

.act-card-edit-primary {
    display: flex;
    gap: 8px;
}

.act-card-edit-secondary {
    display: flex;
    gap: 4px;
}

.act-card-edit-btn {
    padding: 4px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.act-card-edit-btn.save {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.act-card-edit-btn.save:hover {
    background: #059669;
}

.act-card-edit-btn.cancel:hover {
    background: #f3f4f6;
}

.act-card-edit-btn.delete {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    padding: 2px 6px;
    font-size: 0.7rem;
}

.act-card-edit-btn.delete:hover {
    background: #dc2626;
}

/* Better edit icon positioning */
.act-card-edit-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #4b5563;
    transition: all 0.2s ease;
    opacity: 1;
    cursor: pointer;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.act-card-edit-icon:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

/* Tooltip for act cards */
.act-card-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: normal;
    width: 280px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.act-card-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2d3748;
}

.act-card:hover .act-card-tooltip {
    opacity: 1;
}

/* Responsive design for act cards */
@media (max-width: 768px) {
    .act-card {
        flex: 1 1 calc(50% - 8px);
        min-width: 140px;
    }
    
    .act-card-tooltip {
        width: 250px;
    }
}

@media (max-width: 480px) {
    .act-card {
        flex: 1 1 100%;
        max-width: none;
    }
}

/* Enhanced template selection feedback */
.template-option {
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
    position: relative;
    overflow: hidden;
}

.template-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.template-option:hover {
    border-color: #4facfe;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.15);
}

.template-option:hover::before {
    opacity: 1;
}

.template-option.selected {
    border-color: #4facfe;
    background: rgba(79, 172, 254, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.2);
}

.template-option.selected::before {
    opacity: 1;
}

.template-option.selecting {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

@media (max-width: 768px) {
    .selected-template-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
    }
    
    .selected-template-card h3 {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }

    .selected-template-card .template-description {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 12px;
        padding: 0 16px;
    }
    
    .selected-template-actions {
        width: 100%;
        max-width: 300px;
        flex-direction: column;
    }
    
    .selected-template-actions .btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}

/* Acts Generation Options */
.acts-generation-options {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.acts-generation-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.acts-info {
    color: #718096;
    font-style: italic;
}

@media (max-width: 768px) {
    .acts-generation-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .template-info-card {
        padding: 15px;
    }
    
    .template-info-card h3 {
        font-size: 1.1rem;
    }
}

/* Disabled button styles */
.btn-disabled,
.btn:disabled {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    transform: none !important;
}

.btn-disabled:hover,
.btn:disabled:hover {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Editable Content Block Styles */
.editable-content-block {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
    background: #ffffff;
    transition: all 0.2s ease;
}

.editable-content-block:hover {
    border-color: #2196F3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
}

.editable-content-block.editing {
    border-color: #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.editable-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: 8px 8px 0 0;
}

.editable-content-header-minimal {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0;
    margin: 0;
    height: 0;
    background: transparent;
    position: relative;
    z-index: 10;
}

.editable-content-title {
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

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

.editable-content-header-minimal .editable-content-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 20;
}

.editable-content-body {
    padding: 15px;
}

.editable-content-body.compact {
    padding: 12px 16px;
}

.editable-content-body.compact .editable-content-display {
    margin-top: 0;
    padding-top: 0;
}

.editable-content-body.compact .editable-content-display p:first-child {
    margin-top: 0;
}

.scene-content-compact {
    margin: 0;
    padding: 0;
}

.scene-content-compact p:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.editable-content-display {
    line-height: 1.6;
    color: #444;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

.editable-content-display h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.editable-content-display p {
    margin-bottom: 8px;
    margin-top: 0;
}

.editable-content-display ol, .editable-content-display ul {
    margin-bottom: 12px;
    padding-left: 20px;
}

.editable-content-display li {
    margin-bottom: 6px;
}

.editable-content-editor {
    display: none;
}

.editable-content-editor textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.editable-content-editor textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.editable-content-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.editing .editable-content-display {
    display: none;
}

.editing .editable-content-editor {
    display: block;
}

.edit-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.edit-btn:hover {
    background: #1976D2;
}

.save-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.save-btn:hover {
    background: #45a049;
}

.save-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.cancel-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.cancel-btn:hover {
    background: #d32f2f;
}

.editable-content-meta {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.content-type-badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.content-type-badge.acts { background: #e8f5e8; color: #2e7d32; }
.content-type-badge.plot-points { background: #fff3e0; color: #f57c00; }
.content-type-badge.scenes { background: #f3e5f5; color: #7b1fa2; }
.content-type-badge.dialogue { background: #fce4ec; color: #c2185b; }

/* Loading state for content blocks */
.editable-content-block.loading {
    opacity: 0.7;
    pointer-events: none;
}

.editable-content-block.loading .editable-content-header::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error feedback */
.content-save-feedback {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

.content-save-feedback.success {
    background: #e8f5e8;
    border: 1px solid #4caf50;
    color: #2e7d32;
}

.content-save-feedback.error {
    background: #ffeaea;
    border: 1px solid #f44336;
    color: #c62828;
}

/* Specific text wrapping for dialogue content */
.dialogue-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow-x: hidden;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .editable-content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .editable-content-actions {
        align-self: flex-end;
    }
    
    .editable-content-editor-actions {
        flex-direction: column;
    }
    
    .save-btn, .cancel-btn {
        width: 100%;
    }
}

/* Character System Styles */
.characters-container {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.characters-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 0.5rem;
}

.characters-list {
    padding: 1rem;
    min-height: 60px;
}

.characters-empty {
    color: #9ca3af;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.character-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.character-item:last-child {
    margin-bottom: 0;
}

.character-content {
    flex: 1;
}

.character-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.character-description {
    color: #6b7280;
    font-size: 0.9em;
    line-height: 1.4;
}

.character-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

.character-actions button {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.character-edit-btn {
    background: #f3f4f6;
    color: #6b7280;
}

.character-edit-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.character-delete-btn {
    background: #fef2f2;
    color: #dc2626;
}

.character-delete-btn:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.character-library-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.character-library-item:hover {
    border-color: #3b82f6;
    background: #f8faff;
}

.character-library-item:last-child {
    margin-bottom: 0;
}

.character-library-empty {
    color: #9ca3af;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* Character Modal Specific Styling */
#addCharacterModal .modal-content,
#characterLibraryModal .modal-content {
    padding: 0;
    min-width: 500px;
    max-width: 600px;
}

#addCharacterModal .modal-header,
#characterLibraryModal .modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

#addCharacterModal .modal-body,
#characterLibraryModal .modal-body {
    padding: 2rem;
}

#addCharacterModal .form-group {
    margin-bottom: 1.5rem;
}

#addCharacterModal .form-group:last-of-type {
    margin-bottom: 0;
}

#addCharacterModal .form-actions,
#characterLibraryModal .modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    margin: 0;
}

#addCharacterModal input,
#addCharacterModal textarea {
    padding: 0.75rem;
    font-size: 0.95rem;
}

#addCharacterModal textarea {
    min-height: 100px;
    resize: vertical;
}

/* Universal Library Save Modal */
.universal-library-modal .modal-content {
    min-width: 500px;
    max-width: 600px;
}

.universal-library-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px 8px 0 0;
}

.universal-library-modal .modal-header h3 {
    color: white;
    font-weight: 600;
}

.universal-library-modal .modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    opacity: 0.9;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.universal-library-modal .modal-close:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.universal-library-modal .modal-body {
    padding: 2rem;
}

.universal-library-modal .modal-body p {
    margin-bottom: 1.5rem;
    color: #4b5563;
    font-size: 1rem;
}

.universal-library-modal .form-group {
    margin-bottom: 1.5rem;
}

.universal-library-modal .form-group:last-of-type {
    margin-bottom: 0;
}

.universal-library-modal input,
.universal-library-modal textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.universal-library-modal input:focus,
.universal-library-modal textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.universal-library-modal .modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    border-radius: 0 0 8px 8px;
}

.universal-library-modal .btn {
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
}

.universal-library-modal .btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.universal-library-modal .btn-secondary:hover {
    background: #e5e7eb;
    color: #374151;
}

.universal-library-modal .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.universal-library-modal .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Mobile responsiveness for character modals and universal library modal */
@media (max-width: 768px) {
    #addCharacterModal .modal-content,
    #characterLibraryModal .modal-content,
    .universal-library-modal .modal-content {
        min-width: auto;
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    #addCharacterModal .modal-header,
    #addCharacterModal .modal-body,
    #addCharacterModal .form-actions,
    #characterLibraryModal .modal-header,
    #characterLibraryModal .modal-body,
    #characterLibraryModal .modal-footer,
    .universal-library-modal .modal-header,
    .universal-library-modal .modal-body,
    .universal-library-modal .modal-footer {
        padding: 1rem;
    }
}

/* Story Concept Display */
.story-concept-display {
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #cbd5e0;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.story-concept-display:hover {
    border-color: #a0aec0;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.story-concept-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.story-concept-content {
    flex: 1;
}

.story-concept-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.story-concept-logline {
    color: #4a5568;
    line-height: 1.5;
    font-style: italic;
}

.story-concept-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.story-concept-actions .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

.edit-concept-btn {
    background: #4facfe;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.edit-concept-btn:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.remove-concept-btn {
    background: #e53e3e;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.remove-concept-btn:hover {
    background: #c53030;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .story-concept-card {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .story-concept-actions {
        align-self: stretch;
    }
    
    .story-concept-actions .btn {
        flex: 1;
    }
}

/* Save Status Indicator */
.save-status {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
    margin-right: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    min-width: 80px;
    justify-content: center;
}

.save-status:empty {
    display: none;
}

.save-status.info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.save-status.success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.save-status.error {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.save-status.success::before {
    content: "✓ ";
    margin-right: 0.25rem;
}

.save-status.error::before {
    content: "⚠ ";
    margin-right: 0.25rem;
}

/* Global Project Controls */
.global-project-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.global-model-selector select {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(5px);
}

.global-model-selector select option {
    background: #1a202c;
    color: white;
}

.global-project-actions {
    display: flex;
    gap: 0.5rem;
}

.select-compact {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
    min-height: auto !important;
    height: auto !important;
}

@media (max-width: 768px) {
    .global-project-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .global-model-selector select {
        width: 100%;
    }
    
    .global-project-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* Form Actions Layout - Simplified */
.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}



/* Compact project header with progress badge */
.project-item .project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.project-item .project-header h4 {
    margin: 0;
    flex: 1;
    margin-right: 0.75rem;
}

.progress-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #4facfe;
    color: white;
    border-radius: 50%;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    cursor: help;
    transition: all 0.2s;
}

.progress-badge:hover {
    background: #2e86de;
    transform: scale(1.05);
}

/* Make format badges smaller and more compact */
.format-badge {
    font-size: 0.625rem !important;
    padding: 0.125rem 0.375rem !important;
    border-radius: 0.5rem !important;
    margin-left: 0.375rem !important;
    vertical-align: top;
}

/* Template Structure Preview */
.template-structure-preview {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.structure-preview-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.structure-preview-header h3 {
    color: #4facfe;
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.structure-preview-description {
    color: #a0aec0;
    font-size: 1rem;
    margin: 0 0 15px 0;
    line-height: 1.6;
}

.structure-preview-hint {
    color: #68d391;
    font-size: 0.9rem;
    margin: 0;
    padding: 10px 20px;
    background: rgba(113, 128, 150, 0.1);
    border-radius: 8px;
    border-left: 4px solid #68d391;
}

.structure-acts-preview {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    margin-top: 20px;
}

.act-preview-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.act-preview-card:hover {
    border-color: #4facfe;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.15);
}

.act-preview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4facfe, #00f2fe);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.act-preview-card:hover::before {
    opacity: 1;
}

.act-preview-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.act-number {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.act-name {
    color: #e2e8f0;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

.act-preview-content {
    margin-top: 12px;
}

.act-description {
    color: #a0aec0;
    line-height: 1.6;
    margin: 0 0 15px 0;
    font-size: 0.95rem;
}

.act-placeholder {
    background: rgba(113, 128, 150, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    margin-top: 10px;
}

.placeholder-text {
    color: #718096;
    font-style: italic;
    font-size: 0.9rem;
}

.generated-content {
    text-align: left;
    padding: 0;
}

.generated-content p {
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.generated-content p:last-child {
    margin-bottom: 0;
}

/* Mobile responsiveness */
/* Unified Preview/Generation Containers */
.structure-preview-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.structure-preview-header h3 {
    color: #4facfe;
    margin: 0 0 15px 0;
    font-size: 1.4rem;
}

.structure-preview-description {
    color: #a0aec0;
    margin: 0 0 15px 0;
    line-height: 1.6;
}

.preview-badge {
    background: #4facfe;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 8px;
}

.structure-element-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 5px;
}

.preview-status {
    background: rgba(104, 211, 145, 0.2);
    color: #68d391;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.template-description {
    background: transparent;
    border-left: none;
    padding: 0;
    margin-bottom: 15px;
    border-radius: 0;
    color: #a0aec0;
    font-size: 0.9rem;
}

/* Creative directions styling */
.creative-directions {
    background: rgba(255, 215, 0, 0.1);
    border-left: 4px solid #ffd700;
    padding: 12px 16px;
    margin: 12px 0;
    border-radius: 6px;
    color: #b7791f;
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.1);
}

.creative-directions strong {
    color: #996f00;
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

/* Creative Direction Section Styling - Dedicated Row Layout */
.creative-direction-section {
    margin: 1rem 0 !important;
    border-top: 2px solid rgba(255, 215, 0, 0.3) !important;
    padding-top: 1rem !important;
    background: rgba(255, 215, 0, 0.03) !important;
    border-radius: 0.5rem !important;
    padding: 1rem !important;
}

.creative-direction-controls {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
}

.creative-direction-controls .btn {
    align-self: flex-start !important;
    background: linear-gradient(135deg, #ffd700, #ffed4e) !important;
    color: #333 !important;
    border: none !important;
    padding: 0.5rem 1rem !important;
    font-weight: 600 !important;
}

/* Ensure Acts creative direction button gets yellow styling - Maximum specificity */
.structure-element-header .creative-direction-controls .btn.btn-sm,
.structure-element-header .creative-direction-controls .btn,
h3 .creative-direction-controls .btn {
    background: linear-gradient(135deg, #ffd700, #ffed4e) !important;
    color: #333 !important;
    border: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    padding: 0.5rem 1rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

.structure-element-header .creative-direction-controls .btn.btn-sm:hover,
.structure-element-header .creative-direction-controls .btn:hover,
h3 .creative-direction-controls .btn:hover {
    background: linear-gradient(135deg, #ffed4e, #ffd700) !important;
    color: #333 !important;
    border: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.creative-directions-preview {
    background: rgba(255, 215, 0, 0.15) !important;
    border: 2px solid rgba(255, 215, 0, 0.4) !important;
    border-left: 5px solid #ffd700 !important;
    border-radius: 0.5rem !important;
    padding: 1rem !important;
    font-size: 0.95rem !important;
    margin-top: 0.75rem !important;
    color: #b7791f !important;
    line-height: 1.6 !important;
}

.creative-directions-preview strong {
    color: #996f00 !important;
    display: inline !important;
    margin-right: 0.5rem !important;
    font-weight: 700 !important;
}

.creative-direction-placeholder {
    font-size: 0.9rem !important;
    color: #4a5568 !important;
    font-style: italic !important;
    margin-top: 0.5rem !important;
    padding: 0.5rem !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 0.25rem !important;
    border: 1px dashed rgba(255, 255, 255, 0.3) !important;
}

@media (max-width: 768px) {
    .creative-direction-section {
        margin: 0.75rem 0 !important;
        padding: 0.75rem !important;
        padding-top: 0.75rem !important;
    }
    
    .creative-direction-controls {
        gap: 0.5rem !important;
    }
    
    .creative-directions-preview {
        padding: 0.75rem !important;
        font-size: 0.9rem !important;
        margin-top: 0.5rem !important;
    }
    
    .creative-direction-placeholder {
        font-size: 0.85rem !important;
        padding: 0.4rem !important;
        color: #4a5568 !important;
    }
}

/* Compact act reference header styling */
.act-reference-header {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 12px 0 8px 0;
    font-size: 12px;
    line-height: 1.3;
    color: #6c757d;
}

.template-context {
    margin-bottom: 4px;
}

.template-label {
    font-weight: 600;
    color: #495057;
}

.compact-creative-directions {
    padding-top: 4px;
    border-top: 1px solid #e9ecef;
}

.directions-label {
    font-weight: 600;
    color: #e67e22;
}

.content-placeholder {
    min-height: 100px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
}

.placeholder-content {
    text-align: center;
    color: #718096;
}

.placeholder-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

.placeholder-text {
    font-style: italic;
    font-size: 0.9rem;
}

/* Compact preview mode for structure elements - much more condensed */
.structure-element.preview-mode {
    padding: 8px 12px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.structure-element.preview-mode h3 {
    font-size: 1rem;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

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

.structure-element.preview-mode .structure-element-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.structure-element.preview-mode .act-number {
    font-size: 0.75rem;
    padding: 2px 6px;
    background: #4facfe;
    color: white;
    border-radius: 12px;
    font-weight: 600;
}

.structure-element.preview-mode .preview-status {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: rgba(104, 211, 145, 0.2);
    color: #68d391;
    border-radius: 4px;
}

.structure-element.preview-mode .template-description {
    font-size: 0.8rem;
    color: #a0aec0;
    margin: 4px 0;
    font-style: italic;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.structure-element.preview-mode .content-placeholder {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 6px;
    text-align: center;
    min-height: 24px;
}

.structure-element.preview-mode .placeholder-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #718096;
    font-size: 0.75rem;
}

.structure-element.preview-mode .placeholder-icon {
    font-size: 0.9rem;
}

/* Universal act progress notation styling */
.act-progress {
    display: inline-block;
    background: #4facfe;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 8px;
    vertical-align: middle;
}

/* Make sure it works in both preview and generated containers */
.editable-content-title .act-progress {
    font-size: 0.75rem;
    padding: 2px 6px;
    margin-right: 6px;
}

@media (max-width: 768px) {
    .structure-acts-preview {
        grid-template-columns: 1fr;
    }
    
    .template-structure-preview {
        padding: 20px;
    }
    
    .act-preview-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .act-number {
        align-self: flex-start;
    }
    
    .structure-element.preview-mode {
        padding: 6px 10px;
        margin-bottom: 4px;
    }
    
    .structure-element.preview-mode h3 {
        font-size: 0.9rem;
    }
    
    .structure-element.preview-mode .structure-element-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .structure-element.preview-mode .structure-element-meta {
        align-items: flex-start;
        gap: 6px;
    }
    
    .structure-element.preview-mode .template-description {
        font-size: 0.75rem;
        margin: 2px 0;
    }
    
    .structure-element.preview-mode .content-placeholder {
        padding: 4px;
        min-height: 20px;
    }
    
    .structure-element.preview-mode .placeholder-content {
        font-size: 0.7rem;
        gap: 4px;
    }
    
    /* Creative directions mobile styling */
    .creative-directions {
        padding: 8px 12px;
        margin: 8px 0;
        font-size: 0.8rem;
    }
    
    .creative-directions strong {
        margin-bottom: 4px;
        font-size: 0.8rem;
    }
    
    /* Act reference header mobile styling */
    .act-reference-header {
        font-size: 11px;
        padding: 6px 10px;
        margin: 10px 0 6px 0;
    }
}

/* Hierarchical Content Structure Styles */
.hierarchical-content {
    margin-top: 1rem;
}

.hierarchical-plot-point {
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #f8fafc;
    overflow: hidden;
}

.plot-point-header {
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Plot Point Number Header - Compact Badge Style */
.plot-point-number-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.plot-point-number-badge {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 2.5rem;
    text-align: center;
}

.plot-point-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Plot Point Description Section - Own Line */
.plot-point-description-section {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.375rem;
    border-left: 3px solid #4facfe;
}

.plot-point-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1a1a1a;
    font-weight: 400;
    margin: 0;
    cursor: help; /* Shows this is truncated and hoverable */
}

.plot-point-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.4;
    flex: 1;
}

.plot-point-number {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 700;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.plot-point-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: 1rem;
}

.generate-scenes-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: white !important;
}

.generate-scenes-btn:hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: white !important;
}

.scene-count {
    background: #e0e7ff;
    color: #3730a3;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.plot-point-scenes {
    padding: 0;
}

.hierarchical-scene {
    border-bottom: 1px solid #e2e8f0;
    background: white;
}

.hierarchical-scene:last-child {
    border-bottom: none;
}

.scene-header {
    padding: 0.75rem 1rem;
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
}

.scene-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.scene-number {
    background: #8b5cf6;
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.scene-name {
    color: #334155;
    font-weight: 500;
}

.scene-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.scene-content-container {
    padding: 0 1rem 1rem 1rem;
}

.no-scenes-for-plot-point {
    padding: 2rem 1rem;
    text-align: center;
    background: #fefefe;
    border-top: 1px solid #f1f5f9;
}

.no-scenes-for-plot-point .placeholder-text {
    color: #64748b;
    margin-bottom: 1rem;
    font-style: italic;
}

.scenes-fallback {
    background: #fef3cd;
    border: 1px solid #f59e0b;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.scenes-fallback h4 {
    color: #92400e;
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.warning-text {
    color: #92400e;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.flat-scenes-container {
    background: white;
    border-radius: 0.375rem;
    padding: 1rem;
}

/* Responsive Design for Hierarchical Structure */
@media (max-width: 768px) {
    .plot-point-header {
        padding: 0.75rem;
    }
    
    .plot-point-number-header {
        margin-bottom: 0.5rem;
    }
    
    .plot-point-number-badge {
        padding: 0.25rem 0.6rem;
        font-size: 0.8rem;
        min-width: 2rem;
    }
    
    .plot-point-label {
        font-size: 0.75rem;
    }
    
    .plot-point-description-section {
        padding: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .plot-point-text {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .plot-point-meta {
        margin-left: 0;
        align-self: flex-end;
    }
    
    .scene-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .scene-actions {
        align-self: flex-end;
    }
    
    .hierarchical-plot-point {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .plot-point-title {
        font-size: 1rem;
    }
    
    .scene-title {
        font-size: 0.9rem;
    }
    
    .plot-point-number,
    .scene-number {
        font-size: 0.7rem;
        padding: 0.15rem 0.3rem;
    }
    
    .scene-count {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Step 5 Scene Count Container */
.scene-count-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    max-width: fit-content;
    flex-wrap: nowrap;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 8px 12px;
}

/* Inline Screenplay Estimates */
.screenplay-estimates-inline {
    color: #495057;
    white-space: nowrap;
    display: inline-block;
}

/* Step 6 Dialogue Script Overview */
.dialogue-script-overview {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    max-width: fit-content;
    gap: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 8px 12px;
}

.script-info-label {
    color: #495057;
    font-weight: 500;
    flex-shrink: 0;
}

.screenplay-estimates-inline span {
    white-space: nowrap;
}

/* Scene count input - compact width for 3 digits */
#totalScenes {
    width: 80px;
    text-align: center;
}

/* Responsive: stack on mobile */
@media (max-width: 480px) {
    .estimates-content {
        font-size: 0.85em;
    }
}

/* Responsive: stack on mobile */
@media (max-width: 480px) {
    .estimates-content {
        flex-direction: column;
    }
}

/* Hierarchical Dialogue Layout Styles */
.dialogue-group {
    margin-bottom: 2rem;
}

.dialogue-group-header.compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 0.5rem;
    border: 1px solid #cbd5e0;
    margin-bottom: 1rem;
}

.dialogue-act-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.dialogue-group-actions {
    display: flex;
    gap: 0.5rem;
}

.dialogue-act-description.compact {
    padding: 0.5rem 1rem;
    background: rgba(247, 250, 252, 0.6);
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    border-left: 3px solid #e2e8f0;
}

.dialogue-act-description.compact .act-description-text {
    font-size: 0.9rem;
    color: #4a5568;
    margin: 0;
    line-height: 1.4;
}

.hierarchical-dialogue-content {
    padding-left: 0.5rem;
}

.hierarchical-dialogue-plot-point {
    margin-bottom: 1.5rem;
    border-left: 2px solid #e2e8f0;
    padding-left: 1rem;
}

.dialogue-plot-point-header.compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(237, 242, 247, 0.8);
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    margin-bottom: 0.75rem;
}

.dialogue-plot-point-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #374151;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dialogue-plot-point-title .plot-point-number {
    background: #6366f1;
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 2.5rem;
    text-align: center;
}

.dialogue-plot-point-title .plot-point-text {
    flex: 1;
    line-height: 1.3;
}

.dialogue-plot-point-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dialogue-plot-point-meta .scene-count {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

.dialogue-plot-point-scenes {
    padding-left: 0.5rem;
}

.hierarchical-dialogue-scene {
    margin-bottom: 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.hierarchical-dialogue-scene:last-child {
    margin-bottom: 0;
}

.dialogue-scene-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #fef7ff 0%, #f3e8ff 100%);
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0.5rem 0.5rem 0 0;
}

.dialogue-scene-title {
    font-size: 1rem;
    font-weight: 600;
    color: #6b46c1;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dialogue-scene-title .scene-number {
    background: #8b5cf6;
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 3rem;
    text-align: center;
}

.dialogue-scene-title .scene-name {
    flex: 1;
}

.dialogue-scene-actions {
    display: flex;
    gap: 0.5rem;
}

.dialogue-content-container {
    padding: 1rem;
}

.dialogue-content-container .editable-content-block {
    margin: 0;
    box-shadow: none;
    border: none;
    background: transparent;
}

.dialogue-content-container .editable-content-header {
    display: none; /* Hide title since it's already in the scene header */
}

.dialogue-content-container .dialogue-content {
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    line-height: 1.6;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
    margin: 0;
}

.no-dialogue-scenes-for-plot-point {
    padding: 1rem;
    text-align: center;
    background: #f9fafb;
    border-radius: 0.375rem;
    border: 1px dashed #d1d5db;
}

.no-dialogue-scenes-for-plot-point .placeholder-text {
    color: #6b7280;
    font-style: italic;
    margin-bottom: 0.5rem;
}

.no-dialogue-scenes-for-plot-point .info-text {
    color: #9ca3af;
    font-size: 0.875rem;
    margin: 0;
}

.dialogue-scenes-fallback {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.dialogue-scenes-fallback h4 {
    color: #92400e;
    margin-bottom: 0.5rem;
}

.dialogue-scenes-fallback .warning-text {
    color: #b45309;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.dialogue-plot-points-warning,
.dialogue-scenes-warning,
.dialogue-prerequisites-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.dialogue-plot-points-warning p,
.dialogue-scenes-warning p,
.dialogue-prerequisites-warning p {
    color: #b45309;
    font-size: 0.9rem;
    margin: 0;
}

.dialogue-prerequisites-warning {
    background: #fee2e2;
    border-color: #f87171;
}

.dialogue-prerequisites-warning p {
    color: #dc2626;
}

/* Responsive adjustments for dialogue hierarchy */
@media (max-width: 768px) {
    .dialogue-group-header.compact {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .dialogue-group-actions {
        justify-content: center;
    }
    
    .dialogue-plot-point-header.compact {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .dialogue-plot-point-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .dialogue-scene-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .dialogue-scene-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .dialogue-scene-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hierarchical-dialogue-plot-point {
        padding-left: 0.5rem;
    }
    
    .dialogue-plot-point-scenes {
        padding-left: 0.25rem;
    }
    
    .dialogue-act-title {
        font-size: 1rem;
    }
    
    .dialogue-plot-point-title {
        font-size: 0.875rem;
    }
    
    .dialogue-scene-title {
        font-size: 0.9rem;
    }
}

/* Dialogue Scene Vertical Layout Styles - Force Vertical Layout */
.dialogue-scene-header {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    padding: 1rem !important;
    background: #ffffff !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

.dialogue-scene-header .scene-number-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.dialogue-scene-header .scene-number-badge {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 2.5rem;
    text-align: center;
}

.dialogue-scene-header .scene-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dialogue-scene-header .scene-description-section {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.375rem;
    border-left: 3px solid #8b5cf6;
}

.dialogue-scene-header .scene-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.4;
}

.dialogue-scene-header .scene-description {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1a1a1a !important;
    font-weight: 400;
    margin: 0;
    cursor: help;
}

.dialogue-scene-header .dialogue-actions-section {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.dialogue-scene-header .dialogue-actions-section .btn {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

@media (max-width: 768px) {
    .dialogue-scene-header .scene-number-badge {
        padding: 0.25rem 0.6rem;
        font-size: 0.8rem;
        min-width: 2rem;
    }
    
    .dialogue-scene-header .scene-label {
        font-size: 0.75rem;
    }
    
    .dialogue-scene-header .scene-description-section {
        padding: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .dialogue-scene-header .scene-title {
        font-size: 1rem;
    }
    
    .dialogue-scene-header .scene-description {
        font-size: 0.9rem;
    }
    
    .dialogue-scene-header .dialogue-actions-section {
        gap: 0.25rem;
        margin-top: 0.75rem;
    }
    
    .dialogue-scene-header .dialogue-actions-section .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .dialogue-scene-header .scene-number-header {
        margin-bottom: 0.5rem;
    }
    
    .dialogue-scene-header .scene-description-section {
        margin-bottom: 0.5rem;
    }
    
    .dialogue-scene-header .dialogue-actions-section {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .dialogue-scene-header .dialogue-actions-section .btn {
        width: 100%;
        text-align: center;
    }
}

/* AI Story Analysis Feedback Styles */
.story-analysis-results {
    margin-top: 2rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.analysis-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.close-analysis-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.close-analysis-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.analysis-content {
    padding: 2rem;
}

.analysis-overall-score {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.score-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    margin-bottom: 1rem;
}

.score-circle.high { background: #28a745; }
.score-circle.medium { background: #ffc107; color: #333; }
.score-circle.low { background: #dc3545; }

.readiness-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.readiness-badge.exceptional { 
    background: linear-gradient(45deg, #4CAF50, #45a049); 
    color: white; 
    font-weight: bold;
}
.readiness-badge.ready { background: #fff3cd; color: #856404; }
.readiness-badge.needs_work { background: #f8d7da; color: #721c24; }

.analysis-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.analysis-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.analysis-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.analysis-section h4 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.analysis-score {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.score-bar {
    width: 100px;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.score-fill.high { background: #28a745; }
.score-fill.medium { background: #ffc107; }
.score-fill.low { background: #dc3545; }

.score-number {
    font-weight: 600;
    font-size: 0.9rem;
    color: #666;
}

.analysis-feedback {
    color: #555;
    line-height: 1.6;
    margin-top: 0.75rem;
}

.analysis-strengths, .analysis-suggestions {
    margin-top: 1.5rem;
}

.analysis-strengths h4, .analysis-suggestions h4 {
    color: #333;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.analysis-strengths ul, .analysis-suggestions ul {
    list-style: none;
    padding: 0;
}

.analysis-strengths li, .analysis-suggestions li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #555;
    line-height: 1.5;
}

.analysis-strengths li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

.analysis-suggestions li::before {
    content: '💡';
    position: absolute;
    left: 0;
}

/* Enhanced Analysis Sections */
.analysis-dealbreakers {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
}

.analysis-dealbreakers h4 {
    color: #c53030;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.analysis-dealbreakers ul {
    list-style: none;
    padding: 0;
}

.analysis-dealbreakers li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #c53030;
    line-height: 1.5;
    font-weight: 500;
}

.analysis-dealbreakers li::before {
    content: '🚨';
    position: absolute;
    left: 0;
}

.analysis-weaknesses {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fffaf0;
    border: 1px solid #fbd38d;
    border-radius: 8px;
}

.analysis-weaknesses h4 {
    color: #d69e2e;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.analysis-weaknesses ul {
    list-style: none;
    padding: 0;
}

.analysis-weaknesses li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #d69e2e;
    line-height: 1.5;
}

.analysis-weaknesses li::before {
    content: '⚠️';
    position: absolute;
    left: 0;
}

/* Dual Score Display */
.analysis-score-double {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.score-label {
    font-size: 0.8rem;
    color: #666;
    min-width: 80px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .analysis-score-double {
        gap: 0.75rem;
    }
    
    .score-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .score-label {
        min-width: auto;
        font-size: 0.75rem;
    }
}

.confidence-level {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    text-align: center;
}

.confidence-level h5 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-weight: 600;
}

.confidence-score {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.analyzed-prompt-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
    text-align: center;
}

.analyzed-prompt-section .btn {
    margin-bottom: 0.5rem;
}

.prompt-note {
    margin: 0.5rem 0 0 0;
    font-size: 0.85rem;
    color: #6c757d;
    font-style: italic;
}

/* Large Modal for Prompt Display */
.large-modal {
    max-width: 900px;
    width: 90vw;
}

.large-modal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.prompt-info {
    background: #e3f2fd;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #2196f3;
}

.prompt-info p {
    margin: 0.5rem 0;
    color: #1565c0;
}

.prompt-content {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    max-height: 400px;
    overflow: auto;
}

.prompt-content pre {
    margin: 0;
    padding: 1.5rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #495057;
}

.template-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f1f3f4;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.template-info h4 {
    margin: 0 0 1rem 0;
    color: #155724;
    font-size: 1.1rem;
}

.template-info p {
    margin: 0.5rem 0;
    color: #155724;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.analyze-btn-loading {
    opacity: 0.7;
    pointer-events: none;
}

.analyze-btn-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

/* Template Recommendation Styling */
.template-recommendation {
    border: 2px solid #4F46E5;
    border-radius: 8px;
    background: linear-gradient(135deg, #EEF2FF 0%, #F8FAFC 100%);
}

.template-recommendation .analysis-section-header h4 {
    color: #4F46E5;
}

.recommended-template-name {
    font-size: 1.1em;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
}

.alternative-templates {
    margin-top: 15px;
    padding: 12px;
    background: #F8FAFC;
    border-radius: 6px;
    border-left: 3px solid #94A3B8;
}

.alternative-templates h5 {
    margin: 0 0 8px 0;
    font-size: 0.9em;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alternative-templates ul {
    margin: 0;
    padding-left: 20px;
}

.alternative-templates li {
    margin-bottom: 4px;
    font-size: 0.9em;
    color: #475569;
}

.template-action {
    margin-top: 15px;
    text-align: center;
}

.template-action .btn {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    border: none;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.template-action .btn:hover {
    background: linear-gradient(135deg, #4338CA 0%, #6D28D9 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

@media (max-width: 768px) {
    .analysis-header {
        padding: 1rem 1.5rem;
    }
    
    .analysis-content {
        padding: 1.5rem;
    }
    
    .analysis-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .score-circle {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* Apply Suggestions Section */
.apply-suggestions-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-radius: 8px;
    text-align: center;
}

.apply-suggestions-section .btn {
    background: white;
    color: #4CAF50;
    border: 2px solid white;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.apply-suggestions-section .btn:hover {
    background: transparent;
    color: white;
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.apply-suggestions-section .btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.apply-note {
    color: white;
    margin-top: 0.75rem;
    margin-bottom: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Improvement Preview Modal */
.improvement-comparison {
    max-width: 100%;
}

.comparison-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.comparison-header h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.comparison-header p {
    color: #666;
    margin: 0;
}

.improvement-section {
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.improvement-section h4 {
    background: #f8f9fa;
    margin: 0;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    color: #333;
    font-size: 1rem;
    font-weight: 600;
}

.comparison-box {
    padding: 1.5rem;
}

.before-after {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.before, .after {
    padding: 1rem;
    border-radius: 6px;
    min-height: 80px;
}

.before {
    background: #fff5f5;
    border: 1px solid #fed7d7;
}

.after {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
}

.before label, .after label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.before label {
    color: #c53030;
}

.after label {
    color: #38a169;
}

.before .content, .after .content {
    color: #333;
    line-height: 1.5;
    font-size: 0.95rem;
}

.change-controls {
    padding: 0.75rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.change-controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-weight: 500;
    cursor: pointer;
    color: #333;
}

.change-controls input[type="checkbox"] {
    margin: 0;
    transform: scale(1.1);
}

.changes-summary, .preserved-elements {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
}

.changes-summary {
    background: #fff5f5;
    border: 1px solid #fed7d7;
}

.preserved-elements {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
}

.changes-summary h4, .preserved-elements h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #333;
    font-size: 1rem;
    font-weight: 600;
}

.changes-summary ul, .preserved-elements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.changes-summary li, .preserved-elements li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #555;
    line-height: 1.5;
}

.changes-summary li::before {
    content: '🔄';
    position: absolute;
    left: 0;
}

.preserved-elements li::before {
    content: '✅';
    position: absolute;
    left: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .before-after {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .apply-suggestions-section {
        padding: 1rem;
    }
    
    .apply-suggestions-section .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
    }
    
    .comparison-box {
        padding: 1rem;
    }
    
    .modal-actions {
        flex-direction: column-reverse;
        gap: 0.5rem;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}

/* Genie Button - Magical themed button for AI feedback */
.btn-genie {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 1px solid #667eea;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.btn-genie:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    border-color: #5a67d8;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

.btn-genie:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* Genie Button Container - Icon next to button layout */
.genie-button-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.genie-icon-large {
    width: 64px;
    height: 64px;
    opacity: 0.9;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.3));
}

.genie-button-container:hover .genie-icon-large {
    opacity: 1;
    transform: scale(1.05);
}

/* Loading state for genie button container */
.btn-genie.analyze-btn-loading + .genie-icon-large,
.genie-button-container .btn-genie.analyze-btn-loading ~ .genie-icon-large {
    animation: spin 1.5s linear infinite;
}

/* Keep old genie icon styles for backward compatibility */
.genie-icon {
    width: 28px;
    height: 28px;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.btn-genie:hover .genie-icon {
    opacity: 1;
}

/* Loading state for genie button */
.btn-genie.analyze-btn-loading {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.8;
    cursor: not-allowed;
}

.btn-genie.analyze-btn-loading .genie-icon {
    animation: spin 1s linear infinite;
}

/* Genie Header Icons - For "The Genie's Verdict" and "Improvements" */
.analysis-title-container,
.genie-improvements-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.genie-icon-header {
    width: 64px;
    height: 64px;
    opacity: 0.8;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.analysis-title-container:hover .genie-icon-header,
.genie-improvements-header:hover .genie-icon-header {
    opacity: 1;
}

/* Genie Wisdom Container - For "Apply the Genie's Wisdom" */
.genie-wisdom-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.genie-icon-medium {
    width: 64px;
    height: 64px;
    opacity: 0.8;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.genie-wisdom-container:hover .genie-icon-medium {
    opacity: 1;
    transform: scale(1.05);
}

/* Responsive design for genie container */
@media (max-width: 768px) {
    .genie-button-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .genie-icon-large {
        width: 48px;
        height: 48px;
    }
    
    .genie-wisdom-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .genie-icon-header {
        width: 48px;
        height: 48px;
    }
    
    .genie-icon-medium {
        width: 48px;
        height: 48px;
    }
}

/* Genie Commentary Section - For displaying genie's personality feedback */
.genie-commentary {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8ebff 100%);
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.genie-commentary-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #d0d7ff;
}

.genie-commentary-header h4 {
    margin: 0;
    color: #4c51bf;
    font-size: 1.1rem;
    font-weight: 600;
}

.genie-commentary-text {
    color: #4a5568;
    font-style: italic;
    line-height: 1.6;
    font-size: 1rem;
    white-space: pre-wrap;
}

@media (max-width: 768px) {
    .genie-commentary {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .genie-commentary-header {
        gap: 0.5rem;
    }
}

/* Genie Suggestions System - Modal Footer Button */
.btn-genie {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: white;
    border: none;
    padding: 10px 8px 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    order: 1;
}

.btn-genie:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #0a58ca 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
    color: white;
}

.btn-genie:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Genie button with branded icon */
.genie-icon-button {
    width: 48px;
    height: 48px;
    margin-left: 2px;
    vertical-align: middle;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    order: 2;
}

.modal-footer-left:hover .genie-icon-button {
    opacity: 1;
}

.modal-footer-left {
    display: flex;
    align-items: center;
    gap: 0;
}

.genie-highlight {
    animation: genieHighlight 1s ease-in-out;
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
}

@keyframes genieHighlight {
    0% {
        background-color: rgba(13, 110, 253, 0.1);
    }
    50% {
        background-color: rgba(13, 110, 253, 0.2);
    }
    100% {
        background-color: transparent;
    }
}

/* Enhanced modal footer for Genie button positioning */
.universal-library-modal .modal-footer,
.library-modal .modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-top: 1px solid #dee2e6;
    width: 100%;
}

.modal-footer-left {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    justify-content: flex-start;
    margin-right: 20px; /* Add spacing between genie button and right side buttons */
}

.modal-footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    justify-content: flex-end;
}

/* Responsive adjustments for Genie system */
@media (max-width: 768px) {
    .universal-library-modal .modal-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer-left,
    .modal-footer-right {
        width: 100%;
        justify-content: center;
    }
    
    .genie-icon-button {
        width: 40px;
        height: 40px;
        margin-left: 2px;
    }
}

/* Close button styling for modals using class="close" */
.close {
    background: rgba(71, 85, 105, 0.1);
    border: 1px solid rgba(71, 85, 105, 0.2);
    font-size: 1.5rem;
    cursor: pointer;
    color: #475569;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    line-height: 1;
    text-decoration: none;
}

.close:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

/* Scene Navigation */
.scene-nav {
    margin-bottom: 10px;
}

.scene-nav select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 300px;
}

/* Voice Generation System Styles */
.voice-generation-button {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.voice-generation-button:hover {
    background: linear-gradient(45deg, #0056b3, #003d82);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.voice-generation-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.voice-assignment-container {
    margin-bottom: 20px;
}

.voice-assignment-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.voice-assignment-item strong {
    min-width: 120px;
    margin-right: 15px;
    color: #495057;
}

.voice-assignment-item select {
    flex: 1;
    margin-right: 10px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
}

.voice-preview-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
}

.voice-preview-btn:hover {
    background: #218838;
}

.generation-options {
    margin-top: 20px;
    padding: 15px;
    background: #f1f3f4;
    border-radius: 8px;
}

.generation-options label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

.generation-options input[type="number"] {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

/* Advanced Voice Settings */
.advanced-settings {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.advanced-settings h6 {
    margin-bottom: 15px;
    color: #495057;
    font-weight: 600;
}

.advanced-settings .form-group {
    margin-bottom: 15px;
}

.advanced-settings label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.advanced-settings select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
}

.advanced-settings input[type="range"] {
    width: 100%;
    margin: 5px 0;
}

.advanced-settings small {
    display: block;
    margin-top: 3px;
    color: #6c757d;
    font-size: 11px;
}

.advanced-settings input[type="checkbox"] {
    margin-right: 8px;
}

.scene-audio-player {
    padding: 20px;
}

.audio-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.audio-info p {
    margin: 5px 0;
}

.audio-controls {
    margin-bottom: 20px;
}

.audio-controls button {
    margin-right: 10px;
}

.audio-segments {
    border-top: 1px solid #dee2e6;
    padding-top: 20px;
}

.segments-list {
    max-height: 300px;
    overflow-y: auto;
}

.segment-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.segment-item strong {
    min-width: 100px;
    margin-right: 15px;
    color: #495057;
}

.segment-text {
    flex: 1;
    margin-right: 15px;
    color: #6c757d;
}

.segment-item button {
    flex-shrink: 0;
}

