/* Uninflected Stylesheet */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --text-color: #333;
    --border-color: #ddd;
    --bg-light: #f8f9fa;
    --error-color: #e74c3c;
    --success-color: #27ae60;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: "courier-std", monospace;
    font-weight: 400;
    font-style: normal;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

/* Header */
.site-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.logo a {
    color: white;
    text-decoration: none;
}

.site-header nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.site-header nav a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

.site-header nav a:hover {
    opacity: 0.8;
}

.user-name {
    color: rgba(255,255,255,0.8);
}

/* Footer */
.site-footer {
    background: var(--bg-light);
    padding: 2rem 0;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-footer nav {
    display: flex;
    gap: 1.5rem;
}

.site-footer nav a {
    color: var(--text-color);
    text-decoration: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-family: "courier-std", monospace;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.5;
    vertical-align: middle;
    box-sizing: border-box;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: var(--primary-color);
}

.btn-large {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.9rem;
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-icon,
.btn-icon-small {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.35rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-color);
}

.btn-icon:hover,
.btn-icon-small:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.btn-icon svg,
.btn-icon-small svg {
    display: block;
}

.btn-icon-small {
    padding: 0.25rem;
}

.insertion-zone .btn-icon-small {
    padding: 0.25rem 0.5rem;
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    line-height: 1.5;
}

.edit-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-delete-right {
    margin-left: auto;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: "courier-std", monospace;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.alert-error {
    background: #fadbd8;
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.alert-success {
    background: #d4edda;
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

/* Authentication Pages */
.auth-page {
    background: var(--bg-light);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.auth-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.auth-box h1 {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.auth-link {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-link a {
    color: var(--accent-color);
}

/* Home Page */
.home-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.home-page main {
    padding: 0;
    flex: 1;
}

.hero {
    background: var(--primary-color);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero .lead {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.features {
    padding: 4rem 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature h3 {
    margin-bottom: 0.5rem;
}

.philosophy {
    background: var(--bg-light);
    padding: 4rem 0;
}

.philosophy h3 {
    margin-bottom: 1rem;
}

.cta {
    padding: 4rem 0;
    text-align: center;
}

.cta h3 {
    margin-bottom: 2rem;
}

/* Content Pages */
main {
    flex: 1;
}

.content-page {
    max-width: 800px;
    padding: 3rem 20px;
}

.content-page h2 {
    margin-bottom: 2rem;
}

.content-page section {
    margin-bottom: 3rem;
}

.content-page h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.content-page ul {
    margin-left: 2rem;
}

/* Dashboard */
.dashboard {
    padding: 3rem 0;
    flex: 1;
}

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

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state h3 {
    margin-bottom: 1rem;
}

.empty-state p {
    margin-bottom: 2rem;
    color: var(--secondary-color);
}

.screenplay-list {
    margin-bottom: 3rem;
}

.screenplay-list h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.screenplay-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.screenplay-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.screenplay-card:hover {
    transform: translateY(-2px);
}

.screenplay-card h4 {
    margin: 0 0 0.5rem 0;
}

.screenplay-card h4 a {
    color: var(--primary-color);
    text-decoration: none;
}

.screenplay-card h4 a:hover {
    color: var(--accent-color);
}

.screenplay-meta {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.screenplay-date {
    font-size: 0.85rem;
    color: #777;
    margin: 0.5rem 0 1rem 0;
}

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

/* Editor Layout */
.editor-container {
    display: flex;
    height: calc(100vh - 60px);
    background: var(--bg-light);
}

.editor-sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    overflow-y: auto;
}

.editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.editor-toolbar {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-toolbar h2 {
    margin: 0;
    font-size: 1.3rem;
}

.toolbar-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.toolbar-burger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-color);
}

.toolbar-burger:hover {
    color: var(--accent-color);
}

.toolbar-scenes-btn {
    display: none;
}

.toolbar-dropdown {
    display: none;
}

.save-indicator {
    font-size: 0.9rem;
    color: var(--success-color);
    margin-right: 1rem;
}

.editor-tabs {
    display: none;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.editor-tab {
    flex: 1;
    padding: 1rem;
    border: none;
    background: var(--bg-light);
    font-family: "courier-std", monospace;
    font-size: 1rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.editor-tab:hover {
    background: #e8e8e8;
}

.editor-tab.active {
    background: white;
    border-bottom-color: var(--accent-color);
    font-weight: 700;
}

.editor-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.editor-pane {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.editor-write {
    background: white;
    border-right: 1px solid var(--border-color);
}

.editor-preview {
    background: white;
    font-family: "courier-std", "Courier New", monospace;
    font-size: 12pt;
    line-height: 1.5;
}

/* Screenplay Elements */
.scene-container {
    margin-bottom: 2rem;
    border: 1px solid transparent;
    border-top: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
    padding: 0.5rem;
    border-radius: 4px;
    background: 
        linear-gradient(to bottom, rgba(232, 232, 232, 0.2) 0%, transparent 8%),
        linear-gradient(to top, rgba(232, 232, 232, 0.2) 0%, transparent 8%);
}

.scene-container:hover {
    border-color: var(--border-color);
    background: 
        linear-gradient(to bottom, rgba(232, 232, 232, 0.3) 0%, transparent 8%),
        linear-gradient(to top, rgba(232, 232, 232, 0.3) 0%, transparent 8%),
        var(--bg-light);
}

.scene-container.drag-target-scene {
    border-color: var(--accent-color);
    background: 
        linear-gradient(to bottom, rgba(232, 232, 232, 0.3) 0%, transparent 8%),
        linear-gradient(to top, rgba(232, 232, 232, 0.3) 0%, transparent 8%),
        rgba(52, 152, 219, 0.1);
    border-width: 2px;
}

.scene-container > .add-buttons {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.scene-container:hover > .add-buttons {
    opacity: 1;
    visibility: visible;
}

.scene-heading-container {
    margin-bottom: 1rem;
}

.scene-heading-display {
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 1rem;
    cursor: pointer;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-block;
    min-width: 200px;
}

.scene-heading-display:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #adb5bd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.scene-heading-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.scene-heading-form input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.shot-container {
    margin-bottom: 1rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.5rem 0.5rem 1.5rem;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    position: relative;
    background: rgba(0, 0, 0, 0.01);
}

.shot-controls {
    position: absolute;
    right: 1.25rem;
    top: 0.5rem;
    display: flex;
    gap: 0.25rem;
    z-index: 50;
}

.element-controls {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.shot-container::before {
    content: '';
    position: absolute;
    left: 0.25rem;
    top: 0;
    bottom: 0;
    width: 0.5rem;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        #d0d0d0 2px,
        #d0d0d0 10px,
        transparent 10px,
        transparent 12px
    );
    border-radius: 2px;
    opacity: 0.5;
}

.shot-container::after {
    content: '';
    position: absolute;
    right: 0.25rem;
    top: 0;
    bottom: 0;
    width: 0.5rem;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        #d0d0d0 2px,
        #d0d0d0 10px,
        transparent 10px,
        transparent 12px
    );
    border-radius: 2px;
    opacity: 0.5;
}

.shot-container:hover {
    border-color: var(--border-color);
    background: rgba(52, 152, 219, 0.05);
}

.shot-container:hover::before,
.shot-container:hover::after {
    opacity: 0.7;
}

.shot-container.dragging {
    opacity: 0.5;
}

.shot-container.drag-target-shot {
    border-color: var(--accent-color);
    background: rgba(52, 152, 219, 0.1);
    border-width: 2px;
}

.shot-container.drop-target-before {
    border-top: 3px solid var(--accent-color);
    margin-top: 3px;
}

.shot-container.drop-target-after {
    border-bottom: 3px solid var(--accent-color);
    margin-bottom: 3px;
}

.shot-container > .add-buttons {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.shot-container:hover > .add-buttons {
    opacity: 1;
    visibility: visible;
}

/* Keep buttons in forms always visible */
.scene-form-inline .add-buttons {
    opacity: 1 !important;
    visibility: visible !important;
}

.drag-handle {
    cursor: move;
    padding: 0.25rem 0.5rem;
    color: var(--text-color);
    opacity: 0.6;
    user-select: none;
    transition: all 0.2s;
    font-weight: 700;
    font-size: 1.2rem;
}

.drag-handle:hover {
    color: var(--accent-color);
    opacity: 1;
}

.shot-drag-handle {
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
    z-index: 50;
    cursor: move;
    pointer-events: auto;
}

.element-drag-handle {
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.shot-elements {
    margin-left: 0;
}

.shot-element {
    margin-bottom: 0.5rem;
    margin-right: 0.75rem;
    padding: 1rem 0.5rem 0.5rem 0.5rem;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.01);
}

.shot-element:hover {
    background: rgba(0, 0, 0, 0.04);
}

.shot-element.dragging {
    opacity: 0.5;
    background: rgba(52, 152, 219, 0.1);
}

.shot-element.drop-target-before {
    border-top: 3px solid var(--accent-color);
    margin-top: 3px;
}

.shot-element.drop-target-after {
    border-bottom: 3px solid var(--accent-color);
    margin-bottom: 3px;
}

.shot-element .element-content {
    flex: 1;
    cursor: pointer;
}

.shot-element .character-name {
    cursor: pointer;
}

.element-action {
    margin-bottom: 0.5rem;
}

.element-dialogue {
    margin-bottom: 0.5rem;
}

.element-dialogue .character-name {
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    font-weight: 700;
    margin-left: 3rem;
}

.element-dialogue .element-content > div:last-child {
    margin-left: 2rem;
}

.add-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.add-buttons.left-align {
    justify-content: flex-start;
}

.shot-container > .add-buttons {
    margin-right: 0.75rem;
}

.add-scene-button {
    text-align: center;
    margin-top: 1rem;
}

.add-scene-button .btn {
    background: white;
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.add-scene-button .btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Insertion zones */
.insertion-zone {
    position: relative;
    height: 1.5rem;
    margin: 0.25rem 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.insertion-buttons {
    position: absolute;
    left: 50%;
    top: -5px;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 0.5rem;
    white-space: nowrap;
    align-items: center;
}

.insertion-zone .btn {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    background: white;
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.insertion-zone-shot {
    margin: 0.75rem 0;
    height: 2rem;
}

.insertion-zone-element {
    margin: 0.25rem 0;
}

.insertion-zone .btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

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

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-header h2 {
    flex: 1;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--secondary-color);
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

/* Scene Navigator */
.scene-navigator .scene-list-item {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scene-navigator .scene-list-item:hover {
    background: var(--bg-light);
    border-color: var(--accent-color);
}

.scene-navigator .scene-list-item.dragging {
    opacity: 0.5;
}

.scene-navigator .scene-list-item.drag-over-top {
    border-top: 3px solid var(--accent-color);
}

.scene-navigator .scene-list-item.drag-over-bottom {
    border-bottom: 3px solid var(--accent-color);
}

.scene-navigator .scene-number {
    font-weight: bold;
    color: var(--accent-color);
    min-width: 2rem;
}

.scene-navigator .scene-heading-text {
    flex: 1;
    font-family: "courier-std", "Courier New", monospace;
    text-transform: uppercase;
}

.scene-reorder-controls {
    display: flex;
    gap: 0.25rem;
    margin-left: 10px;
}

.scene-move-btn {
    opacity: 1;
}

.scene-move-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.scene-move-btn:disabled:hover {
    background: white;
    border-color: var(--border-color);
    color: var(--text-color);
}

.scene-navigator .scene-drag-handle {
    display: none;
}

/* Autocomplete */
.autocomplete-container {
    position: relative;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.autocomplete-suggestion {
    padding: 0.5rem;
    cursor: pointer;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.active {
    background: var(--bg-light);
}

/* Preview Screenplay Format */
.screenplay-preview {
    max-width: 8.5in;
    margin: 0 auto;
    padding: 1in;
    background: white;
    font-family: "courier-std", "Courier New", monospace;
    font-size: 12pt;
    line-height: 1.5;
}

.screenplay-title-page {
    text-align: center;
    height: 11in;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.screenplay-title-page h1 {
    text-transform: uppercase;
    font-size: 24pt;
    margin-bottom: 2rem;
}

.screenplay-title-page .author {
    font-size: 14pt;
    margin-bottom: 1rem;
}

.screenplay-title-page .based-on {
    font-size: 12pt;
    margin-bottom: 2rem;
}

.screenplay-title-page .contact {
    position: absolute;
    bottom: 1in;
    left: 1in;
    text-align: left;
    font-size: 12pt;
    white-space: pre-line;
}

.screenplay-scene-heading {
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.screenplay-action {
    margin-bottom: 1rem;
    max-width: 60ch;
}

.screenplay-dialogue {
    margin-bottom: 1rem;
}

.screenplay-character {
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    margin-left: 22ch;
}

.screenplay-dialogue > div:last-child {
    margin-left: 10ch;
    max-width: 35ch;
}

.screenplay-fade {
    text-align: right;
    margin: 1.5rem 0;
}

.screenplay-fade-in {
    text-align: left;
    margin: 1.5rem 0;
}

/* Collaboration */
.collaborator-list {
    margin-top: 1rem;
}

.collaborator-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.collaborator-info {
    flex: 1;
}

.collaborator-name {
    font-weight: 700;
}

.collaborator-email {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.collaborator-permission {
    margin-right: 1rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .editor-tabs {
        display: flex;
    }
    
    .editor-content {
        flex-direction: column;
        position: relative;
    }
    
    .editor-pane {
        padding: 1rem;
        display: none;
        width: 100%;
    }
    
    .editor-pane.active {
        display: block;
    }
    
    
    .screenplay-preview {
        padding: 0.5in;
    }
    
    .site-header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .site-footer .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .toolbar-burger {
        display: block;
    }
    
    .toolbar-scenes-btn {
        display: inline-block;
    }
    
    .toolbar-scenes-desktop {
        display: none;
    }
    
    .toolbar-dropdown {
        display: none;
        position: absolute;
        right: 0.5rem;
        top: 100%;
        margin-top: 0.5rem;
        background: white;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        box-shadow: var(--shadow);
        padding: 0.5rem;
        z-index: 100;
        min-width: 200px;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .toolbar-dropdown.open {
        display: flex;
    }
    
    .toolbar-dropdown > * {
        width: 100%;
        text-align: left;
        display: block;
    }
    
    .toolbar-dropdown .save-indicator {
        display: none !important;
    }
    
    .toolbar-actions > *:not(.toolbar-burger):not(.toolbar-dropdown):not(.toolbar-scenes-btn) {
        display: none;
    }
    
    .editor-toolbar {
        position: relative;
    }
    
    .editor-toolbar h2 {
        font-size: 1.1rem;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* Always show delete buttons on mobile/touch devices */
    .scene-container > .add-buttons,
    .shot-container > .add-buttons {
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Hidden */
.hidden {
    display: none;
}

/* Cookie Consent Banner */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary-color);
    color: white;
    padding: 1.5rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.cookie-consent-content p {
    margin: 0;
    flex: 1;
    line-height: 1.6;
}

.cookie-consent-buttons {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .cookie-consent-buttons {
        width: 100%;
        justify-content: center;
    }
}

/* Inline Forms */
.scene-form-inline {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid var(--accent-color);
    margin-bottom: 1rem;
    margin-right: 0.75rem;
}

.scene-form-inline h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.scene-form-inline .form-group {
    margin-bottom: 1rem;
}

.scene-form-inline .form-group:last-of-type {
    margin-bottom: 0;
}

.scene-form-inline label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.scene-form-inline input,
.scene-form-inline textarea {
    font-family: "courier-std", monospace;
    font-size: 1rem;
    pointer-events: auto;
    user-select: text;
    -webkit-user-select: text;
    color: var(--text-color);
    background: white;
}

/* Help Page Layout */
.help-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    align-items: start;
}

.help-toc {
    position: sticky;
    top: 20px;
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.help-toc h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.help-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.help-toc li {
    margin-bottom: 0.75rem;
}

.help-toc a {
    color: var(--text-color);
    text-decoration: none;
    display: block;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.help-toc a:hover {
    background: var(--bg-light);
    color: var(--accent-color);
    padding-left: 1rem;
}

.help-toc a.active {
    background: var(--accent-color);
    color: white;
    font-weight: 700;
}

.help-content {
    min-width: 0;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Offset for sticky header when jumping to sections */
section[id] {
    scroll-margin-top: 20px;
}

/* Responsive help layout */
@media (max-width: 900px) {
    .help-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .help-toc {
        position: static;
        margin-bottom: 1rem;
    }
    
    .help-toc ul {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.5rem;
    }
    
    .help-toc li {
        margin-bottom: 0;
    }
    
    .help-toc a:hover {
        padding-left: 0.5rem;
    }
}

