/* 누적 지도 전용 레이아웃. 지도는 왼쪽 전체, 타임라인은 오른쪽 고정 폭. */
* { box-sizing: border-box; }

body {
    margin: 0;
    display: flex;
    font-family: 'Malgun Gothic', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f5f5;
}

#map {
    flex: 1;
    height: 100vh;
    cursor: grab;
}

#map.clickable { cursor: pointer; }

#timeline-panel {
    width: 420px;
    flex-shrink: 0;
    height: 100vh;
    background: #fff;
    border-left: 1px solid #ddd;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.tl-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 2px solid #eee;
    background: #fafafa;
}

.tl-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 6px;
    background: #6c757d;
    color: #fff;
    text-decoration: none;
    font-size: 1.1em;
    line-height: 1;
}

.tl-back:hover { background: #545b62; }

.tl-header h3 {
    margin: 0;
    font-size: 1.05em;
    border-left: 4px solid #007bff;
    padding-left: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#tl-summary {
    padding: 12px 20px;
    font-size: 0.85em;
    color: #555;
    background: #fff;
    border-bottom: 1px solid #eee;
}

#tl-summary .legend {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 12px;
}

#tl-summary .legend img { width: 18px; height: 18px; }

#tl-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 40px;
}

.tl-empty {
    color: #888;
    font-size: 0.9em;
    line-height: 1.6;
}

.tl-place {
    margin: 0 0 4px;
    font-size: 1.1em;
    font-weight: bold;
}

.tl-place-sub {
    margin: 0 0 16px;
    font-size: 0.8em;
    color: #888;
    word-break: break-all;
}

/* 세로선을 그려 시간 흐름을 표시한다. */
.tl-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0 18px;
    border-left: 2px solid #e3e3e3;
}

.tl-item {
    position: relative;
    padding: 0 0 20px 6px;
}

.tl-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #999;
}

.tl-item.red::before { background: #dc3545; }
.tl-item.blue::before { background: #1a73e8; }

.tl-when {
    font-size: 0.82em;
    color: #666;
    font-variant-numeric: tabular-nums;
}

.tl-who {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.72em;
    color: #fff;
    background: #999;
    vertical-align: 1px;
}

.tl-item.red .tl-who { background: #dc3545; }
.tl-item.blue .tl-who { background: #1a73e8; }

.tl-detail {
    margin: 6px 0 0;
    font-size: 0.88em;
    line-height: 1.55;
    color: #222;
    white-space: pre-wrap;
    word-break: break-word;
}

.tl-detail.clamped {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: pointer;
}

.tl-more {
    margin-top: 3px;
    font-size: 0.78em;
    color: #1a73e8;
    cursor: pointer;
    user-select: none;
}

.tl-none {
    margin: 6px 0 0;
    font-size: 0.85em;
    color: #aaa;
}

@media (max-width: 900px) {
    body { flex-direction: column; }
    #map { height: 55vh; }
    #timeline-panel { width: 100%; height: 45vh; border-left: none; border-top: 1px solid #ddd; }
}
