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


body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

/* Heading Fonts */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Literata', Georgia, 'Times New Roman', serif;
    font-weight: 600;
    line-height: 1.3;
}

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

.timeline-panel .home-nav {
    margin-bottom: 15px;
    text-align: right;
}

.timeline-panel .home-link {
    display: inline-block;
    font-size: 0.85rem;
    color: #718096;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.timeline-panel .home-link:hover {
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.2);
}

/* Project Creation Panel */
.project-creation-panel,
.character-creation-panel {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border: 2px solid #667eea;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Bootstrap Panel */
.bootstrap-panel {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #48bb78;
    border-radius: 12px;
    margin-bottom: 30px;
    overflow: hidden;
}

.bootstrap-content {
    padding: 30px;
    text-align: center;
}

.bootstrap-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.bootstrap-content h3 {
    color: #2d3748;
    font-size: 1.8rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.bootstrap-content p {
    color: #4a5568;
    font-size: 1.1rem;
    margin-bottom: 25px;
    line-height: 1.6;
}

.bootstrap-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 25px 0;
    text-align: left;
}

.feature-column h4 {
    color: #2d3748;
    font-size: 1rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.feature-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-column li {
    color: #4a5568;
    font-size: 0.9rem;
    padding: 2px 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.feature-column li:last-child {
    border-bottom: none;
}

.feature-column li em {
    color: #48bb78;
    font-weight: 600;
}

.bootstrap-actions {
    margin-top: 30px;
}

.bootstrap-actions button {
    font-size: 1.1rem;
    padding: 15px 30px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border-radius: 8px;
    min-width: 280px;
}

@media (max-width: 768px) {
    .bootstrap-content {
        padding: 20px 15px;
    }
    
    .bootstrap-features {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        margin: 20px 0;
    }
    
    .bootstrap-actions button {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .bootstrap-features {
        grid-template-columns: 1fr;
    }
    
    .bootstrap-content h3 {
        font-size: 1.5rem;
    }
    
    .bootstrap-content p {
        font-size: 1rem;
    }
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.form-header h2 {
    color: #667eea;
    font-size: 1.8rem;
    margin: 0;
}

.cancel-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #718096;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: auto;
    min-height: auto;
}

.cancel-btn:hover {
    background-color: rgba(226, 232, 240, 0.5);
    color: #e53e3e;
}

.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 5px;
    font-size: 1rem;
}

.form-row input[type="text"],
.form-row input[type="password"],
.form-row textarea,
.form-row select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.2s ease;
    -webkit-appearance: none;
}

.form-row input[type="text"]:focus,
.form-row input[type="password"]:focus,
.form-row textarea:focus,
.form-row select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-row textarea {
    resize: vertical;
    min-height: 80px;
}

.form-help {
    display: block;
    font-size: 0.85rem;
    color: #718096;
    margin-top: 4px;
    font-style: italic;
}

.feedback-status {
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 0.9rem;
    font-weight: 500;
}

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

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

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

.primary-btn {
    background: linear-gradient(135deg, rgba(108, 117, 203, 0.85) 0%, rgba(131, 102, 162, 0.85) 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    backdrop-filter: blur(1px);
    box-shadow: 0 2px 4px rgba(108, 117, 203, 0.2);
}

.primary-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(88, 97, 173, 0.9) 0%, rgba(111, 82, 142, 0.9) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 203, 0.25);
}

.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    background: white;
    color: #718096;
    border: 2px solid #e2e8f0;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.secondary-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.05);
}

