body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #1e1e1e;
    color: #ccc;
    position: relative;
}

:root {
    --page-min-width: 1080px;
    --page-max-width: 1760px;
    --macro-series-height: 600px;
    --macro-history-height: 360px;
}

.login-page {
    min-height: 100vh;
    background: #171717;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    box-sizing: border-box;
}

.login-panel {
    width: min(360px, 100%);
    background: #242424;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 26px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
    box-sizing: border-box;
}

.login-panel h1 {
    margin: 0 0 22px;
    color: #f0f0f0;
    font-size: 24px;
    font-weight: 700;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-form label {
    color: #d8d8d8;
    font-size: 13px;
    font-weight: 700;
}

.login-form input {
    height: 36px;
    border: 1px solid #4b4b4b;
    border-radius: 4px;
    background: #1c1c1c;
    color: #f2f2f2;
    padding: 0 10px;
    font-size: 14px;
    box-sizing: border-box;
}

.login-form input:focus {
    border-color: #26a69a;
    outline: none;
}

.login-form button {
    height: 38px;
    margin-top: 8px;
    border: 1px solid #26a69a;
    border-radius: 4px;
    background: #26a69a;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.login-form button:disabled,
.login-form input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-error {
    border: 1px solid #7b3838;
    border-radius: 4px;
    background: #331f1f;
    color: #f1c7c7;
    padding: 9px 10px;
    font-size: 13px;
    line-height: 1.4;
}

.home-page,
.macro-page {
    min-height: 100vh;
    background: #181818;
    color: #d8d8d8;
}

.home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 22px;
    border-bottom: 1px solid #303030;
    background: #202020;
    box-sizing: border-box;
}

.home-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.home-title-row h1 {
    margin: 0;
    color: #f2f2f2;
    font-size: 23px;
    line-height: 1.1;
}

.home-title-row p {
    margin: 2px 0 0;
    color: #a9a9a9;
    font-size: 13px;
}

.home-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.home-actions form {
    margin: 0;
}

.home-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    height: auto;
    padding: 5px 10px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #2b2b2b;
    color: #e4e4e4;
    font-size: 13px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}

.home-action-link:hover {
    background: #373737;
}

.status-indicator-container {
    position: relative;
    display: flex;
    align-items: center;
}

.status-indicator {
    display: block;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 2px solid #111;
    border-radius: 50%;
    background: #2ecc40;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

.status-indicator.warning {
    background: #e74c3c;
}

.status-popup {
    display: none;
    position: absolute;
    top: 28px;
    left: 0;
    min-width: 260px;
    max-width: 360px;
    padding: 14px 16px;
    border: 1px solid #3f3f3f;
    border-radius: 6px;
    background: #222;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
    color: #eee;
    font-size: 13px;
    z-index: 50;
}

.status-popup.visible {
    display: block;
}

.status-popup ul {
    margin: 8px 0;
    padding-left: 18px;
}

.status-popup li {
    margin-bottom: 8px;
}

.status-popup span {
    color: #aaa;
    font-size: 12px;
}

.status-popup button {
    height: auto;
    border: 0;
    border-radius: 4px;
    background: #e74c3c;
    color: #fff;
    padding: 6px 10px;
    cursor: pointer;
}

.status-ok {
    color: #2ecc40;
    font-weight: 700;
}

.home-shell,
.macro-shell {
    width: clamp(var(--page-min-width), calc(100vw - 32px), var(--page-max-width));
    margin: 14px auto 28px;
}

.home-shell {
    display: grid;
    grid-template-columns: minmax(360px, 0.82fr) minmax(560px, 1.18fr);
    gap: 12px;
    align-items: start;
}

.pair-panel,
.macro-overview-panel,
.heatmap-panel,
.weekly-release-panel,
.macro-browser,
.macro-detail,
.macro-releases {
    border: 1px solid #333;
    border-radius: 8px;
    background: #222;
    padding: 11px;
    box-sizing: border-box;
}

.home-lower-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 12px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 9px;
}

.section-heading h2 {
    margin: 0;
    color: #efefef;
    font-size: 15px;
}

.section-heading span {
    color: #999;
    font-size: 12px;
}

.section-heading .heading-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.table-height-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #aaa;
    font-size: 12px;
    font-weight: 700;
}

.table-height-control input[type="range"] {
    width: 116px;
    accent-color: #26a69a;
}

