* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7fa;
    color: #1e293b;
}

body {
    display: flex;
    flex-direction: column;
}

.top-panel {
    position: relative;
    z-index: 20;

    min-height: 64px;
    padding: 10px 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    background: #ffffff;
    border-bottom: 1px solid #d7dee8;
}

.project-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.project-title strong {
    font-size: 20px;
}

.project-title span {
    color: #64748b;
    font-size: 13px;
}

.controls {
    display: flex;
    align-items: center;
    gap: 7px;
}

.controls button {
    min-height: 38px;
    padding: 0 14px;

    border: 1px solid #cbd5e1;
    border-radius: 7px;

    background: #ffffff;
    color: #1e293b;

    font-size: 15px;
    cursor: pointer;
}

.controls button:hover {
    background: #eef3f8;
}

#zoomOutButton,
#zoomInButton {
    width: 42px;
    padding: 0;
    font-size: 22px;
}

.timeline-container {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#timelineCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
    background: #f8fafc;
    touch-action: none;
}

#timelineCanvas.dragging {
    cursor: grabbing;
}

.timeline-hint {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);

    padding: 7px 12px;

    border: 1px solid #d7dee8;
    border-radius: 7px;

    background: rgba(255, 255, 255, 0.92);
    color: #64748b;

    font-size: 12px;
    pointer-events: none;
    white-space: nowrap;
}

.object-panel {
    position: fixed;
    z-index: 50;

    top: 64px;
    right: 0;
    bottom: 0;

    width: min(390px, 92vw);
    padding: 28px 24px;

    overflow-y: auto;

    background: #ffffff;
    border-left: 1px solid #d7dee8;
    box-shadow: -8px 0 24px rgba(15, 23, 42, 0.08);

    transform: translateX(105%);
    transition: transform 0.2s ease;
}

.object-panel.open {
    transform: translateX(0);
}

.close-panel {
    position: absolute;
    top: 12px;
    right: 14px;

    width: 34px;
    height: 34px;

    border: 0;
    background: transparent;

    color: #64748b;
    font-size: 28px;
    cursor: pointer;
}

.object-panel h2 {
    margin: 10px 40px 24px 0;
    font-size: 25px;
}

.panel-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 14px;

    margin-bottom: 14px;
    padding-bottom: 14px;

    border-bottom: 1px solid #edf0f4;
}

.panel-section {
    margin-top: 23px;
}

.panel-label {
    margin-bottom: 8px;
    color: #64748b;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

#panelJustification {
    line-height: 1.55;
    white-space: pre-line;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tag {
    display: inline-flex;
    padding: 5px 9px;

    border-radius: 20px;
    background: #e9f0f9;
    color: #315f99;

    font-size: 13px;
}

@media (max-width: 650px) {
    .top-panel {
        padding: 8px 10px;
    }

    .project-title span {
        display: none;
    }

    .project-title strong {
        font-size: 17px;
    }

    #resetButton {
        display: none;
    }

    .timeline-hint {
        max-width: calc(100% - 20px);
        white-space: normal;
        text-align: center;
    }
}