@media (max-width: 768px) {
    .project-creation-panel,
    .character-creation-panel {
        padding: 20px 15px;
        border-radius: 8px;
        margin-bottom: 20px;
    }
    
    /* Improve tab navigation on medium screens */
    .nav-tab {
        min-width: 75px;
        padding: 14px 8px;
        font-size: 0.8rem;
        gap: 4px;
    }
    
    .nav-label {
        font-size: 0.75rem;
        line-height: 1.2;
    }

    /* Sub-tab responsive styles */
    .sub-tab-btn {
        font-size: 0.8rem;
        padding: 8px 12px;
    }

    .relationship-item {
        padding: 12px 16px;
        gap: 8px;
        font-size: 0.9rem;
    }

    .relationship-axis {
        padding: 3px 8px;
        font-size: 0.85rem;
    }

    .relationship-search-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .relationship-count {
        text-align: center;
    }

    /* Better modal sizing on medium screens */
    .delete-relationship-panel,
    .delete-account-panel,
    .project-creation-panel,
    .character-creation-panel,
    .project-edit-panel,
    .character-edit-panel,
    .modal-content {
        width: 90%;
        max-width: 450px;
        padding: 25px 20px;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .form-header h2 {
        font-size: 1.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .primary-btn,
    .secondary-btn {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 20px;
    }
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px 15px;
    background: linear-gradient(135deg, #5a67d8 0%, #6b7280 100%);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

header p {
    opacity: 0.9;
    font-size: 0.95rem;
}

@media (min-width: 768px) {
    header {
        margin-bottom: 40px;
        padding: 30px;
        border-radius: 12px;
    }
    
    header h1 {
        font-size: 2.5rem;
        margin-bottom: 10px;
    }
    
    header p {
        font-size: 1.1rem;
    }
}

/* User Controls (Login info and logout button) */
.user-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 0.8rem;
    z-index: 10;
}

.user-controls button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.user-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mobile responsive layout for user controls */
@media (max-width: 768px) {
    .user-controls {
        position: static;
        justify-content: center;
        margin-top: 12px;
        gap: 10px;
        font-size: 0.85rem;
        flex-wrap: wrap;
    }
    
    .user-controls button {
        font-size: 0.8rem;
        padding: 8px 16px;
    }
}

/* Navigation Tabs */
.app-nav {
    display: flex;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow-x: auto;
}

.nav-tab {
    flex: 1;
    min-width: 80px;
    padding: 15px 10px;
    border: none;
    background: transparent;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    border-bottom: 3px solid transparent;
}

.nav-tab:hover {
    background: rgba(102, 126, 234, 0.05);
    color: #667eea;
}

.nav-tab.active {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-bottom-color: #667eea;
}

.nav-icon {
    font-size: 1.1rem;
}

/* Sub-Navigation Tabs */
.sub-nav {
    display: flex;
    background: #f7fafc;
    border-radius: 6px;
    margin: 20px 0;
    padding: 4px;
    gap: 4px;
}

.sub-tab-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    background: transparent;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    border-radius: 4px;
}

.sub-tab-btn:hover {
    background: rgba(102, 126, 234, 0.05);
    color: #667eea;
}

.sub-tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sub-tab-content {
    padding: 20px 15px;
}

/* Relationship List Styles */
.relationship-list-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 10px;
}

.grouping-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    padding: 4px;
    background: #f7fafc;
    border-radius: 8px;
}

.grouping-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #4a5568;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.grouping-btn:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

.grouping-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.relationship-search-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f7fafc;
    border-radius: 8px;
}

.relationship-search-bar input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
}

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

.relationship-count {
    color: #718096;
    font-size: 0.85rem;
    white-space: nowrap;
    font-weight: 500;
}

.relationships-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow-y: auto;
    padding: 0 5px 0 2px;
}

/* Custom scrollbar for relationship list */
.relationships-list::-webkit-scrollbar {
    width: 8px;
}

.relationships-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.relationships-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.relationships-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.relationship-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.relationship-item:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.relationship-from,
.relationship-to {
    font-weight: 600;
    color: #2d3748;
}

.relationship-axis {
    color: #667eea;
    font-weight: 500;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 12px;
    border-radius: 4px;
}

.relationship-arrow {
    color: #a0aec0;
    font-size: 0.9rem;
}

.relationship-group-header {
    font-weight: 600;
    color: #2d3748;
    font-size: 1rem;
    padding: 8px 12px;
    background: #f7fafc;
    border-radius: 6px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.relationship-group-header:hover {
    background: #edf2f7;
    color: #667eea;
}

.relationship-group-header::before {
    content: '▼';
    color: #667eea;
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.relationship-group.collapsed .relationship-group-header::before {
    transform: rotate(-90deg);
}

.relationship-group-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 10px;
}

.brainstorm-tab-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 40px 20px;
}

.brainstorm-tab-content h3 {
    color: #2d3748;
    margin-bottom: 15px;
}

.brainstorm-tab-content p {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 20px;
}

.nav-label {
    font-weight: 500;
}