.table-height-value {
    min-width: 42px;
    text-align: right;
}

.pair-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.pair-group {
    border: 1px solid #363636;
    border-radius: 6px;
    background: #262626;
    padding: 8px;
}

.pair-group-title {
    margin-bottom: 6px;
    color: #efefef;
    font-size: 13px;
    font-weight: 700;
}

.pair-button-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
    gap: 5px;
}

.pair-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #313131;
    color: #d8d8d8;
    font-size: 11px;
    text-decoration: none;
}

.pair-button:hover {
    background: #3c3c3c;
}

.macro-table-scroll {
    width: 100%;
    overflow-x: auto;
}

.macro-series-scroll,
.macro-history-scroll {
    overflow-y: auto;
    border: 1px solid #303030;
    border-radius: 6px;
}

.macro-series-scroll {
    min-height: 240px;
    max-height: var(--macro-series-height);
}

.macro-history-scroll {
    min-height: 220px;
    max-height: var(--macro-history-height);
}

.macro-overview-table,
.macro-catalog-table,
.macro-history-table,
.weekly-release-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.macro-overview-table th,
.macro-overview-table td,
.macro-catalog-table th,
.macro-catalog-table td,
.macro-history-table th,
.macro-history-table td,
.weekly-release-table th,
.weekly-release-table td {
    border-bottom: 1px solid #333;
    padding: 6px 7px;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.macro-overview-table thead th,
.macro-catalog-table thead th,
.macro-history-table thead th,
.weekly-release-table thead th {
    background: #292929;
    color: #ddd;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 2;
}

.macro-overview-table {
    font-size: 13px;
}

.macro-overview-table tbody tr:nth-child(even),
.weekly-release-table tbody tr:nth-child(even) {
    background: #252525;
}

.macro-overview-table tbody th {
    background: #292929;
    color: #efefef;
    font-weight: 700;
    min-width: 112px;
}

.macro-overview-table td {
    background: #1f2726;
    border-left: 1px solid #303837;
}

.macro-overview-table td strong {
    display: block;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.15;
}

.macro-overview-table td span {
    display: inline-block;
    color: #a7d6cf;
    font-size: 11px;
    margin-top: 2px;
}

.macro-overview-table td em {
    display: block;
    color: #a8a8a8;
    font-size: 10px;
    font-style: normal;
    margin-top: 3px;
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.macro-overview-table .release-cell {
    min-width: 160px;
    max-width: 220px;
    white-space: normal;
    color: #cfcfcf;
    line-height: 1.35;
}

.heatmap-panel .tradingview-widget-container {
    min-height: 300px;
}

.weekly-release-scroll {
    max-height: 326px;
    overflow-y: auto;
    border: 1px solid #303030;
    border-radius: 6px;
}

.weekly-release-table {
    table-layout: fixed;
}

.weekly-release-table th:first-child,
.weekly-release-table td:first-child {
    width: 104px;
}

.weekly-release-table tbody th {
    color: #f2f2f2;
    font-weight: 700;
    background: #292929;
}

.weekly-release-table td {
    white-space: normal;
    min-width: 0;
}

.weekly-release-item {
    display: block;
    padding: 4px 5px;
    margin-bottom: 4px;
    border-left: 2px solid #52605e;
    background: #202827;
    color: #dcdcdc;
    line-height: 1.25;
}

.weekly-release-item.important {
    border-left-color: #26a69a;
    background: #1d302e;
}

.weekly-release-item span {
    display: block;
    color: #9ca7a5;
    font-size: 10px;
}

.weekly-release-item strong {
    display: block;
    color: #f2f2f2;
    font-size: 11px;
    font-weight: 700;
}

.weekly-release-table small {
    display: block;
    color: #aaa;
    font-size: 10px;
}

.release-empty {
    color: #666;
}

.macro-shell {
    display: grid;
    grid-template-columns: minmax(540px, 1fr) minmax(420px, 0.9fr);
    gap: 20px;
    align-items: start;
}

.macro-browser {
    grid-row: span 2;
}

.macro-filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr)) minmax(180px, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.macro-filter-row label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #cfcfcf;
    font-size: 12px;
    font-weight: 700;
}

.macro-filter-row select,
.macro-filter-row input {
    height: 34px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #1c1c1c;
    color: #eee;
    padding: 0 9px;
    box-sizing: border-box;
}

