/* Modal system */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100vh - 50px);
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2200;
}

.modal:not(.hidden) {
    display: flex;
}

body.timeline-pinned .modal {
    height: calc(100vh - 220px);
}

.modal-content {
    background: #fff;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 8px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Two-pane focus mode layout */
.modal-content.two-pane {
    display: flex;
    flex-direction: row;
    width: auto !important;
    max-width: 95vw !important;
    height: 90vh;
    padding: 0 !important;
}

.modal-settings-pane {
    width: 400px;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid #eee;
    padding: 20px;
    background: #fff;
    height: 100%;
}

.modal-preview-pane {
    flex: 1 1 auto;
    min-width: 320px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #111;
    position: relative;
    overflow: hidden;
    height: 100%;
}

/* Focus mode body states */
body[class*="editing-"] {
    overflow: hidden !important;
}

body[class*="editing-"] .input-section,
body[class*="editing-"] header,
body[class*="editing-"] footer,
body[class*="editing-"] .export-section {
    display: none !important;
}

body[class*="editing-"] .container {
    display: block !important;
    width: auto !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* History List */
.history-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 15px;
}

.segment-editor-container {
    padding: 15px;
}

.field-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.override-label {
    display: flex;
    align-items: center;
    font-size: 0.8em;
    color: #aaa;
    margin-right: 10px;
}

.override-label span {
    margin-left: 2px;
}

.override-label input[type="checkbox"] {
    width: auto;
    margin-right: 2px;
}

.hidden-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.field-title {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 500;
}

.history-item {
    padding: 12px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.history-item.current {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.history-item-desc {
    font-weight: 500;
    color: #333;
}

.history-item-time {
    font-size: 11px;
    color: #999;
}

/* Dialog button area */
.dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}