html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    background-color: #333;
    color: #eee;
    overflow: hidden;
}

#header, #preview, #timeline {
    position: absolute;
    left: 0;
    right: 0;
}

#header {
    top: 0;
    height: 3em;
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
}

#preview {
    top: 3em;
    bottom: 100px;
}

#timeline {
    bottom: 0;
    height: 100px;
    position: absolute;
}

/* Date range picker - centered inside the timeline */
.timeline-date-picker {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    pointer-events: auto;
}

.timeline-date-picker input[type="date"] {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ccc;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', monospace;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    width: 110px;
}

.timeline-date-picker input[type="date"]:focus {
    border-color: rgba(110, 168, 254, 0.6);
    background: rgba(255, 255, 255, 0.12);
}

.timeline-date-picker input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.6);
    cursor: pointer;
}

.timeline-date-picker .tdp-sep {
    color: #666;
    font-size: 10px;
    user-select: none;
}

.timeline-date-picker .tdp-apply {
    background: rgba(45, 122, 74, 0.8);
    border: none;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.timeline-date-picker .tdp-apply:hover {
    background: rgba(58, 157, 94, 0.9);
}

.timeline-date-picker .tdp-apply:disabled {
    opacity: 0.4;
    cursor: wait;
}

#header > * {
    height: 2em;
    margin: 0 0.5em;
    font-size: 1em;
    font-family: ArtifaktElement;
}

#header .title {
    height: auto;
}

.auth-btn {
    display: flex;
    align-items: center;
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    padding: 0.5em 1em;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s;
}

.auth-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.logout-btn {
    background: #ff4444;
    border: none;
    color: white;
    padding: 0.3em 0.8em;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
    margin-left: 0.5em;
}

.logout-btn:hover {
    background: #cc3333;
}

#user-info {
    display: flex;
    align-items: center;
    color: #fff;
}

#user-name {
    font-weight: bold;
    margin-right: 0.5em;
}

/* ============================================================================
   Model Search Panel
   ============================================================================ */

#model-search-panel {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 420px;
    max-width: calc(100vw - 32px);
    background: #1e1e1e;
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    color: #ddd;
    max-height: calc(100vh - 160px);
}

.msp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #252525;
    border-bottom: 1px solid #333;
    user-select: none;
    flex-shrink: 0;
}

.msp-header span {
    flex: 1;
    font-weight: 600;
    font-size: 13px;
    color: #ccc;
}

.msp-close {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}

.msp-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.msp-search-row {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    gap: 6px;
    border-bottom: 1px solid #2d2d2d;
    flex-shrink: 0;
}

.msp-input {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid #444;
    color: #e0e0e0;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.msp-input:focus {
    border-color: #4d9de0;
    background: #2f2f2f;
}

.msp-input::placeholder {
    color: #666;
}

.msp-clear {
    background: none;
    border: none;
    color: #777;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.msp-clear:hover {
    color: #ccc;
}

.msp-status {
    padding: 6px 14px;
    font-size: 11px;
    color: #777;
    min-height: 24px;
    flex-shrink: 0;
    border-bottom: 1px solid #2a2a2a;
}

.msp-status.msp-loading {
    color: #4d9de0;
}

.msp-results {
    overflow-y: auto;
    flex: 1;
}

.msp-results::-webkit-scrollbar {
    width: 6px;
}

.msp-results::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.msp-results::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.msp-result-item {
    padding: 10px 14px;
    border-bottom: 1px solid #262626;
    cursor: pointer;
    transition: background 0.12s;
}

.msp-result-item:hover {
    background: #2a2a2a;
}

.msp-result-item.msp-result-active {
    background: #1a3a5c;
    border-left: 3px solid #4d9de0;
}

.msp-result-name {
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msp-result-name mark {
    background: rgba(77, 157, 224, 0.35);
    color: #7ec8ff;
    border-radius: 2px;
    padding: 0 1px;
}

.msp-result-dbid {
    font-size: 10px;
    color: #555;
    margin-bottom: 4px;
}

.msp-prop-row {
    display: flex;
    gap: 4px;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
    overflow: hidden;
}

.msp-prop-name {
    color: #7a9cc4;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msp-prop-sep {
    color: #555;
    flex-shrink: 0;
}

.msp-prop-value {
    color: #aaa;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msp-prop-row mark,
.msp-prop-name mark,
.msp-prop-value mark {
    background: rgba(77, 157, 224, 0.3);
    color: #7ec8ff;
    border-radius: 2px;
    padding: 0 1px;
}

.msp-prop-more {
    font-size: 10px;
    color: #555;
    margin-top: 2px;
    font-style: italic;
}

.msp-empty {
    padding: 24px;
    text-align: center;
    color: #555;
    font-size: 12px;
}

/* ============================================================================
   Properties Popup
   ============================================================================ */

#msp-properties-popup {
    position: absolute;
    top: 60px;
    right: 16px;
    width: 360px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 200px);
    background: #1e1e1e;
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    z-index: 999;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 12px;
    color: #ddd;
}

.msp-pp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #252525;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
    user-select: none;
}