.macro-catalog-table tbody tr {
    cursor: pointer;
}

.macro-catalog-table tbody tr:hover,
.macro-history-table tbody tr:hover,
.macro-overview-table tbody tr:hover {
    background: #2c2c2c;
}

#macro-chart {
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 1px solid #333;
    border-radius: 6px;
    background: #1b1b1b;
    margin-bottom: 14px;
}

.macro-range-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: -2px 0 14px;
}

.macro-date-controls,
.macro-range-buttons {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.macro-date-controls label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #cfcfcf;
    font-size: 12px;
    font-weight: 700;
}

.macro-date-controls input {
    height: 30px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #1c1c1c;
    color: #eee;
    padding: 0 8px;
    box-sizing: border-box;
}

.macro-range-button {
    min-height: 28px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #2b2b2b;
    color: #e4e4e4;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

.macro-range-button:hover,
.macro-range-button.active {
    border-color: #26a69a;
    background: #203b38;
    color: #fff;
}

.release-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 520px;
    overflow-y: auto;
}

.release-row {
    display: grid;
    grid-template-columns: 150px 64px minmax(0, 1fr) 60px;
    gap: 8px;
    align-items: start;
    border-bottom: 1px solid #333;
    padding: 8px 0;
    color: #d8d8d8;
    font-size: 12px;
}

.release-row strong {
    color: #f0f0f0;
    font-weight: 700;
}

.release-row em {
    color: #999;
    font-style: normal;
}

@media (max-width: 1120px) {
    .home-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .home-actions {
        justify-content: flex-start;
    }

    .home-shell,
    .macro-shell {
        width: min(100% - 28px, 900px);
        grid-template-columns: 1fr;
    }

    .home-lower-grid {
        grid-template-columns: 1fr;
    }

    .pair-groups,
    .macro-filter-row {
        grid-template-columns: 1fr;
    }

    .macro-browser {
        grid-row: auto;
    }

    .release-row {
        grid-template-columns: 1fr;
    }
}

#chart {
    height: 90vh;
    width: 100%;
    display: block;
}

#controls {
    padding: 10px;
    background-color: #2a2a2a;
    color: #ccc;
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: flex-start;
    justify-content: center;
}

/* Group containers */
.control-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

/* Row 1: Home Button Group */
.home-row {
    justify-content: center;
}

#home-button {
    background-color: #333;
    color: #ccc;
    border: 1px solid #444;
    padding: 4px 12px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#home-button:hover {
    background-color: #444;
}

.logout-form {
    margin: 0;
}

.logout-button {
    background-color: #333;
    color: #ccc;
    border: 1px solid #444;
    padding: 4px 12px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    height: 28px;
}

.logout-button:hover {
    background-color: #444;
}

/* Group 2: Pair & Timeframe Controls */
.pair-timeframe-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: flex-start;
}

.dropdown-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dropdown-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.dropdown-group label {
    font-weight: bold;
    color: #ddd;
}

/* Timeframe buttons */
.tf-buttons {
    display: flex;
    gap: 4px;
}

.tf-btn {
    background-color: #333;
    color: #ccc;
    border: 1px solid #444;
    padding: 2px 6px;
    font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
    min-width: 28px;
    height: 28px;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tf-btn:hover {
    background-color: #444;
}

.tf-btn.active {
    background-color: #26a69a;
    border-color: #26a69a;
    color: #fff;
}

/* Group 3: Grid Layout Buttons */
.grid-layout-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.grid-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 3px;
    padding: 0;
}

.grid-btn {
    padding: 3px;
    background-color: #333;
    border: 1px solid #444;
    color: #ccc;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.grid-btn:hover {
    background-color: #444;
    border-color: #666;
}

.grid-btn.active {
    background-color: #26a69a;
    border-color: #26a69a;
    color: #fff;
}

/* Grid Visual Icons - CSS-based instead of Unicode */
.grid-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.grid-icon.single::before {
    content: '';
    width: 14px;
    height: 10px;
    background-color: currentColor;
    border-radius: 1px;
}

.grid-icon.dual {
    gap: 1px;
}

.grid-icon.dual::before,
.grid-icon.dual::after {
    content: '';
    width: 6px;
    height: 10px;
    background-color: currentColor;
    border-radius: 1px;
}

.grid-icon.triple {
    position: relative;
    width: 14px;
    height: 10px;
}

