/* xFi Trading Hub v0.5.22 — workspace polish, history analytics, signals drawer. */
.xfi-desktop-rail button[hidden]{display:none!important}
.xfi-v2-brand>span{display:none!important}
.xfi-floating-desktop-wrap{margin-left:auto;padding-left:18px;border-left:1px solid #273137;color:#9ca8ad!important}
.xfi-floating-desktop-wrap b{color:#24d39f!important;font-variant-numeric:tabular-nums}
.xfi-floating-desktop-wrap b.loss{color:#ff686c!important}.xfi-floating-desktop-wrap b.gain{color:#24d39f!important}

@media(min-width:561px){
  .xfi-native-settings.xfi-desktop-settings-open{inset:78px 22px 22px auto!important;width:min(460px,38vw)!important;padding:0 18px 22px!important;border:1px solid #303a40!important;border-radius:16px!important;background:#0b1012!important;box-shadow:0 28px 90px rgba(0,0,0,.82)!important}
  .xfi-settings-desktop-head{margin:0 -18px 16px!important;padding:18px 20px!important;background:#0d1316f7!important;border-bottom:1px solid #263138!important}
  .xfi-settings-desktop-head h1{font-size:22px!important;line-height:1.2!important}.xfi-settings-desktop-head small{font-size:9px!important;color:#d3a95e!important}
  .xfi-native-settings.xfi-desktop-settings-open .xfi-settings-group{padding:14px!important;margin:0 0 14px!important;border:1px solid #273238!important;border-radius:14px!important;background:#101619!important;overflow:visible!important}
  .xfi-native-settings.xfi-desktop-settings-open .xfi-settings-account>button{display:grid!important;grid-template-columns:1fr auto!important;grid-template-areas:"name arrow" "server arrow" "mode arrow"!important;align-items:center!important;width:100%!important;min-height:0!important;padding:12px 2px 14px!important;border:0!important;border-bottom:1px solid #273238!important;border-radius:0!important;background:transparent!important;color:#eef2f3!important;text-align:left!important;box-shadow:none!important}
  .xfi-settings-account>button strong{grid-area:name!important;font-size:16px!important;line-height:1.3!important}.xfi-settings-account>button>span:first-of-type{display:none!important}.xfi-settings-account>button>span:last-of-type{grid-area:server!important;margin-top:3px!important;color:#b7c0c4!important;font-size:12px!important}.xfi-settings-account>button small{grid-area:mode!important;margin-top:4px!important;color:#78878e!important;font-size:10px!important}.xfi-settings-account>button em{grid-area:arrow!important;position:static!important;color:#748188!important;font-size:24px!important;font-style:normal!important}
  .xfi-native-settings.xfi-desktop-settings-open .xfi-settings-row{display:flex!important;align-items:center!important;gap:12px!important;min-height:58px!important;padding:5px 0!important;border-bottom:1px solid #253036!important}.xfi-native-settings.xfi-desktop-settings-open .xfi-settings-row:last-child{border-bottom:0!important}
  .xfi-native-settings.xfi-desktop-settings-open .xfi-settings-icon{display:grid!important;place-items:center!important;flex:0 0 32px!important;width:32px!important;height:32px!important;border-radius:9px!important;color:#fff!important;font-size:15px!important}.xfi-settings-icon.green{background:#174a38!important}.xfi-settings-icon.blue{background:#183a50!important}.xfi-settings-icon.gold{background:#5a421d!important}
  .xfi-native-settings.xfi-desktop-settings-open .xfi-settings-row a,.xfi-native-settings.xfi-desktop-settings-open .xfi-settings-link-button{display:flex!important;align-items:center!important;justify-content:space-between!important;flex:1!important;gap:12px!important;color:#eef2f3!important;text-decoration:none!important;font:600 13px/1.35 system-ui!important;background:transparent!important;border:0!important;padding:0!important}.xfi-native-settings.xfi-desktop-settings-open .xfi-settings-row a span,.xfi-settings-link-button>span{display:flex!important;flex-direction:column!important;gap:3px!important}.xfi-native-settings.xfi-desktop-settings-open .xfi-settings-row small,.xfi-settings-link-button small{display:block!important;color:#78868c!important;font-size:10px!important;font-weight:400!important;line-height:1.35!important}
  .xfi-settings-group-title{padding:1px 0 11px!important;color:#c99a4e!important;font-size:9px!important;letter-spacing:.17em!important}.xfi-one-click-warning{margin:10px 0 2px!important;padding:10px 12px!important;border-radius:9px!important;background:#0b1114!important;color:#748289!important;line-height:1.45!important}
  .xfi-chart-level-title{display:flex!important;flex-direction:column!important;gap:4px!important;margin-bottom:7px!important}.xfi-chart-level-title strong{font-size:14px!important}.xfi-chart-level-title small{color:#78868c!important;font-size:10px!important;line-height:1.4!important}
  .xfi-chart-level-switch{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:14px!important;min-height:55px!important;padding:8px 0!important;margin:0!important;border-bottom:1px solid #253036!important;color:#e9edef!important}.xfi-chart-level-switch:last-child{border-bottom:0!important}.xfi-chart-level-switch>span{display:flex!important;flex-direction:column!important;gap:3px!important;font-size:13px!important}.xfi-chart-level-switch small{color:#78868c!important;font-size:10px!important;font-weight:400!important}.xfi-chart-level-switch input{width:18px!important;height:18px!important;margin:0!important;flex:0 0 auto!important}
}

.xfi-history-range{padding:12px 14px 16px;border-bottom:1px solid #273137;background:#0c1113}
.xfi-history-range-controls{display:flex;align-items:end;gap:10px;flex-wrap:wrap}.xfi-history-range-controls label{display:flex;flex-direction:column;gap:5px;margin:0;color:#87949a;font-size:10px;text-transform:uppercase;letter-spacing:.05em}.xfi-history-range-controls input{height:34px;padding:0 9px;border:1px solid #303b40;border-radius:7px;background:#11181b;color:#e9edef;font:12px system-ui;color-scheme:dark}.xfi-history-range-controls>button{height:34px;padding:0 14px;border:1px solid #9a7136;border-radius:7px;background:#241b10;color:#efc475;font-weight:700;cursor:pointer}
.xfi-history-presets{display:flex;gap:6px;margin-right:auto}.xfi-history-presets button{height:34px;padding:0 11px;border:1px solid #2d383e;border-radius:7px;background:#11181b;color:#97a2a7;cursor:pointer}.xfi-history-presets button.active{border-color:#a87d3c;background:#332511;color:#f0c477}
.xfi-history-range-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:12px 0}.xfi-history-range-summary>div{padding:10px 12px;border:1px solid #263238;border-radius:9px;background:#101619}.xfi-history-range-summary span{display:block;color:#7f8d93;font-size:9px;text-transform:uppercase;letter-spacing:.05em}.xfi-history-range-summary b{display:block;margin-top:4px;color:#edf1f2;font-size:15px;font-variant-numeric:tabular-nums}.xfi-history-range-summary b.gain{color:#23d19d}.xfi-history-range-summary b.loss{color:#ff6b6f}
.xfi-history-range-head,.xfi-history-range-list .xfi-history-range-row{display:grid;grid-template-columns:1.2fr .65fr .7fr 1.5fr 1.25fr .8fr;gap:8px;align-items:center}.xfi-history-range-head{padding:9px 10px;color:#718087;font-size:9px;text-transform:uppercase;border-top:1px solid #263238;border-bottom:1px solid #263238}.xfi-history-range-list .xfi-history-range-row{padding:11px 10px;border-bottom:1px solid #202a2f;color:#cbd2d5;font-size:11px}.xfi-history-range-row .gain{color:#24d39f;font-weight:750}.xfi-history-range-row .loss{color:#ff6b6f;font-weight:750}.xfi-history-range-row strong{color:#f0f3f4}.xfi-history-range-ready>.history-head,.xfi-history-range-ready>#demo-history,.xfi-history-range-ready>#demo-history-empty{display:none!important}#xfi-history-range-empty{padding:20px 10px;color:#7f8c92;text-align:center}

.xfi-signals-drawer{position:fixed;z-index:125;inset:78px 22px 22px auto;width:min(430px,38vw);overflow:auto;border:1px solid #303b40;border-radius:16px;background:#0b1012;box-shadow:0 28px 90px rgba(0,0,0,.82);padding:18px}.xfi-signals-drawer[hidden]{display:none!important}.xfi-signals-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding-bottom:14px;border-bottom:1px solid #263138}.xfi-signals-head small{color:#c99a4e;font-size:9px;font-weight:800;letter-spacing:.17em}.xfi-signals-head h2{margin:3px 0 3px;font-size:22px}.xfi-signals-head p{margin:0;color:#78868c;font-size:11px}.xfi-signals-head button{width:36px;height:36px;border:1px solid #344047;border-radius:9px;background:#12191c;color:#dbe2e5;font-size:22px;cursor:pointer}.xfi-signals-list{display:grid;gap:10px;padding-top:14px}.xfi-signal-card{padding:14px;border:1px solid #273238;border-radius:12px;background:#101619}.xfi-signal-card header{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.xfi-signal-card h3{margin:0;font-size:15px}.xfi-signal-card small{color:#718087}.xfi-signal-return{color:#23d19d;font-size:15px;font-weight:800}.xfi-signal-meta{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:11px 0}.xfi-signal-meta div{padding:7px 8px;border-radius:8px;background:#0b1114}.xfi-signal-meta span{display:block;color:#6f7e84;font-size:8px;text-transform:uppercase}.xfi-signal-meta b{display:block;margin-top:2px;color:#dce2e5;font-size:11px}.xfi-signal-card a{display:flex;align-items:center;justify-content:center;height:36px;border:1px solid #9d7438;border-radius:8px;background:#21180e;color:#efc475;text-decoration:none;font-size:11px;font-weight:800}

@media(max-width:760px){.xfi-history-range-summary{grid-template-columns:repeat(2,1fr)}.xfi-history-range-head{display:none}.xfi-history-range-list .xfi-history-range-row{grid-template-columns:1fr auto;gap:5px}.xfi-history-range-row span:nth-child(2),.xfi-history-range-row span:nth-child(3),.xfi-history-range-row span:nth-child(4){display:none}.xfi-signals-drawer{inset:0;width:auto;border:0;border-radius:0;padding:18px 16px 100px}.xfi-floating-desktop-wrap{display:none!important}}
@media(min-width:901px){.xfi-ticket-tabs{grid-template-columns:1fr auto!important}.xfi-ticket-tabs strong{padding-left:12px!important}}

/* xFi v0.5.22 — native-style History / Deals experience. */
.xfi-history-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 14px;border-bottom:1px solid #263137;background:#0b1113}.xfi-history-toolbar strong{display:block;color:#eef2f3;font-size:14px}.xfi-history-toolbar small{display:block;margin-top:2px;color:#7e8b91;font-size:10px}.xfi-history-toolbar button{display:grid;place-items:center;width:36px;height:36px;border:1px solid #344047;border-radius:50%;background:#12191c;color:#e8edf0;font-size:20px;cursor:pointer}.xfi-history-toolbar button:hover{border-color:#a77a3d;color:#efc475}
.xfi-history-range{padding:0 14px 14px!important;background:#0b1012!important}.xfi-history-range-head{margin:0 -14px;padding:10px 14px!important}.xfi-history-range-list .xfi-history-range-row{display:block!important;padding:12px 4px!important;border-bottom:1px solid #20292e!important;cursor:pointer}.xfi-history-deal-top,.xfi-history-deal-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px}.xfi-history-deal-top strong{display:flex;align-items:baseline;gap:4px;color:#f2f5f6;font-size:13px}.xfi-history-deal-top em{font-style:normal;font-weight:750}.xfi-history-deal-top em.buy{color:#5aa1ff}.xfi-history-deal-top em.sell{color:#f05d4d}.xfi-history-deal-top b{font-size:13px;font-variant-numeric:tabular-nums}.xfi-history-deal-top b.gain{color:#5aa1ff!important}.xfi-history-deal-top b.loss{color:#ff675f!important}.xfi-history-deal-bottom{margin-top:4px;color:#8f999e;font-size:10px;font-variant-numeric:tabular-nums}.xfi-history-deal-bottom time{white-space:nowrap}
.xfi-history-statement{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:1px;margin:14px 0 0;border:1px solid #273238;border-radius:10px;overflow:hidden;background:#273238}.xfi-history-statement>div{display:flex;flex-direction:column;gap:3px;padding:10px;background:#0e1518}.xfi-history-statement span{color:#7c8990;font-size:9px;text-transform:uppercase;letter-spacing:.04em}.xfi-history-statement b{color:#eef2f3;font-size:13px;font-variant-numeric:tabular-nums}.xfi-history-statement b.gain{color:#5aa1ff}.xfi-history-statement b.loss{color:#ff675f}.xfi-history-counts{display:flex;gap:16px;padding:10px 1px 0;color:#77858b;font-size:10px}.xfi-history-counts b{color:#cdd5d8}
.xfi-history-filter-sheet{position:fixed;z-index:160;inset:0}.xfi-history-filter-sheet[hidden]{display:none!important}.xfi-history-filter-backdrop{position:absolute;inset:0;background:#000b;backdrop-filter:blur(5px)}.xfi-history-filter-sheet>section{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:min(430px,calc(100vw - 32px));max-height:min(760px,calc(100vh - 34px));overflow:auto;padding:18px;border:1px solid #343e44;border-radius:18px;background:#0b0f11;color:#f2f4f5;box-shadow:0 28px 100px #000e}.xfi-history-filter-sheet header{display:grid;grid-template-columns:42px 1fr 42px;align-items:center;margin-bottom:18px}.xfi-history-filter-sheet header button{width:40px;height:40px;border:1px solid #313b40;border-radius:50%;background:#171d20;color:#fff;font-size:30px;line-height:1;cursor:pointer}.xfi-history-filter-sheet h2{margin:0;text-align:center;font-size:20px}.xfi-history-symbol-filter{display:flex;align-items:center;justify-content:space-between;gap:14px;height:58px;padding:0 16px;margin-bottom:16px;border:1px solid #2f383e;border-radius:14px;background:#171c1f;color:#f1f3f4}.xfi-history-symbol-filter select{max-width:60%;border:0;background:transparent;color:#969da2;text-align:right;font:inherit;outline:0;color-scheme:dark}.xfi-history-period-list{overflow:hidden;border:1px solid #2f383e;border-radius:16px;background:#171c1f}.xfi-history-period-list button{display:flex;align-items:center;justify-content:space-between;width:100%;height:55px;padding:0 16px;border:0;border-bottom:1px solid #30383d;background:transparent;color:#f4f5f6;text-align:left;font:500 15px system-ui;cursor:pointer}.xfi-history-period-list button:last-child{border-bottom:0}.xfi-history-period-list i{visibility:hidden;color:#45a5ff;font-size:20px;font-style:normal}.xfi-history-period-list button.active i{visibility:visible}.xfi-history-custom-range{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:14px 0}.xfi-history-custom-range label{display:flex;flex-direction:column;gap:5px;color:#849097;font-size:10px;text-transform:uppercase}.xfi-history-custom-range input{height:42px;padding:0 10px;border:1px solid #303b40;border-radius:9px;background:#13191c;color:#eef2f3;color-scheme:dark}.xfi-history-apply{width:100%;height:44px;margin-top:14px;border:1px solid #a87c3d;border-radius:10px;background:#2a1f12;color:#f0c477;font-weight:800;cursor:pointer}.xfi-history-report{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:66px;margin-top:16px;padding:10px 16px;border:1px solid #2f383e;border-radius:14px;background:#171c1f;color:#f4f5f6;text-align:left;cursor:pointer}.xfi-history-report span{display:flex;flex-direction:column;gap:4px;font-size:14px}.xfi-history-report small{color:#929ba0;font-size:11px}.xfi-history-report b{color:#747f84;font-size:28px;font-weight:400}

@media(max-width:760px){
 body.mobile-view-history .terminal-history{position:relative!important;padding-top:0!important;background:#000!important}
 body.mobile-view-history .mobile-history-filters{margin:0 86px 22px 18px!important}
 body.mobile-view-history .xfi-history-toolbar{position:absolute;top:0;right:18px;width:56px;height:56px;padding:0;border:0;background:transparent}
 body.mobile-view-history .xfi-history-toolbar>div{display:none!important}
 body.mobile-view-history .xfi-history-toolbar button{width:56px;height:56px;border-color:#3a3a3d;background:#242426;font-size:25px}
 body.mobile-view-history .xfi-history-range{padding:0 20px 118px!important;border:0!important;background:#000!important}
 body.mobile-view-history .xfi-history-range-head{display:none!important}
 body.mobile-view-history .xfi-history-range-list .xfi-history-range-row{padding:13px 0!important;border-bottom:1px solid #262628!important;background:#000!important}
 body.mobile-view-history .xfi-history-deal-top strong{font-size:clamp(16px,4.4vw,20px)}
 body.mobile-view-history .xfi-history-deal-top b{font-size:clamp(16px,4.4vw,20px)}
 body.mobile-view-history .xfi-history-deal-bottom{font-size:clamp(12px,3.4vw,15px);color:#a8a8ad}
 body.mobile-view-history .xfi-history-statement{display:block;margin:16px 0 0;border:0;border-radius:0;background:#000}
 body.mobile-view-history .xfi-history-statement>div{flex-direction:row;align-items:center;justify-content:space-between;padding:4px 0;background:#000}
 body.mobile-view-history .xfi-history-statement span{color:#f2f2f3;font-size:clamp(14px,4vw,18px);text-transform:none;letter-spacing:0}
 body.mobile-view-history .xfi-history-statement b{font-size:clamp(14px,4vw,18px);font-weight:500}
 body.mobile-view-history .xfi-history-counts{justify-content:space-between;padding:14px 0 0;border-top:1px solid #252527;margin-top:10px;font-size:11px}
 .xfi-history-filter-sheet>section{inset:0;transform:none;width:auto;max-height:none;padding:calc(18px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));border:0;border-radius:0;background:#000}
 .xfi-history-filter-backdrop{display:none}
 .xfi-history-filter-sheet header{margin:0 0 28px}.xfi-history-filter-sheet h2{font-size:21px}.xfi-history-filter-sheet header button{background:#242426;border-color:#343438}
 .xfi-history-symbol-filter{height:66px;border:0;border-radius:30px;background:#1d1d1f;font-size:18px}.xfi-history-symbol-filter select{font-size:17px}
 .xfi-history-period-list{border:0;border-radius:24px;background:#1d1d1f}.xfi-history-period-list button{height:66px;padding:0 20px;border-bottom-color:#38383b;font-size:18px}
 .xfi-history-custom-range{grid-template-columns:1fr;margin:15px 0}.xfi-history-custom-range input{height:50px;border-color:#38383b;background:#1d1d1f;font-size:16px}
 .xfi-history-apply{height:52px;border-radius:14px;font-size:16px}
 .xfi-history-report{min-height:78px;margin-top:26px;border:0;border-radius:24px;background:#1d1d1f}.xfi-history-report span{font-size:18px}.xfi-history-report small{font-size:14px}
}
.terminal-history>.history-head,.terminal-history>#demo-history,.terminal-history>#demo-history-empty,.terminal-history>#mobile-history-summary{display:none!important}

/* v0.5.36: deal rows must flow naturally, not be clipped to .demo-rows 170px. */
body.terminal-body #xfi-history-range-list.demo-rows{display:block!important;flex:0 0 auto!important;max-height:none!important;min-height:0!important;height:auto!important;overflow:visible!important;overscroll-behavior:auto!important;}
.xfi-history-list-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 4px;color:#8b979b;font-size:12px;}
#xfi-history-load-more{border:1px solid #8f6b33;border-radius:8px;color:#f5ce87;background:#22190e;padding:10px 15px;font-weight:700;cursor:pointer;}
#xfi-history-load-more[hidden]{display:none!important;}
body.mobile-view-history #xfi-history-range-list.demo-rows{width:100%!important;overflow:visible!important;}
body.mobile-view-history .xfi-history-list-footer{padding:15px 0;}

/* 0.5.42: expandable deal details, tap again to collapse; no modal or route change */
.xfi-history-range-list .xfi-history-range-row{display:block!important;min-width:0}
.xfi-history-deal-toggle{position:relative;display:block;width:100%;padding:0 19px 0 0;margin:0;text-align:left;border:0;background:transparent;color:inherit;font:inherit;cursor:pointer;touch-action:manipulation}
.xfi-history-deal-toggle:focus-visible{outline:2px solid #d7a955;outline-offset:4px;border-radius:4px}
.xfi-history-deal-toggle .xfi-history-deal-top,.xfi-history-deal-toggle .xfi-history-deal-bottom{min-width:0}
.xfi-history-deal-expand-hint{position:absolute;right:0;top:50%;transform:translateY(-50%);font-size:17px;color:#7f8b91;transition:transform .18s ease}
.xfi-history-range-row.expanded .xfi-history-deal-expand-hint{transform:translateY(-50%) rotate(180deg);color:#dcb775}
.xfi-history-deal-details[hidden]{display:none!important}
.xfi-history-deal-details{padding:12px 13px 12px;margin:12px 0 0;border:1px solid #283137;border-radius:12px;background:#121719;color:#e6ebed}
.xfi-history-deal-details-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 18px;margin:0}
.xfi-history-deal-details-grid>div{display:flex;align-items:baseline;justify-content:space-between;gap:8px;padding:8px 0;border-bottom:1px solid #273136;min-width:0}
.xfi-history-deal-details-grid dt{font-size:11px;color:#8d9a9e;flex-shrink:0}
.xfi-history-deal-details-grid dd{font-size:12px;font-variant-numeric:tabular-nums;font-weight:600;text-align:right;margin:0;overflow-wrap:anywhere}
.xfi-history-deal-details-note{color:#7f8c90;font-size:10px;line-height:1.5;margin:12px 0 0}
@media(max-width:760px){
 body.mobile-view-history .xfi-history-deal-details{padding:10px 12px;margin-top:12px;background:#151517;border-color:#353537}
 body.mobile-view-history .xfi-history-deal-details-grid{grid-template-columns:1fr;gap:0}
 body.mobile-view-history .xfi-history-deal-details-grid>div{padding:9px 0;border-bottom-color:#303034}
 body.mobile-view-history .xfi-history-deal-details-grid dt{font-size:13px}
 body.mobile-view-history .xfi-history-deal-details-grid dd{font-size:13px}
 body.mobile-view-history .xfi-history-deal-details-note{font-size:11px}
}
