/* Per-account workspace and EA deployment */
.account-detail-content { display: grid; gap: 9px; }
.account-detail-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(250px, .85fr); gap: 9px; }
.account-identity-panel, .account-ea-panel, .balance-history-panel, .positions-panel, .ea-upload-panel, .ea-config-panel, .ea-status-panel { min-width: 0; }
.account-identity-panel .panel-heading, .account-ea-panel .panel-heading, .balance-history-panel .panel-heading, .positions-panel .panel-heading, .history-panel .panel-heading, .ea-upload-panel .panel-heading, .ea-config-panel .panel-heading, .ea-status-panel .panel-heading { min-height: 42px; }
.account-identity-panel .panel-heading h2, .account-ea-panel .panel-heading h2, .balance-history-panel .panel-heading h2, .positions-panel .panel-heading h2, .history-panel .panel-heading h2, .ea-upload-panel .panel-heading h2, .ea-config-panel .panel-heading h2, .ea-status-panel .panel-heading h2 { margin: 2px 0 0; color: #e2eae3; font-size: 13px; font-weight: 620; }
.account-identity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding: 2px 12px 12px; }
.account-identity-grid > div, .ea-status-grid > div { display: grid; min-width: 0; gap: 4px; }
.account-identity-grid span, .ea-status-grid span { color: #7f8d85; font-size: 8px; font-weight: 720; letter-spacing: .07em; }
.account-identity-grid strong, .ea-status-grid strong { overflow: hidden; color: #dce5de; font-size: 10px; font-weight: 590; text-overflow: ellipsis; white-space: nowrap; }
.account-ea-panel { display: grid; align-content: start; }
.account-active-pair { padding: 2px 12px 0; color: #d8eac2; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 19px; font-weight: 650; }
.account-ea-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px 12px; color: #8b9991; font-size: 9px; }
.account-metrics { margin: 0; }
.account-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; align-items: start; }
.balance-chart-wrap { padding: 8px 12px 11px; }
.balance-range-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 0 12px 7px; }
.balance-range-button { min-height: 27px; padding: 0 9px; border: 1px solid #2b393d; border-radius: 5px; background: #11191c; color: #94a198; cursor: pointer; font-size: 9px; font-weight: 560; }
.balance-range-button:hover { border-color: #56684e; color: #dce5de; }
.balance-range-button.is-active, .balance-range-button[aria-pressed="true"] { border-color: #506641; background: #1a281d; color: #c8e8a1; }
.custom-balance-range { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 12px 8px; }
.custom-balance-range label { color: #93a097; font-size: 8px; }
.custom-balance-range input { width: 132px; min-width: 0; height: 29px; padding: 0 7px; border: 1px solid #334149; border-radius: 5px; background: #0b1215; color: #dce5de; color-scheme: dark; font-size: 9px; }
.custom-balance-range input:focus { border-color: #a6d873; outline: 2px solid rgb(173 221 106 / 13%); }
.balance-range-error { flex-basis: 100%; color: #f0a59b; font-size: 9px; }
.balance-chart-wrap svg { display: block; width: 100%; height: 202px; overflow: visible; }
.chart-grid { fill: none; stroke: #28363a; stroke-width: 1; stroke-dasharray: 3 5; }
.balance-y-axis { fill: #8e9c93; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; font-variant-numeric: tabular-nums; }
.balance-y-title { fill: #b9c6bc; font-size: 9px; font-weight: 650; letter-spacing: .035em; }
.balance-y-label { text-anchor: end; dominant-baseline: central; }
.balance-area { fill: rgb(173 221 106 / 9%); }
.balance-line { fill: none; stroke: #b4df7b; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.balance-points circle { fill: #0e1718; stroke: #c3eb8c; stroke-width: 2; vector-effect: non-scaling-stroke; }
.balance-points title { fill: #dfe8df; }
.balance-axis { display: flex; justify-content: space-between; color: #819087; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; }
.chart-note { margin: 7px 12px 10px; color: #89968e; font-size: 9px; line-height: 1.45; }
.positions-table, .history-table { width: 100%; border-collapse: collapse; text-align: left; }
.positions-table { min-width: 0; }
.history-table { min-width: 760px; }
.positions-table thead, .history-table thead { background: #11191d; }
.positions-table th, .history-table th { height: 29px; padding: 0 10px; border-bottom: 1px solid #27343a; color: #829088; font-size: 8px; font-weight: 760; letter-spacing: .07em; white-space: nowrap; }
.positions-table td, .history-table td { height: 37px; padding: 6px 10px; border-bottom: 1px solid #222f34; color: #c0cbc4; font-size: 10px; vertical-align: middle; }
.positions-table tbody tr:last-child td, .history-table tbody tr:last-child td { border-bottom: 0; }
.positions-table tbody tr:hover, .history-table tbody tr:hover { background: #151f22; }
.history-table td { white-space: nowrap; }
.history-side { font-size: 9px; font-weight: 700; }
.history-side.buy { color: #a9d77c; }
.history-side.sell { color: #ee8b81; }
.position-side { font-size: 9px; font-weight: 700; }
.position-side.buy, .positive { color: #a9d77c !important; }
.position-side.sell, .negative { color: #ee8b81 !important; }
.account-open-link { max-width: 100%; overflow: hidden; padding: 0; border: 0; background: transparent; color: #dce8da; cursor: pointer; font: inherit; font-size: 9px; font-weight: 620; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.account-open-link:hover { color: #c6ed91; text-decoration: underline; }
.account-open-link:focus-visible { border-radius: 2px; outline: 2px solid #a6d873; outline-offset: 3px; }
.detail-empty { display: grid; min-height: 170px; align-content: center; justify-items: center; gap: 7px; text-align: center; }
.detail-empty strong { color: #e0e9e2; font-size: 13px; }
.detail-empty p { max-width: 380px; margin: 0 0 4px; color: #95a198; font-size: 10px; line-height: 1.5; }
.automation-account-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; padding: 10px 13px; }
.automation-account-bar > div { display: grid; gap: 4px; min-width: 0; }
.automation-account-bar strong { color: #e1e9e2; font-size: 11px; font-weight: 620; }
.automation-account-bar small { color: #89968e; font-size: 9px; }
.automation-layout { display: grid; grid-template-columns: minmax(250px, .78fr) minmax(360px, 1.22fr); gap: 9px; align-items: start; }
.ea-upload-form, .ea-config-form { display: grid; gap: 10px; padding: 11px 13px 13px; }
.ea-upload-form input[type="file"] { width: 100%; min-height: 34px; padding: 6px; border: 1px solid #334149; border-radius: 5px; background: #0c1316; color: #cdd8d0; font-size: 10px; }
.ea-upload-form input[type="file"]::file-selector-button { margin-right: 8px; padding: 5px 8px; border: 1px solid #415148; border-radius: 4px; background: #1b2921; color: #d9e9cd; cursor: pointer; font-size: 9px; }
.ea-upload-form .button { justify-self: start; }
.optional-label { margin-left: 4px; color: #7e8b83; font-size: 9px; font-weight: 450; }
.ea-config-empty { display: grid; min-height: 150px; align-content: center; justify-items: center; gap: 5px; padding: 12px; text-align: center; }
.ea-config-empty strong { color: #dce5de; font-size: 11px; }
.ea-config-empty p { max-width: 340px; margin: 0; color: #89968e; font-size: 9px; line-height: 1.5; }
.ea-target-fields { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(110px, .6fr); gap: 9px; }
.ea-target-fields input, .ea-target-fields select, .ea-parameter-field input, .ea-parameter-field select { width: 100%; min-width: 0; height: 33px; padding: 0 8px; border: 1px solid #334149; border-radius: 5px; background: #0b1215; color: #dce5de; font: inherit; font-size: 10px; }
.ea-target-fields input:focus, .ea-target-fields select:focus, .ea-parameter-field input:focus, .ea-parameter-field select:focus { border-color: #a6d873; outline: 2px solid rgb(173 221 106 / 13%); }
.ea-parameters { display: grid; gap: 8px; padding-top: 8px; border-top: 1px solid #27343a; }
.parameter-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.parameter-heading strong { color: #dce5de; font-size: 10px; }
.parameter-heading span { color: #89968e; font-size: 9px; }
.ea-parameter-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 300px; overflow: auto; padding-right: 3px; }
.ea-parameter-field { min-width: 0; }
.ea-parameter-field label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ea-fundamental-settings { display: grid; gap: 8px; padding-top: 9px; border-top: 1px solid #27343a; }
.ea-fundamental-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ea-fundamental-fields input, .ea-fundamental-fields select { width: 100%; min-width: 0; height: 33px; padding: 0 8px; border: 1px solid #334149; border-radius: 5px; background: #0b1215; color: #dce5de; font: inherit; font-size: 10px; }
.ea-fundamental-fields input:focus, .ea-fundamental-fields select:focus { border-color: #a6d873; outline: 2px solid rgb(173 221 106 / 13%); }
.ea-fundamental-fields :disabled { cursor: not-allowed; opacity: .55; }
.ea-fundamental-current { margin: 0; padding: 7px 9px; border: 1px solid #2b393b; border-radius: 5px; background: #10181a; color: #a7b8a8; font-size: 9px; line-height: 1.5; }
.ea-fundamental-current.is-within { border-color: #36513b; color: #a9ddb2; }
.ea-fundamental-current.is-outside, .ea-fundamental-current.is-unavailable { border-color: #67413d; color: #efaaa1; }
.ea-action-row { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 2px; }
.button-danger-quiet { border: 1px solid #593f3b; background: #211615; color: #efaaa1; }
.button-danger-quiet:hover:not(:disabled) { border-color: #98554c; background: #2b1a18; }
.button-danger-quiet:disabled { cursor: not-allowed; opacity: .45; }
.ea-live-note { margin: -2px 0 0; color: #9caa9f; font-size: 9px; line-height: 1.45; }
.ea-status-panel { grid-column: 1 / -1; }
.ea-status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 10px 13px 0; }
.ea-runtime-error { margin: 0 12px 10px; padding: 8px 10px; border: 1px solid #75423d; border-radius: 5px; background: #261715; color: #f0a59b; font-size: 10px; line-height: 1.4; }
.automation-status-list { overflow-x: auto; padding: 0 11px 8px; }
.automation-status-row { display: grid; min-width: 900px; grid-template-columns: minmax(140px, 1.25fr) minmax(90px, .7fr) 68px minmax(160px, 1.25fr) 100px minmax(235px, 1.7fr); align-items: center; gap: 9px; padding: 9px 4px; border-bottom: 1px solid #27343a; }
.automation-status-row:last-child { border-bottom: 0; }
.automation-status-heading { min-height: 31px; padding-top: 4px; padding-bottom: 4px; color: #74837a; font-size: 8px; font-weight: 700; letter-spacing: .07em; }
.automation-status-ea, .automation-status-runtime { display: grid; min-width: 0; gap: 3px; }
.automation-status-ea strong { overflow: hidden; color: #dce5de; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.automation-status-ea small, .automation-status-runtime small { overflow: hidden; color: #89968e; font-size: 8px; line-height: 1.4; text-overflow: ellipsis; }
.automation-status-pair { overflow: hidden; color: #cbd8cd; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.automation-status-fundamental { display: grid; min-width: 0; gap: 3px; }
.automation-status-fundamental strong { overflow: hidden; color: #cbd8cd; font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.automation-status-fundamental small { overflow: hidden; color: #89968e; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.automation-status-fundamental.is-within strong { color: #a9ddb2; }
.automation-status-fundamental.is-outside strong, .automation-status-fundamental.is-unavailable strong { color: #efaaa1; }
.automation-status-fundamental.is-manually_paused strong { color: #d4bd82; }
.automation-status-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.automation-status-actions .button { min-height: 26px; padding: 0 8px; font-size: 8px; }
.button-delete-quiet { border: 1px solid #553b38; background: #211716; color: #e8a49c; }
.button-delete-quiet:hover:not(:disabled) { border-color: #985b53; background: #2b1a18; }
.button-delete-quiet:disabled { cursor: not-allowed; opacity: .45; }
.ea-install-progress { display: grid; grid-template-columns: 82px minmax(70px, 1fr); align-items: center; gap: 7px; margin-top: 2px; }
.ea-install-progress-label { color: #b8cf9c; font-size: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ea-install-progress-track { height: 5px; overflow: hidden; border-radius: 999px; background: #25322d; }
.ea-install-progress-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #83b45b, #c2e482); transition: width 260ms ease; }
.ea-install-progress.is-deleting .ea-install-progress-label { color: #e1a79d; }
.ea-install-progress.is-deleting .ea-install-progress-fill { background: linear-gradient(90deg, #a85f55, #e4a197); }
.button-quiet { border-color: #34443b; background: #151e1a; color: #c7d7c2; }
.button-quiet:hover:not(:disabled) { border-color: #78965e; background: #1c2b21; }
@media (max-width: 900px) {
  .account-detail-top, .account-detail-grid { grid-template-columns: 1fr; }
  .automation-layout { grid-template-columns: 1fr; }
  .ea-status-panel { grid-column: auto; }
}
@media (max-width: 600px) {
  .account-identity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-identity-grid > div:last-child { grid-column: 1 / -1; }
  .account-ea-meta { align-items: flex-start; flex-direction: column; }
  .balance-chart-wrap svg { height: 165px; }
  .balance-range-controls { gap: 5px; }
  .balance-range-button { min-height: 32px; padding: 0 8px; }
  .custom-balance-range input { width: min(128px, calc(50vw - 45px)); }
  .automation-account-bar { align-items: flex-start; }
  .ea-target-fields { grid-template-columns: 1fr 110px; }
  .ea-parameter-fields { grid-template-columns: 1fr; max-height: 240px; }
  .ea-fundamental-fields { grid-template-columns: 1fr; }
  .ea-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .app-main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

.login-secondary-link { display: block; width: fit-content; color: #aacd7a; font-size: 9px; }
.login-secondary-link:hover { color: #d4efaa; text-decoration: underline; text-underline-offset: 3px; }
.login-form .form-field { gap: 5px; }
.login-form .form-field input { width: 100%; min-width: 0; height: 35px; padding: 0 9px; border: 1px solid #334249; border-radius: 5px; background: #0a1114; color: var(--text); font-size: 10px; }
.login-form .form-field input:focus { border-color: #8eb95b; outline: none; box-shadow: 0 0 0 2px rgb(173 221 106 / 9%); }
@media (max-width: 600px) {
  .login-form .form-field input { height: 40px; font-size: 14px; }
}


