/* Timeline Explorer (tlx-*) ------------------------------------------------ */

.tlx-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
    background: #f6f8fb;
    overflow: hidden;
}

.tlx-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    background: #ffffff;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    flex-wrap: wrap;
}

.tlx-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tlx-brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #1a4d80, #7C3AED);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(26, 77, 128, 0.25);
}

.tlx-brand-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}

.tlx-brand-sub {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.2;
}

.tlx-search {
    min-width: 260px;
    max-width: 340px;
    flex: 1;
}

.tlx-toolbar-spacer {
    flex: 1;
}

.tlx-control-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tlx-control-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-right: 2px;
}

.tlx-segment {
    display: flex;
    background: #eef2f7;
    border-radius: 9px;
    padding: 3px;
}

.tlx-segment button {
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    border-radius: 7px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tlx-segment button.is-active {
    background: #ffffff;
    color: #1a4d80;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
}

.tlx-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
    border-radius: 999px;
    padding: 5px 13px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tlx-chip .tlx-chip-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    transition: transform 0.15s ease;
}

.tlx-chip.is-off {
    opacity: 0.45;
    text-decoration: line-through;
}

.tlx-chip:hover {
    border-color: rgba(26, 77, 128, 0.4);
    transform: translateY(-1px);
}

.tlx-icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
    border-radius: 8px;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tlx-icon-btn:hover {
    border-color: rgba(26, 77, 128, 0.4);
    color: #1a4d80;
}

.tlx-canvas-wrap {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.tlx-canvas-host {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.tlx-canvas {
    display: block;
    touch-action: none;
}

.tlx-canvas-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #64748b;
    text-align: center;
    padding: 24px;
}

.tlx-corner {
    position: absolute;
    z-index: 5;
}

.tlx-corner.tr { top: 14px; right: 14px; }
.tlx-corner.br { bottom: 14px; right: 14px; }
.tlx-corner.bl { bottom: 14px; left: 14px; }

.tlx-zoom {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
}

.tlx-zoom button {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 7px;
    color: #475569;
    cursor: pointer;
}

.tlx-zoom button:hover {
    background: #eef2f7;
    color: #1a4d80;
}

.tlx-zoom-value {
    min-width: 48px;
    text-align: center;
    font-size: 11.5px;
    font-weight: 700;
    color: #1a4d80;
}

.tlx-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 10px;
    padding: 8px 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
    font-size: 11.5px;
    font-weight: 600;
    color: #475569;
}

.tlx-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tlx-legend-marker {
    width: 10px;
    height: 10px;
}

.tlx-legend-marker.routine { border-radius: 50%; background: #1a4d80; }
.tlx-legend-marker.defect { background: #9a1f1f; transform: rotate(45deg); border-radius: 2px; }
.tlx-legend-marker.repair { background: #0a6633; border-radius: 3px; }

/* Tooltip card --------------------------------------------------------- */

.tlx-tooltip {
    position: absolute;
    z-index: 20;
    width: 290px;
    display: none;
    opacity: 0;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.18), 0 3px 10px rgba(15, 23, 42, 0.1);
    pointer-events: none;
    overflow: hidden;
    will-change: transform, opacity;
}

.tlx-tip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.tlx-tip-header-cluster {
    background: rgba(26, 77, 128, 0.07);
}

.tlx-tip-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: none;
}

.tlx-tip-kind {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    flex: none;
}

.tlx-tip-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tlx-tip-body {
    padding: 10px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.tlx-tip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #0f172a;
}

.tlx-tip-label {
    flex: none;
    width: 88px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.tlx-tip-chip {
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.tlx-tip-user {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
}

.tlx-tip-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9.5px;
    font-weight: 800;
    flex: none;
}

.tlx-tip-desc {
    font-size: 11.5px;
    line-height: 1.45;
    color: #475569;
    background: #f6f8fb;
    border-radius: 8px;
    padding: 7px 9px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tlx-tip-linked {
    font-size: 11px;
    font-weight: 600;
    color: #0a6633;
    background: rgba(10, 102, 51, 0.08);
    border-radius: 8px;
    padding: 5px 9px;
}

.tlx-tip-row-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tlx-tip-row-date {
    margin-left: auto;
    color: #64748b;
    font-size: 11px;
    flex: none;
}

.tlx-tip-more {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

.tlx-tip-hint {
    font-size: 10.5px;
    color: #94a3b8;
    border-top: 1px dashed rgba(15, 23, 42, 0.08);
    padding-top: 6px;
    margin-top: 2px;
}

.tlx-truncated {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    background: rgba(255, 244, 224, 0.96);
    color: #8a4a00;
    border: 1px solid rgba(138, 74, 0, 0.25);
    border-radius: 999px;
    padding: 4px 14px;
    font-size: 11.5px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

@media (max-width: 900px) {
    .tlx-search { min-width: 180px; }
    .tlx-control-label { display: none; }
}
