body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 20px;
    color: #333;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.container {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Top Controls */
.controls {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-shrink: 0;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 20px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
}

.back-btn:hover {
    background: #f0f0f0;
}

.tab-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tab-btn {
    padding: 4px 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

.tab-btn.active {
    color: #1a0dab;
    border: 1px solid #f39c12;
    font-weight: bold;
}

.metal-select {
    padding: 5px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

/* Title Bar */
.title-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.title-bar h2 {
    margin: 0;
    font-size: clamp(14px, 1.2vw, 20px);
    font-weight: bold;
}

.date-range {
    font-size: clamp(14px, 1vw, 14px);
    color: #333;
}

/* Content Box */
.chart-content-box {
    border: 1px solid #e5e5e5;
    padding: 20px;
    display: flex;
    gap: 30px;
    background: #fff;
}

/* Left: Chart */
.chart-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-right: 16px;
}

.chart-sidebar h3 {
    margin: 0 0 0 0;
    font-size: clamp(13px, 1vw, 14px);
}

.chart-main h3 {
    font-size: clamp(13px, 1vw, 14px);
    font-weight: normal;
    color: #666;
}

.chart-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0;
    aspect-ratio: 24 / 9;
    position: relative;
    min-height: 0;
}

/* Right: Sidebar */
.chart-sidebar {
    width: auto;
    flex-shrink: 0;
    font-size: clamp(11px, 1vw, 13px);
    color: #666;
}

.legend-box {
    border: 1px solid #e5e5e5;
    padding: 15px;
    margin-bottom: 10px;
    text-align: center;
    white-space: nowrap;
    background: #fff;
}

.legend-line {
    display: inline-block;
    width: 13px;
    border-top: 2px solid #c0392b;
    vertical-align: middle;
    margin-right: 6px;
}

.note-text {
    line-height: 1.6;
    margin-bottom: 20px;
}

.action-btn {
    border: 2px solid #1a2b4c;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    color: #1a2b4c;
    cursor: pointer;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    body {
        height: auto;
    }

    .container {
        width: 100%;
    }

    .chart-content-box {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .chart-header {
        align-items: center;
    }

    .legend-box {
        padding: 5px 10px;
        margin-bottom: 0;
    }

    .chart-sidebar {
        width: auto;
    }

    .chart-wrapper {
        width: 100%;
        min-height: auto;
    }

    .title-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .controls {
        flex-wrap: wrap;
    }
}