:root{color-scheme:light;font:16px/1.55 'Segoe UI',sans-serif;--bg:#f5f1ed;--surface:#fffdfb;--soft:#eee8f4;--input:#faf7fc;--text:#333b50;--muted:#666b7c;--border:#d9d4e2;--accent:#72519a;--accent-hover:#5d3b85;--on-accent:#fff;--positive:#16714f;--negative:#aa3348;--danger:#fae5e8;--link:#624087;--shadow:0 8px 30px #51426608;--stripe:#f7f3fa;background:var(--bg);color:var(--text)}
:root[data-theme=dark]{color-scheme:dark;--bg:#141824;--surface:#1b202d;--soft:#2b2d40;--input:#242a3a;--text:#e9eaf3;--muted:#b1b6ca;--border:#3b4055;--accent:#c5a6e6;--accent-hover:#d8bdf2;--on-accent:#272035;--positive:#7fddba;--negative:#ffa6b3;--danger:#452a39;--link:#d2b8ed;--shadow:0 8px 30px #00000015;--stripe:#202535}
*{box-sizing:border-box}body{margin:0}main{max-width:1460px;margin:auto;padding:28px}header,nav,.controls,.card-title,.brand,.header-actions{display:flex;align-items:center;gap:16px;flex-wrap:wrap}header{justify-content:space-between;padding:18px 0 24px;border-bottom:1px solid var(--border);margin-bottom:24px}.brand{flex-wrap:nowrap;gap:22px}.header-actions{gap:14px}.header-actions form{margin:0}.header-mascots{width:122px;height:78px;object-fit:contain;flex-shrink:0}h1{font-size:30px;letter-spacing:-.7px;margin:0;font-weight:700}h2{font-size:23px;margin:0;letter-spacing:-.4px}p{margin:12px 0}.brand p{margin:4px 0}.eyebrow{font-size:12px;letter-spacing:1.8px;color:var(--muted);font-weight:600}
button,input,select{font:inherit;border-radius:11px;border:1px solid var(--border);padding:10px 15px;background:var(--input);color:var(--text)}button{cursor:pointer;font-weight:600;transition:background .15s,border-color .15s}button:hover{border-color:var(--accent);background:var(--soft)}button:disabled{opacity:.45;cursor:default}button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid var(--accent);outline-offset:3px}.primary,nav .selected{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}.primary:hover,nav .selected:hover{background:var(--accent-hover);color:var(--on-accent)}.danger{background:var(--danger);color:var(--negative)}a{color:var(--link);text-underline-offset:4px}
.intro,.operation,.card,.auth{background:var(--surface);border:1px solid var(--border);border-radius:20px;padding:22px;margin:20px 0;box-shadow:var(--shadow)}.intro summary{cursor:pointer;font-weight:600}.intro{border-left:4px solid var(--accent)}.muted,.note{color:var(--muted);font-size:14px}.error,#message{color:var(--negative);white-space:pre-wrap}.positive{color:var(--positive)}.negative{color:var(--negative)}label{display:flex;gap:8px;align-items:center}.card{padding:20px 12px;margin:26px 0}.card-title{padding:0 12px;justify-content:space-between}.chart{height:760px;min-height:760px;width:100%;background:var(--surface);border-radius:12px;overflow:hidden}.controls{padding:12px}.controls input{width:125px;font-variant-numeric:tabular-nums}.note{padding:0 12px}.badge{font-size:14px;color:var(--link);background:var(--soft);padding:5px 12px;border-radius:20px;font-variant-numeric:tabular-nums}.operation:empty{display:none}nav{gap:10px;margin:16px 0}
.theme-switch{display:inline-flex;gap:2px;padding:3px;border:1px solid var(--border);background:var(--surface);border-radius:11px;align-items:center}.theme-switch button{border:0;background:transparent;border-radius:8px;font-size:15px;line-height:1;width:30px;height:30px;padding:0;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;box-sizing:border-box}.theme-switch button[aria-pressed=true]{background:var(--soft);color:var(--link)}
.auth-page{min-height:100vh;background:radial-gradient(ellipse at 15% 10%,var(--soft),transparent 50%),var(--bg)}.auth-toolbar{display:flex;justify-content:flex-end;max-width:1460px;margin:auto;padding:24px 28px 0}.auth{max-width:470px;margin:32px auto 70px;padding:30px 36px}.auth-mascots{width:200px;height:110px;display:block;margin:0 auto 18px}.auth h1{font-size:30px}.auth label{display:block;margin:18px 0;font-weight:600;font-size:14px}.auth input,.auth select{display:block;width:100%;margin-top:7px;font-weight:400}.auth form>.primary{width:100%;margin:12px 0 22px}.auth>a{font-size:14px}.auth .eyebrow{margin:0 0 8px}
.history-table{overflow:auto;max-height:680px;border:1px solid var(--border);border-radius:14px;margin:16px 0;background:var(--surface)}.history-table table{border-collapse:collapse;width:100%;font-size:14px;white-space:nowrap;font-variant-numeric:tabular-nums}.history-table th,.history-table td{padding:12px 14px;text-align:left;border-bottom:1px solid var(--border)}.history-table th{position:sticky;top:0;background:var(--soft);color:var(--text);z-index:1;font-weight:600}.history-table tr:nth-child(even){background:var(--stripe)}.history-table tbody tr:hover{background:var(--soft)}[hidden]{display:none!important}
@media(max-width:650px){main{padding:12px}header{padding-top:10px;gap:18px}.brand{gap:12px}.header-mascots{width:74px;height:58px}.header-actions{width:100%;justify-content:space-between}.intro{padding:16px}.chart{height:600px;min-height:600px}h1{font-size:24px}h2{font-size:20px}.auth{margin:24px 16px;padding:26px;max-width:none}.auth-toolbar{padding:16px 16px 0}.card-title{gap:8px}.controls{gap:10px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
.alerts{display:grid;gap:10px;margin:0 0 22px}.alert{display:flex;gap:12px;align-items:flex-start;padding:16px 18px;border:1px solid var(--border);border-left-width:5px;border-radius:14px;background:var(--surface);color:var(--text);overflow-wrap:anywhere}.alert-error{border-color:var(--negative);background:var(--danger)}.alert-warning{border-left-color:#c08a27}.alert-info{border-left-color:var(--accent)}.alert-icon{display:grid;place-items:center;flex:0 0 26px;width:26px;height:26px;border:1px solid currentColor;border-radius:50%;font-weight:700;color:var(--link)}.alert-error .alert-icon{color:var(--negative)}.alert-warning .alert-icon{color:#b48222}.alert>div{flex:1;min-width:0}.alert strong{font-size:15px}.alert p{font-size:14px;white-space:pre-wrap;margin:4px 0 0}.alert>button{flex:0 0 auto;border:0;background:transparent;padding:0 7px;line-height:28px;font-size:24px;color:var(--muted)}.alert>button:hover{color:var(--text);background:var(--soft)}
.account-toolbar{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:0 0 22px}.account-toolbar select{max-width:min(440px,70vw)}.gear-button{font-size:24px;padding:5px 13px}.settings-dialog{width:min(600px,calc(100% - 28px));max-height:88vh;overflow:auto;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:20px;padding:24px;box-shadow:0 20px 70px #0005}.settings-dialog::backdrop{background:#080c1980}.settings-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.settings-heading button{font-size:24px;padding:0 10px}.settings-dialog h3{font-size:17px;margin:16px 0 8px}.settings-dialog label{display:block;font-size:14px;margin:14px 0}.settings-dialog input,.settings-dialog select{display:block;width:100%;margin-top:5px}.settings-dialog details{border-top:1px solid var(--border);margin-top:24px;padding-top:18px}.settings-dialog summary{cursor:pointer;font-weight:600}.settings-dialog form>button{margin-top:8px}.settings-dialog #settings-message:empty{display:none}

.sound-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:8px 0 4px}.sound-bar button{margin:0}.sound-bar #sound-toggle[aria-pressed=true]{border-color:var(--accent);color:var(--accent)}
.badge.proximity{background:var(--soft);color:var(--accent);border:1px solid var(--accent)}
.card.near-entry{box-shadow:0 0 0 2px var(--accent),var(--shadow)}.card.at-entry{box-shadow:0 0 0 3px var(--positive),var(--shadow)}.card.at-entry .badge.proximity{color:var(--positive);border-color:var(--positive)}

/* Trading workspace: controls above, one asset beside its selector. */
.opportunity-stats{flex:0 0 auto;border:0;padding:0 0 0 12px;border-left:1px solid var(--border)}.opportunity-metrics{display:flex;align-items:center;gap:14px;white-space:nowrap;margin:0;font-variant-numeric:tabular-nums}.opportunity-metrics dt{font-size:11px;color:var(--muted)}.opportunity-metrics dd{margin:0;font-size:12px;font-weight:600}.opportunity-source{font-size:10px;color:var(--muted);margin:4px 0 0;line-height:1.4}
@media(max-width:760px){.opportunity-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.opportunity-metrics dd{font-size:12px}}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.history-chart-button{font-size:12px;padding:6px 10px;white-space:nowrap;color:var(--link);border-color:var(--accent)}#history-view .history-table td:first-child{position:sticky;left:0;z-index:1;background:var(--surface)}#history-view .history-table th:first-child{left:0;z-index:3}
.history-clickable{cursor:pointer}.history-clickable:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.history-chart-hint{font-size:12px;color:var(--muted);margin:4px 0}.history-chart-dialog{width:min(1400px,calc(100vw - 24px));height:min(900px,calc(100dvh - 24px));max-width:none;max-height:none;border:1px solid var(--border);border-radius:14px;background:var(--surface);color:var(--text);padding:14px;overflow:hidden}.history-chart-dialog[open]{display:flex;flex-direction:column;gap:6px}.history-chart-dialog::backdrop{background:#080c19b3}.history-chart-top{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.history-chart-top h2{font-size:18px;margin:0}.history-chart-top strong{margin-left:auto;font-size:14px}.history-chart-top button{padding:0 10px;font-size:25px}.history-chart-dialog p{font-size:11px;color:var(--muted);margin:2px 0}#history-chart-host{flex:1;min-height:0;min-width:0}.history-detail-chart{height:100%;width:100%;min-height:200px}@media(max-width:760px){.history-chart-dialog{width:calc(100vw - 8px);height:calc(100dvh - 8px);padding:6px}.history-chart-top{gap:6px}.history-chart-top h2{font-size:15px}.history-chart-top strong{font-size:12px}.history-chart-top button{padding:0 7px}}
.trading-page #best-view{display:flex;flex-direction:column;min-height:0;flex:1;gap:6px;overflow:hidden}.best-workspace{display:grid;grid-template-columns:155px minmax(0,1fr);gap:10px;flex:1;min-height:0}#best-tabs{display:flex;flex-direction:column;gap:8px;margin-top:9px}#best-tabs .asset-button span,#best-tabs .asset-button small{display:block}#best-tabs .asset-button small{font-size:10px;opacity:.8;margin-top:4px}#best-tabs .selected{background:var(--accent);color:var(--on-accent)}#best-cards{display:flex;min-width:0;min-height:0}.best-card-summary{flex:0 0 auto;border-top:1px solid var(--border);padding-top:6px}.best-heading,.best-card-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.best-heading h2{font-size:20px}.best-heading button{font-size:12px;padding:6px 12px}.best-card{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;border:1px solid var(--border);border-radius:14px;background:var(--surface);padding:10px;margin:0}.best-card-heading h3{font-size:16px;margin:0}.best-detail{font-size:11px;color:var(--muted);margin:5px 0}.best-chart{height:auto;flex:1;min-height:240px;width:100%;min-width:0}#best-status{font-size:12px;margin:6px 0}
@media(max-width:760px){.trading-page:has(#best-view:not([hidden])) main{height:100dvh;min-height:660px}.best-workspace{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr)}#best-tabs{flex-direction:row;overflow-x:auto;margin:0;gap:6px}#best-tabs .asset-button{min-width:145px}.best-chart{height:auto;flex:1;min-height:240px}.best-card{padding:4px}.best-card-heading h3{font-size:14px}.best-card-heading strong{font-size:13px}}
.trading-page main{max-width:1920px;height:100dvh;min-height:660px;padding:8px 18px;display:flex;flex-direction:column;gap:6px}
.trading-page .app-header{flex:0 0 auto;padding:4px 0 10px;margin:0;gap:12px;flex-wrap:wrap}
.app-header .brand{gap:8px;flex-shrink:0}.app-header .header-mascots{width:56px;height:42px}.app-header h1{font-size:19px;letter-spacing:-.4px}.app-header .brand p{font-size:12px;line-height:1.2;margin:0;color:var(--muted)}
.app-header .account-toolbar{margin:0;gap:8px;flex-wrap:nowrap;display:inline-flex;align-items:center}.app-header .account-toolbar label{font-size:13px;margin:0}
.app-header button,.app-header select{height:34px;box-sizing:border-box;font-size:13px;padding:0 12px;border-radius:9px;display:inline-flex;align-items:center;justify-content:center;line-height:1;font-weight:600}
.app-header select{font-weight:400;width:200px;max-width:24vw;padding:0 10px}
.app-header .section-tabs{margin:0;gap:6px;display:inline-flex;align-items:center}
.app-header .header-actions{gap:6px;margin-left:auto;width:auto;display:inline-flex;align-items:center}
.app-header .header-actions form{margin:0;display:inline-flex}
.app-header .gear-button,.app-header .icon-button{width:34px;height:34px;min-width:34px;max-width:34px;padding:0;margin:0;display:inline-flex;align-items:center;justify-content:center;line-height:1}
.app-header .gear-button{font-size:16px}
.app-header .icon-button{font-family:Georgia,serif;font-style:italic;font-weight:bold;font-size:15px!important}
.app-header .theme-switch{height:34px;box-sizing:border-box;padding:2px;gap:2px;border-radius:10px;display:inline-flex;align-items:center}
.app-header .theme-switch button{width:28px;height:28px;min-width:28px;max-width:28px;padding:0;margin:0;font-size:14px;line-height:1;border-radius:7px;display:inline-flex;align-items:center;justify-content:center;border:0}
.trading-page #trading-view{display:flex;flex-direction:column;flex:1;min-height:0;gap:5px}.trading-page .operation-strip{display:grid;grid-template-columns:minmax(0,1fr) clamp(110px,14vw,190px);align-items:center;gap:12px;flex:0 0 auto;padding:4px 12px;border:1px solid var(--border);border-radius:13px;background:color-mix(in srgb,var(--surface) 45%,transparent);box-shadow:var(--shadow)}
.trading-page .operation{padding:10px 12px;margin:0;border-radius:13px;min-width:0;font-size:13px}.operation-heading{display:flex;gap:8px;align-items:center;flex-wrap:nowrap;flex:0 0 auto;white-space:nowrap}.operation-heading b{font-size:15px}.operation-heading .badge{font-size:11px;padding:2px 8px}.operation-heading button{margin-left:auto;font-size:12px;padding:4px 9px}.operation-metrics{display:flex;align-items:center;gap:14px;margin:0;font-variant-numeric:tabular-nums;flex:0 0 auto}.operation-metrics div{display:flex;align-items:baseline;gap:5px;white-space:nowrap;min-width:0}.operation-metrics dt{font-size:11px;color:var(--muted)}.operation-metrics dd{margin:0;font-size:13px}.operation .operation-idle{margin:3px 0;font-size:12px;color:var(--muted)}
.trading-page .operation-strip .operation{display:flex;align-items:center;gap:16px;overflow-x:auto;padding:2px 0;border:0;box-shadow:none;background:transparent;scrollbar-width:thin}.trading-page .operation-strip .chibi-jar{--s:.85;--pot-right:4px;min-width:0;width:100%;margin:0;height:56px;min-height:0;border:0;border-left:1px solid var(--border);border-radius:0;background:transparent;box-shadow:none}
.trade-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;flex:0 0 auto}.trade-toolbar nav{margin:0;gap:5px}.trade-toolbar button{height:32px;box-sizing:border-box;padding:0 12px;font-size:13px;font-weight:600;border-radius:9px;display:inline-flex;align-items:center;justify-content:center;line-height:1}.trade-toolbar #risk-summary{font-size:12px;margin:0}.trade-toolbar .sound-bar{margin:0 0 0 auto;gap:6px}.trading-page #status{margin:0;font-size:11px;flex:0 0 auto}
.chart-workspace{display:grid;grid-template-columns:132px minmax(0,1fr);gap:10px;flex:1;min-height:0}.asset-sidebar{border:1px solid var(--border);border-radius:14px;background:color-mix(in srgb,var(--surface) 45%,transparent);padding:10px;overflow:auto}.sidebar-label{font-size:11px;letter-spacing:1px;text-transform:uppercase;color:var(--muted)}#asset-tabs{display:flex;flex-direction:column;gap:8px;margin-top:9px}.asset-button{width:100%;min-width:0;text-align:left;padding:10px 8px;font-size:12px;border-radius:10px;overflow-wrap:anywhere}.asset-button[aria-selected=true]{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}.asset-button.near-entry{box-shadow:inset 3px 0 var(--accent)}.asset-button.at-entry{box-shadow:inset 4px 0 var(--positive)}
.trading-page #charts{min-width:0;min-height:0;height:100%;display:flex}.trading-page .card{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;margin:0;padding:10px;border-radius:14px;gap:5px}.trading-page .card-title{padding:0 3px;gap:8px}.trading-page .card-title h2{font-size:19px}.trading-page .card-title .badge{font-size:12px;padding:3px 8px}.trading-page .card .note{margin:0;padding:0 3px;font-size:12px}.trading-page .chart{height:auto;min-height:240px;flex:1}.trading-page .card .controls{padding:3px 0 0;gap:8px}.trading-page .card .controls button{padding:7px 12px;font-size:13px}
.card-footer{display:flex;align-items:center;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin;gap:10px 16px;flex:0 0 auto;border-top:1px solid var(--border);padding-top:6px}.trading-page .card-footer .controls{padding:0;flex:0 0 auto}.card-summary{flex:1 0 280px;min-width:280px}.trading-page .card-summary .card-title{justify-content:flex-start;padding:0;gap:7px}.trading-page .card-summary .card-title h2{font-size:15px}.trading-page .card-summary .card-title .badge{font-size:11px;padding:2px 7px}.trading-page .card-summary .note{padding:0;font-size:11px;margin-top:3px}
.trading-page .alerts{margin:0;max-height:22vh;overflow:auto;flex:0 0 auto;gap:6px}.trading-page .alert{padding:8px 12px;gap:8px}.trading-page .alert p{margin:0;font-size:12px}.trading-page .alert strong{font-size:13px}
.trading-page #history-view{min-height:0;flex:1;overflow:auto}.trading-page #history-view>h2{font-size:20px}.trading-page .history-table{max-height:calc(100dvh - 290px)}.info-dialog{width:min(720px,calc(100% - 28px))}.info-dialog p{font-size:14px}
@media(max-width:1100px){.app-header .account-toolbar select{width:170px}.app-header .brand img{display:none}.operation-metrics{gap:6px}.operation-heading b{font-size:14px}}
@media(max-width:760px){
    .trading-page main{height:auto;min-height:100dvh;padding:10px 4px;gap:8px}.trading-page .card{padding:4px}.trading-page .app-header{gap:8px}.app-header .brand{order:0}.app-header .header-actions{order:1}.app-header .account-toolbar{order:2;flex:1}.app-header .account-toolbar select{max-width:none;width:160px;flex:1;min-width:0}.app-header .section-tabs{order:3}.app-header button,.app-header select{height:32px;font-size:12px;padding:0 9px}.app-header .gear-button,.app-header .icon-button{width:32px;height:32px;min-width:32px;max-width:32px}.app-header .theme-switch{height:32px;padding:2px}.app-header .theme-switch button{width:26px;height:26px;min-width:26px;max-width:26px;font-size:13px}.app-header .brand h1{font-size:16px}
    .trading-page .operation-strip{min-height:0}.trading-page .operation-strip{grid-template-columns:minmax(0,1fr) 100px;gap:8px;padding:4px 8px}.trading-page .operation-strip .chibi-jar{--s:.65;--pot-right:4px;height:44px;min-height:0}.operation-metrics{gap:10px}.operation-heading{gap:5px}.operation-heading b{font-size:12px}.operation-heading strong{font-size:12px}.trade-toolbar{gap:7px}.trade-toolbar .sound-bar{margin-left:0}.trade-toolbar #risk-summary{font-size:11px}.chart-workspace{grid-template-columns:minmax(0,1fr)}.asset-sidebar{padding:6px;overflow:hidden}.sidebar-label{display:none}#asset-tabs{flex-direction:row;overflow-x:auto;margin:0;gap:5px}.asset-button{flex:0 0 auto;width:auto;min-width:85px;font-size:11px;padding:6px 9px}.trading-page .chart{height:62dvh;min-height:380px;flex:none}.trading-page .card-title h2{font-size:17px}.trading-page .card-title .badge{font-size:10px}.trading-page .card .controls{flex-wrap:wrap}.trading-page .card .controls button{font-size:12px;padding:7px 9px}
}

.history-duration-reference{margin:0 0 6px;font-size:.8rem;line-height:1.4}
.history-duration-reference:empty{display:none}
.trend-row{display:flex;align-items:center;gap:6px;flex:0 0 auto;padding:0 12px;border-left:1px solid var(--border);white-space:nowrap}.trend-row[hidden]{display:none}.trend-label{font-size:11px;color:var(--muted);margin-right:2px}.trend-chip{display:inline-flex;align-items:center;gap:4px;padding:2px 8px 2px 3px;border-radius:999px;border:1.5px solid var(--chibi-outline,var(--border));background:var(--soft);font-size:11px;line-height:1.3;font-variant-numeric:tabular-nums}.trend-chip b{font-weight:600}.trend-arrow{display:inline-grid;place-items:center;width:18px;height:18px;border-radius:50%;font-style:normal;font-size:9px;color:var(--on-accent,#fff);background:var(--muted)}.trend-chip.up .trend-arrow{background:var(--positive);animation:trend-bob 3.2s ease-in-out infinite}.trend-chip.down .trend-arrow{background:var(--negative);animation:trend-bob 3.2s ease-in-out infinite reverse}.trend-chip.up{border-color:var(--positive)}.trend-chip.down{border-color:var(--negative)}@keyframes trend-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-1px)}}@media (prefers-reduced-motion:reduce){.trend-chip .trend-arrow{animation:none!important}}@media (max-width:760px){.trend-row{border-left:0;padding:0;flex-wrap:wrap;white-space:normal}}

.card-footer{flex-wrap:wrap;overflow-x:visible}
.trend-row{display:grid;grid-template-columns:repeat(2,max-content);gap:4px 6px}
.card-footer .opportunity-stats{flex:0 1 auto;min-width:0}
.card-footer .opportunity-metrics{flex-wrap:wrap;white-space:normal}
@media(max-width:760px){.card-footer{gap:8px}.card-summary{flex-basis:100%;min-width:0}.card-footer .opportunity-stats{border-left:0;padding-left:0;max-width:100%}.card-footer .opportunity-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.trend-row{display:flex;padding:0;border-left:0}}

.history-trend .trend-row{padding:0;border:0;min-width:130px;display:grid;grid-template-columns:repeat(2,max-content)}
.history-trend .trend-arrow{animation:none!important}

.history-chart-trend-host{display:flex;align-items:center;gap:8px;font-size:11px;margin:0 0 6px;flex-wrap:wrap}
.history-chart-trend-host:empty{display:none}
.history-chart-trend-host .trend-row{display:flex;border:0;padding:0;white-space:normal;flex-wrap:wrap}
.history-chart-trend-host .trend-arrow{animation:none!important}

/* Compact history: preserve numeric precision and put headings on two lines. */
#history-view .history-table table{font-size:14px;line-height:1.3}
#history-view .history-table th,#history-view .history-table td{padding:7px 4px;vertical-align:middle}
#history-view .history-table th{font-size:13px;line-height:1.15;white-space:normal}
#history-view .history-table td:nth-child(2),#history-view .history-table td:nth-child(3){white-space:normal;min-width:95px;max-width:105px}
#history-view .history-chart-button{font-size:13px;padding:4px 5px}
#history-view .history-trend .trend-row{min-width:112px;gap:3px 4px}
#history-view .history-trend .trend-chip{font-size:12px;gap:2px;padding:1px 4px 1px 2px}
#history-view .history-trend .trend-arrow{width:16px;height:16px;font-size:9px}

#history-view .history-table td:nth-child(6),#history-view .history-table td:nth-child(7),#history-view .history-table td:nth-child(8),#history-view .history-table td:nth-child(13),#history-view .history-table td:nth-child(18){white-space:normal}
#history-view .history-table td:nth-child(7){max-width:100px}
#history-view .history-table td:nth-child(8){max-width:110px}
#history-view .history-table td:nth-child(18){max-width:110px}

#history-chart-refresh{font-size:12px;padding:5px 8px;line-height:1.2}

.history-summary{--chibi-fur:#efbc95;--chibi-belly:#fff4df;--chibi-ear-inner:#eaa4ae;--chibi-outline:#655472;--chibi-blush:#ed96aa;margin-left:auto;display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;padding:5px 12px 5px 6px;border:2px solid var(--chibi-outline);border-radius:18px;background:linear-gradient(180deg,var(--surface),var(--stripe));box-shadow:var(--shadow)}
:root[data-theme=dark] .history-summary{--chibi-fur:#d9b8e6;--chibi-belly:#f5ecfa;--chibi-ear-inner:#e7a5bc;--chibi-outline:#8a79a3;--chibi-blush:#f09cb0}
.hs-item{display:flex;align-items:center;gap:5px;min-width:0}.hs-item+.hs-item{padding-left:10px;border-left:1.5px dashed var(--border)}
.hs-item>div{display:flex;flex-direction:column;line-height:1.15}.hs-label{font-size:10px;color:var(--muted);letter-spacing:.02em}.hs-value{font-size:14px;font-variant-numeric:tabular-nums;white-space:nowrap}.hs-value.up{color:var(--positive)}.hs-value.down{color:var(--negative)}
.hs-face{width:34px;height:34px;flex:0 0 auto;animation:hs-bob 5s ease-in-out infinite}.hs-item:nth-child(2) .hs-face{animation-delay:-2.5s}
.hs-fur *,.hs-fur{fill:var(--chibi-fur);stroke:var(--chibi-outline);stroke-width:2;stroke-linejoin:round}.hs-inner{fill:var(--chibi-ear-inner);stroke:none}.hs-belly{fill:var(--chibi-belly);stroke:none}.hs-blush{fill:var(--chibi-blush);opacity:.7;stroke:none}
.hs-line{fill:none;stroke:var(--chibi-outline);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.hs-line .dot{fill:var(--chibi-outline);stroke:none}.hs-line .nose{fill:var(--chibi-outline)}.hs-line .tear{fill:#63b3ed;stroke:none}
.hs-item .m-up,.hs-item .m-flat,.hs-item .m-down{display:none}.hs-item[data-mood=up] .m-up,.hs-item[data-mood=flat] .m-flat,.hs-item[data-mood=down] .m-down{display:inline}
@keyframes hs-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-1px)}}@media (prefers-reduced-motion:reduce){.hs-face{animation:none}}
@media (max-width:760px){.history-summary{margin-left:0;width:100%;padding:6px 10px}.hs-item+.hs-item{padding-left:8px}.hs-face{width:32px;height:32px}.hs-value{font-size:13px}}
.hs-coin{width:26px;height:26px;flex:0 0 auto}.hs-coin .coin-edge{fill:#f6c445;stroke:var(--chibi-outline);stroke-width:2.5}.hs-coin .coin-face{fill:#ffe07d;stroke:#b7791f;stroke-width:1.5}.hs-coin .coin-mark{fill:none;stroke:#b7791f;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}

.btc-dialog{width:min(1800px,calc(100vw - 20px));height:calc(100dvh - 20px);max-width:none;max-height:none;padding:10px;border:1px solid var(--border);border-radius:14px;background:var(--surface);color:var(--text);overflow:hidden}
.btc-dialog[open]{display:flex;flex-direction:column;gap:7px}.btc-dialog::backdrop{background:#080c19bd}
.btc-heading{display:flex;align-items:center;gap:10px;flex:0 0 auto}.btc-heading>div{margin-right:auto;min-width:0}.btc-heading h2{margin:0;font-size:19px}.btc-heading p{margin:0;color:var(--muted);font-size:11px}.btc-heading button{padding:5px 10px;font-size:12px}.btc-heading #btc-close{font-size:24px;padding:0 9px}
.btc-status{margin:0;font-size:11px;color:var(--muted);flex:0 0 auto}
.btc-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:8px;flex:1;min-height:0;min-width:0}
.btc-card{display:flex;flex-direction:column;min-height:0;min-width:0;border:1px solid var(--border);border-radius:10px;padding:6px;background:var(--surface);overflow:hidden}.btc-card-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:0 0 auto}.btc-card h3{font-size:15px;margin:0}.btc-card strong{font-size:12px;font-variant-numeric:tabular-nums}.btc-chart{flex:1;min-width:0;min-height:180px}.btc-card-status{margin:0;font-size:11px;color:var(--muted);line-height:1.3;flex:0 0 auto}
@media(max-width:760px){.btc-dialog{width:calc(100vw - 8px);height:calc(100dvh - 8px);padding:6px}.btc-grid{grid-template-columns:minmax(0,1fr);grid-template-rows:none;grid-auto-rows:minmax(360px,50dvh);overflow-y:auto}.btc-heading h2{font-size:16px}.btc-heading{gap:6px}.btc-card-status{font-size:11px}}

/* BTC structure chips stay in the heading, outside the candle plot. */
.btc-card-heading{flex-wrap:wrap;column-gap:8px;row-gap:2px}.btc-card-heading>strong{margin-left:auto}
.btc-trend{display:inline-flex;align-items:center;gap:5px;border:1px solid currentColor;border-radius:20px;padding:1px 9px 1px 4px;font-size:13px;font-weight:700;line-height:1.2;white-space:nowrap}
.btc-trend-cat{display:inline-flex;width:29px;height:27px}.btc-trend-cat svg{width:100%;height:100%}
.btc-trend-up{color:#14795a;background:#28b88a18}.btc-trend-down{color:#b53656;background:#e16b7d18}.btc-trend-flat{color:#865a12;background:#f5a74218}.btc-trend-unknown{color:var(--muted)}
[data-theme="dark"] .btc-trend-up{color:#64dfb7}[data-theme="dark"] .btc-trend-down{color:#ff9eae}[data-theme="dark"] .btc-trend-flat{color:#f6ce7d}
@media(max-width:760px){.btc-trend{font-size:12px;padding-right:6px}.btc-trend-cat{width:25px;height:24px}.btc-card-heading{column-gap:6px}}

.asset-detail{font-size:12px;padding:5px 10px;align-self:center;white-space:nowrap}

/* Compact history actions share one row and never inherit large form controls. */
#history-view .history-actions{display:inline-flex;align-items:center;gap:4px;white-space:nowrap}
#history-view .history-actions button{display:inline-flex;align-items:center;justify-content:center;min-height:28px;margin:0;padding:4px 7px;border-radius:7px;font-size:12px;line-height:1.2;white-space:nowrap}
#history-view .history-actions .history-close-button{background:transparent;color:var(--negative);border-color:var(--border)}
#history-view .history-actions .history-close-button:hover:not(:disabled){background:var(--danger);border-color:var(--negative)}
#history-view .history-table th:first-child,#history-view .history-table td:first-child{width:1%;white-space:nowrap}

.best-workspace>.asset-sidebar{display:flex;flex-direction:column;min-height:0}#best-tabs{min-height:0;overflow-y:auto;flex:1}#best-tabs>.asset-button{flex-shrink:0}
@media(max-width:760px){#best-tabs{overflow-y:hidden;flex:0 0 auto}}

.chart-settings .simplify-charts{display:inline-flex;align-items:center;gap:7px;font-size:13px;cursor:pointer;white-space:nowrap}
.chart-settings .simplify-charts input{width:16px;height:16px;margin:0;accent-color:#B794F4}

.app-header .strategy-select-label{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
@media(max-width:760px){.app-header .account-toolbar{flex-wrap:wrap;flex-basis:100%}.app-header .strategy-select-label{flex-basis:100%}.app-header .strategy-select-label select{flex:1;min-width:0}}

.app-header .strategy-risk-summary{font-size:13px;color:var(--text);background:#b794f41c;border:1px solid #b794f470;border-radius:8px;padding:7px 9px;white-space:nowrap}
@media(max-width:760px){.app-header .strategy-risk-summary{flex-basis:100%;box-sizing:border-box}}


.hs-integrated{display:block;flex:1 1 580px;max-width:800px;min-width:0;padding:10px 12px}
.hs-integrated .hs-periods{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.hs-integrated .hs-periods .hs-item{padding:3px 7px;gap:7px;align-items:center}
.hs-integrated .hs-periods .hs-item>div{gap:4px;min-width:0}
.hs-integrated .hs-periods .hs-label{font-size:10px;white-space:nowrap}
.hs-integrated .hs-periods strong{font-size:12px;font-weight:600}
.hs-integrated .hs-face{width:39px;height:43px}
.hs-details{display:flex;flex-wrap:wrap;justify-content:space-between;gap:10px;margin-top:9px;padding-top:8px;border-top:1.5px dashed var(--border)}
.hs-integrated .hs-base{margin:8px 0 0;font-size:10px;line-height:1.4;color:var(--muted);font-weight:400}
.hs-bear .hs-face{--chibi-fur:#eac6a3;--chibi-belly:#fff3e1;animation-delay:-1.7s}
.hs-panda .hs-face{--chibi-fur:#b7c5e9;--chibi-belly:#f2f1ff;animation-delay:-3.4s}
.hs-panda-patches{fill:#a68bd283}
.hs-eye-blink{transform-origin:24px 28px;animation:hs-soft-blink 7s infinite}
.hs-panda .hs-eye-blink{animation-delay:-2.8s}
@keyframes hs-soft-blink{0%,92%,96%,100%{transform:scaleY(1)}94%{transform:scaleY(.12)}}
@media(max-width:760px){.hs-integrated{max-width:100%;width:100%;flex-basis:100%;padding:9px}.hs-integrated .hs-periods{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 6px}.hs-integrated .hs-periods .hs-item:nth-child(3){border-left:0}.hs-integrated .hs-periods .hs-item{padding:3px 4px}.hs-integrated .hs-face{width:35px;height:39px}.hs-integrated .hs-details .hs-value{font-size:12px}}
@media(prefers-reduced-motion:reduce){.hs-integrated .hs-face,.hs-integrated .hs-eye-blink{animation:none}}
.history-top{display:flex;align-items:flex-start;gap:12px;margin:0 0 8px}
.history-heading{flex:1;min-width:150px}.history-heading h2{font-size:20px;margin:2px 0 7px}
.history-help{font-size:12px;color:var(--muted)}.history-help summary{cursor:pointer}.history-help p{font-size:12px;margin:6px 0}
.history-top .hs-integrated{flex:0 1 760px;margin:0;padding:7px 9px}
.hs-integrated .hs-periods .hs-item{padding:1px 4px;gap:6px}
.hs-integrated .hs-face{width:42px;height:45px}
.hs-integrated .hs-return-row{display:flex;flex-direction:row;align-items:baseline;gap:4px;flex-wrap:wrap;line-height:1.2}
.hs-return-row>span{font-size:10px;color:var(--muted);font-weight:400}
.hs-integrated .hs-return-row strong{font-size:11px}
.hs-integrated .hs-details{margin-top:6px;padding-top:5px;gap:6px}
.hs-integrated .hs-base{margin-top:5px;font-size:9px}
#history-view .history-controls{padding:2px 0 5px;gap:7px;display:flex;align-items:center;flex-wrap:wrap}
.history-controls label{font-size:12px;gap:5px}.history-controls select,.history-controls button{font-size:12px;padding:6px 9px}
#history-status{font-size:12px;margin:4px 0 7px}
@media(max-width:1050px){.history-top{flex-wrap:wrap}.history-heading{flex:1 0 100%;display:flex;justify-content:space-between;align-items:center}.history-top .hs-integrated{flex-basis:100%;max-width:none}.history-heading h2{margin:0}.history-help{max-width:60%}}
@media(max-width:760px){.history-top{gap:6px;margin-bottom:6px}.history-top .hs-integrated{padding:6px 8px}.hs-integrated .hs-periods{gap:6px 5px}.hs-integrated .hs-face{width:38px;height:40px}.hs-integrated .hs-periods .hs-item>div{gap:2px}.hs-integrated .hs-details .hs-value{font-size:11px}#history-view .history-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}.history-controls label{min-width:0;display:flex;flex-direction:column;align-items:stretch;gap:3px}.history-controls label:nth-child(2){grid-column:1/-1;grid-row:2}.history-controls select{width:100%;min-width:0;padding:5px}.history-controls button{padding:7px 5px;min-width:0;font-size:11px}}


.allocation-cards{display:grid;gap:10px;margin:12px 0}.allocation-card{--chibi-fur:#d9b8e6;--chibi-belly:#f5ecfa;--chibi-ear-inner:#e7a5bc;--chibi-outline:#8a79a3;--chibi-blush:#ed96aa;border:1px solid var(--border);border-radius:14px;padding:10px 12px;background:var(--stripe)}
.allocation-heading{display:flex;align-items:center;gap:8px}.allocation-heading h4{margin:0;font-size:15px;flex:1}.allocation-pet .hs-face{width:39px;height:43px}.settings-dialog .allocation-lock{display:inline-flex;align-items:center;gap:4px;margin:0;font-size:12px;white-space:nowrap}.settings-dialog .allocation-lock input{width:16px;margin:0}
.allocation-amount{display:flex;justify-content:space-between;gap:10px;margin:6px 0;font-size:16px;font-variant-numeric:tabular-nums}.capital-percent{color:var(--accent);font-weight:700}.capital-money{color:var(--positive)}.settings-dialog .capital-share{width:100%;margin:9px 0;accent-color:#b794f4;cursor:pointer}.allocation-card[data-blocked=true]{border-color:var(--negative)}.allocation-reserved{margin:5px 0;font-size:11px}.settings-dialog .allocation-card label:not(.allocation-lock){margin:8px 0 0}.allocation-lock:has(input:checked){color:var(--accent)}

.account-capital{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.account-capital output{font-weight:700;color:var(--text);font-variant-numeric:tabular-nums}

.app-header .header-navigation{margin-left:auto;display:flex;align-items:center;gap:6px}
.app-header .header-navigation .header-actions{margin-left:0}
@media(max-width:760px){.app-header .header-navigation{display:contents}.app-header .header-navigation .header-actions{margin-left:auto}.app-header .section-tabs{margin-left:auto}}

.history-celebration{position:fixed;inset:0;overflow:hidden;pointer-events:none;z-index:50}
.history-celebration>span{position:absolute;left:var(--star-x);top:var(--star-y);font-size:var(--star-size);color:#b794f4;text-shadow:0 0 9px #b794f466;opacity:0;animation:history-win-spark 6s ease-out var(--star-delay) both}
.history-celebration>span:nth-child(3n){color:#f3c96b}.history-celebration>span:nth-child(3n+1){color:#efaec9}
@keyframes history-win-spark{0%{opacity:0;transform:translate(0,25px) scale(.3) rotate(0)}20%{opacity:.9}100%{opacity:0;transform:translate(var(--star-dx),-130px) scale(1.1) rotate(100deg)}}
@media(prefers-reduced-motion:reduce){.history-celebration{display:none}}

.history-win-message{position:absolute;top:27%;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:16px;padding:16px 24px;box-sizing:border-box;max-width:calc(100vw - 32px);border:1px solid #b794f499;border-radius:24px;background:var(--surface);box-shadow:0 8px 36px #b794f433,0 0 30px #efaec91a;animation:history-win-message 6.4s ease both}
.history-win-message img{width:90px;height:72px;object-fit:contain;flex-shrink:0}
.history-win-message strong{font-size:clamp(20px,3vw,30px);line-height:1.2;color:var(--text);text-align:center;text-shadow:0 2px 12px #b794f455}
@keyframes history-win-message{0%{opacity:0}12%,84%{opacity:1}100%{opacity:0}}
@media(max-width:760px){.history-win-message{width:calc(100vw - 40px);gap:10px;padding:14px 16px;border-radius:20px}.history-win-message img{width:74px;height:60px}}

.client-update-notice{position:fixed;bottom:16px;left:50%;transform:translateX(-50%);z-index:10000;max-width:calc(100vw - 32px);width:max-content;box-sizing:border-box;padding:12px 18px;border:1px solid #b794f4;border-radius:14px;background:var(--surface);color:var(--text);box-shadow:0 4px 24px #0004;font-size:13px;pointer-events:none}