.msp-pp-title {
    flex: 1;
    font-weight: 600;
    font-size: 13px;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msp-pp-close {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.msp-pp-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.msp-pp-body {
    overflow-y: auto;
    flex: 1;
    padding: 8px 0;
}

.msp-pp-body::-webkit-scrollbar {
    width: 5px;
}

.msp-pp-body::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.msp-pp-body::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.msp-pp-category {
    margin-bottom: 2px;
}

.msp-pp-cat-header {
    padding: 5px 14px 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #4d9de0;
    background: #242424;
    border-top: 1px solid #2d2d2d;
    border-bottom: 1px solid #2d2d2d;
}

.msp-pp-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.msp-pp-table td {
    padding: 4px 14px;
    vertical-align: top;
    border-bottom: 1px solid #262626;
    word-break: break-word;
}

.msp-pp-name {
    width: 45%;
    color: #7a9cc4;
    font-size: 11px;
}

.msp-pp-value {
    color: #ccc;
    font-size: 11px;
}

.msp-pp-footer {
    padding: 8px 14px;
    border-top: 1px solid #2d2d2d;
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
}

.msp-pp-show-all-btn {
    background: #2a2a2a;
    border: 1px solid #444;
    color: #aaa;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    transition: background 0.15s, color 0.15s;
}

.msp-pp-show-all-btn:hover {
    background: #333;
    color: #fff;
}

/* ============================================================
   Model Export Extension Panel  (#model-export-panel)
   ============================================================ */

#model-export-panel {
    position: absolute;
    top: 80px;
    right: 70px;
    width: 280px;
    background: #1e1e1e;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    z-index: 100;
    font-family: 'Segoe UI', sans-serif;
    font-size: 13px;
    color: #ddd;
    overflow: hidden;
}

.mep-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #252525;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
    user-select: none;
}

.mep-header span {
    flex: 1;
    font-weight: 600;
    font-size: 13px;
    color: #eee;
}

.mep-header svg {
    flex-shrink: 0;
    color: #7a9cc4;
}

.mep-close {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s;
}

.mep-close:hover { color: #fff; }

.mep-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
}

.mep-status {
    font-size: 12px;
    color: #999;
    min-height: 16px;
}

.mep-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mep-progress-bar {
    height: 4px;
    background: #2e2e2e;
    border-radius: 2px;
    overflow: hidden;
}

.mep-progress-fill {
    height: 100%;
    width: 0%;
    background: #4a9eff;
    border-radius: 2px;
    transition: width 0.2s ease;
}

.mep-progress-label {
    font-size: 11px;
    color: #666;
    text-align: right;
}

.mep-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mep-info {
    font-size: 11px;
    color: #666;
    padding-bottom: 2px;
}

.mep-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 6px;
    border: 1px solid #3a3a3a;
    background: #2a2a2a;
    color: #ccc;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-align: left;
}

.mep-btn:hover {
    background: #333;
    color: #fff;
    border-color: #555;
}

.mep-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.mep-btn-excel:hover {
    border-color: #3d7a45;
    background: #1e2e20;
    color: #6abf73;
}

.mep-btn-json:hover {
    border-color: #7a6a3d;
    background: #2e2a1e;
    color: #bfaa6a;
}

/* ============================================================
   ETS Filter Extension Panel  (#ets-filter-panel)
   ============================================================ */

#ets-filter-panel {
    position: absolute;
    top: 140px;
    right: 70px;
    width: 280px;
    background: #1e1e1e;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    z-index: 100;
    font-family: 'Segoe UI', sans-serif;
    font-size: 13px;
    color: #ddd;
    overflow: hidden;
}

.efp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #1a2230;
    border-bottom: 1px solid #2a3545;
    flex-shrink: 0;
    user-select: none;
}

.efp-header span {
    flex: 1;
    font-weight: 600;
    font-size: 13px;
    color: #eee;
}

.efp-header svg {
    flex-shrink: 0;
    color: #6ab0e0;
}

.efp-close {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s;
}

.efp-close:hover { color: #fff; }

.efp-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
}

.efp-status {
    font-size: 12px;
    color: #999;
    min-height: 16px;
}

.efp-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.efp-progress-bar {
    height: 4px;
    background: #2e2e2e;
    border-radius: 2px;
    overflow: hidden;
}

.efp-progress-fill {
    height: 100%;
    width: 0%;
    background: #6ab0e0;
    border-radius: 2px;
    transition: width 0.2s ease;
}

.efp-progress-label {
    font-size: 11px;
    color: #666;
    text-align: right;
}

.efp-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.efp-info {
    font-size: 11px;
    color: #666;
    padding-bottom: 2px;
}

.efp-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 6px;
    border: 1px solid #3a3a3a;
    background: #2a2a2a;
    color: #ccc;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-align: left;
}

.efp-btn:hover {
    background: #333;
    color: #fff;
    border-color: #555;
}

.efp-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.efp-btn-excel:hover {
    border-color: #3d7a45;
    background: #1e2e20;
    color: #6abf73;
}

.efp-btn-json:hover {
    border-color: #7a6a3d;
    background: #2e2a1e;
    color: #bfaa6a;
}

.efp-btn-rescan:hover {
    border-color: #3d5a7a;
    background: #1e2030;
    color: #6ab0e0;
}