.grid-icon.triple::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 8px;
    height: 10px;
    background-color: currentColor;
    border-radius: 1px;
}

.grid-icon.triple::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 5px;
    height: 4px;
    background-color: currentColor;
    border-radius: 1px;
    box-shadow: 0 6px 0 currentColor;
}

.grid-icon.quad {
    position: relative;
    width: 14px;
    height: 10px;
}

.grid-icon.quad::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 6px;
    height: 4px;
    background-color: currentColor;
    border-radius: 1px;
    box-shadow:
        8px 0 0 currentColor,
        0 6px 0 currentColor,
        8px 6px 0 currentColor;
}

/* Group 4: Go to Start Button */
.goto-group {
    display: flex;
    align-items: flex-start;
}

#goto-start {
    background-color: #333;
    color: #ccc;
    border: 1px solid #444;
    padding: 4px 8px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#goto-start:hover {
    background-color: #444;
}

.error-log-group {
    display: flex;
    align-items: flex-start;
}

.indicator-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 210px;
}

.indicator-select-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.indicator-select-row label {
    font-weight: bold;
    color: #ddd;
    font-size: 13px;
    white-space: nowrap;
}

#indicator-select {
    min-width: 72px;
}

#indicator-settings-button {
    width: 28px;
    padding: 4px;
    justify-content: center;
}

.indicator-ratio-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

#indicator-ratio {
    width: 76px;
}

#indicator-ratio-value {
    min-width: 38px;
    font-size: 11px;
    color: #aaa;
    font-family: Menlo, Consolas, monospace;
}

#error-log-button {
    min-width: 62px;
}

#error-log-button.has-errors {
    background-color: #7a2d2d;
    border-color: #b94a4a;
    color: #fff;
}

.error-log-panel {
    position: absolute;
    top: 54px;
    right: 12px;
    width: min(760px, calc(100vw - 24px));
    max-height: min(520px, calc(100vh - 90px));
    background: rgba(24, 24, 24, 0.98);
    border: 1px solid #666;
    color: #eee;
    z-index: 3000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.error-log-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #444;
    background: #2a2a2a;
    font-weight: bold;
}

.error-log-header span {
    flex: 1;
}

.error-log-header button {
    height: 24px;
    font-size: 12px;
}

#error-log-content {
    margin: 0;
    padding: 10px;
    max-height: 460px;
    overflow: auto;
    white-space: pre-wrap;
    font-family: Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.45;
}

.indicator-settings-panel {
    position: absolute;
    top: 54px;
    right: 12px;
    width: min(720px, calc(100vw - 24px));
    max-height: min(640px, calc(100vh - 90px));
    background: rgba(24, 24, 24, 0.98);
    border: 1px solid #666;
    color: #eee;
    z-index: 2900;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.indicator-settings-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #444;
    background: #2a2a2a;
    font-weight: bold;
}

.indicator-settings-header span {
    flex: 1;
}

.indicator-settings-header button {
    height: 24px;
    font-size: 12px;
}

.indicator-settings-body {
    display: grid;
    gap: 12px;
    padding: 12px;
    overflow: auto;
    max-height: 560px;
}

.indicator-settings-row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.indicator-empty-settings {
    color: #aaa;
    font-size: 13px;
    padding: 4px 0;
}

.indicator-settings-section {
    display: grid;
    grid-template-columns: 120px minmax(80px, 1fr) 120px minmax(80px, 1fr);
    gap: 8px;
    align-items: center;
}

.indicator-settings-section label,
.indicator-settings-row label {
    color: #ddd;
    font-size: 12px;
    font-weight: bold;
}

.indicator-settings-section input,
.indicator-settings-section select,
.indicator-settings-row select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.indicator-settings-section input[type="color"] {
    height: 28px;
    padding: 2px;
}

.indicator-settings-section input[type="text"],
.indicator-settings-section input[type="number"] {
    background-color: #333;
    color: #ccc;
    border: 1px solid #444;
    border-radius: 4px;
    height: 28px;
    padding: 4px 8px;
}

@media (max-width: 760px) {
    .indicator-settings-section,
    .indicator-settings-row {
        grid-template-columns: 1fr;
    }
}

