:root{color-scheme:dark;font-family:system-ui,-apple-system,sans-serif;background:#0c1118;color:#eaf0f6}*{box-sizing:border-box}body{margin:0}main{max-width:1000px;margin:auto;padding:32px 24px}header{display:flex;align-items:center;justify-content:space-between;gap:20px;padding-bottom:28px;border-bottom:1px solid #26303d}.brand{font-size:26px;font-weight:800;color:#6de2b1}.brand span{color:#eaf0f6;margin-left:15px;font-size:20px}.tag,.muted,footer{color:#92a3b7}.tag{font-size:13px}section{padding:65px 0 35px;max-width:800px}h1{font-size:clamp(30px,6vw,48px);letter-spacing:-1.5px;margin:12px 0 20px}.eyebrow{font-size:11px;letter-spacing:2px;color:#6de2b1}.muted{line-height:1.7}button{display:block;background:#6de2b1;border:1px solid transparent;border-radius:9px;padding:14px 20px;font:600 15px system-ui;color:#10251e;margin-top:25px;cursor:pointer}button:disabled{opacity:.5;cursor:wait}.secondary{background:#18212d;border-color:#2d3c4f;color:#dce6f2}.actions{display:flex;gap:12px;flex-wrap:wrap}label{display:block;font-size:14px;color:#acbacc;margin:28px 0 10px}input{background:#141d28;border:1px solid #33465b;border-radius:8px;color:white;padding:14px;font-size:16px;width:min(100%,400px)}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:16px;margin-top:32px}.card{padding:24px;background:#141c27;border:1px solid #283747;border-radius:12px}.card h2{font-size:20px;margin-top:0}.card p{color:#a5b6c9;font-size:14px}.ok{color:#6de2b1}#message{color:#e4bf77;font-size:14px;line-height:1.6}footer{border-top:1px solid #26303d;margin-top:60px;padding-top:20px;font-size:10px;letter-spacing:2px}[hidden]{display:none!important}

.toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:24px 0}.toolbar button{margin:0}.toolbar h2{margin-right:auto}select{background:#141d28;color:#eaf0f6;border:1px solid #33465b;border-radius:8px;padding:13px;font:15px system-ui;max-width:100%}.toolbar select{flex:1;min-width:200px}#dashboard{max-width:none}#account-view h2{font-size:20px;margin-top:35px}.panel{background:#111b27;border:1px solid #33465b;padding:24px;border-radius:12px;margin:24px 0}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px}.form-grid input,.form-grid select{width:100%;max-width:none}.wide,#lighter-fields{grid-column:1/-1}.small{font-size:12px}.table-wrap{overflow:auto;border-bottom:1px solid #26303d}table{width:100%;border-collapse:collapse;font-size:13px;white-space:nowrap}th,td{text-align:right;padding:14px 12px;border-bottom:1px solid #26303d}th:first-child,td:first-child{text-align:left}th{color:#92a3b7;font-weight:500}.positive{color:#6de2b1}.negative{color:#ef888c}.card p{overflow-wrap:anywhere}.card .actions{gap:8px}.card button{font-size:12px;padding:9px 13px;margin-top:10px}#balance{margin-top:16px}#balance .card h2{font-size:26px;margin:10px 0 0}main{max-width:1200px}@media(max-width:600px){main{padding:20px 15px}.form-grid{grid-template-columns:1fr}section{padding-top:35px}.tag{font-size:10px}.panel{padding:18px}.toolbar{gap:8px}.toolbar button{padding:12px;font-size:13px}}


.trade-panel{max-width:100%;padding:26px;margin:28px 0 36px;background:#101923;border:1px solid #2d3c4f;border-radius:14px}
.trade-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:22px}
.trade-heading h2{font-size:19px;letter-spacing:1px;margin:0;color:#6de2b1}
.trade-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 20px}
.trade-field{min-width:0}
.trade-field label{margin:0 0 8px;font-size:11px;letter-spacing:1px;color:#91a4b9}
.trade-field input,.trade-field select{width:100%;max-width:none;min-width:0;height:46px;padding:10px 12px;background:#141e2a;border:1px solid #34465a;border-radius:8px;color:#edf4fa;font-size:15px}
.trade-inline{display:flex;align-items:stretch;gap:8px;min-width:0}
.trade-inline>input{flex:1;min-width:0}
.trade-segment{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:4px;background:#0b121b;border:1px solid #2a394a;border-radius:9px;min-width:0}
.trade-segment button{margin:0;padding:10px 12px;min-height:38px;background:transparent;border:1px solid transparent;border-radius:6px;color:#aab9c9;font-size:12px;letter-spacing:.4px}
.trade-segment button.active{background:#273646;border-color:#3d526a;color:#f3f7fb}
.trade-segment button.long.active{color:#6de2b1}
.trade-segment button.short.active{color:#ef888c}
.trade-segment.compact{flex:0 0 42%;max-width:190px}
.trade-segment.compact button{padding:8px 7px;font-size:11px}
#trade-direction{grid-template-columns:repeat(2,minmax(0,1fr))}
#trade-mode{grid-template-columns:repeat(4,minmax(0,1fr))}
#trade-mode button{padding:9px 4px;font-size:11px}
.trade-protection-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.trade-check{display:flex;align-items:center;gap:9px;margin:0;color:#b4c2d1;font-size:12px;letter-spacing:.5px}
.trade-check input{width:16px;height:16px;accent-color:#6de2b1}
.trade-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.trade-actions button{margin:0;min-height:48px}
.trade-actions #trade-preview{background:#1a2634;border-color:#3b4d62;color:#e7eff7}
.trade-actions #trade-open{background:#6de2b1;color:#10251e}
.trade-actions #trade-open:disabled{background:#2b3a48;color:#8190a1;border-color:#34465a;cursor:not-allowed}
.trade-output{padding:16px;background:#0b131d;border:1px solid #304358;border-radius:9px;color:#dce8f4;line-height:1.75;font-size:13px;white-space:pre-line}
.trade-output .trade-result-title{font-weight:700;color:#6de2b1;margin-bottom:8px}
.trade-output .trade-result-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px 18px}
.trade-output .negative{color:#ef888c}.trade-output .positive{color:#6de2b1}
#trade-safety{margin:0}
@media(max-width:650px){
 .trade-panel{padding:18px 14px}
 .trade-grid{grid-template-columns:1fr;gap:16px}
 .trade-field.wide,.wide{grid-column:auto}
 .trade-segment.compact{flex-basis:43%}
 .trade-heading{align-items:flex-start;flex-direction:column}
}

.history-panel{padding:24px 0;max-width:none}.history-panel .toolbar h2{margin:0 auto 0 0}.history-panel .toolbar select{flex:0 1 auto;min-width:150px}#history-summary{font-variant-numeric:tabular-nums}

/* VPS1 reference base, card assets, then its active theme. */


* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 18px;

    font-family:
        Arial,
        sans-serif;

    background: #111;
    color: #eee;
}

.wrap {
    max-width: 520px;
    margin: auto;
}


/* =========================
   HEADER
   ========================= */

.header {
    position: relative;

    display: flex;
    align-items: center;

    min-height: 42px;

    margin-bottom: 10px;
}

.account-area {
    display: flex;
    align-items: center;

    min-width: 0;
    flex: 1;

    margin-left: 12px;
}

.account-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    min-width: 0;

    border: 0;
    padding: 0;

    background: transparent;
    color: #eee;

    font-size: 21px;
    font-weight: bold;

    text-align: left;
}

.account-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    max-width: 190px;
}

.chevron {
    font-size: 11px;
    color: #aaa;

    transform: translateY(1px);
}

.collateral {
    margin-left: 7px;

    font-size: 21px;
    font-weight: bold;

    white-space: nowrap;
}

.key-link {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    margin-left: auto;
    padding: 0;

    border: 0;

    background: transparent;

    text-decoration: none;
    cursor: pointer;
}


/* Market overview icon; match the hamburger's 3*3px bars plus 2*4px gaps. */
.header-quotes-icon {display:flex;align-items:center;justify-content:center;flex:0 0 34px;height:42px;margin-left:8px;cursor:pointer;background:transparent;border:0;padding:0;color:inherit}
.header-quotes-icon svg {display:block;width:23.5103px;height:23.5103px;transform:translateX(-8px)}
#market-overview-dialog {width:min(520px,calc(100vw - 32px));max-height:85vh;overflow:auto;box-sizing:border-box;background:#171a1c;color:#d7dadd;border:1px solid #41464a;border-radius:12px;padding:20px;font-family:inherit}
#market-overview-dialog::backdrop {background:rgba(0,0,0,.65)}
.market-overview-head {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}
.market-overview-head h3 {margin:0;font-family:inherit;font-weight:700;font-size:15px;letter-spacing:.4px}
#market-overview-close {display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;background:transparent;border:0;color:#d7dadd;cursor:pointer;border-radius:50%}
#market-overview-close:hover {background:rgba(255,255,255,.07)}
.market-overview-table {width:100%;border-collapse:collapse;table-layout:auto;font-size:14px;font-variant-numeric:tabular-nums}
.market-overview-table th {font-weight:700;font-size:12px;color:#999da3;padding:0 0 12px;text-align:left;white-space:nowrap}
.market-overview-table td {padding:15px 0;border-top:1px solid #363b3f;text-align:left;white-space:nowrap}
.market-overview-table th:first-child,.market-overview-table td:first-child {text-align:left;padding-right:10px}
.market-overview-table td:first-child {font-weight:700}
.market-overview-table th+th,.market-overview-table td+td {padding-left:8px}
.market-overview-positive {color:#3fba7c}
.market-overview-negative {color:#d1616a}
#market-overview-status {font:inherit;font-size:12px;color:#999da3;margin:14px 0 0}
#market-overview-status:empty {display:none}
@media(max-width:360px){ #market-overview-dialog {padding:14px}.market-overview-table {font-size:13px}.market-overview-table th+th,.market-overview-table td+td {padding-left:5px}}


/* API KEYS hamburger */

.menu-symbol {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;

    width: 24px;
    height: 22px;

    transform: translateX(-8px);
}

.menu-symbol span {
    display: block;

    width: 24px;
    height: 3px;

    border-radius: 2px;

    background: #e5a11a;
}


/* =========================
   DROPDOWN
   ========================= */

.dropdown {
    display: none;

    position: absolute;
    z-index: 100;

    top: 44px;
    left: 0;

    width: min(
        245px,
        calc(100vw - 78px)
    );

    padding: 5px;

    background: #202020;

    border:
        1px solid #444;

    border-radius: 11px;

    box-shadow:
        0 12px 30px
        rgba(0,0,0,.45);
}

.dropdown.open {
    display: block;
}

.settings-dropdown {
    left: auto;
    right: 0;

    width: 58px;
}

.settings-dropdown .dropdown-item {
    display: grid;
    place-items: center;

    height: 46px;

    padding: 0;
}

.settings-dropdown .dropdown-item
+ .dropdown-item {
    margin-top: 3px;
}

.settings-menu-icon {
    width: 22px;
    height: 22px;

    fill: none;
    stroke: currentColor;

    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dropdown-form {
    margin: 0;
}

.dropdown-item {
    display: block;

    width: 100%;

    padding: 9px 11px;

    border: 1px solid transparent;
    border-radius: 8px;

    background: transparent;
    color: #eee;

    text-align: left;
    text-decoration: none;
}

.dropdown-item.current {
    background: #3b341d;

    border:
        1px solid
        #b58b22;

    color: #ffd867;
}

.dropdown-name {
    display: block;

    font-size: 15px;
    font-weight: bold;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-empty {
    color: #999;
    padding: 12px;
}


/* =========================
   TABS
   ========================= */


.tabs {
    display: flex;
    align-items: flex-end;

    gap: 0;

    margin:
        0 0 -1px 0;

    position: relative;
    z-index: 3;
}

.tab {
    flex: 1;

    padding: 11px 10px;

    border:
        1px solid #3d3d3d;

    border-bottom:
        1px solid #3d3d3d;

    border-radius:
        10px 10px 0 0;

    text-align: center;
    text-decoration: none;

    color: #888;
    background: #171717;

    font-size: 14px;
    font-weight: bold;

    position: relative;
    z-index: 2;
}

.tab + .tab {
    margin-left: -1px;
}

.tab.active {
    color: #e5a11a;

    background: #1d1d1d;

    border-color: #3d3d3d;

    /*
       Активная вкладка той же высоты,
       что и неактивная.
    */
    border-bottom-color: #1d1d1d;

    z-index: 4;
}

.tab-content-card {
    margin-top: 0;

    background: #1d1d1d;

    border:
        1px solid #3d3d3d;

    /*
       Принудительно убираем все
       верхние скругления, даже если
       базовый класс .card задаёт их.
    */
    border-radius:
        0 0 14px 14px !important;

    border-top-left-radius:
        0 !important;

    border-top-right-radius:
        0 !important;

    position: relative;
    z-index: 2;
}


body[data-page="keys"]
.tabs + .card {
    border-top-left-radius:
        0 !important;

    border-top-right-radius:
        0 !important;
}



/* =========================
   CARDS
   ========================= */

.card {
    background: #1d1d1d;

    border-radius: 14px;

    padding: 18px;

    margin-bottom: 16px;
}

h2 {
    margin:
        0 0 16px;

    font-size: 18px;
}

.label {
    margin-top: 13px;

    color: #999;

    font-size: 12px;
}

.value {
    margin-top: 5px;

    font-size: 15px;
}

.key-index-row {
    display: grid;

    grid-template-columns:
        minmax(0, 2fr)
        minmax(0, 1fr);

    gap: 16px;
}

.key-index-item {
    min-width: 0;
}

.private-key {
    margin-top: 6px;

    padding: 11px;

    border-radius: 8px;

    background: #111;

    font-family:
        monospace;

    overflow-wrap: anywhere;

    font-size: 12px;
}

.error {
    color: #ff6b6b;
}


/* =========================
   FORMS
   ========================= */

input[type="text"] {
    display: block;

    width: 100%;

    margin-top: 5px;
    padding: 12px;

    border:
        1px solid #444;

    border-radius: 9px;

    background: #292929;
    color: #fff;

    font-size: 15px;
}

button {
    border: 0;

    border-radius: 9px;

    padding: 12px;

    font-weight: bold;
    font-size: 14px;
}

.form-buttons {
    display: flex;

    gap: 8px;

    margin-top: 15px;
}

.form-buttons button {
    flex: 1;
}

.edit-button {
    background: #ddd;
    color: #111;
}

.delete-button {
    background: #9f302b;
    color: #fff;
}

.save-button {
    background: #e5a11a;
    color: #111;
}

.cancel-button {
    background: #333;
    color: #ddd;
}

.add-button {
    width: 100%;

    background: #e5a11a;
    color: #111;
}

.hidden {
    display: none;
}


/* =========================
   POSITIONS
   ========================= */

.position-card {
    padding: 14px;

    margin-bottom: 10px;

    border-radius: 11px;

    background: #272727;
}

.position-top {
    margin-bottom: 8px;

    font-size: 16px;
    font-weight: bold;
}

.long {
    color: #63d46b;
}

.short {
    color: #ff6969;
}

.position-row {
    margin-top: 5px;

    font-size: 14px;
}

.empty {
    color: #999;
}


/* =========================
   TRADE PLACEHOLDER
   ========================= */

.placeholder-title {
    margin-bottom: 8px;

    font-size: 17px;
    font-weight: bold;
}

.placeholder-text {
    color: #999;

    line-height: 1.5;

    font-size: 14px;
}


/* TERMINAL2_TRADE_UI_V1 */

.trade-card {
    padding: 16px;
}

.trade-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.trade-top-row {
    display: grid;
    grid-template-columns:
        minmax(90px, .80fr)
        minmax(185px, 1.55fr);

    gap: 10px;
    align-items: end;
}

.trade-field {
    min-width: 0;
}

.trade-label {
    display: block;

    margin-bottom: 7px;

    color: #969696;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: .45px;
}

.trade-input {
    width: 100%;
    height: 45px;

    box-sizing: border-box;

    padding: 0 12px;

    border:
        1px solid #3d3d3d;

    border-radius: 9px;

    outline: none;

    background: #151515;
    color: #f0f0f0;

    font-size: 15px;
}

.trade-input:focus {
    border-color: #666;
}

.trade-input::placeholder {
    color: #666;
}

.max-position-line {
    display: flex;
    gap: 6px;
    min-width: 0;
    align-items: stretch;
}

.max-position-line .trade-input {
    min-width: 0;
    flex: 1 1 auto;
}

.trade-segment {
    display: flex;

    min-height: 45px;
    box-sizing: border-box;

    padding: 3px;

    border:
        1px solid #3d3d3d;

    border-radius: 9px;

    background: #151515;
}

.trade-segment button {
    flex: 1;

    min-width: 0;
    height: 37px;

    padding: 0 8px;

    border: 0;
    border-radius: 6px;

    background: transparent;
    color: #858585;

    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;
}

.trade-segment button.active {
    background: #2a2a2a;
    color: #e5a11a;
}

/*
   DIRECTION uses background color only.
   Text remains the same color as inactive state.
*/

#direction-segment {height:48px!important;min-height:48px!important}
#direction-segment button {height:100%;min-height:0}

#direction-segment button[data-value="long"].active {
    background: #1f4934;
    color: #858585;
}

#direction-segment button[data-value="short"].active {
    background: #51272b;
    color: #858585;
}

.max-unit {
    flex: 0 0 94px;
    height: 45px;
    box-sizing: border-box;
}

.max-unit button {
    padding: 0 5px;
    font-size: 10px;
}

.mode-segment button {
    font-size: 11px;
}
.mode-segment {display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
.mode-segment button {padding:0 2px}
/* Shared right-hand controls occupy 50% of the whole Trade form row. */
.trade-form .trade-top-row {
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) 50%;
    gap:7px!important;
}
.trade-form .trade-segment.trade-inline-mode {flex:0 0 50%;height:47px}
.trade-inline-mode button {font-size:10px}
#size-mode-segment button.active,#entry-mode-segment button.active {
    border:1px solid rgba(232,171,42,.28);
    background:linear-gradient(180deg,#4b3b18,#332916)!important;
    color:var(--t2-gold,#e5a11a)!important;
}
#trade-entry:disabled {
    background:#1b1e21!important;
    border-color:#363b3f!important;
    box-shadow:none!important;
    opacity:1;
    color:rgba(238,238,238,.7)!important;
    -webkit-text-fill-color:rgba(238,238,238,.7)!important;
    cursor:not-allowed;
}
.trade-protection-pair {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
#trade-single-value[hidden],#trade-tp-sl-fields[hidden] {display:none!important}

.trade-coin-field {position:relative}
.trade-coin-button {display:flex;align-items:center;justify-content:space-between;gap:4px;text-align:left;cursor:pointer}
.trade-coin-button span {overflow:hidden;text-overflow:ellipsis}
.trade-coin-menu {position:absolute;top:100%;left:0;min-width:130px;width:100%;max-height:280px;overflow:auto;z-index:40;margin-top:5px;padding:4px;background:#171a1c;border:1px solid #41464a;border-radius:9px;box-shadow:0 8px 24px rgba(0,0,0,.4);box-sizing:border-box}
.trade-coin-menu[hidden],#trade-max-body[hidden],#trade-position-check-row[hidden],.trade-estimate[hidden] {display:none!important}
.trade-coin-row {display:flex;align-items:center}
#trade-size-label {display:flex;align-items:baseline;gap:4px;white-space:nowrap}
#trade-calculated-size {min-width:0;white-space:nowrap;letter-spacing:0;font-weight:400!important;color:var(--t2-gold,#e5a11a)!important}
.trade-coin-row button,.trade-coin-add {background:transparent;border:0;color:#d7dadd;cursor:pointer;min-height:36px;padding:6px 9px;font:inherit}
.trade-coin-row .trade-coin-select {flex:1;text-align:left;min-width:0;font-size:13px}
.trade-coin-row .trade-coin-remove {display:flex;align-items:center;justify-content:center;flex:0 0 30px;padding:6px;color:#9aa0a6}
.trade-coin-row button:hover,.trade-coin-add:hover {background:#292d30;border-radius:5px}
.trade-coin-row .trade-coin-remove:hover {color:#d1616a}
.trade-coin-add {display:block;width:100%;text-align:left;font-size:13px;color:var(--t2-gold,#e5a11a)}
.trade-coin-divider {height:1px;margin:4px 2px;background:#363b3f;border:0;border-radius:0;flex-shrink:0}
.trade-collapse-title {display:flex;align-items:center;gap:5px;background:none;border:0;padding:0;cursor:pointer;font-family:inherit;text-align:left}
.trade-collapse-title[aria-expanded="false"] {margin-bottom:0}
.trade-collapse-title[aria-expanded="false"] svg {transform:rotate(-90deg)}
.trade-estimate-field {position:relative;min-width:0}
.trade-estimate {position:absolute;right:10px;top:50%;transform:translateY(-50%);font-size:11px;font-weight:600;pointer-events:none;white-space:nowrap;max-width:52%;overflow:hidden;text-overflow:ellipsis}
.trade-estimate.gain {color:#3fba7c}
.trade-estimate.loss {color:#d1616a}
.trade-estimate-field input.has-estimate {padding-right:var(--estimate-space,85px)!important}
#trade-preview-dialog {width:min(760px,calc(100vw - 24px))}
#trade-preview-info {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px;font-size:12px;line-height:1.5;margin:0 0 14px}
#trade-preview-info .preview-field {min-width:0;overflow-wrap:anywhere}
#trade-preview-title .long {color:#3fba7c}
#trade-preview-title .short {color:#d1616a}
#trade-preview-info .preview-gain {color:#3fba7c}
#trade-preview-info .preview-loss {color:#d1616a}
#trade-preview-periods {display:flex;align-items:center;justify-content:flex-start;gap:8px;margin-bottom:10px;color:#777c82}
#trade-preview-periods button {background:none;border:0;padding:3px 0;font:inherit;font-size:12px;color:#9aa0a6;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:3px}
#trade-preview-periods button[aria-pressed="true"] {color:#e1a52b;text-decoration:none}
#trade-preview-chart {min-height:220px;background:#111416;border:1px solid #343a3e;border-radius:9px;overflow:hidden}
#trade-preview-chart svg {display:block;width:100%;height:auto;font-family:Arial,sans-serif}
#trade-preview-status {color:#9aa0a6;font-size:12px;margin:10px 0}
#trade-preview-dialog::backdrop {backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}
#trade-preview-dialog .orders-actions {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;margin-top:16px}
#trade-preview-dialog .orders-actions button {width:100%;min-width:0}
.trade-extrema-head {display:grid;grid-template-columns:minmax(0,1fr) repeat(2,minmax(0,calc(25% - 5px)));gap:10px;align-items:center;margin-bottom:7px}
.trade-extrema-head .trade-label {margin-bottom:0!important}
.trade-extrema-title {position:relative;justify-self:start;padding-right:25px}
#trade-extrema-restore {position:absolute;right:0;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:0;background:transparent;color:#9aa0a6;border-radius:4px;cursor:pointer}
#trade-extrema-restore svg {width:13px;height:13px}
#trade-extrema-restore:hover {color:#eeeeee}
#trade-extrema-restore[hidden],#trade-extrema-label[hidden] {display:none!important}
#trade-value-label {cursor:pointer}
.trade-extrema-line {display:grid;grid-template-columns:minmax(0,1fr) repeat(2,minmax(0,calc(25% - 5px)));align-items:center;gap:10px}
.trade-extrema-line .trade-estimate-field {flex:1;min-width:0}
#trade-extrema-picker {width:100%;min-width:0}
#trade-extrema-picker[hidden],#trade-fib-picker[hidden],#trade-fib-label[hidden],#trade-entry-fib[hidden] {display:none!important}
#trade-fib-picker {width:100%;min-width:0}
#trade-fib-label {display:flex;align-items:center;gap:5px;white-space:nowrap}
#trade-fib-track {font:inherit;letter-spacing:inherit;line-height:inherit;color:#74797e;border:0;background:transparent;padding:0;margin:0}
#trade-fib-track[aria-pressed="true"] {color:var(--gold,#e1a52b)}
#trade-fib-track:disabled {cursor:default}
#trade-fib-track-dialog {width:min(360px,calc(100vw - 32px))}
.trade-fib-track-options {display:flex;align-items:center;justify-content:space-between;gap:16px}
.trade-fib-track-options .no-position-row {align-items:center;gap:8px;padding:0;white-space:nowrap;cursor:pointer}
.trade-fib-track-options .no-position-row input {margin:0;cursor:pointer}
.trade-fib-track-options .no-position-main {font-size:12px}
.trade-fib-track-options input:focus-visible {outline:1px solid #e1a52b;outline-offset:3px}

#trade-extrema-button,#trade-fib-button {width:100%!important;padding-left:3px!important;padding-right:3px!important;gap:2px;justify-content:center}
#trade-extrema-button svg,#trade-fib-button svg {width:8px;min-width:8px;flex:0 0 8px}
#trade-extrema-name,#trade-fib-name {flex:1;min-width:0;text-align:center}
#trade-single-value[data-classic="false"] .trade-extrema-line,#trade-single-value[data-classic="false"] .trade-extrema-head {grid-template-columns:minmax(0,1fr)}
#trade-extrema-name {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#trade-extrema-menu button[data-extrema-period="custom"] {font-size:11px;color:#e1a52b;border-top:1px solid #343a3e;border-radius:0;margin-top:4px}
.trade-custom-date-fields {position:relative;display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:14px 0 0}
.trade-custom-date-fields .trade-input {width:100%!important;box-sizing:border-box;min-width:0;font-family:inherit!important;font-size:14px!important;padding:10px!important}
#trade-extrema-custom-dialog::backdrop {backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}
.trade-period-field {display:flex;align-items:center;justify-content:center;cursor:pointer;height:47px;text-align:center;line-height:normal!important;font-weight:400!important;color:#eeeeee!important}
.trade-period-field[aria-expanded="true"] {border-color:#e1a52b!important}
#trade-period-presets {display:flex;align-items:center;justify-content:center;gap:7px;flex-wrap:wrap;margin:36px 0;line-height:16px;font-family:inherit;font-size:12px;color:#9aa0a6}
#trade-period-presets button {padding:0;border:0;background:none;font-family:inherit;font-size:12px;color:#b6b9bd;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:4px;cursor:pointer}
#trade-period-presets button[aria-pressed="true"] {color:#e1a52b}
.trade-period-picker {position:absolute;top:calc(100% + 6px);z-index:30;box-sizing:border-box;border:1px solid #343a3e;border-radius:9px;background:#171a1c;padding:10px;margin:0;font-family:inherit;color:#eeeeee;box-shadow:0 14px 32px rgba(0,0,0,.45);max-height:calc(100dvh - 150px);overflow-y:auto}
#trade-period-calendar {left:0;width:min(290px,100%)}
#trade-period-clock {right:0;width:min(220px,100%)}
#trade-extrema-custom-dialog {overflow:visible}
#trade-extrema-custom-dialog[data-selector-version="2"] h3,#trade-extrema-custom-dialog[data-selector-version="2"] .trade-custom-date-fields > div > label {display:none!important}
#trade-extrema-custom-dialog[data-selector-version="2"] .trade-custom-date-fields {margin-top:0}
#trade-period-slider-row {margin:20px 0 0;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
#trade-period-slider-row[hidden] {display:none!important}
#trade-period-slider {display:block;width:100%;height:20px;margin:0;padding:0;appearance:none;-webkit-appearance:none;background:transparent;cursor:pointer;accent-color:#e1a52b;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;outline:none;box-shadow:none}
#trade-period-slider::selection {background:transparent}
#trade-period-slider::-webkit-slider-runnable-track {height:4px;background:#343a3e;border-radius:2px}
#trade-period-slider::-webkit-slider-thumb {appearance:none;-webkit-appearance:none;width:18px;height:18px;margin-top:-7px;border:0;border-radius:50%;background:#e1a52b;box-shadow:none;outline:none}
#trade-period-slider::-moz-range-track {height:4px;background:#343a3e;border-radius:2px}
#trade-period-slider::-moz-range-thumb {width:18px;height:18px;border:0;border-radius:50%;background:#e1a52b;box-shadow:none;outline:none}
#trade-period-slider:focus-visible {outline:1px solid #e1a52b;outline-offset:4px;border-radius:3px}
#trade-extrema-custom-dialog[data-selector-version="2"] #trade-period-presets {margin:20px 0 24px}
@media(max-height:560px){ #trade-extrema-custom-dialog {margin-top:24px}}
.trade-period-picker[hidden] {display:none!important}
.trade-period-picker button {font-family:inherit;font-size:13px;border:0;background:none;color:#d7dadd;cursor:pointer;border-radius:5px}
.trade-period-picker button:hover {background:#292d30}
.trade-period-picker button:focus-visible,#trade-period-presets button:focus-visible {outline:1px solid #e1a52b;outline-offset:2px}
.trade-period-picker button:disabled {opacity:.25;cursor:default;background:none}
.trade-calendar-nav {display:grid;grid-template-columns:30px 1fr 30px;align-items:center;text-align:center;font-size:13px;margin-bottom:10px}
.trade-calendar-nav button {height:30px;font-size:23px;line-height:1}
.trade-calendar-week,.trade-calendar-days {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;text-align:center}
.trade-calendar-week {font-size:10px;color:#9aa0a6;margin-bottom:4px}
.trade-calendar-days button {height:31px;padding:0}
.trade-calendar-days button.outside-month {color:#777c82}
.trade-calendar-days button[aria-pressed="true"],.trade-time-options button[aria-selected="true"] {color:#e1a52b;background:rgba(225,165,43,.14)}
.trade-time-columns {display:grid;grid-template-columns:1fr 1fr;gap:10px}
.trade-time-columns .trade-label {font-family:inherit;font-size:11px!important;margin-bottom:7px!important}
.trade-time-options {max-height:170px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#555b60 #171a1c}
.trade-time-options button {display:block;width:100%;min-height:31px;text-align:center;padding:4px}
#trade-extrema-custom-error {font-size:12px;color:#d8616b;margin:8px 0}
#trade-extrema-custom-error[hidden] {display:none!important}
#trade-fib-button:disabled {opacity:.5;cursor:default}
#trade-fib-menu {min-width:80px}
#trade-fib-menu button {display:block;width:100%;text-align:left;background:none;border:0;color:#d7dadd;min-height:36px;padding:6px 9px;font-family:inherit;font-size:13px;cursor:pointer}
#trade-fib-menu button:hover,#trade-fib-menu button[aria-selected="true"] {background:#292d30;border-radius:5px}
.trade-entry-field {position:relative;flex:1;min-width:0}
.trade-form .trade-entry-field #trade-entry {width:100%!important;box-sizing:border-box}
#trade-entry[data-fib="1"] {color:rgba(238,238,238,.7)!important;-webkit-text-fill-color:rgba(238,238,238,.7)!important}
#trade-entry-fib {position:absolute;top:12px;right:12px;font-size:9px;line-height:12px;color:rgba(238,238,238,.7);pointer-events:none}
#trade-extrema-menu {min-width:80px}
#trade-extrema-menu button {display:block;width:100%;text-align:left;background:none;border:0;color:#d7dadd;min-height:36px;padding:6px 9px;font-family:inherit;font-size:13px;cursor:pointer}
#trade-extrema-menu button:hover,#trade-extrema-menu button[aria-selected="true"] {background:#292d30;border-radius:5px}
#trade-extrema-period[hidden],#trade-extrema-marker[hidden] {display:none!important}
#trade-value[data-auto-extremum="1"] {color:rgba(238,238,238,.7)!important;-webkit-text-fill-color:rgba(238,238,238,.7)!important}
#trade-extrema-marker {position:absolute;left:var(--extrema-marker-left,60px);top:50%;transform:translateY(-50%);color:rgba(238,238,238,.7);pointer-events:none;font-size:13px}

.trade-form input[type="number"] {appearance:textfield;-moz-appearance:textfield}
.trade-form input[type="number"]::-webkit-inner-spin-button,
.trade-form input[type="number"]::-webkit-outer-spin-button {-webkit-appearance:none;margin:0}
.trade-form #trade-risk {width:100%!important;box-sizing:border-box}

#trade-coin-dialog .trade-input {margin-bottom:12px}
#trade-coin-dialog [hidden] {display:none!important}
#trade-error-close {display:block;margin-left:auto;max-width:100%;box-sizing:border-box}
#trade-form[data-trade-pending] .trade-input,
#trade-form[data-trade-pending] .trade-segment,
#trade-form[data-trade-pending] .trade-label,
#trade-form[data-trade-pending] .no-position-row,
#trade-form[data-trade-pending] .trade-estimate {opacity:.7;pointer-events:none}
#trade-form[data-trade-pending="open"] #trade-open,
#trade-form[data-trade-pending="preview"] #trade-preview {opacity:1}




/* Center utility links over their corresponding action buttons. */
.trade-check-line {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;gap:11px!important}
.trade-check-line .no-position-row {grid-column:1/-1;align-items:center;min-width:0;justify-self:start;pointer-events:none}
.trade-check-line .no-position-row>span {min-width:0}
.trade-check-line .no-position-row input {margin:0!important}
.trade-check-line .no-position-main {font-size:11px!important}
.trade-check-line .no-position-row input,
.trade-check-line .no-position-main {pointer-events:auto}
.trade-check-line .no-position-main {width:fit-content;max-width:100%}
#trade-reset,#trade-test {display:flex;align-items:center;gap:5px;justify-self:center;margin-top:2px;padding:0;background:none;border:0;border-radius:0;color:#9aa0a6;font-family:inherit;font-size:12px;font-weight:600;line-height:20px;cursor:pointer;text-transform:none}
#trade-reset span,#trade-test {text-decoration:underline;text-decoration-style:dotted;text-underline-offset:4px}
#trade-reset svg {width:14px;height:14px}
#trade-reset:hover,#trade-test:hover {color:#d7dadd}
#trade-reset:disabled,#trade-test:disabled {opacity:.7;cursor:default;pointer-events:none}

.no-position-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    padding: 2px 1px;
}

.no-position-row input {
    appearance: none;
    -webkit-appearance: none;

    flex: 0 0 auto;

    width: 19px;
    height: 19px;

    margin: 1px 0 0 0;

    border:
        1px solid #555;

    border-radius: 5px;

    background: #151515;

    position: relative;
}

.no-position-row input:checked {
    border-color: #e5a11a;
    background: #e5a11a;
}

.no-position-row input:checked::after {
    content: "✓";

    position: absolute;

    left: 3px;
    top: -2px;

    color: #111;

    font-size: 15px;
    font-weight: 900;
}

.no-position-main {
    display: block;

    color: #cfcfcf;

    font-size: 12px;
    font-weight: 700;
}

.no-position-help {
    display: block;

    margin-top: 2px;

    color: #707070;

    font-size: 10px;
}

.trade-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 9px;

    margin-top: 1px;
}

.trade-action {
    height: 43px;

    border-radius: 9px;

    font-size: 13px;
    font-weight: 800;
}

.trade-preview {
    border:
        1px solid #4a4a4a;

    background: #1a1a1a;
    color: #bdbdbd;
}

.trade-open {
    border:
        1px solid #8f6e1d;

    background: #332d1c;
    color: #e5a11a;
}

.trade-output {
    display: none;

    margin-top: 1px;

    padding: 12px;

    border:
        1px solid #3d3d3d;

    border-radius: 9px;

    background: #151515;
    color: #bcbcbc;

    font-family: monospace;
    font-size: 12px;

    line-height: 1.55;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.trade-output.visible {
    display: block;
}

#pos-output {
    font-family: inherit;
}

@media (max-width: 370px) {
    .trade-top-row {
        grid-template-columns:
            minmax(82px, .72fr)
            minmax(174px, 1.58fr);

        gap: 8px;
    }

    .max-unit {
        flex-basis: 88px;
    }

    .trade-card {
        padding-left: 13px;
        padding-right: 13px;
    }
}



.trade-action:disabled {
    opacity: .55;
    pointer-events: none;
}



/* TERMINAL2_POSITIONS_UI_V1 */

.positions-card {
    padding: 15px;
}

.pos-label {
    margin: 0 0 7px;

    color: #969696;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: .45px;
}

.pos-scope {
    margin-bottom: 12px;
}

.pos-scope button {
    font-size: 11px;
}

.pos-total {
    display: flex;

    justify-content:
        space-between;

    align-items: center;

    height: 42px;

    margin-bottom: 10px;

    border-bottom:
        1px solid #333;

    color: #858585;

    font-size: 11px;
    font-weight: 750;
}

.pos-total strong {
    font-size: 15px;
}

.pnl-pos {
    color: #48a978 !important;
}

.pnl-neg {
    color: #c95b65 !important;
}

.pnl-zero {
    color: #999 !important;
}

.pos-warning {
    display: none;

    margin-bottom: 9px;
    padding: 9px;

    border:
        1px solid #5a4a2a;

    border-radius: 8px;

    background: #211d14;
    color: #a79466;

    font-size: 10px;

    white-space: pre-wrap;
}

.pos-warning.show {
    display: block;
}

.pos-list {
    display: flex;

    flex-direction: column;

    gap: 9px;
}

.pos-card {
    padding: 13px;

    border:
        1px solid #3d3d3d;

    border-radius: 11px;

    background: #181818;
}

.pos-card.selected {
    border-color: #9a771f;

    background: #222018;
}

.pos-top {
    display: flex;

    justify-content:
        space-between;

    align-items:
        flex-start;

    margin-bottom: 12px;
}

.pos-market {
    color: #e0e0e0;

    font-size: 15px;
    font-weight: 800;
}

.pos-account {
    display: none;

    margin-top: 2px;

    color: #707070;

    font-size: 10px;
}

.positions-all
.pos-account {
    display: block;
}

.pos-side-wrap {
    display: flex;

    align-items: center;

    gap: 9px;
}

.pos-side {
    font-size: 12px;
    font-weight: 850;
}

.pos-side.long {
    color: #48a978;
}

.pos-side.short {
    color: #c95b65;
}

.pos-check {
    display: grid;

    place-items: center;

    width: 18px;
    height: 18px;

    border:
        1px solid #555;

    border-radius: 5px;

    color: transparent;

    font-size: 12px;
    font-weight: 900;
}

.pos-card.selected
.pos-check {
    border-color: #9a771f;

    background: #332d1c;
    color: #e5a11a;
}

.pos-grid {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap:
        12px 20px;
}

.pos-field label {
    display: block;

    margin-bottom: 3px;

    color: #686868;

    font-size: 9px;
    font-weight: 750;

    letter-spacing: .45px;
}

.pos-field div {
    color: #cfcfcf;

    font-size: 13px;
    font-weight: 700;
}

.pos-pnl {
    font-size:
        14px !important;

    font-weight:
        800 !important;
}

.pos-empty {
    padding: 28px 8px;

    text-align: center;

    color: #666;

    font-size: 11px;
    font-weight: 700;
}

.pos-select-row {
    display: flex;

    justify-content:
        space-between;

    margin:
        11px 0 7px;
}

.pos-select-row button {
    border: 0;

    background:
        transparent;

    color: #797979;

    font-size: 10px;
    font-weight: 750;
}

.pos-close {
    width: 100%;
    height: 43px;

    border-radius: 9px;

    font-size: 12px;
    font-weight: 800;
}

.selected-close {
    margin-bottom: 8px;

    border:
        1px solid #704146;

    background: #321e21;
    color: #c76a72;
}

.all-close {
    border:
        1px solid #63363b;

    background: #211719;
    color: #a9575e;
}

.pos-close:disabled,
.pos-select-row
button:disabled,
.pos-scope
button:disabled {
    opacity: .45;

    pointer-events: none;
}



/* Telegram event preferences share API Keys card and Trade controls. */
body[data-page="telegram_groups"] .tabs .tab {min-width:0;padding-left:4px!important;padding-right:4px!important}
@media(max-width:360px){body[data-page="telegram_groups"] .tabs .tab {font-size:10px!important}}
.telegram-groups-card {position:relative;margin-top:0;border:1px solid var(--t2-border,#3d3d3d)!important;background:linear-gradient(180deg,var(--t2-surface,#191c1e),var(--t2-surface-2,#171a1c))!important;box-shadow:0 14px 30px rgba(0,0,0,.16),inset 0 1px 0 rgba(255,255,255,.015);border-top-left-radius:0!important;border-top-right-radius:0!important}
#telegram-groups-form {display:grid;grid-template-columns:minmax(0,max-content) minmax(72px,1fr);column-gap:12px;row-gap:10px}
.telegram-event-row {display:grid;grid-template-columns:subgrid;grid-column:1/-1;align-items:center;padding:0;border:0}
.telegram-event-label {align-items:center;margin:0;padding:0;cursor:pointer;min-width:0}
.telegram-event-label input {margin:0;cursor:pointer}
.telegram-event-label .no-position-main {font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.telegram-group-picker {position:relative;min-width:0}
.telegram-group-picker summary {list-style:none;box-sizing:border-box;width:100%;margin:0}
.telegram-group-picker summary::-webkit-details-marker {display:none}
.telegram-group-picker summary svg {flex-shrink:0}
.telegram-group-picker .trade-coin-menu {display:block;width:100%;min-width:0}
.telegram-group-option {display:block;width:100%;text-align:left;background:transparent;border:0;color:#d7dadd;min-height:36px;padding:8px 9px;font:inherit;font-size:13px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.telegram-group-option:hover,.telegram-group-option:focus-visible {background:#292d30;border-radius:5px}
.telegram-groups-empty {display:block;padding:8px 9px;color:#858585;font-size:13px}
#telegram-groups-save {grid-column:1/-1;width:100%;margin-top:8px;cursor:pointer}
#telegram-groups-save:disabled {opacity:.6;cursor:default}
.telegram-groups-status {margin-top:10px;font-size:12px;color:#bdbdbd}
#telegram-groups-status {position:absolute;bottom:3px;left:18px;right:18px;margin:0;text-align:center;font-size:10px;line-height:12px}
#telegram-groups-status:empty {display:none}
.telegram-group-title {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}



.history-card {
    padding: 17px 16px 18px;
}

.history-period {
    margin-bottom: 14px !important;
}

.history-period button {
    flex: 1 1 20%;
    min-width: 0;
}

.history-summary {
    display: grid !important;
    grid-template-columns:
        1.25fr .8fr .95fr;
    align-items: center;
    gap: 0;
    min-height: 68px !important;
    padding: 0 !important;
    overflow: hidden;
}

.history-summary-item {
    min-width: 0;
    padding: 10px 12px;
}

.history-summary-item
+ .history-summary-item {
    border-left:
        1px solid
        rgba(128,128,128,.18);
}

.history-summary-label {
    display: block;
    margin-bottom: 5px;
    font-size: 10px;
    font-weight: 800;
    opacity: .62;
}

.history-summary-value {
    font-size: 15px;
    font-weight: 850;
    white-space: nowrap;
}

.history-status {
    margin: 12px 0;
    text-align: center;
    font-size: 10px;
    font-weight: 800;
    opacity: .55;
}

.history-warning {
    margin-bottom: 10px;
    padding: 10px 11px;
    border-radius: 9px;
    font-size: 10px;
    line-height: 1.4;
    opacity: .78;
}

.history-trade {
    cursor: default !important;
}

.history-trade-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 13px;
}

.history-trade-heading {
    min-width: 0;
}

.history-account {
    margin-top: 4px;
    font-size: 10px;
    font-weight: 700;
    opacity: .50;
}

.history-trade-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    column-gap: 18px;
    row-gap: 13px;
}

.history-trade .pos-field {
    min-width: 0;
}

.history-trade .pos-field div {
    overflow-wrap: anywhere;
}

.history-empty {
    min-height: 145px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .35px;
    opacity: .48;
}

@media (max-width: 420px) {
    .history-card {
        padding-left: 15px;
        padding-right: 15px;
    }

    .history-summary-item {
        padding:
            9px 8px;
    }

    .history-summary-label {
        font-size:
            9px;
    }

    .history-summary-value {
        font-size:
            13px;
    }

    .history-period button {
        font-size:
            10px !important;
    }
}


.orders-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 8px}
.orders-grid .pos-field {min-width:0}
.orders-grid label {display:block;margin:0 0 4px;color:#74797e;font-size:10px;font-weight:800}
.orders-grid .pos-field div {font-size:13px;font-weight:700;overflow-wrap:anywhere;color:#d7dadd}
.orders-grid .pos-field .pnl-pos {color:#3fba7c!important}
.orders-grid .pos-field .pnl-neg {color:#d1616a!important}
.orders-created {position:relative;margin-top:10px;padding-top:10px;border-top:1px solid #303438;color:#7f8489;font-size:11px;font-weight:700}
.orders-created>span:first-child {display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - var(--orders-tracking-width, -10px) - 10px)}
.orders-track-label.trade-label {position:absolute;right:0;top:0;bottom:calc(-1 * var(--orders-footer-bottom-inset,14px));display:flex;align-items:center;gap:10px;margin:0;white-space:nowrap}
.orders-track {font:inherit;letter-spacing:inherit;line-height:inherit;color:#74797e;border:0;background:transparent;padding:0;margin:0;cursor:pointer}
.orders-track[aria-checked="true"] {color:var(--gold,#e1a52b)}
.orders-track:disabled {cursor:default}
.orders-edit {display:flex;align-items:center;justify-content:center;background:transparent;color:#9aa0a6;border:0;padding:6px;cursor:pointer}
.orders-edit:hover {color:#eeeeee}
.orders-card-actions {display:flex;align-items:center;gap:2px}
.orders-delete svg {transform:translateY(-1px)}
.orders-delete:hover {color:#d1616a}
.orders-delete-dialog {width:min(300px,calc(100vw - 32px))}
.orders-dialog .orders-delete-confirm {border:1px solid #a74750!important;background:linear-gradient(180deg,#8a343d,#702a32)!important;color:#fff!important;box-shadow:none}
.orders-dialog {width:min(420px,calc(100vw - 32px));max-height:90vh;overflow:auto;box-sizing:border-box;background:#171a1c;color:#d7dadd;border:1px solid #41464a;border-radius:12px;padding:20px}
.orders-dialog::backdrop {background:rgba(0,0,0,.65)}
.orders-dialog h3 {margin:0 0 14px;font-size:16px}
.orders-dialog h3:focus {outline:none}
.orders-form-grid {display:grid;grid-template-columns:1fr 1fr;gap:12px}
.orders-form-grid label {font-size:10px;color:#9aa0a6;display:block}
.orders-form-grid input {box-sizing:border-box;height:47px;width:100%;min-width:0;margin-top:5px;background:#101214;color:#eee;border:1px solid #41464a;border-radius:8px;padding:10px}
.orders-form-grid input[type="number"] {appearance:textfield;-moz-appearance:textfield}
.orders-form-grid input[type="number"]::-webkit-inner-spin-button,
.orders-form-grid input[type="number"]::-webkit-outer-spin-button {-webkit-appearance:none;margin:0}
.orders-preview {display:flex;justify-content:space-between;margin:16px 0;font-size:12px}
.orders-dialog p {color:#9aa0a6;font-size:11px;line-height:1.5}
.orders-dialog button {padding:10px 16px;cursor:pointer}
.orders-dialog .orders-actions {display:grid;grid-template-columns:1fr 1fr;gap:9px}
.orders-dialog .orders-actions .trade-action {box-sizing:border-box;padding:0 16px}
.orders-dialog .orders-error {color:#d1616a;min-height:16px}
.position-card .pos-grid {grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px 8px!important}
.position-card .pos-field {min-width:0}
.position-card .pos-field label {font-size:9px;letter-spacing:0}
.position-card .pos-field div {overflow-wrap:anywhere}
.position-card[data-side="long"] .pos-market {color:#3fba7c!important}
.position-card[data-side="short"] .pos-market {color:#d1616a!important}
.position-card .pnl-pos {color:#3fba7c!important}
.position-card .pnl-neg {color:#d1616a!important}
.position-card .pnl-zero {color:#a0a4a8!important}
.position-protection-row {position:relative;margin-bottom:12px;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 8px}
.orders-dialog .position-row-error {grid-column:1/-1;margin:0;color:#d1616a}
.position-protection-row input[aria-invalid="true"] {border-color:#d1616a}
.position-protection-row[data-protection-draft="1"]>label:last-of-type {padding-right:20px}
.position-protection-row[data-protection-draft="1"]>label:last-of-type input {width:calc(100% + 20px)}
.position-protection-row[data-protection-draft="0"]>label:last-of-type {padding-right:44px}
.position-protection-row[data-protection-draft="0"]>label:last-of-type input {width:calc(100% + 44px)}
.position-protection-actions {position:absolute;right:0;top:-4px;display:flex;gap:4px}
.orders-dialog .position-row-action {display:flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:0;background:transparent;color:#9aa0a6;border-radius:4px}
.orders-dialog .position-remove svg,.orders-dialog .position-mark-delete svg {width:18.2px;height:18.2px}
.orders-dialog [data-reset-protection] svg {width:13px;height:13px}
.orders-dialog .position-row-action:hover {color:#eeeeee}
.orders-dialog .position-mark-delete {color:#d1616a}
.orders-dialog .position-mark-delete:hover {color:#ef7a84}
.orders-dialog .position-protection-row input[data-protection-size-locked="1"] {background:#1b1e21;color:rgba(238,238,238,.6);-webkit-text-fill-color:rgba(238,238,238,.6);opacity:1;cursor:not-allowed}
.orders-dialog .position-protection-row[data-protection-deleted="1"] input {background:linear-gradient(180deg,rgba(59,32,36,.36),rgba(42,25,28,.36))!important;border-color:#d1616a!important;text-decoration:line-through;-webkit-text-fill-color:color-mix(in srgb,currentColor 40%,transparent);text-decoration-color:color-mix(in srgb,currentColor 40%,transparent);opacity:1;cursor:not-allowed}
.orders-dialog .position-protection-direction.long {color:#3fba7c}
.orders-dialog .position-protection-direction.short {color:#d1616a}
.position-protection-label.tp {color:#3fba7c}
.position-protection-label.sl {color:#d1616a}
.orders-dialog .position-remove {position:absolute;right:0;top:-4px;display:flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:0;background:transparent;color:#9aa0a6;border-radius:4px}
.orders-dialog .position-remove:hover {color:#eeeeee}
.position-protection-group {margin-bottom:18px}
.position-protection-group + .position-protection-group {border-top:1px solid rgba(160,164,168,.2);padding-top:18px}
.orders-dialog .position-add {width:100%;font-size:11px!important}
.orders-dialog .position-save-result {margin:12px 0 0;color:#d1616a;white-space:pre-wrap}

/* =========================================================
   TERMINAL 2
   DESIGN VARIANT #2 — FULL TERMINAL
   ========================================================= */

:root {
    --t2-bg: #0c0e0f;

    --t2-surface: #191c1e;
    --t2-surface-2: #171a1c;
    --t2-surface-3: #141719;
    --t2-surface-4: #111315;

    --t2-input: #121416;

    --t2-border: #41464a;
    --t2-border-soft: #353a3e;
    --t2-border-strong: #50565b;

    --t2-text: #eeeeee;
    --t2-text-soft: #d5d8da;

    --t2-muted: #969a9f;
    --t2-muted-2: #71767b;

    --t2-gold: #efb43a;
    --t2-gold-dark: #ce9019;
    --t2-gold-surface: #3a3019;

    --t2-green: #147346;
    --t2-green-light: #2cab72;

    --t2-red: #67272e;
    --t2-red-light: #a3454e;
}


/* =========================================================
   GLOBAL
   ========================================================= */

html,
body {
    background:
        radial-gradient(
            circle at 50% 8%,
            #191c1e 0%,
            #111315 34%,
            #0c0e0f 74%
        ) !important;

    color: var(--t2-text);
}


/* =========================================================
   TOP ACCOUNT DROPDOWN
   ========================================================= */

.dropdown {
    padding: 6px !important;

    border:
        1px solid
        var(--t2-border) !important;

    border-radius:
        12px !important;

    background:
        linear-gradient(
            180deg,
            #1c1f21,
            #16181a
        ) !important;

    box-shadow:
        0 16px 35px
        rgba(0,0,0,.42) !important;
}


.dropdown-item {
    padding:
        10px 11px !important;

    border-radius:
        8px !important;

    color:
        #d7dadd !important;

    font-weight:
        750 !important;
}


.dropdown-item.current {
    border:
        1px solid
        rgba(239,180,58,.33) !important;

    background:
        linear-gradient(
            180deg,
            #41351b,
            #2f2718
        ) !important;

    color:
        var(--t2-gold) !important;
}


.dropdown-name {
    font-weight:
        800 !important;
}


.menu-symbol {
    gap:
        4px !important;
}


.menu-symbol span {
    height:
        3px !important;

    border-radius:
        3px !important;

    background:
        var(--t2-gold) !important;
}


/* =========================================================
   MAIN TABS
   ========================================================= */

.tabs {
    display: flex;
    align-items: flex-end;

    gap: 0;

    margin-bottom: -1px;

    position: relative;
    z-index: 5;
}


.tab {
    flex: 1;

    min-height: 56px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0 10px;

    border:
        1px solid
        var(--t2-border);

    border-radius:
        14px 14px 0 0;

    background:
        linear-gradient(
            180deg,
            #181a1c,
            #141618
        );

    color:
        #8c9094;

    font-size:
        14px;

    font-weight:
        800;

    text-decoration: none;

    position: relative;

    box-shadow:
        inset 0 1px 0
        rgba(255,255,255,.015);
}


.tab + .tab {
    margin-left: -1px;
}


/*
   ACTIVE TAB

   Та же поверхность, что и основной блок.
   Никакого разделителя снизу.
*/

.tab.active {
    background:
        var(--t2-surface);

    color:
        var(--t2-gold);

    border-color:
        var(--t2-border);

    border-bottom-color:
        var(--t2-surface);

    z-index: 7;

    text-decoration: none;
}


/*
   Только короткая золотая линия
   под названием вкладки.
*/

.tab.active::after {
    content: "";

    position: absolute;

    bottom: 10px;
    left: 50%;

    height: 2px;

    border-radius: 2px;

    background:
        var(--t2-gold);

    transform:
        translateX(-50%);
}


.tab[href*="trade"].active::after {
    width: 42px;
}


.tab[href*="positions"].active::after {
    width: 76px;
}


/* =========================================================
   TAB CONTENT
   ========================================================= */

.tab-content-card {
    margin-top:
        0 !important;

    background:
        linear-gradient(
            180deg,
            var(--t2-surface) 0%,
            var(--t2-surface-2) 100%
        ) !important;

    border:
        1px solid
        var(--t2-border) !important;

    border-top-color:
        var(--t2-surface) !important;

    border-top-left-radius:
        0 !important;

    border-top-right-radius:
        0 !important;

    border-bottom-left-radius:
        16px !important;

    border-bottom-right-radius:
        16px !important;

    box-shadow:
        0 18px 40px
        rgba(0,0,0,.22),

        inset 0 1px 0
        rgba(255,255,255,.015);
}


/* =========================================================
   TRADE CARD
   ========================================================= */

.trade-card {
    padding:
        17px 16px 18px !important;
}


.trade-label {
    margin-bottom:
        7px !important;

    color:
        #999da3 !important;

    font-size:
        11px !important;

    font-weight:
        800 !important;

    letter-spacing:
        .55px !important;
}


/* =========================================================
   INPUTS
   ========================================================= */

.trade-input {
    height:
        47px !important;

    padding:
        0 13px !important;

    border:
        1px solid
        #474d52 !important;

    border-radius:
        11px !important;

    background:
        linear-gradient(
            180deg,
            #15181a,
            var(--t2-input)
        ) !important;

    color:
        #f0f0f0 !important;

    font-size:
        15px !important;

    box-shadow:
        inset 0 1px 2px
        rgba(0,0,0,.35),

        inset 0 1px 0
        rgba(255,255,255,.015);

    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}


.trade-input:focus {
    border-color:
        #666c71 !important;

    outline:
        none !important;

    box-shadow:
        0 0 0 1px
        rgba(255,255,255,.025),

        inset 0 1px 2px
        rgba(0,0,0,.35);
}


.trade-input::placeholder {
    color:
        #62676c !important;
}


.trade-top-row {
    gap:
        11px !important;
}


.max-position-line {
    gap:
        7px !important;
}


/* =========================================================
   GENERIC SEGMENTED CONTROLS
   ========================================================= */

.trade-segment {
    min-height:
        47px !important;

    padding:
        4px !important;

    border:
        1px solid
        #444a4f !important;

    border-radius:
        11px !important;

    background:
        linear-gradient(
            180deg,
            #131517,
            #101214
        ) !important;

    box-shadow:
        inset 0 1px 2px
        rgba(0,0,0,.30);
}


.trade-segment button {
    min-height:
        37px;

    border-radius:
        8px !important;

    color:
        var(--t2-muted) !important;

    font-size:
        12px;

    font-weight:
        800 !important;

    transition:
        background .15s ease,
        color .15s ease,
        border-color .15s ease;
}


/* =========================================================
   COIN / USD
   ========================================================= */

#max-unit-segment button.active {
    border:
        1px solid
        rgba(232,171,42,.28);

    background:
        linear-gradient(
            180deg,
            #4b3b18,
            #332916
        ) !important;

    color:
        var(--t2-gold) !important;

    box-shadow:
        inset 0 1px 0
        rgba(255,214,100,.07);
}


/* =========================================================
   LONG / SHORT
   ========================================================= */

#direction-segment {
    padding:
        4px !important;
}


#direction-segment button {
    display: flex;

    align-items: center;
    justify-content: center;

    gap:
        9px;

    font-size:
        13px !important;

    font-weight:
        800 !important;
}


/*
   CSS-only arrows.
*/

#direction-segment
button[data-value="long"]::before {
    content: "↗";

    display: inline-block;

    font-size:
        20px;

    line-height:
        1;

    font-weight:
        900;

    color:
        #7f858a;

    transform:
        translateY(-1px);
}


#direction-segment
button[data-value="short"]::before {
    content: "↘";

    display: inline-block;

    font-size:
        20px;

    line-height:
        1;

    font-weight:
        900;

    color:
        #7f858a;

    transform:
        translateY(-1px);
}


/* LONG ACTIVE */

#direction-segment
button[data-value="long"].active {
    border:
        1px solid
        var(--t2-green-light);

    background:
        linear-gradient(
            180deg,
            #23925f,
            var(--t2-green)
        ) !important;

    color:
        #f0f0f0 !important;

    box-shadow:
        inset 0 1px 0
        rgba(255,255,255,.12),

        0 0 14px
        rgba(28,171,105,.09);
}


#direction-segment
button[data-value="long"].active::before {
    color:
        #eefaf4;
}


/* SHORT ACTIVE */

#direction-segment
button[data-value="short"].active {
    border:
        1px solid
        var(--t2-red-light);

    background:
        linear-gradient(
            180deg,
            #8a343d,
            var(--t2-red)
        ) !important;

    color:
        #f0f0f0 !important;

    box-shadow:
        inset 0 1px 0
        rgba(255,255,255,.08),

        0 0 14px
        rgba(180,55,67,.08);
}


#direction-segment
button[data-value="short"].active::before {
    color:
        #f8e9eb;
}


/* =========================================================
   MODE
   ========================================================= */

.mode-segment {
    padding:
        4px !important;
}


.mode-segment button {
    font-size:
        11px !important;

    font-weight:
        800 !important;
}


.mode-segment button.active {
    border:
        1px solid
        rgba(226,165,38,.22);

    background:
        linear-gradient(
            180deg,
            #463819,
            #312816
        ) !important;

    color:
        var(--t2-gold) !important;
}


/* =========================================================
   NO POSITION CHECK
   ========================================================= */

.no-position-row {
    gap:
        11px !important;

    padding:
        2px 1px !important;
}


.no-position-row input {
    width:
        20px !important;

    height:
        20px !important;

    border:
        1px solid
        #5b6064 !important;

    border-radius:
        6px !important;

    background:
        #141618 !important;
}


.no-position-row input:checked {
    border-color:
        #e1a52b !important;

    background:
        linear-gradient(
            180deg,
            #f0b538,
            #d99818
        ) !important;

    box-shadow:
        0 0 12px
        rgba(221,157,25,.09);
}


.no-position-row
input:checked::after {
    color:
        #151515 !important;

    font-weight:
        900 !important;
}


.no-position-main {
    color:
        var(--t2-text) !important;

    font-size:
        12px !important;

    font-weight:
        850 !important;
}


.no-position-help {
    margin-top:
        3px !important;

    color:
        #777c82 !important;

    font-size:
        10px !important;
}


/* =========================================================
   TRADE ACTIONS
   ========================================================= */

.trade-actions {
    gap:
        11px !important;

    margin-top:
        4px !important;
}


.trade-action {
    height:
        48px !important;

    border-radius:
        11px !important;

    font-size:
        13px !important;

    font-weight:
        850 !important;
}


.trade-preview {
    border:
        1px solid
        #555b60 !important;

    background:
        linear-gradient(
            180deg,
            #1d2022,
            #17191b
        ) !important;

    color:
        #e0e2e5 !important;

    box-shadow:
        inset 0 1px 0
        rgba(255,255,255,.025);
}


.trade-open {
    border:
        1px solid
        #e3a925 !important;

    background:
        linear-gradient(
            180deg,
            var(--t2-gold),
            var(--t2-gold-dark)
        ) !important;

    color:
        #181818 !important;

    box-shadow:
        inset 0 1px 0
        rgba(255,255,255,.20),

        0 7px 22px
        rgba(210,145,20,.11);
}


/* =========================================================
   OUTPUT / STATUS
   ========================================================= */

.trade-output {
    margin-top:
        6px !important;

    padding:
        13px !important;

    border:
        1px solid
        var(--t2-border) !important;

    border-radius:
        10px !important;

    background:
        #121416 !important;

    color:
        #bfc2c5 !important;

    box-shadow:
        inset 0 1px 2px
        rgba(0,0,0,.30);
}


/* =========================================================
   POSITIONS
   ========================================================= */

.positions-card {
    padding:
        17px 16px 18px !important;

    background:
        linear-gradient(
            180deg,
            var(--t2-surface),
            var(--t2-surface-2)
        ) !important;
}


.pos-label {
    margin-bottom:
        8px !important;

    color:
        #999da3 !important;

    font-size:
        11px !important;

    font-weight:
        800 !important;

    letter-spacing:
        .55px !important;
}


/* =========================================================
   CURRENT / ALL ACCOUNTS
   ========================================================= */

.pos-scope {
    min-height:
        49px !important;

    margin-bottom:
        14px !important;

    padding:
        4px !important;

    border:
        1px solid
        #444a4f !important;

    border-radius:
        11px !important;

    background:
        linear-gradient(
            180deg,
            #131517,
            #101214
        ) !important;
}


.pos-scope button {
    min-height:
        39px;

    border:
        1px solid
        transparent;

    border-radius:
        8px !important;

    color:
        var(--t2-muted) !important;

    font-size:
        11px !important;

    font-weight:
        800 !important;
}


.pos-scope button.active {
    border-color:
        rgba(226,165,38,.22);

    background:
        linear-gradient(
            180deg,
            #463819,
            #312816
        ) !important;

    color:
        var(--t2-gold) !important;
}


/* =========================================================
   TOTAL PNL
   ========================================================= */

.pos-total {
    min-height:
        52px !important;

    margin:
        0 0 13px !important;

    padding:
        0 13px !important;

    border:
        1px solid
        var(--t2-border-soft) !important;

    border-radius:
        10px !important;

    background:
        linear-gradient(
            180deg,
            #171a1c,
            #141618
        ) !important;

    color:
        #92969b !important;

    font-size:
        11px !important;

    font-weight:
        800 !important;
}


.pos-total strong {
    font-size:
        16px !important;

    font-weight:
        850 !important;
}


.pnl-pos {
    color:
        #3fba7c !important;
}


.pnl-neg {
    color:
        #d1616a !important;
}


.pnl-zero {
    color:
        #a0a4a8 !important;
}


/* =========================================================
   POSITION WARNINGS
   ========================================================= */

.pos-warning {
    margin-bottom:
        11px !important;

    padding:
        11px !important;

    border:
        1px solid
        #5c4b27 !important;

    border-radius:
        9px !important;

    background:
        #211d14 !important;

    color:
        #b39b64 !important;
}


/* =========================================================
   POSITION CARDS
   ========================================================= */

.pos-list {
    gap:
        10px !important;
}


.pos-card {
    padding:
        14px !important;

    border:
        1px solid
        var(--t2-border) !important;

    border-radius:
        12px !important;

    background:
        linear-gradient(
            180deg,
            #171a1c,
            #141618
        ) !important;

    box-shadow:
        inset 0 1px 0
        rgba(255,255,255,.015);

    transition:
        border-color .15s ease,
        background .15s ease;
}


.pos-card.selected {
    border-color:
        #9b7825 !important;

    background:
        linear-gradient(
            180deg,
            #252117,
            #1d1b15
        ) !important;

    box-shadow:
        inset 0 1px 0
        rgba(255,214,100,.03);
}


.pos-market {
    color:
        var(--t2-text) !important;

    font-size:
        15px !important;

    font-weight:
        850 !important;
}


.pos-account {
    color:
        var(--t2-muted-2) !important;

    font-size:
        10px !important;
}


.pos-side {
    font-weight:
        850 !important;
}


.pos-side.long {
    color:
        #3eb376 !important;
}


.pos-side.short {
    color:
        #cc5b65 !important;
}


.pos-check {
    border:
        1px solid
        #555c61 !important;

    border-radius:
        5px !important;

    background:
        #131517 !important;
}


.pos-card.selected
.pos-check {
    border-color:
        #a58027 !important;

    background:
        #3a301a !important;

    color:
        var(--t2-gold) !important;
}


.pos-field label {
    color:
        #74797e !important;

    font-weight:
        800 !important;
}


.pos-field div {
    color:
        #d7dadd !important;

    font-weight:
        700 !important;
}


/* =========================================================
   EMPTY POSITIONS
   ========================================================= */

.pos-empty {
    min-height:
        145px;

    display: flex;

    align-items: center;
    justify-content: center;

    padding:
        28px 8px !important;

    color:
        #686d72 !important;

    font-size:
        11px !important;

    font-weight:
        800 !important;

    letter-spacing:
        .35px;
}


/* =========================================================
   SELECT ALL / CLEAR
   ========================================================= */

.pos-select-row {
    margin:
        12px 0 9px !important;
}


.pos-select-row button {
    padding:
        8px 4px !important;

    color:
        #8a8f94 !important;

    font-size:
        10px !important;

    font-weight:
        800 !important;
}


.pos-select-row
button:not(:disabled):active {
    color:
        var(--t2-gold) !important;
}


/* =========================================================
   CLOSE BUTTONS
   ========================================================= */

.pos-close {
    height:
        46px !important;

    border-radius:
        10px !important;

    font-size:
        12px !important;

    font-weight:
        850 !important;
}


.selected-close {
    margin-bottom:
        9px !important;

    border:
        1px solid
        #753d43 !important;

    background:
        linear-gradient(
            180deg,
            #3b2024,
            #2a191c
        ) !important;

    color:
        #d86c75 !important;
}


.all-close {
    border:
        1px solid
        #66343a !important;

    background:
        linear-gradient(
            180deg,
            #2d1c1f,
            #211719
        ) !important;

    color:
        #c15c65 !important;
}


.pos-close:disabled {
    opacity:
        .36 !important;
}


/* =========================================================
   API KEYS
   ========================================================= */

/*
   Все карточки страницы API KEYS.
*/

body[data-page="keys"]
.card {
    border:
        1px solid
        var(--t2-border) !important;

    border-radius:
        14px !important;

    background:
        linear-gradient(
            180deg,
            var(--t2-surface),
            var(--t2-surface-2)
        ) !important;

    box-shadow:
        0 14px 30px
        rgba(0,0,0,.16),

        inset 0 1px 0
        rgba(255,255,255,.015);
}


/* Page heading */

body[data-page="keys"]
h1,

body[data-page="keys"]
h2,

body[data-page="keys"]
h3 {
    color:
        var(--t2-text) !important;

    font-weight:
        850 !important;
}


/* =========================================================
   KEYS INPUTS
   ========================================================= */

body[data-page="keys"]
input,

body[data-page="keys"]
textarea,

body[data-page="keys"]
select {
    min-height:
        44px;

    padding:
        9px 11px !important;

    border:
        1px solid
        #474d52 !important;

    border-radius:
        10px !important;

    outline:
        none !important;

    background:
        #121416 !important;

    color:
        var(--t2-text) !important;

    box-shadow:
        inset 0 1px 2px
        rgba(0,0,0,.30);
}


body[data-page="keys"]
input:focus,

body[data-page="keys"]
textarea:focus,

body[data-page="keys"]
select:focus {
    border-color:
        #666c71 !important;
}


/* Labels */

body[data-page="keys"]
label,

body[data-page="keys"]
small {
    color:
        #858a8f !important;
}


/* =========================================================
   PRIVATE KEY DISPLAY
   ========================================================= */

body[data-page="keys"]
pre,

body[data-page="keys"]
code,

.private-key,
[class*="private-key"],
[class*="key-value"] {
    border:
        1px solid
        #303438 !important;

    border-radius:
        10px !important;

    background:
        #101214 !important;

    color:
        #d4d7da !important;

    box-shadow:
        inset 0 1px 2px
        rgba(0,0,0,.45);
}


/* =========================================================
   + ADD KEY
   ========================================================= */

body[data-page="keys"] #addForm .save-button {
    min-height:
        46px;

    border:
        1px solid
        #dfaa2e !important;

    border-radius:
        11px !important;

    background:
        linear-gradient(
            180deg,
            var(--t2-gold),
            var(--t2-gold-dark)
        ) !important;

    color:
        #181818 !important;

    font-weight:
        850 !important;

    box-shadow:
        inset 0 1px 0
        rgba(255,255,255,.17),

        0 6px 18px
        rgba(210,145,20,.08);
}


/* =========================================================
   KEY EDIT BUTTONS
   ========================================================= */

body[data-page="keys"]
button {
    border-radius:
        10px;
}


body[data-page="keys"]
.card button:not([type="submit"]) {
    border:
        1px solid
        #50565b !important;

    background:
        linear-gradient(
            180deg,
            #202326,
            #191c1e
        ) !important;

    color:
        #e0e2e4 !important;

    font-weight:
        800 !important;
}


/* =========================================================
   SAVE KEY
   ========================================================= */

body[data-page="keys"] [id^="edit-"] .save-button {
    border:
        1px solid
        #bd8f26 !important;

    background:
        linear-gradient(
            180deg,
            #493917,
            #322916
        ) !important;

    color:
        var(--t2-gold) !important;

    font-weight:
        850 !important;
}


/* =========================================================
   DELETE KEY
   ========================================================= */

body[data-page="keys"] .delete-button {
    border:
        1px solid
        #793c43 !important;

    background:
        linear-gradient(
            180deg,
            #442126,
            #301a1d
        ) !important;

    color:
        #d86872 !important;

    font-weight:
        850 !important;
}


/* =========================================================
   GENERIC KEY CLASSES
   ========================================================= */

.key-card,
.keys-card {
    border:
        1px solid
        var(--t2-border) !important;

    border-radius:
        14px !important;

    background:
        linear-gradient(
            180deg,
            var(--t2-surface),
            var(--t2-surface-2)
        ) !important;
}


.key-actions,
.keys-actions {
    gap:
        9px !important;
}


.key-actions button,
.keys-actions button {
    min-height:
        44px;

    border-radius:
        10px !important;
}


/* =========================================================
   FLASH / ERROR / STATUS
   ========================================================= */

.flash,
.message,
.alert,
.status-message {
    border:
        1px solid
        var(--t2-border) !important;

    border-radius:
        10px !important;

    background:
        #121416 !important;

    color:
        #bec2c5 !important;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 420px) {

    .trade-card,
    .positions-card {
        padding-left:
            15px !important;

        padding-right:
            15px !important;
    }


    .tab {
        min-height:
            54px;
    }


    #direction-segment
    button::before {
        font-size:
            18px;
    }
}

/* =========================================================
   REMOVE LONG / SHORT ARROWS
   ========================================================= */

#direction-segment
button[data-value="long"]::before,

#direction-segment
button[data-value="short"]::before {
    content: none !important;
    display: none !important;
}

/* =========================================================
   FIX PAGE BACKGROUND
   Убирает более светлую область внизу страницы
   ========================================================= */

html {
    min-height: 100% !important;
    background: #0c0e0f !important;
}

body {
    min-height: 100vh !important;

    background:
        radial-gradient(
            circle at 50% 8%,
            #191c1e 0%,
            #111315 34%,
            #0c0e0f 74%
        )
        fixed
        no-repeat !important;

    background-color: #0c0e0f !important;
}

/* =========================================================
   TERMINAL 2
   HISTORY ADD-ON FOR CSS V2 — REVISED
   ========================================================= */


/* =========================================================
   HISTORY MAIN CONTAINER
   Убираем дополнительный внутренний слой отступов.
   Основной tab-content-card уже имеет собственные отступы.
   ========================================================= */

.tab-content-card > .history-card {
    width: 100% !important;

    box-sizing: border-box !important;

    margin: 0 !important;

    padding:
        0 !important;

    border:
        0 !important;

    background:
        transparent !important;

    box-shadow:
        none !important;
}


/* =========================================================
   HISTORY TAB UNDERLINE
   ========================================================= */

.tab[href*="history"].active::after {
    width:
        7.1ch !important;
}


/* =========================================================
   HISTORY LABELS
   ========================================================= */

.history-card > .pos-label {
    margin-bottom:
        8px !important;

    color:
        #999da3 !important;

    font-size:
        11px !important;

    font-weight:
        800 !important;

    letter-spacing:
        .55px !important;
}


/* =========================================================
   DISPLAY + PERIOD
   ========================================================= */

.history-scope,
.history-period {
    width:
        100% !important;

    max-width:
        none !important;

    box-sizing:
        border-box !important;

    display:
        flex !important;

    align-items:
        stretch !important;

    justify-content:
        stretch !important;

    gap:
        0 !important;

    padding:
        4px !important;

    border:
        1px solid
        #444a4f !important;

    border-radius:
        11px !important;

    background:
        linear-gradient(
            180deg,
            #131517 0%,
            #101214 100%
        ) !important;

    box-shadow:
        inset 0 1px 2px
        rgba(0,0,0,.30) !important;

    overflow:
        hidden !important;
}


/* DISPLAY */

.history-scope {
    margin:
        0 0 18px !important;
}


/* PERIOD */

.history-period {
    margin:
        0 0 18px !important;
}


/* =========================================================
   ALL HISTORY SEGMENT BUTTONS
   ========================================================= */

.history-scope button,
.history-period button {
    appearance:
        none !important;

    -webkit-appearance:
        none !important;

    min-width:
        0 !important;

    width:
        auto !important;

    min-height:
        39px !important;

    margin:
        0 !important;

    padding:
        0 6px !important;

    border:
        1px solid
        transparent !important;

    border-radius:
        8px !important;

    background:
        transparent !important;

    color:
        #96999e !important;

    box-shadow:
        none !important;

    font-weight:
        800 !important;

    text-align:
        center !important;
}


/* =========================================================
   DISPLAY:
   50% + 50%
   ========================================================= */

.history-scope button {
    flex:
        1 1 0 !important;

    max-width:
        none !important;

    font-size:
        11px !important;
}


/* =========================================================
   PERIOD:
   пять абсолютно равных сегментов
   ========================================================= */

.history-period button {
    flex:
        1 1 0 !important;

    max-width:
        none !important;

    font-size:
        10px !important;
}


/* =========================================================
   ACTIVE DISPLAY / PERIOD
   ========================================================= */

.history-scope button.active,
.history-period button.active {
    border:
        1px solid
        rgba(226,165,38,.22) !important;

    background:
        linear-gradient(
            180deg,
            #463819 0%,
            #312816 100%
        ) !important;

    color:
        #efb43a !important;

    box-shadow:
        inset 0 1px 0
        rgba(255,219,124,.045) !important;
}


/* =========================================================
   HISTORY SUMMARY
   ========================================================= */

.history-summary {
    width:
        100% !important;

    box-sizing:
        border-box !important;

    display:
        grid !important;

    grid-template-columns:
        1.15fr .8fr .95fr !important;

    min-height:
        66px !important;

    margin:
        0 0 15px !important;

    padding:
        0 !important;

    border:
        1px solid
        #41464a !important;

    border-radius:
        11px !important;

    background:
        linear-gradient(
            180deg,
            #171a1c 0%,
            #141618 100%
        ) !important;

    overflow:
        hidden !important;

    box-shadow:
        inset 0 1px 0
        rgba(255,255,255,.015) !important;
}


.history-summary-item {
    min-width:
        0 !important;

    min-height:
        66px !important;

    box-sizing:
        border-box !important;

    display:
        flex !important;

    flex-direction:
        column !important;

    justify-content:
        center !important;

    padding:
        9px 12px !important;
}


.history-summary-item
+ .history-summary-item {
    border-left:
        1px solid
        #303438 !important;
}


.history-summary-label {
    display:
        block !important;

    margin:
        0 0 5px !important;

    color:
        #74797e !important;

    font-size:
        10px !important;

    font-weight:
        800 !important;

    opacity:
        1 !important;
}


.history-summary strong {
    font-size:
        16px !important;

    font-weight:
        850 !important;
}


/* =========================================================
   HISTORY LIST
   ========================================================= */

#history-list,
.history-card .pos-list {
    width:
        100% !important;

    box-sizing:
        border-box !important;
}


/* =========================================================
   HISTORY TRADE CARD
   ========================================================= */

.history-trade {
    width:
        100% !important;

    box-sizing:
        border-box !important;

    padding:
        14px !important;

    border:
        1px solid
        #41464a !important;

    border-radius:
        12px !important;

    background:
        linear-gradient(
            180deg,
            #171a1c 0%,
            #141618 100%
        ) !important;

    box-shadow:
        inset 0 1px 0
        rgba(255,255,255,.015) !important;
}


.history-trade-top {
    display:
        flex !important;

    align-items:
        center !important;

    justify-content:
        space-between !important;

    gap:
        10px !important;

    margin-bottom:
        14px !important;
}


.history-trade .pos-market {
    color:
        #eeeeee !important;

    font-size:
        15px !important;

    font-weight:
        850 !important;
}


.history-account {
    margin-top:
        3px !important;

    color:
        #71767c !important;

    font-size:
        10px !important;

    font-weight:
        700 !important;

    opacity:
        1 !important;
}


/* =========================================================
   HISTORY CARD DATA GRID

   ENTRY  | EXIT
   SIZE   | CLOSED
   ----------------
   PNL                  RESULT
   ========================================================= */

.history-trade-grid {
    width:
        100% !important;

    display:
        grid !important;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr) !important;

    grid-template-rows:
        auto auto auto !important;

    column-gap:
        18px !important;

    row-gap:
        13px !important;
}


/*
   DOM:
   1 SIZE
   2 ENTRY
   3 EXIT
   4 PNL
   5 CLOSED
*/


/* ENTRY */

.history-trade-grid
> .pos-field:nth-child(2) {
    order:
        1 !important;

    grid-column:
        1 !important;

    grid-row:
        1 !important;
}


/* EXIT */

.history-trade-grid
> .pos-field:nth-child(3) {
    order:
        2 !important;

    grid-column:
        2 !important;

    grid-row:
        1 !important;
}


/* SIZE */

.history-trade-grid
> .pos-field:nth-child(1) {
    order:
        3 !important;

    grid-column:
        1 !important;

    grid-row:
        2 !important;
}


/* CLOSED */

.history-trade-grid
> .pos-field:nth-child(5) {
    order:
        4 !important;

    grid-column:
        2 !important;

    grid-row:
        2 !important;
}


/* =========================================================
   PNL — FINAL RESULT
   ========================================================= */

.history-trade-grid
> .pos-field:nth-child(4) {
    order:
        5 !important;

    grid-column:
        1 / -1 !important;

    grid-row:
        3 !important;

    width:
        100% !important;

    display:
        flex !important;

    align-items:
        center !important;

    justify-content:
        space-between !important;

    gap:
        15px !important;

    margin:
        3px 0 0 !important;

    padding:
        12px 0 0 !important;

    border-top:
        1px solid
        #303438 !important;
}


.history-trade-grid
> .pos-field:nth-child(4)
label {
    margin:
        0 !important;

    color:
        #74797e !important;

    font-size:
        10px !important;

    font-weight:
        800 !important;
}


.history-trade-grid
> .pos-field:nth-child(4)
div {
    margin:
        0 !important;

    font-size:
        19px !important;

    line-height:
        1.1 !important;

    font-weight:
        900 !important;

    text-align:
        right !important;
}


/* =========================================================
   STANDARD CARD VALUES
   ========================================================= */

.history-trade-grid
> .pos-field:not(:nth-child(4))
label {
    display:
        block !important;

    margin:
        0 0 4px !important;

    color:
        #74797e !important;

    font-size:
        10px !important;

    font-weight:
        800 !important;
}


.history-trade-grid
> .pos-field:not(:nth-child(4))
div {
    color:
        #d7dadd !important;

    font-weight:
        700 !important;
}


/* =========================================================
   PNL COLORS
   ========================================================= */

.history-trade .pnl-pos,
.history-summary .pnl-pos {
    color:
        #3fba7c !important;
}


.history-trade .pnl-neg,
.history-summary .pnl-neg {
    color:
        #d1616a !important;
}


.history-trade .pnl-zero,
.history-summary .pnl-zero {
    color:
        #a0a4a8 !important;
}


/* =========================================================
   EMPTY / STATUS / WARNING
   ========================================================= */

.history-empty {
    width:
        100% !important;

    min-height:
        145px !important;

    display:
        flex !important;

    align-items:
        center !important;

    justify-content:
        center !important;

    padding:
        28px 8px !important;

    color:
        #686d72 !important;

    font-size:
        11px !important;

    font-weight:
        800 !important;

    letter-spacing:
        .35px !important;

    opacity:
        1 !important;
}


.history-status {
    color:
        #74797e !important;
}


.history-warning {
    border:
        1px solid
        #5c4b27 !important;

    background:
        #211d14 !important;

    color:
        #b39b64 !important;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 420px) {

    .history-scope button {
        padding-left:
            3px !important;

        padding-right:
            3px !important;

        font-size:
            10px !important;
    }


    .history-period button {
        padding-left:
            2px !important;

        padding-right:
            2px !important;

        font-size:
            10px !important;
    }


    .history-summary-item {
        padding-left:
            8px !important;

        padding-right:
            8px !important;
    }


    .history-summary-label {
        font-size:
            9px !important;
    }


    .history-summary strong {
        font-size:
            14px !important;
    }


    .history-trade-grid
    > .pos-field:nth-child(4)
    div {
        font-size:
            18px !important;
    }
}
/* =========================================================
   HISTORY PERIOD — UNEQUAL SEGMENTS
   TODAY | YESTERDAY | 3D | 7D | 30D | ALL
   ========================================================= */

.history-period {
    display:
        grid !important;

    grid-template-columns:
        17fr
        23fr
        15fr
        15fr
        15fr
        15fr !important;

    align-items:
        stretch !important;

    gap:
        0 !important;
}


.history-period button {
    width:
        100% !important;

    min-width:
        0 !important;

    max-width:
        none !important;

    margin:
        0 !important;

    padding-left:
        2px !important;

    padding-right:
        2px !important;

    white-space:
        nowrap !important;

    text-align:
        center !important;
}


/* На узком мобильном экране сохраняем те же пропорции */

@media (max-width: 420px) {

    .history-period {
        grid-template-columns:
            17fr
            23fr
            15fr
            15fr
            15fr
            15fr !important;
    }

    .history-period button {
        padding-left:
            1px !important;

        padding-right:
            1px !important;
    }
}

/* =========================================================
   HISTORY TRADE CARD — COMPACT 3-COLUMN LAYOUT
   ENTRY | EXIT | SIZE
   -------------------
   CLOSED TIME              PNL VALUE
   ========================================================= */


/* Немного уменьшаем высоту самой карточки */

.history-trade {
    padding:
        12px 14px !important;
}


.history-trade-top {
    margin-bottom:
        12px !important;
}


/* =========================================================
   GRID
   ========================================================= */

.history-trade-grid {
    position:
        relative !important;

    display:
        grid !important;

    grid-template-columns:
        36fr
        36fr
        28fr !important;

    grid-template-rows:
        auto auto !important;

    column-gap:
        12px !important;

    row-gap:
        10px !important;
}


/* =========================================================
   FIRST ROW
   ENTRY | EXIT | SIZE
   ========================================================= */


/* ENTRY */

.history-trade-grid
> .pos-field:nth-child(2) {
    order:
        initial !important;

    grid-column:
        1 !important;

    grid-row:
        1 !important;
}


/* EXIT */

.history-trade-grid
> .pos-field:nth-child(3) {
    order:
        initial !important;

    grid-column:
        2 !important;

    grid-row:
        1 !important;
}


/* SIZE */

.history-trade-grid
> .pos-field:nth-child(1) {
    order:
        initial !important;

    grid-column:
        3 !important;

    grid-row:
        1 !important;
}


/* =========================================================
   BOTTOM ROW
   CLOSED TIME LEFT
   PNL VALUE RIGHT
   ========================================================= */


/* PNL занимает всю нижнюю строку
   и создаёт общую разделительную линию */

.history-trade-grid
> .pos-field:nth-child(4) {
    order:
        initial !important;

    grid-column:
        1 / -1 !important;

    grid-row:
        2 !important;

    width:
        100% !important;

    box-sizing:
        border-box !important;

    display:
        flex !important;

    align-items:
        center !important;

    justify-content:
        flex-end !important;

    margin:
        0 !important;

    padding:
        10px 0 0 !important;

    border-top:
        1px solid
        #303438 !important;

    z-index:
        1 !important;
}


/* Скрываем слово PNL */

.history-trade-grid
> .pos-field:nth-child(4)
label {
    display:
        none !important;
}


/* Размер PNL как в TOTAL PNL */

.history-trade-grid
> .pos-field:nth-child(4)
div {
    margin:
        0 !important;

    font-size:
        16px !important;

    line-height:
        1.15 !important;

    font-weight:
        850 !important;

    text-align:
        right !important;
}


/* CLOSED помещаем поверх той же строки слева */

.history-trade-grid
> .pos-field:nth-child(5) {
    order:
        initial !important;

    grid-column:
        1 / -1 !important;

    grid-row:
        2 !important;

    align-self:
        end !important;

    justify-self:
        start !important;

    width:
        auto !important;

    max-width:
        72% !important;

    margin:
        0 !important;

    padding:
        10px 0 0 !important;

    border:
        0 !important;

    z-index:
        2 !important;

    pointer-events:
        none !important;
}


/* Скрываем слово CLOSED */

.history-trade-grid
> .pos-field:nth-child(5)
label {
    display:
        none !important;
}


/* Дата/время закрытия — второстепенная информация */

.history-trade-grid
> .pos-field:nth-child(5)
div {
    margin:
        0 !important;

    color:
        #7f8489 !important;

    font-size:
        11px !important;

    line-height:
        1.15 !important;

    font-weight:
        700 !important;

    white-space:
        nowrap !important;

    text-align:
        left !important;
}


/* =========================================================
   FIRST ROW LABELS / VALUES
   ========================================================= */

.history-trade-grid
> .pos-field:nth-child(1)
label,

.history-trade-grid
> .pos-field:nth-child(2)
label,

.history-trade-grid
> .pos-field:nth-child(3)
label {
    display:
        block !important;

    margin:
        0 0 4px !important;

    color:
        #74797e !important;

    font-size:
        10px !important;

    font-weight:
        800 !important;
}


.history-trade-grid
> .pos-field:nth-child(1)
div,

.history-trade-grid
> .pos-field:nth-child(2)
div,

.history-trade-grid
> .pos-field:nth-child(3)
div {
    margin:
        0 !important;

    color:
        #d7dadd !important;

    font-weight:
        700 !important;

    white-space:
        nowrap !important;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 420px) {

    .history-trade-grid {
        grid-template-columns:
            36fr
            36fr
            28fr !important;

        column-gap:
            8px !important;
    }


    .history-trade-grid
    > .pos-field:nth-child(4)
    div {
        font-size:
            14px !important;
    }


    .history-trade-grid
    > .pos-field:nth-child(5)
    div {
        font-size:
            10px !important;
    }
}
/* =========================================================
   HISTORY TRADE CARD
   HIDE LONG / SHORT
   COLOR MARKET BY POSITION SIDE
   ========================================================= */


/* Убираем отдельную надпись LONG / SHORT */

.history-trade .pos-side,
.history-trade .position-side,
.history-trade .side-badge,
.history-trade .trade-side {
    display:
        none !important;
}


/* =========================================================
   LONG
   Market получает тот же зелёный цвет,
   который используется в CSS V2 для LONG
   ========================================================= */

.history-trade:has(.long) .pos-market,
.history-trade:has(.pos-long) .pos-market,
.history-trade:has(.side-long) .pos-market,
.history-trade:has([data-side="long"]) .pos-market,
.history-trade:has([data-direction="long"]) .pos-market {
    color:
        #3fba7c !important;
}


/* =========================================================
   SHORT
   Market получает тот же красный цвет,
   который используется в CSS V2 для SHORT
   ========================================================= */

.history-trade:has(.short) .pos-market,
.history-trade:has(.pos-short) .pos-market,
.history-trade:has(.side-short) .pos-market,
.history-trade:has([data-side="short"]) .pos-market,
.history-trade:has([data-direction="short"]) .pos-market {
    color:
        #d1616a !important;
}
/* One Trade shell adaptations for exchange identities and isolated dialogs. */
body{padding:18px;font-family:Arial,sans-serif}main.wrap{max-width:520px;padding:0;margin:auto}
#dashboard{padding:12px 0;max-width:none}#dashboard>.eyebrow{display:none}
header{padding:0 0 12px;border-bottom:0}header .brand{font-size:20px;color:var(--t2-gold)}
header .brand span{font-size:18px;color:var(--t2-text)}header .tag{font-size:10px}
.toolbar{margin:12px 0;gap:8px}.toolbar select{font-family:inherit}
.tabs{margin-top:14px;align-items:stretch}.tabs .tab{margin-top:0;min-width:0;font-family:inherit}
.tab-content-card{padding:16px}.tab-content-card>section{padding:0}
.positions-card{padding:17px 16px 18px;max-width:none}
.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
#trade-panel{padding:0;max-width:none}#trade-panel .trade-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:16px}
#trade-panel .trade-grid{gap:14px}
#trade-panel label{font-size:10px;color:#74797e;font-weight:800;margin:0 0 6px}
#trade-panel input:not([type=checkbox]),#trade-panel select{height:47px;width:100%;min-width:0;background:var(--t2-input);border:1px solid var(--t2-border);color:var(--t2-text);font:14px Arial,sans-serif;border-radius:8px}
#trade-panel .trade-segment{border:1px solid var(--t2-border);border-radius:8px}
#trade-panel .trade-segment button{height:45px;min-width:0;margin:0;padding:0 8px;font:800 11px Arial,sans-serif;background:#171a1c;color:#969a9f;border:0}
#trade-panel .trade-segment button.active{color:var(--t2-gold);background:var(--t2-gold-surface)}
#trade-panel .trade-segment button.long.active{color:#3fba7c;background:#153524}
#trade-panel .trade-segment button.short.active{color:#d1616a;background:#3d2026}
#trade-panel .trade-actions button{height:47px;margin:0;font-size:12px}
#trade-panel .trade-check{display:flex;align-items:center;gap:8px}
#account-view{display:flex;flex-direction:column}#account-view>#balance{order:1;margin:10px 0}
#account-view>#snapshot-status,#account-view>#listener-status{order:2;margin:5px 0;font-size:10px}
#account-view>.tab-content-card{order:0}#balance{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
#balance .card{padding:10px;min-width:0}#balance .card p{font-size:9px;margin:0 0 5px}#balance .card h2{font-size:13px;overflow-wrap:anywhere;margin:0}
.pos-card{margin:0!important}.pos-top{display:flex;justify-content:space-between;gap:10px;margin-bottom:12px}
.pos-market{font-size:15px;font-weight:800}.pos-account,.history-account{display:block!important;font-size:10px;color:#74797e;margin-top:4px;overflow-wrap:anywhere}
.pos-grid,.orders-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 8px}
.pos-field{min-width:0}.pos-field label{display:block;margin:0 0 4px;font-size:9px;font-weight:800;color:#74797e}
.pos-field div{font-size:13px;font-weight:700;overflow-wrap:anywhere;color:#d7dadd}
.pos-side{font-size:12px;font-weight:850}.long,.pnl-pos{color:#3fba7c!important}.short,.pnl-neg{color:#d1616a!important}.pnl-zero{color:#a0a4a8!important}
.card-footer{margin-top:10px;padding-top:10px;border-top:1px solid #303438;font-size:10px;color:#7f8489}
.card-status{font-size:10px;color:#b39b64;margin:8px 0 0}
.history-summary{border:1px solid var(--t2-border);border-radius:10px;margin:12px 0}
#history-quality{font-size:10px;line-height:1.5}.history-card .toolbar{margin:0 0 14px}
.history-card .toolbar select{width:100%;height:42px;font-size:12px}
.terminal-menu{width:min(300px,calc(100vw - 32px))}.terminal-menu button,.menu-link{width:100%;display:block;min-height:42px;margin:0 0 7px;text-align:left;padding:10px 12px;font:700 13px Arial,sans-serif;background:#1b1e21;color:#d7dadd;border:1px solid #353a3e;border-radius:7px;text-decoration:none}
.terminal-manager{width:min(520px,calc(100vw - 24px));max-height:90dvh;padding:20px}
.terminal-manager section{padding:0;max-width:none}.terminal-manager .grid{grid-template-columns:1fr;margin:14px 0}
.dialog-close{margin:0 0 12px auto;padding:0;width:32px;height:32px;background:transparent;color:#969a9f;border:1px solid #41464a;border-radius:50%;font-size:22px}
.menu-button{min-width:42px;padding:10px!important;font-size:19px!important}
#account-confirm-ok{background:#702a32;border-color:#a74750;color:#fff}
dialog::backdrop{background:rgba(0,0,0,.65)}
@media(max-width:420px){body{padding:12px}.tabs .tab{padding:0 3px!important;min-height:54px}.trade-grid{grid-template-columns:1fr}.trade-field.wide,.trade-protection-pair.wide,.trade-check.wide,.trade-actions.wide{grid-column:1/-1}.toolbar select{min-width:0}.terminal-manager .toolbar h2{font-size:16px}.history-summary-value{font-size:14px}.history-trade-grid{column-gap:8px!important}}

/* Runtime theme uses !important flex rules for empty cards; hidden states must win. */
#dashboard [hidden],#account-dialog [hidden],#coin-dialog [hidden]{display:none!important}

#trade-panel .trade-reset{margin:0;padding:6px 9px;font:800 10px Arial,sans-serif;color:#969a9f;background:#171a1c;border:1px solid #41464a;border-radius:6px}
#trade-panel .trade-collapse-title{margin:0 0 8px;padding:0;display:flex;align-items:center;gap:5px;color:#74797e;font:800 10px Arial,sans-serif;background:none;border:0}
#trade-panel[aria-busy="true"] button:disabled,#trade-panel[aria-busy="true"] input:disabled,#trade-panel[aria-busy="true"] select:disabled{opacity:.7}
.trade-preview-dialog{width:min(520px,calc(100vw - 24px));max-height:90dvh;overflow:auto}
.trade-preview-dialog .trade-result-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px 16px;font-size:12px}
.trade-preview-dialog .trade-result-grid strong{overflow-wrap:anywhere;text-align:right}
.trade-preview-dialog .orders-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:20px}
.trade-preview-dialog button{margin:0;height:47px}
#trade-quote{font:11px Arial,sans-serif;color:#969a9f;text-align:right}

.ext-head{display:grid;grid-template-columns:1fr 110px 34px;gap:10px}.ext-head>span{font-size:11px;color:#969ea4}.ext-line{display:grid;grid-template-columns:minmax(0,1fr) 110px 34px;gap:10px;align-items:center}.ext-value{position:relative}.ext-value input{width:100%;box-sizing:border-box}.ext-value [data-auto-extremum]{opacity:.7}.ext-value>span{position:absolute;right:12px;top:50%;transform:translateY(-50%);color:#969ea4}.ext-line button{margin:0;height:46px;padding:8px;min-height:42px;background:#22272b;color:#d7dadd;border:1px solid #394147;border-radius:6px}.ext-presets{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:20px 0}.ext-presets button{background:#292d30;color:#d7dadd;min-height:42px;border:1px solid #394147;border-radius:6px}.ext-presets button.active{border-color:#3f9a72;color:#fff}#trade-ext-dialog{max-width:420px}#trade-ext-status:empty{display:none}@media(max-width:480px){.ext-head,.ext-line{grid-template-columns:minmax(0,1fr) 85px 32px}}
/* Reference PERIOD calendar/clock, adapted to Last/5m and separate native dialogs. */
#trade-ext-dialog{width:min(420px,calc(100vw - 24px));max-height:90dvh;overflow:auto;padding:24px}#trade-ext-dialog::backdrop{backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}#trade-ext-dialog h3{margin:0 0 20px;font-size:16px;text-align:center}#trade-ext-dialog button{margin:0}#trade-ext-dialog .trade-period-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}#trade-ext-dialog .trade-period-fields>button{height:46px;width:100%;padding:10px;font:14px Arial,sans-serif;background:#171a1c;border:1px solid #41464a;color:#d7dadd;border-radius:7px}#trade-ext-dialog .trade-period-picker{margin:10px 0 0;padding:12px;max-width:none;border:1px solid #41464a;border-radius:7px;background:#171a1c}#trade-ext-dialog .trade-period-picker[hidden]{display:none!important}#trade-ext-dialog .trade-period-picker button{padding:0;font-family:inherit;font-size:13px;border:0;background:none;color:#d7dadd;cursor:pointer;border-radius:5px}#trade-ext-dialog .trade-period-picker button:hover{background:#292d30}#trade-ext-dialog .trade-period-picker button:disabled{opacity:.25;cursor:default;background:none}.trade-calendar-nav{display:grid;grid-template-columns:30px minmax(0,1fr) 30px;align-items:center;text-align:center;font-size:13px;margin-bottom:10px}#trade-ext-dialog .trade-calendar-nav button{height:30px;font-size:23px;line-height:1}.trade-calendar-week,.trade-calendar-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;text-align:center}.trade-calendar-week{font-size:10px;color:#9aa0a6;margin-bottom:4px}#trade-ext-dialog .trade-calendar-days button{height:31px}#trade-ext-dialog .trade-calendar-days button.outside-month{color:#777c82}#trade-ext-dialog .trade-calendar-days button[aria-pressed="true"],#trade-ext-dialog .trade-time-options button[aria-selected="true"]{color:#e1a52b;background:rgba(225,165,43,.14)}.trade-time-columns{display:grid;grid-template-columns:1fr 1fr;gap:10px}.trade-time-columns .trade-label{font-size:11px;margin-bottom:7px}.trade-time-options{max-height:170px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#555b60 #171a1c}#trade-ext-dialog .trade-time-options button{display:block;width:100%;min-height:31px;text-align:center;padding:4px}.trade-period-slider-row{margin:20px 0 0}#trade-period-slider{display:block;width:100%;height:20px;margin:0;padding:0;appearance:none;-webkit-appearance:none;background:transparent;cursor:pointer;accent-color:#e1a52b;outline:none;box-shadow:none}#trade-period-slider::-webkit-slider-runnable-track{height:4px;background:#343a3e;border-radius:2px}#trade-period-slider::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:18px;height:18px;margin-top:-7px;border:0;border-radius:50%;background:#e1a52b}#trade-period-slider::-moz-range-track{height:4px;background:#343a3e;border-radius:2px}#trade-period-slider::-moz-range-thumb{width:18px;height:18px;border:0;border-radius:50%;background:#e1a52b}#trade-period-slider:focus-visible,#trade-ext-dialog button:focus-visible{outline:1px solid #e1a52b;outline-offset:2px}#trade-period-error{font-size:12px;color:#d8616b;margin:8px 0}#trade-ext-dialog .orders-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:20px}#trade-ext-dialog .orders-actions button{width:100%;height:44px;padding:8px;font-size:13px}#trade-ext-presets{margin:20px 0}.trade-period-fields button:disabled{opacity:.5}

#trade-ext-dialog{overflow:visible}#trade-ext-dialog #trade-ext-title{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}#trade-ext-dialog .trade-period-fields{position:relative}#trade-ext-dialog .trade-period-fields button[aria-expanded="true"]{border-color:#e1a52b}#trade-ext-dialog .trade-period-picker{position:absolute;top:calc(100% + 6px);z-index:30;box-sizing:border-box;margin:0;padding:10px;max-height:calc(100dvh - 150px);overflow-y:auto;box-shadow:0 14px 32px rgba(0,0,0,.45)}#trade-period-calendar{left:0;width:min(290px,100%)}#trade-period-clock{right:0;width:min(220px,100%)}#trade-ext-dialog #trade-ext-presets{display:flex;align-items:center;justify-content:center;gap:7px;flex-wrap:wrap;margin:20px 0 24px;line-height:16px;font-size:12px;color:#9aa0a6}#trade-ext-dialog #trade-ext-presets button{margin:0;padding:0;min-height:0;border:0;background:none;font-size:12px;color:#b6b9bd;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:4px}#trade-ext-dialog #trade-ext-presets button[aria-pressed="true"]{color:#e1a52b}@media(max-height:560px){#trade-ext-dialog{margin-top:24px}}
.ext-head{grid-template-columns:minmax(0,1fr) 85px 85px 32px}.ext-line{grid-template-columns:minmax(0,1fr) 85px 85px 32px}.trade-fib-picker{position:relative;min-width:0}.trade-fib-picker>button{width:100%}#trade-fib-menu{position:absolute;top:calc(100% + 5px);right:0;z-index:25;min-width:90px;padding:5px;background:#171a1c;border:1px solid #41464a;border-radius:7px;box-shadow:0 10px 25px #0008}#trade-fib-menu button{display:block;width:100%;height:34px;min-height:34px;text-align:left;border:0;background:none;padding:6px;font-size:13px}#trade-fib-menu button:hover,#trade-fib-menu button[aria-checked="true"]{background:#292d30;color:#e1a52b}.trade-entry-fib{color:#9aa0a6;font-size:10px;align-self:center;white-space:nowrap}#trade-entry[data-fib="1"]{opacity:.7}@media(max-width:480px){.ext-head,.ext-line{grid-template-columns:minmax(0,1fr) 64px 64px 28px;gap:6px}.ext-head>span{font-size:9px}.ext-line button{font-size:12px}}

.trade-entry-field{position:relative;flex:1;min-width:0}.trade-entry-field #trade-entry{width:100%}.trade-entry-field .trade-entry-fib{position:absolute;top:4px;right:7px;z-index:1;font-size:9px;pointer-events:none}

#trade-preview-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 18px;margin:12px 0 20px}#trade-preview-summary>div{display:flex;flex-direction:column;gap:4px;font-size:13px;overflow-wrap:anywhere}#trade-preview-summary span{font-size:10px;color:#969a9f}#trade-preview-periods{display:flex;justify-content:center;gap:12px;flex-wrap:wrap;margin:14px 0}#trade-preview-periods button{height:auto;min-height:30px;padding:2px 4px;background:none;border:0;color:#969a9f;font-size:12px}#trade-preview-periods button[aria-pressed="true"]{color:#e1a52b}#trade-preview-chart{width:100%;min-height:220px;background:#111416;border-radius:7px;overflow:hidden}#trade-preview-chart svg{display:block;width:100%;height:auto;font-family:Arial,sans-serif}#trade-preview-chart-status{font-size:11px;line-height:1.6;color:#969a9f;margin:8px 0}.trade-preview-chart-health{display:flex;align-items:flex-start;gap:10px}#trade-preview-chart-retry{font-size:10px;height:auto;min-height:28px;padding:5px 8px;margin-top:8px}#trade-preview-details{margin:14px 0;font-size:12px}#trade-preview-details summary{cursor:pointer;color:#969a9f;margin-bottom:12px}#trade-preview-dialog .trade-result-grid strong{min-width:0;overflow-wrap:anywhere}#trade-preview-dialog .trade-result-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}

#trade-fib-track{font:inherit;color:#74797e;border:0;background:transparent;padding:0;margin:0 0 0 5px;letter-spacing:inherit}#trade-fib-track[aria-pressed="true"]{color:var(--gold,#e1a52b)}#trade-fib-track:disabled{cursor:default}#trade-fib-track-dialog{width:min(360px,calc(100vw - 32px))}.trade-fib-track-options{display:flex;align-items:center;justify-content:space-between;gap:16px}.trade-fib-track-options label{display:flex;align-items:center;gap:8px;white-space:nowrap;font-size:12px;cursor:pointer}.trade-fib-track-options input{margin:0;cursor:pointer}.trade-fib-track-options input:focus-visible{outline:1px solid #e1a52b;outline-offset:3px}