/* Tab Content */
.tab-content {
    display: none;
    background: white;
    padding: 20px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.tab-content.active {
    display: block;
}

.tab-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.tab-header h2 {
    color: #667eea;
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.tab-header p {
    color: #718096;
    font-size: 0.95rem;
}

/* Selection Steps */
.selection-step {
    margin-bottom: 25px;
}

.selection-step h3 {
    color: #4a5568;
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.project-selection,
.character-selection,
.relationship-selection {
    max-width: 500px;
    margin: 0 auto;
}

.current-project,
.project-actions {
    margin-bottom: 20px;
}

.project-actions {
    text-align: center;
}

@media (min-width: 768px) {
    .nav-tab {
        padding: 20px 15px;
        font-size: 0.9rem;
        gap: 8px;
    }
    
    .nav-icon {
        font-size: 1.3rem;
    }
    
    .tab-content {
        padding: 30px;
        margin-bottom: 40px;
    }
    
    .tab-header h2 {
        font-size: 2.2rem;
    }
    
    .tab-header p {
        font-size: 1rem;
    }
    
    .selection-step h3 {
        font-size: 1.2rem;
    }
}

/* Settings Panel */
.settings-panel {
    background: white;
    padding: 20px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.settings-content {
    margin-top: 20px;
}

.settings-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

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

.settings-section h3 {
    color: #4a5568;
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 600;
}

/* Enhanced styling for Settings forms */
.settings-section .form-row input[type="text"],
.settings-section .form-row input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    background: #fafafa;
    transition: all 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.settings-section .form-row input[type="text"]:focus,
.settings-section .form-row input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.settings-section .form-row input[type="text"]::placeholder,
.settings-section .form-row input[type="password"]::placeholder {
    color: #a0aec0;
    font-style: italic;
}

.settings-section .primary-btn {
    background: linear-gradient(135deg, rgba(108, 117, 203, 0.85) 0%, rgba(131, 102, 162, 0.85) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(1px);
    box-shadow: 0 2px 4px rgba(108, 117, 203, 0.2);
}

.settings-section .primary-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(88, 97, 173, 0.9) 0%, rgba(111, 82, 142, 0.9) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 203, 0.25);
}

.settings-section .primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.settings-section .secondary-btn {
    background: #e2e8f0;
    color: #4a5568;
    border: 1px solid #cbd5e0;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-section .secondary-btn:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Admin Dashboard Styles */
.admin-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

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

.stat-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
}

.stat-breakdown {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-breakdown strong {
    color: #667eea;
    font-weight: 600;
}

.stat-divider {
    color: #cbd5e0;
}

.admin-actions {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* Management panels styling */
.management-actions {
    margin-bottom: 25px;
    text-align: center;
}

.character-actions,
.project-actions {
    margin-top: 20px;
    text-align: center;
}

.character-item,
.project-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.2s ease;
}

.character-item:hover,
.project-item:hover {
    border-color: #a0aec0;
    background: #f7fafc;
    cursor: grab;
}

.character-item:active {
    cursor: grabbing;
}

.character-item.dragging {
    opacity: 0.5;
    background: #e2e8f0;
    border-style: dashed;
}

.drag-handle {
    color: #cbd5e0;
    font-size: 1.2rem;
    cursor: grab;
    padding: 0 8px;
    user-select: none;
    transition: color 0.2s ease;
}

.character-item:hover .drag-handle {
    color: #667eea;
}

.drag-handle:active {
    cursor: grabbing;
}

.project-item.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.character-info h4 {
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.character-notes {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

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

.character-tags .tag {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.character-actions,
.project-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.icon-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.05);
}

.icon-btn.edit-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.icon-btn.delete-btn:hover {
    background: rgba(197, 48, 48, 0.1);
}

.empty-state,
.error-state,
.no-project {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
    font-style: italic;
}

.confirm-delete {
    text-align: center;
}

.confirm-delete p {
    margin-bottom: 10px;
    font-weight: 600;
    color: #c53030;
}

.confirm-delete-btn {
    background: #c53030;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    margin-right: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.confirm-delete-btn:hover {
    background: #9c2626;
    transform: translateY(-1px);
}

.cancel-delete-btn {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.user-info-display p {
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.user-info-display strong {
    color: #2d3748;
    font-weight: 600;
}

.account-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .settings-panel {
        padding: 30px;
        border-radius: 12px;
        margin-bottom: 40px;
    }
    
    .settings-section h3 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .user-info-display p {
        font-size: 1rem;
        margin-bottom: 10px;
    }
}

.selection-panel {
    background: white;
    padding: 20px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.step {
    margin-bottom: 20px;
}

.step h3 {
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

@media (min-width: 768px) {
    .selection-panel {
        padding: 30px;
        border-radius: 12px;
        margin-bottom: 30px;
    }
    
    .step {
        margin-bottom: 25px;
    }
    
    .step h3 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
}

select, button {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    min-height: 48px; /* Better touch targets */
}

@media (min-width: 768px) {
    select, button {
        padding: 12px 16px;
        border-radius: 8px;
        min-height: auto;
    }
}

select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

button {
    background: linear-gradient(135deg, rgba(108, 117, 203, 0.85) 0%, rgba(131, 102, 162, 0.85) 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 20px;
    transition: all 0.3s ease;
    backdrop-filter: blur(1px);
    box-shadow: 0 2px 4px rgba(108, 117, 203, 0.2);
}

button:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(88, 97, 173, 0.9) 0%, rgba(111, 82, 142, 0.9) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 203, 0.25);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.timeline-panel {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.axis-selector {
    position: relative !important;
    display: inline-block;
    z-index: 100;
}

.timeline-controls {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
}

.delete-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.delete-btn:hover {
    background: #c53030;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.3);
}

/* Modal overlay for interrupting popups */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Welcome Modal Styles */
.welcome-modal {
    max-width: 550px;
}

.welcome-content {
    padding: 10px 0;
    font-size: 1rem;
    line-height: 1.7;
}

.welcome-content p {
    margin-bottom: 15px;
    color: #4a5568;
}

.welcome-content strong {
    color: #2d3748;
}

.welcome-signature {
    margin-top: 20px;
    font-style: italic;
    color: #667eea;
}

/* Changelog Modal Styles */
.changelog-modal {
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.changelog-content {
    flex: 1;
    overflow-y: auto;
    max-height: 50vh;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    font-family: inherit;
}

.changelog-content::-webkit-scrollbar {
    width: 8px;
}

.changelog-content::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 4px;
}

.changelog-content::-webkit-scrollbar-thumb {
    background: #a0aec0;
    border-radius: 4px;
}

.changelog-content::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

.delete-relationship-panel {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    max-width: 500px;
    width: 90%;
}

.warning-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #fef5e7;
    border: 1px solid #f6ad55;
    border-radius: 8px;
    margin-bottom: 20px;
}

.warning-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.warning-message p {
    margin: 0;
    color: #744210;
    line-height: 1.5;
}

.delete-options {
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #4a5568;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
}

.danger-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.danger-btn:hover {
    background: #c53030;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.3);
}

.danger-btn:disabled {
    background: #fed7d7;
    color: #9b2c2c;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.account-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.danger-text {
    color: #e53e3e;
    font-weight: 500;
}

.delete-account-panel {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    max-width: 500px;
    width: 90%;
}

.delete-confirmation-field {
    margin: 20px 0;
}

.delete-confirmation-field label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 500;
}

.delete-confirmation-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

.export-btn {
    background: transparent;
    color: #667eea;
    border: 1px solid #667eea;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.export-btn:hover {
    background: #f7fafc;
    border-color: #5a67d8;
    color: #5a67d8;
    transform: translateY(-1px);
}

.export-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 120px;
    margin-top: 4px;
}

.export-dropdown button {
    display: block;
    width: 100%;
    background: none;
    border: none;
    padding: 10px 16px;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 14px;
}

.export-dropdown button:hover {
    background: #f7fafc;
}

.export-dropdown button:first-child {
    border-radius: 6px 6px 0 0;
}

.export-dropdown button:last-child {
    border-radius: 0 0 6px 6px;
}

.clickable-axis {
    color: #667eea;
    font-size: 2.2rem;
    margin-bottom: 5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    user-select: none;
}

.clickable-axis:hover {
    background-color: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.dropdown-icon {
    font-size: 0.8em;
    transition: transform 0.2s ease;
}

.axis-selector.open .dropdown-icon {
    transform: rotate(180deg);
}

.custom-dropdown {
    position: absolute !important;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #a0aec0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    min-width: 200px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.custom-dropdown.show {
    display: block;
}

.dropdown-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

.dropdown-option.selected {
    background-color: rgba(102, 126, 234, 0.2);
    font-weight: 600;
}

@media (max-width: 768px) {
    .timeline-header {
        margin-bottom: 20px;
        padding-bottom: 12px;
    }
    
    .clickable-axis {
        font-size: 1.8rem;
        padding: 6px 12px;
        gap: 8px;
    }
    
    .custom-dropdown {
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .clickable-axis {
        font-size: 1.6rem;
        padding: 4px 10px;
        gap: 6px;
    }
    
    .custom-dropdown {
        min-width: 160px;
        font-size: 0.9rem;
    }
}

.equalizer-container {
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .equalizer-container {
        margin-bottom: 30px;
    }
}

.direction-header {
    margin-bottom: 15px;
    text-align: center;
}

.clickable-direction {
    color: #4a5568;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    margin-bottom: 6px;
    user-select: none;
}

@media (min-width: 768px) {
    .direction-header {
        margin-bottom: 20px;
    }
    
    .clickable-direction {
        padding: 16px 20px;
        border-radius: 12px;
        gap: 12px;
        font-size: 1.3rem;
        margin-bottom: 8px;
    }
}

.clickable-direction:hover {
    background: linear-gradient(135deg, rgba(108, 117, 203, 0.85) 0%, rgba(131, 102, 162, 0.85) 100%);
    color: white;
    transform: translateY(-1px);
    backdrop-filter: blur(1px);
    box-shadow: 0 4px 8px rgba(108, 117, 203, 0.25);
}

.flip-icon {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.clickable-direction:hover .flip-icon {
    transform: rotate(180deg);
}

.flip-hint {
    color: #718096;
    font-size: 0.9rem;
    margin: 0;
    font-style: italic;
}

/* Story Equalizer Styles */
.story-equalizer {
    padding: 20px 15px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    overflow-x: auto;
}

@media (min-width: 768px) {
    .story-equalizer {
        padding: 40px 20px;
        border-radius: 12px;
        margin-bottom: 30px;
        overflow-x: visible;
    }
}

.sliders-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    align-items: flex-end;
    height: 200px;
    margin-bottom: 10px;
}

.phase-slider-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    position: relative;
}

.phase-slider {
    writing-mode: bt-lr; /* IE */
    -webkit-appearance: slider-vertical; /* WebKit */
    width: 6px;
    height: 180px;
    background: transparent;
    outline: none;
    cursor: pointer;
    margin-bottom: 3px;
    touch-action: pan-y;
}

/* Midpoint Slider Special Styling */
.midpoint-wrapper {
    position: relative;
    padding: 0 8px;
    margin: 0 4px;
}

.midpoint-wrapper::before {
    content: '';
    position: absolute;
    left: 0;
    top: -10px;
    right: 0;
    bottom: -10px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 193, 7, 0.15) 100%);
    border: 2px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    z-index: -1;
}

.midpoint-slider {
    width: 10px !important;
    filter: drop-shadow(0 2px 4px rgba(255, 193, 7, 0.3));
}

.midpoint-value {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #1a1a1a;
    font-weight: 700;
    transform: scale(1.1);
    border: 2px solid rgba(255, 193, 7, 0.5);
}

@media (min-width: 768px) {
    .sliders-container {
        gap: 30px;
        height: 300px;
    }
    
    .phase-slider {
        width: 8px;
        height: 280px;
        margin-bottom: 5px;
    }
}

/* Custom slider track */
.phase-slider::-webkit-slider-track {
    width: 6px;
    height: 180px;
    background: linear-gradient(to top, #e53e3e 0%, #fd7f1e 25%, #fdd023 50%, #68d391 75%, #48bb78 100%);
    border-radius: 3px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.midpoint-slider::-webkit-slider-track {
    width: 10px !important;
    background: linear-gradient(to top, #e53e3e 0%, #fd7f1e 25%, #fdd023 50%, #68d391 75%, #48bb78 100%);
    border-radius: 5px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 8px rgba(255, 193, 7, 0.4);
}

.phase-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.midpoint-slider::-webkit-slider-thumb {
    width: 24px !important;
    height: 24px !important;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    border: 3px solid white;
    box-shadow: 0 3px 8px rgba(255, 152, 0, 0.4), 0 0 12px rgba(255, 193, 7, 0.3);
}

@media (min-width: 768px) {
    .phase-slider::-webkit-slider-track {
        width: 8px;
        height: 280px;
        border-radius: 4px;
    }
    
    .midpoint-slider {
        width: 12px !important;
        height: 280px;
    }
    
    .midpoint-slider::-webkit-slider-track {
        width: 12px !important;
        height: 280px;
        border-radius: 6px;
    }
    
    .phase-slider::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
        border: 3px solid white;
    }
    
    .midpoint-slider::-webkit-slider-thumb {
        width: 28px !important;
        height: 28px !important;
        border: 4px solid white;
    }
}

.phase-slider::-webkit-slider-thumb:hover {
    background: #5a67d8;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Firefox */
.phase-slider::-moz-range-track {
    width: 6px;
    height: 180px;
    background: linear-gradient(to top, #e53e3e 0%, #fd7f1e 25%, #fdd023 50%, #68d391 75%, #48bb78 100%);
    border-radius: 3px;
    border: none;
}

.midpoint-slider::-moz-range-track {
    width: 10px;
    border-radius: 5px;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.4);
}

.phase-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.midpoint-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    border: 3px solid white;
    box-shadow: 0 3px 8px rgba(255, 152, 0, 0.4), 0 0 12px rgba(255, 193, 7, 0.3);
}

.slider-value {
    position: absolute;
    bottom: 190px;
    left: 50%;
    transform: translateX(-50%);
    background: #4a5568;
    color: white;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    z-index: 10;
}

@media (min-width: 768px) {
    .phase-slider::-moz-range-track {
        width: 8px;
        height: 280px;
        border-radius: 4px;
    }
    
    .phase-slider::-moz-range-thumb {
        width: 20px;
        height: 20px;
        border: 3px solid white;
    }
    
    .slider-value {
        bottom: 290px;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 0.8rem;
        min-width: 24px;
    }
}

.slider-value::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #4a5568;
}

.phase-labels {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.phase-label-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.phase-label {
    text-align: center;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.7rem;
    word-wrap: break-word;
    width: 100%;
}

.phase-enabled-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6rem;
    color: #718096;
}

.phase-enabled-checkbox {
    width: 12px;
    height: 12px;
    accent-color: #667eea;
}

.phase-enabled-label {
    cursor: pointer;
    user-select: none;
}

.disabled-phase {
    opacity: 0.5;
}

.disabled-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    font-size: 0.7rem;
    color: #a0aec0;
    background: rgba(160, 174, 192, 0.1);
    border-radius: 4px;
    border: 1px dashed #cbd5e0;
}

.midpoint-label {
    color: #ff9800;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(255, 152, 0, 0.2);
    font-size: 0.75rem;
}

@media (min-width: 768px) {
    .phase-labels {
        gap: 30px;
        margin-top: 15px;
    }
    
    .phase-label {
        font-size: 0.9rem;
    }
    
    .phase-enabled-wrapper {
        font-size: 0.7rem;
    }
    
    .phase-enabled-checkbox {
        width: 14px;
        height: 14px;
    }
    
    .disabled-placeholder {
        height: 280px;
        font-size: 0.8rem;
    }
    
    .midpoint-label {
        font-size: 1rem;
    }
}

/* Notes Section */
.notes-section {
    background: white;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.notes-section h4 {
    margin-bottom: 12px;
    color: #4a5568;
    font-size: 1rem;
}

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

.note-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.note-input-wrapper label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #718096;
}

.note-input-wrapper textarea {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 16px; /* Prevent zoom on iOS */
    resize: vertical;
    min-height: 50px;
    transition: border-color 0.2s ease;
}

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

/* Midpoint Note Emphasis */
.midpoint-note-wrapper {
    position: relative;
    background: rgba(255, 193, 7, 0.05);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 8px;
    padding: 8px;
}

.midpoint-note-label {
    color: #ff9800 !important;
    font-weight: 700 !important;
    text-shadow: 1px 1px 2px rgba(255, 152, 0, 0.2);
    font-size: 0.85rem !important;
}

.midpoint-note-wrapper textarea {
    border-color: rgba(255, 193, 7, 0.3) !important;
    background: rgba(255, 248, 225, 0.5);
}

.midpoint-note-wrapper textarea:focus {
    border-color: #ff9800 !important;
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.1) !important;
}

@media (min-width: 768px) {
    .notes-section {
        padding: 20px;
        border-radius: 8px;
    }
    
    .notes-section h4 {
        margin-bottom: 15px;
        font-size: 1.1rem;
    }
    
    .notes-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .note-input-wrapper {
        gap: 5px;
    }
    
    .note-input-wrapper label {
        font-size: 0.85rem;
    }
    
    .note-input-wrapper textarea {
        padding: 8px 12px;
        border-radius: 6px;
        font-size: 0.9rem;
        min-height: 60px;
    }
}

/* Actions and Footer */
.actions {
    text-align: center;
    margin-bottom: 15px;
}

.actions button {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    max-width: 300px;
    margin: 0 auto;
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .actions {
        margin-bottom: 0;
    }
    
    .actions button {
        font-size: 1rem;
    }
}

footer {
    text-align: center;
    padding: 15px 10px;
    color: #718096;
    font-size: 0.85rem;
}

@media (min-width: 768px) {
    footer {
        padding: 20px;
        font-size: 0.9rem;
    }
}

/* Loading and state styles */
select:disabled,
button:disabled {
    opacity: 0.6;
}

/* Success/Error states */
.success {
    color: #38a169;
}

.error {
    color: #e53e3e;
}

/* Additional mobile optimizations */
/* Extra responsive fixes for very narrow screens */
@media (max-width: 320px) {
    .nav-tab {
        min-width: 55px;
        padding: 10px 4px;
        font-size: 0.6rem;
        gap: 2px;
    }
    
    .nav-icon {
        font-size: 0.9rem;
    }
    
    .nav-label {
        font-size: 0.55rem;
        line-height: 1;
        max-width: 45px;
        word-break: break-word;
        hyphens: auto;
    }
    
    .delete-relationship-panel,
    .delete-account-panel,
    .project-creation-panel,
    .character-creation-panel,
    .project-edit-panel,
    .character-edit-panel,
    .modal-content {
        width: 98%;
        padding: 15px 10px;
        font-size: 0.85rem;
    }
    
    .form-header h2 {
        font-size: 1.1rem;
        line-height: 1.2;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    header h1 {
        font-size: 1.6rem;
    }
    
    /* Feedback button mobile */
    .feedback-btn {
        top: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    /* Fix navigation tab text overlapping */
    .nav-tab {
        min-width: 70px;
        padding: 12px 6px;
        font-size: 0.7rem;
        gap: 3px;
    }
    
    .nav-icon {
        font-size: 1rem;
    }
    
    .nav-label {
        font-size: 0.65rem;
        line-height: 1.1;
        text-align: center;
    }

    /* Sub-tab mobile styles */
    .sub-tab-btn {
        font-size: 0.75rem;
        padding: 8px 10px;
        gap: 2px;
    }

    .sub-tab-content {
        padding: 15px 5px;
    }

    .grouping-controls {
        padding: 3px;
        gap: 6px;
    }

    .grouping-btn {
        font-size: 0.75rem;
        padding: 6px 8px;
    }

    .relationship-list-container {
        padding: 0 5px;
    }

    .relationship-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
        gap: 6px;
        font-size: 0.85rem;
    }

    .relationship-arrow {
        display: none;
    }

    .relationship-item:hover {
        transform: none;
    }

    .brainstorm-tab-content {
        padding: 20px 10px;
    }

    .brainstorm-tab-content h3 {
        font-size: 1.2rem;
    }

    .brainstorm-tab-content p {
        font-size: 0.9rem;
    }

    .relationship-search-bar {
        padding: 8px;
    }

    /* Admin dashboard mobile */
    .admin-stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        font-size: 2rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-breakdown {
        font-size: 0.75rem;
        flex-wrap: wrap;
    }

    .relationship-search-bar input {
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    .relationships-list {
        max-height: 400px;
        padding: 0 2px;
    }

    .drag-handle {
        font-size: 1rem;
        padding: 0 6px;
    }

    /* Fix modal/confirmation dialogs getting cut off */
    .delete-relationship-panel,
    .delete-account-panel,
    .project-creation-panel,
    .character-creation-panel,
    .project-edit-panel,
    .character-edit-panel,
    .modal-content {
        width: 95%;
        max-width: 95vw;
        padding: 20px 15px;
        margin: 0;
        max-height: 90vh;
        overflow-y: auto;
    }

    .brainstorm-confirmation-panel.modal-overlay {
        padding: 10px;
    }
    
    .form-header h2 {
        font-size: 1.3rem;
    }
    
    .warning-message {
        padding: 12px;
        gap: 8px;
    }
    
    .warning-message p {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .form-actions {
        gap: 10px;
    }
    
    .clickable-direction {
        font-size: 1rem;
        padding: 10px 14px;
    }
    
    .sliders-container {
        gap: 12px;
    }
    
    .phase-labels {
        gap: 12px;
    }
    
    .phase-label {
        font-size: 0.65rem;
    }
    
    .slider-value {
        font-size: 0.7rem;
        padding: 2px 4px;
        min-width: 18px;
    }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    .phase-slider::-webkit-slider-thumb {
        width: 22px;
        height: 22px;
        border: 3px solid white;
    }
    
    .clickable-direction:hover {
        transform: none;
    }
    
    button:hover:not(:disabled) {
        transform: none;
        box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
    }
}

/* Project Management Panels */
.project-management-panel {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.project-edit-panel,
.character-edit-panel {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.project-list {
    margin-top: 20px;
}

.loading-state {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 40px 20px;
}


.project-info,
.character-info {
    flex-grow: 1;
    margin-right: 20px;
}

.project-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 6px;
}

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

.project-meta {
    color: #a0aec0;
    font-size: 0.8rem;
}

.project-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.project-actions button {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-btn {
    background: #667eea;
    color: white;
}

.edit-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.delete-btn {
    background: #fed7d7;
    color: #e53e3e;
    border-color: #feb2b2;
}

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.empty-state h3 {
    color: #4a5568;
    margin-bottom: 10px;
}

.confirm-delete {
    background: #fed7d7;
    border: 2px solid #feb2b2;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    animation: fadeIn 0.3s ease;
}

.confirm-delete p {
    color: #742a2a;
    margin-bottom: 12px;
    font-weight: 500;
}

.confirm-delete .confirm-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.confirm-delete button {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.confirm-delete .confirm-delete-btn {
    background: #e53e3e;
    color: white;
}

.confirm-delete .confirm-delete-btn:hover {
    background: #c53030;
}

.confirm-delete .cancel-delete-btn {
    background: #e2e8f0;
    color: #4a5568;
}

.confirm-delete .cancel-delete-btn:hover {
    background: #cbd5e0;
}

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

/* Landing Page Styles */
.landing-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Banner Header Styles */
.banner-header {
    text-align: center;
    padding: 20px;
    background: transparent;
    position: relative;
}

.header-banner {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.feedback-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.feedback-btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

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

/* Page Header (for privacy/terms pages) */
.page-header {
    padding: 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.page-header h1 {
    font-size: 2.5rem;
    margin: 10px 0 5px 0;
    color: #1f2937;
}

.page-header .last-updated {
    color: #6b7280;
    font-style: italic;
}

.landing-content {
    flex: 1;
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.hero-section {
    text-align: center;
    margin-bottom: 80px;
}

.hero-section h2 {
    font-size: 2.2rem;
    color: #1f2937;
    margin-bottom: 20px;
    font-weight: 600;
}

.hero-description {
    font-size: 1.1rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.features-section {
    margin-bottom: 80px;
}

.features-section h3 {
    text-align: center;
    font-size: 2rem;
    color: #1f2937;
    margin-bottom: 40px;
    font-weight: 600;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
}

.feature-card h4 {
    font-size: 1.3rem;
    color: #1f2937;
    margin-bottom: 15px;
    font-weight: 600;
}

.feature-card p {
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

.cta-section {
    text-align: center;
    background: #f9fafb;
    padding: 60px 30px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
}

.cta-section h3 {
    font-size: 2rem;
    color: #1f2937;
    margin-bottom: 15px;
    font-weight: 600;
}

.cta-section p {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 30px;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
    align-items: center;
    max-width: 300px;
    margin: 0 auto;
}

.google-btn {
    background: white;
    color: #3c4043;
    border: 1px solid #dadce0;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.google-btn:hover {
    background: #f8f9fa;
    border-color: #c1c7cd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.google-icon {
    flex-shrink: 0;
}

.auth-divider {
    width: 100%;
    text-align: center;
    position: relative;
    margin: 5px 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
}

.auth-divider span {
    background: #f9fafb;
    padding: 0 15px;
    color: #6b7280;
    font-size: 0.9rem;
    position: relative;
}

.tertiary-btn {
    background: transparent;
    color: #6b7280;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-decoration: underline;
}

.tertiary-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.auth-buttons .primary-btn,
.auth-buttons .secondary-btn {
    width: 100%;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
}

/* Responsive design for landing page */
@media (max-width: 768px) {
    .landing-header h1 {
        font-size: 2rem;
    }
    
    .landing-tagline {
        font-size: 1rem;
    }
    
    .hero-section h2 {
        font-size: 1.8rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feature-card {
        padding: 20px;
    }
    
    .auth-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .auth-buttons .primary-btn,
    .auth-buttons .secondary-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Footer Updates */
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.footer-link {
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #667eea;
    text-decoration: underline;
}

/* Responsive footer */
@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

/* Privacy Policy Page Styles */
.privacy-nav {
    margin-bottom: 15px;
}

.back-link {
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #667eea;
    text-decoration: underline;
}

.privacy-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px;
    line-height: 1.7;
}

.privacy-section {
    margin-bottom: 40px;
}

.privacy-section h2 {
    font-size: 1.8rem;
    color: #1f2937;
    margin-bottom: 20px;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
}

.privacy-section p {
    color: #4b5563;
    font-size: 1rem;
    margin-bottom: 15px;
}

.privacy-section ul {
    color: #4b5563;
    margin-left: 20px;
    margin-bottom: 15px;
}

.privacy-section li {
    margin-bottom: 8px;
}

.privacy-footer {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 30px 20px;
    margin-top: 40px;
}

.privacy-footer .footer-links {
    justify-content: center;
    text-align: center;
}

.privacy-footer .footer-links a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.privacy-footer .footer-links a:hover {
    color: #667eea;
    text-decoration: underline;
}

.privacy-footer .footer-links span {
    color: #9ca3af;
}

/* Axis Description Styling */
.axis-description {
    margin: 8px 0 5px 0;
    font-size: 0.9rem;
    color: #6b7280;
    font-style: italic;
    line-height: 1.4;
}

/* Responsive privacy policy */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }
    
    .privacy-content {
        padding: 40px 15px;
    }
    
    .privacy-section h2 {
        font-size: 1.5rem;
    }
}
}