/* Consistent button and select sizing */
select, button {
    background-color: #333;
    color: #ccc;
    border: 1px solid #444;
    padding: 4px 8px;
    font-size: 14px;
    border-radius: 4px;
    height: 28px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.login-form button {
    height: 38px;
    margin-top: 8px;
    border-color: #26a69a;
    background: #26a69a;
    color: #fff;
    justify-content: center;
}

/* Two-column dropdown layout for pairs */
.pair-dropdown-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    max-height: 300px;
    overflow-y: auto;
}

.pair-column {
    background-color: #333;
}

.pair-column optgroup {
    margin-bottom: 5px;
}

/* Make pair dropdown wider to accommodate two columns */
#pair-select {
    min-width: 140px;
}

select:focus, button:focus {
    outline: none;
    border-color: #666;
}

button:hover {
    background-color: #444;
}

#ohlc-box {
    position: absolute;
    top: 70px;
    left: 20px;
    background: rgba(34, 34, 34, 0.95);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #555;
    font-size: 14px;
    font-family: monospace;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    pointer-events: none;
    min-width: 200px;
    letter-spacing: 0.5px;
    display: none; /* Hide the old OHLC box - we use individual chart info boxes now */
}

#split-charts.split-charts-1 {
    display: flex;
    height: 100vh; /* Will be set dynamically by JavaScript */
}

#split-charts.split-charts-1 .chart-area {
    flex: 1 1 100%;
}

#split-charts.split-charts-2 {
    display: flex;
    flex-direction: row;
    height: 100vh; /* Will be set dynamically by JavaScript */
    gap: 1px;
    background-color: #444; /* Separator color */
}

#split-charts.split-charts-2 .chart-area {
    flex: 1 1 0;
}

#split-charts.split-charts-3 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    height: 100vh; /* Will be set dynamically by JavaScript */
    gap: 1px;
    background-color: #444; /* Separator color */
}

#split-charts.split-charts-3 #chart-1 { 
    grid-column: 1; 
    grid-row: 1 / span 2; 
}
#split-charts.split-charts-3 #chart-2 { 
    grid-column: 2; 
    grid-row: 1; 
}
#split-charts.split-charts-3 #chart-3 { 
    grid-column: 2; 
    grid-row: 2; 
}

#split-charts.split-charts-4 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    height: 100vh; /* Will be set dynamically by JavaScript */
    gap: 1px;
    background-color: #444; /* Separator color */
}

#split-charts.split-charts-4 #chart-1 { grid-column: 1; grid-row: 1; }
#split-charts.split-charts-4 #chart-2 { grid-column: 2; grid-row: 1; }
#split-charts.split-charts-4 #chart-3 { grid-column: 1; grid-row: 2; }
#split-charts.split-charts-4 #chart-4 { grid-column: 2; grid-row: 2; }

.chart-area {
    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s ease;
    position: relative; /* Add relative positioning for absolute children */
    display: flex;
    flex-direction: column;
    outline: 1px solid #444;
    outline-offset: -1px;
}

#split-charts.split-charts-1 .chart-area,
#split-charts.split-charts-2 .chart-area {
    height: 100%;
}

#split-charts.split-charts-3 .chart-area,
#split-charts.split-charts-4 .chart-area {
    align-self: stretch;
    justify-self: stretch;
    width: 100%;
    height: 100%;
}

.chart-area:hover {
    border-color: #666;
}

.chart-area.active {
    border-color: #26a69a;
    box-shadow: 0 0 10px rgba(38, 166, 154, 0.3);
}

.price-chart-pane {
    flex: 1 1 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.indicator-chart-pane {
    display: none;
    flex: 0 0 20%;
    min-width: 0;
    min-height: 70px;
    border-top: 1px solid #444;
    background: #181818;
    overflow: hidden;
    position: relative;
}

.indicator-info-box {
    position: absolute;
    top: 6px;
    left: 10px;
    z-index: 1000;
    background: rgba(24, 24, 24, 0.92);
    border: 1px solid #555;
    color: #f2c94c;
    font-family: Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.25;
    padding: 4px 7px;
    border-radius: 4px;
    pointer-events: none;
}

/* Individual chart info boxes */
.chart-info-box {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(34, 34, 34, 0.95);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #555;
    font-size: 12px;
    font-family: monospace;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    pointer-events: none;
    min-width: 180px;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.chart-info-header {
    font-weight: bold;
    margin-bottom: 4px;
    color: #26a69a;
    font-size: 13px;
}

.chart-info-ohlc {
    font-size: 11px;
    color: #ddd;
}
