@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root { --bg:#081015; --panel:#0c171d; --panel-2:#101f26; --line:#1d3038; --text:#e5edf0; --muted:#7d9299; --soft:#a9bbc0; --green:#53d49a; --orange:#f2b66d; --red:#ee7777; --cyan:#78dbe0; }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--text); font-family:'Space Grotesk', 'Microsoft YaHei', sans-serif; font-size:13px; }
button,input { font:inherit; }
button { border:0; cursor:pointer; color:inherit; }
.app-shell { min-height:100vh; background:radial-gradient(circle at 50% -25%, #16343a 0, transparent 42%), var(--bg); }
.topbar { height:70px; display:flex; align-items:center; justify-content:space-between; padding:0 30px; border-bottom:1px solid var(--line); background:rgba(8,16,21,.85); }
.brand-lockup,.topbar-actions,.topbar-center,.asset-title,.asset-name-row,.asset-meta,.chart-tools,.timeframes,.section-heading,.insight-heading,.ai-status,.risk-header,.activity-heading { display:flex; align-items:center; }
.brand-lockup { gap:11px; min-width:260px; }
.brand-mark { display:flex; gap:3px; align-items:flex-end; height:25px; }
.brand-mark span { display:block; width:5px; border-radius:1px; background:var(--green); transform:skew(-16deg); }.brand-mark span:nth-child(1){height:11px;opacity:.55}.brand-mark span:nth-child(2){height:18px;opacity:.8}.brand-mark span:nth-child(3){height:25px}
.brand-name { font-weight:700; letter-spacing:3px; font-size:14px; }.brand-subtitle,.eyebrow { color:var(--muted); font-size:9px; letter-spacing:2px; font-family:'DM Mono',monospace; }
.topbar-center { gap:9px; color:var(--muted); font-size:11px; }.connection-dot { width:7px;height:7px;border-radius:50%;background:var(--orange); box-shadow:0 0 9px rgba(242,182,109,.6); }.connection-dot.live { background:var(--green); box-shadow:0 0 9px rgba(83,212,154,.6); }.separator{color:#35505a}
.topbar-actions { gap:11px; min-width:260px; justify-content:flex-end; }.icon-button,.add-button { background:transparent; color:var(--muted); font-size:19px; padding:4px 7px; }.icon-button:hover,.add-button:hover { color:var(--text); }.eth-alert-shortcut { color:var(--orange); position:relative; }.eth-alert-shortcut::after { content:''; position:absolute; top:3px; right:3px; width:5px; height:5px; border-radius:50%; background:var(--orange); box-shadow:0 0 7px rgba(242,182,109,.7); }.avatar { width:28px;height:28px;border-radius:50%;background:#1e3d42;color:var(--cyan);display:grid;place-items:center;font-weight:600;font-size:12px; }
.workspace { display:grid; grid-template-columns:250px minmax(600px,1fr) 330px; min-height:calc(100vh - 70px); }.watchlist-panel,.insight-panel { background:rgba(12,23,29,.92); }.watchlist-panel { border-right:1px solid var(--line); padding:27px 17px 18px; display:flex; flex-direction:column; }.main-panel { min-width:0; padding:30px 34px 40px; }.insight-panel { border-left:1px solid var(--line); padding:27px 22px 20px; }
.panel-heading,.overview-row { display:flex; justify-content:space-between; align-items:flex-start; }.panel-heading h2,.section-heading h2,.insight-heading h2 { font-size:17px; margin:5px 0 0; font-weight:600; }.add-button { font-size:22px; line-height:1; margin-top:5px; }.search-field { height:34px; display:flex; align-items:center; gap:7px; color:var(--muted); background:#091219; border:1px solid var(--line); padding:0 10px; margin:22px 0 12px; }.search-field input { border:0;outline:0;background:transparent;color:var(--text);width:100%;font-size:12px; }.search-field input::placeholder{color:#536870}.market-filter { display:flex; gap:3px; border-bottom:1px solid var(--line); padding-bottom:13px; }.filter-button { background:transparent; color:var(--muted); padding:6px 8px; font-size:11px; }.filter-button.active { color:var(--text); background:#183138; }.watchlist { overflow:auto; flex:1; }.watch-item { display:grid; grid-template-columns:27px 1fr auto; align-items:center; gap:9px; padding:13px 8px; border-bottom:1px solid rgba(29,48,56,.55); cursor:pointer; }.watch-item:hover,.watch-item.selected { background:#12262d; }.mini-coin,.coin-avatar { border-radius:50%; background:#172e35; color:var(--cyan); display:grid; place-items:center; font-weight:600; }.mini-coin { width:25px;height:25px;font-size:12px; }.watch-symbol { font-size:12px;font-weight:600; }.watch-name { color:var(--muted);font-size:10px;margin-top:3px; }.watch-price { text-align:right;font-family:'DM Mono',monospace;font-size:11px; }.watch-change { text-align:right;font-size:10px;margin-top:4px; }.positive,.green { color:var(--green)!important; }.negative,.red { color:var(--red)!important; }.watchlist-footer { border-top:1px solid var(--line); padding:16px 7px 0; color:var(--muted);font-size:10px;display:flex;justify-content:space-between;gap:6px; }.watchlist-footer strong{font-size:9px;color:var(--soft);font-family:'DM Mono',monospace;font-weight:400}
.market-kind { display:grid; grid-template-columns:1fr 1.35fr; gap:3px; margin-top:15px; padding:3px; border:1px solid var(--line); border-radius:6px; background:#08141a; }
.market-kind-button { min-height:31px; border-radius:4px; background:transparent; color:var(--muted); font-size:10px; }
.market-kind-button.active { background:#1a343b; color:var(--text); box-shadow:inset 0 0 0 1px #31535c; }
.stock-avatar { border-radius:5px!important; background:#263543!important; color:#9fc0ff!important; }
.market-kind + .market-search-wrap .search-field { margin-top:10px; }
.market-search-wrap { position:relative; z-index:6; }
.market-search-results { position:absolute; top:100%; left:0; right:0; max-height:330px; overflow:auto; border:1px solid var(--line-strong); border-radius:6px; background:#0a181e; box-shadow:0 18px 35px rgba(0,0,0,.42); }
.market-search-row { width:100%; min-height:44px; display:grid; grid-template-columns:48px minmax(0,1fr) auto 20px; align-items:center; gap:7px; padding:7px 8px; border-bottom:1px solid rgba(43,67,75,.55); background:transparent; text-align:left; }
.market-search-row:last-child { border-bottom:0; }
.market-search-row:hover,.market-search-row:focus-visible { background:#153039; }
.search-symbol { color:var(--text); font:500 10px 'DM Mono',monospace; }
.search-name { min-width:0; overflow:hidden; color:var(--muted); font-size:9px; line-height:1.3; text-overflow:ellipsis; white-space:nowrap; }
.market-search-row em { color:var(--soft); font:9px 'DM Mono',monospace; font-style:normal; }
.market-search-row b { color:var(--orange); font-size:14px; font-weight:400; text-align:center; }
.market-search-empty { padding:14px 10px; color:var(--muted); font-size:10px; }
.watch-item { grid-template-columns:27px minmax(0,1fr) auto 22px; }
.favorite-remove { width:22px; height:28px; padding:0; border-radius:4px; background:transparent; color:#5f767d; font-size:12px; }
.favorite-remove:hover,.favorite-remove:focus-visible { color:var(--orange); background:#1b3035; }
.level-marker.resistance span { transform:translateX(-90%); }
.overview-row { align-items:center; }.asset-title { gap:13px; }.coin-avatar { width:44px;height:44px;font-size:23px;background:#183d3b;color:var(--green); }.asset-name-row { gap:10px; }.asset-name-row h1 { margin:0;font-size:23px;font-weight:600; }.ticker { color:var(--muted); font-size:12px; font-family:'DM Mono',monospace; }.asset-meta { gap:12px; margin-top:8px; color:var(--muted); font-size:10px; }.live-pill { color:var(--green);font-family:'DM Mono',monospace;font-size:9px;letter-spacing:1px; }.price-block{text-align:right}.big-price{font:500 31px 'DM Mono',monospace;letter-spacing:-.5px}.price-change{font:500 12px 'DM Mono',monospace;margin-top:7px}.price-change span{color:var(--muted);font-weight:400}
.metric-strip { display:grid; grid-template-columns:repeat(5,1fr); margin:31px 0 26px; border-top:1px solid var(--line);border-bottom:1px solid var(--line); }.metric { padding:15px 18px 14px 0; border-right:1px solid var(--line); margin:13px 18px 13px 0; }.metric:last-child{border:0;margin-right:0}.metric span{display:block;color:var(--muted);font-size:10px;margin-bottom:8px}.metric strong{font:500 12px 'DM Mono',monospace}.state-text{color:var(--orange)!important;font-family:'Space Grotesk',sans-serif!important;font-size:11px!important}
.chart-toolbar { display:flex;justify-content:space-between;align-items:center;margin-bottom:11px; }.timeframes { gap:3px; }.timeframes button,.tool-button { background:transparent;color:var(--muted);font:11px 'DM Mono',monospace;padding:6px 10px; }.timeframes button.active,.timeframes button:hover,.tool-button.active { color:var(--text);background:#1b343b; }.chart-tools{gap:3px}.tool-label{color:var(--muted);font-size:10px;margin-right:5px}.tool-button{font-family:'Space Grotesk',sans-serif}.chart-card{position:relative;border:1px solid var(--line);background:#09151a;padding:15px 17px 11px}.chart-legend{display:flex;align-items:center;gap:17px;color:var(--soft);font-size:10px}.chart-legend span{display:flex;align-items:center;gap:6px}.chart-note{margin-left:auto;color:#62777e;font-family:'DM Mono',monospace}.legend-line{display:inline-block;width:17px;height:2px;background:var(--cyan)}.ema-line{background:var(--orange)}.chart-legend b{font:10px 'DM Mono',monospace;color:var(--orange);font-weight:400}.chart-wrap{height:300px;margin-top:9px;position:relative}.chart-wrap canvas,.rsi-wrap canvas{width:100%;height:100%;display:block}.chart-crosshair{display:none;position:absolute;top:0;bottom:0;border-left:1px dashed #76939a;pointer-events:none}.chart-crosshair span{position:absolute;right:5px;top:10px;background:#315058;color:#e8f3f3;padding:4px 6px;font:10px 'DM Mono',monospace;white-space:nowrap}.rsi-wrap{height:67px;margin-top:11px;border-top:1px solid rgba(29,48,56,.65);position:relative;padding-top:9px}.rsi-label{position:absolute;top:10px;left:0;color:var(--muted);font:10px 'DM Mono',monospace;z-index:2}.rsi-label strong{color:var(--orange);font-weight:400;margin-left:5px}.chart-axis{display:flex;justify-content:space-between;color:#60767c;font:9px 'DM Mono',monospace;padding:7px 3px 0}.lower-grid{display:grid;grid-template-columns:1fr 1fr;gap:17px;margin-top:20px}.signal-panel,.levels-panel{border-top:1px solid var(--line);padding-top:16px}.section-heading{justify-content:space-between}.signal-count{color:var(--green);font-size:10px}.text-button{background:transparent;color:var(--cyan);font-size:11px;padding:4px 0}.signal-list{margin-top:11px}.signal-row{display:grid;grid-template-columns:18px 1fr auto;align-items:center;gap:9px;padding:11px 0;border-bottom:1px solid rgba(29,48,56,.6)}.signal-icon{font-size:14px}.signal-copy strong{font-size:11px;font-weight:500;display:block}.signal-copy span{font-size:10px;color:var(--muted);display:block;margin-top:3px}.signal-time{font:9px 'DM Mono',monospace;color:#61767d}.levels-panel{min-width:0}.level-bar{height:58px;background:linear-gradient(90deg,#183438 0%,#234144 52%,#624b38 100%);position:relative;margin-top:25px;border-top:1px solid #547069;border-bottom:1px solid #49645f}.level-marker{position:absolute;top:-8px;width:1px;height:73px;background:#aec1ba}.level-marker span{position:absolute;top:-20px;transform:translateX(-50%);white-space:nowrap;font:9px 'DM Mono',monospace;color:var(--soft)}.level-marker.current{background:var(--cyan);width:2px}.level-marker.current span{color:var(--cyan);top:62px}.level-marker.resistance{background:var(--orange)}.level-marker.resistance span{color:var(--orange)}.level-marker.support{background:var(--green)}.level-marker.support span{color:var(--green)}.level-rows{margin-top:21px}.level-rows div{display:grid;grid-template-columns:1fr auto 58px;padding:8px 0;border-bottom:1px solid rgba(29,48,56,.6);font-size:10px}.level-rows span{color:var(--muted)}.level-rows strong{font:10px 'DM Mono',monospace}.level-rows em{font:10px 'DM Mono',monospace;text-align:right;color:var(--orange);font-style:normal}
.insight-heading{justify-content:space-between}.ai-status{gap:6px;color:var(--green);font-size:10px}.ai-status i{width:6px;height:6px;border-radius:50%;background:var(--green)}.ai-summary{background:#11262b;border:1px solid #23454a;padding:18px;margin-top:23px}.summary-tag{color:var(--cyan);font:10px 'DM Mono',monospace}.ai-summary h3{font-size:15px;line-height:1.4;font-weight:600;margin:11px 0 9px}.ai-summary p{font-size:11px;line-height:1.7;color:#a7bec0;margin:0}.ai-confidence{margin-top:17px;display:grid;grid-template-columns:1fr auto;gap:7px;color:var(--muted);font-size:10px}.ai-confidence strong{color:var(--cyan);font:11px 'DM Mono',monospace}.confidence-track{grid-column:1/-1;height:3px;background:#284349}.confidence-track i{height:100%;display:block;background:var(--cyan)}.scenario-box{padding:20px 0;border-bottom:1px solid var(--line)}.scenario-title{font-size:11px;font-weight:600;margin-bottom:13px}.scenario-row{display:flex;gap:10px;margin:13px 0}.scenario-bullet{display:grid;place-items:center;width:21px;height:21px;font-size:12px;font-weight:600}.green-bullet{background:#183d35;color:var(--green)}.orange-bullet{background:#3f3222;color:var(--orange)}.red-bullet{background:#402727;color:var(--red)}.scenario-row strong{font:11px 'DM Mono',monospace;display:block}.scenario-row small{display:block;color:var(--muted);font-size:10px;margin-top:4px}.risk-box{padding:20px 0 17px;border-bottom:1px solid var(--line)}.risk-header{justify-content:space-between;font-size:11px}.risk-header span{color:var(--muted)}.risk-header strong{color:var(--orange);font-size:11px}.risk-meter{height:5px;background:linear-gradient(90deg,var(--green),var(--orange),var(--red));margin:14px 0 6px;position:relative}.risk-meter b{position:absolute;left:56%;top:-4px;width:3px;height:13px;background:#fff}.risk-scale{display:flex;justify-content:space-between;color:#657a80;font-size:9px}.risk-box p{color:var(--muted);font-size:10px;line-height:1.55;margin:13px 0 0}.activity-heading{justify-content:space-between;margin-top:19px}.activity-list{margin:9px 0 16px}.activity-row{display:flex;align-items:flex-start;gap:9px;padding:9px 0}.activity-icon{font-size:12px}.activity-row p{margin:0;font-size:10px;color:var(--soft);line-height:1.4}.activity-row time{font:9px 'DM Mono',monospace;color:#5d7177;display:block;margin-top:3px}.primary-button{width:100%;height:38px;background:var(--green);color:#071512;font-weight:600;font-size:11px}.primary-button:hover{background:#73e5af}.toast{position:fixed;bottom:24px;left:50%;transform:translate(-50%,15px);opacity:0;transition:.25s;background:#e8f3f3;color:#102024;padding:10px 15px;font-size:11px;pointer-events:none}.toast.show{opacity:1;transform:translate(-50%,0)}.modal-backdrop{display:none;position:fixed;inset:0;background:rgba(2,8,10,.75);place-items:center;z-index:5}.modal-backdrop.open{display:grid}.modal{width:min(390px,calc(100vw - 30px));background:#101f26;border:1px solid #2c4a51;padding:22px}.modal-heading{display:flex;justify-content:space-between;align-items:center}.modal h2{font-size:16px;margin:0}.modal p{color:var(--muted);font-size:11px;margin:12px 0 18px}.modal-input{display:flex;gap:8px}.modal-input input{flex:1;background:#071116;border:1px solid var(--line);color:var(--text);padding:9px 10px;outline:0;text-transform:uppercase;font-family:'DM Mono',monospace;font-size:12px}.modal-input button{background:var(--green);color:#071512;padding:0 16px;font-weight:600}
.account-box,.order-box{border-top:1px solid var(--line);padding:18px 0 0;margin-top:19px}.account-header{display:flex;align-items:flex-start;justify-content:space-between}.account-header h3{font-size:13px;font-weight:600;margin:5px 0 0}.account-mode,.live-only{color:var(--orange);font:9px 'DM Mono',monospace;margin-top:4px}.account-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:14px}.account-grid div{background:#101f26;padding:10px}.account-grid span{display:block;color:var(--muted);font-size:9px;margin-bottom:7px}.account-grid strong{font:11px 'DM Mono',monospace}.holdings-list{margin-top:10px}.holding-row,.order-row{display:grid;grid-template-columns:1fr auto auto;gap:8px;align-items:center;padding:8px 0;border-bottom:1px solid rgba(29,48,56,.55);font:10px 'DM Mono',monospace}.holding-row span{color:var(--soft)}.holding-row em,.order-row em{color:var(--muted);font-size:9px;font-style:normal}.empty-state{color:var(--muted);font-size:10px;padding:10px 0;line-height:1.5}.secondary-button{width:100%;height:30px;background:#1a3339;color:var(--cyan);font-size:10px;margin-top:12px}.orders-title{color:var(--muted);font-size:9px;margin:12px 0 4px}.order-row{grid-template-columns:auto 1fr auto auto}.order-row button{background:transparent;color:var(--red);font-size:16px;padding:0}.order-fields{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:15px}.order-fields label{color:var(--muted);font-size:9px}.order-fields input,.order-fields select{width:100%;display:block;margin-top:5px;background:#071116;border:1px solid var(--line);color:var(--text);padding:8px;font-size:10px;outline:0}.danger-button{width:100%;height:34px;background:#583333;color:#ffdede;font-size:10px;margin-top:13px}.danger-button:hover{background:#6d3c3c}.order-disclaimer{color:#806d65;font-size:9px;line-height:1.5;margin-top:9px}
@media(max-width:1100px){.workspace{grid-template-columns:220px minmax(550px,1fr)}.insight-panel{grid-column:2;border-left:0;border-top:1px solid var(--line);display:grid;grid-template-columns:1fr 1fr;gap:20px;padding:22px 34px}.insight-heading,.activity-heading,.primary-button{grid-column:1/-1}.ai-summary,.scenario-box,.risk-box{margin-top:0}.activity-list{grid-column:1/-1;display:flex;gap:20px}.activity-row{flex:1}.primary-button{max-width:220px;margin-left:auto}}
@media(max-width:760px){.topbar{padding:0 16px;height:58px}.brand-lockup{min-width:0}.brand-subtitle,.topbar-center{display:none}.topbar-actions{min-width:0}.workspace{display:block}.watchlist-panel{display:flex;max-height:280px;border-right:0;border-bottom:1px solid var(--line);padding:17px 15px 12px}.watchlist-panel .panel-heading h2{font-size:15px}.watchlist-panel .search-field{margin:12px 0 8px}.watchlist-panel .watchlist{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;overflow:auto}.watchlist-panel .watch-item{padding:10px 6px}.watchlist-footer{display:none}.main-panel{padding:22px 15px 28px}.overview-row{align-items:flex-start;gap:10px}.asset-name-row{display:block}.asset-name-row h1{font-size:19px}.ticker{display:block;margin-top:5px}.big-price{font-size:20px}.metric-strip{grid-template-columns:repeat(2,1fr);margin:22px 0 20px}.metric{margin:10px 12px 10px 0;padding:9px 0;border-right:0}.metric:nth-child(odd){border-right:1px solid var(--line)}.chart-toolbar{display:block}.chart-tools{margin-top:10px;overflow:auto}.chart-card{padding:12px 10px 8px}.chart-note{display:none}.chart-wrap{height:240px}.lower-grid{display:block}.levels-panel{margin-top:24px}.insight-panel{display:block;border-left:0;padding:23px 15px}.insight-heading{margin-bottom:19px}.ai-summary{margin-top:0}.activity-list{display:block}.primary-button{margin-top:5px}.level-marker span{font-size:8px}.level-marker.support span{transform:translateX(-35%)} }

.volume-wrap{height:45px;margin-top:8px;border-top:1px solid rgba(29,48,56,.65);position:relative;padding-top:7px}.volume-wrap canvas{width:100%;height:100%;display:block}.volume-label{position:absolute;top:8px;left:0;color:var(--muted);font:10px 'DM Mono',monospace;z-index:2}.volume-label strong{color:var(--cyan);font-weight:400;margin-left:5px}.order-preview{margin-top:9px;color:var(--muted);font:9px 'DM Mono',monospace;line-height:1.5}.alert-rules{margin:8px 0 12px;border-bottom:1px solid var(--line)}.rule-row{display:flex;justify-content:space-between;align-items:center;padding:7px 0;border-top:1px solid rgba(29,48,56,.55);color:var(--soft);font:9px 'DM Mono',monospace}.rule-row button{background:transparent;color:var(--red);font-size:15px}.alert-form{display:none;grid-template-columns:1fr 1fr;gap:10px}.alert-form label{color:var(--muted);font-size:10px}.alert-form input,.alert-form select{display:block;width:100%;margin-top:5px;background:#071116;border:1px solid var(--line);color:var(--text);padding:9px;outline:0}.alert-form button{grid-column:1/-1;background:var(--green);color:#071512;padding:10px;font-weight:600}
.chart-wrap>#priceChart{width:100%;height:100%}
.chart-wrap>#priceFallback{display:none;position:absolute;inset:0;width:100%;height:100%;pointer-events:none}

/* Workbench polish and predictable interaction states */
:root { --bg:#071015; --panel:#0b151b; --panel-2:#101e25; --line:#21343c; --line-strong:#2e4a53; --text:#eef5f5; --muted:#91a4aa; --soft:#c3d0d2; --green:#61d9a0; --orange:#f2bd76; --red:#ef7c80; --cyan:#7cdde2; --blue:#8ba9ff; }
html { color-scheme: dark; }
body { min-width:320px; background:var(--bg); }
button, input, select { -webkit-tap-highlight-color:transparent; }
button:focus-visible, input:focus-visible, select:focus-visible { outline:2px solid var(--cyan); outline-offset:2px; }
.topbar { position:relative; z-index:2; height:64px; padding:0 24px; background:rgba(7,16,21,.96); box-shadow:0 1px 0 rgba(124,221,226,.04); }
.brand-lockup { min-width:250px; }
.brand-name { letter-spacing:2.4px; }
.topbar-center { min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.topbar-center #connectionText { overflow:hidden; text-overflow:ellipsis; }
.topbar-actions { min-width:250px; }
.icon-button { width:36px; height:36px; display:grid; place-items:center; padding:0; border:1px solid transparent; border-radius:6px; transition:color .18s ease, background .18s ease, border-color .18s ease; }
.icon-button svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.icon-button:hover { color:var(--text); background:#14272e; border-color:var(--line-strong); }
.eth-sound-toggle { color:var(--green); position:relative; }
.eth-sound-toggle.sound-off { color:#708187; }
.eth-sound-toggle.sound-off::after { content:''; position:absolute; width:21px; height:2px; background:var(--red); transform:rotate(-45deg); border-radius:1px; }
.avatar { width:30px; height:30px; }
.workspace { grid-template-columns:264px minmax(640px,1fr) 354px; height:calc(100vh - 64px); min-height:0; overflow:hidden; }
.watchlist-panel, .main-panel, .insight-panel { overflow-y:auto; scrollbar-width:thin; scrollbar-color:#29434b transparent; }
.watchlist-panel { padding:23px 17px 18px; }
.main-panel { padding:26px 32px 42px; }
.insight-panel { padding:23px 23px 24px; }
.panel-heading h2, .section-heading h2, .insight-heading h2 { letter-spacing:-.2px; }
.search-field { border-radius:6px; height:38px; margin:18px 0 12px; transition:border-color .18s ease, background .18s ease; }
.search-field:focus-within { border-color:#3f6d76; background:#0b1a20; }
.search-field svg { width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; }
.filter-button, .timeframes button, .tool-button { min-height:32px; border-radius:4px; transition:background .18s ease, color .18s ease; }
.filter-button:hover, .timeframes button:hover, .tool-button:hover { background:#142a31; color:var(--text); }
.watch-item { min-height:58px; border-radius:5px; border-bottom-color:rgba(43,67,75,.5); transition:background .18s ease, transform .18s ease; }
.watch-item:hover { transform:translateX(2px); }
.watch-item.selected { box-shadow:inset 2px 0 0 var(--cyan); }
.overview-row { padding-bottom:5px; }
.quote-consensus { margin:10px 0 12px; padding:12px 14px; border:1px solid var(--line-strong); background:#09181e; }
.quote-consensus-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.quote-consensus-heading h2 { margin:4px 0 0; font-size:13px; }
.quote-consensus-status { color:var(--muted); font:9px 'DM Mono',monospace; text-align:right; }
.quote-consensus-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:11px; padding:9px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.quote-consensus-summary div { min-width:0; padding-right:8px; border-right:1px solid var(--line); }
.quote-consensus-summary div:last-child { border-right:0; }
.quote-consensus-summary span,.quote-consensus-summary strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.quote-consensus-summary span { color:var(--muted); font-size:8px; }
.quote-consensus-summary strong { margin-top:4px; color:var(--cyan); font:11px 'DM Mono',monospace; }
.orange { color:var(--orange)!important; }
.quote-source-list { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:1px; margin-top:8px; background:var(--line); }
.quote-source-row { min-width:0; padding:8px 9px; background:#0b1b21; box-shadow:inset 2px 0 0 var(--green); }
.quote-source-row.outlier { box-shadow:inset 2px 0 0 var(--orange); }
.quote-source-row.unavailable { box-shadow:inset 2px 0 0 var(--muted); }
.quote-source-row span,.quote-source-row strong,.quote-source-row small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.quote-source-row span { color:var(--soft); font-size:9px; }
.quote-source-row strong { margin-top:4px; color:var(--text); font:9px 'DM Mono',monospace; }
.quote-source-row small { margin-top:3px; color:var(--muted); font-size:8px; }
.quote-source-empty { grid-column:1/-1; padding:9px; color:var(--muted); font-size:9px; background:#0b1b21; }
.asset-name-row h1 { letter-spacing:-.5px; }
.live-pill { display:inline-flex; align-items:center; gap:4px; }
.live-pill::before { content:""; width:5px; height:5px; border-radius:50%; background:currentColor; box-shadow:0 0 0 3px rgba(97,217,160,.12); }
.live-pill.delayed, #quoteLatency.delayed { color:var(--orange); }
#quoteLatency { font-family:'DM Mono',monospace; }
#quoteSource, #quoteLatency { white-space:nowrap; }
.metric-strip { margin:26px 0 22px; background:rgba(13,27,33,.5); border-color:var(--line); }
.metric strong { color:var(--soft); }
.chart-toolbar { position:static; padding:9px 0 10px; margin:0 0 1px; background:none; }
.chart-card { border-radius:7px; border-color:var(--line-strong); box-shadow:0 12px 32px rgba(0,0,0,.12); }
.chart-legend { min-height:18px; }
.chart-note { color:#7e949b; }
.lower-grid { gap:25px; }
.signal-panel, .levels-panel { border-top-color:var(--line-strong); }
.signal-row, .level-rows div { min-height:43px; }
.ai-summary { border-radius:7px; background:linear-gradient(145deg,#10282e,#0d2026); border-color:#2a555c; box-shadow:0 10px 24px rgba(0,0,0,.12); }
.scenario-bullet { border-radius:5px; }
.primary-button, .secondary-button, .modal-input button, .alert-form button { border-radius:5px; transition:background .18s ease, transform .18s ease; }
.primary-button:hover, .secondary-button:hover, .modal-input button:hover, .alert-form button:hover { transform:translateY(-1px); }
.primary-button:active, .secondary-button:active, .modal-input button:active, .alert-form button:active { transform:translateY(0); }
.toast { border-radius:5px; box-shadow:0 10px 24px rgba(0,0,0,.22); }
.modal-backdrop { backdrop-filter:blur(4px); }
.modal { border-radius:8px; box-shadow:0 20px 70px rgba(0,0,0,.45); }
.settings-modal { width:min(420px,calc(100vw - 30px)); }
.settings-list { border:1px solid var(--line); border-radius:6px; overflow:hidden; }
.settings-list div { display:flex; justify-content:space-between; gap:16px; padding:12px 13px; border-bottom:1px solid var(--line); font-size:11px; }
.settings-list div:last-child { border-bottom:0; }
.settings-list span { color:var(--muted); }
.settings-list strong { color:var(--soft); font:10px 'DM Mono',monospace; text-align:right; }
.settings-modal { max-height:calc(100vh - 40px); overflow:auto; }
.alert-settings { margin-top:14px; padding-top:14px; border-top:1px solid var(--line); }
.settings-section-heading,.settings-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.settings-section-heading h3 { margin:0; font-size:12px; }
.switch-row { display:flex; align-items:center; gap:7px; color:var(--soft); font-size:10px; }
.switch-row input { accent-color:var(--green); }
.sound-master-row { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:12px; margin:12px 0; border:1px solid var(--line-strong); background:#0b191f; }
.sound-master-row strong,.sound-master-row small { display:block; }
.sound-master-row strong { color:var(--text); font-size:11px; }
.sound-master-row small { color:var(--muted); font-size:9px; margin-top:4px; }
.audio-diagnostic { display:grid; grid-template-columns:auto 1fr; gap:7px 10px; align-items:center; margin:-5px 0 12px; padding:10px 12px; border:1px solid var(--line); background:#08151a; }
.audio-diagnostic strong { color:var(--orange); font-size:10px; }
.audio-diagnostic.ready strong { color:var(--green); }
.audio-diagnostic.blocked strong { color:var(--red); }
.audio-diagnostic small { grid-column:1/-1; color:var(--muted); font-size:9px; line-height:1.5; }
.audio-status-dot { width:7px; height:7px; border-radius:50%; background:currentColor; box-shadow:0 0 7px currentColor; }
.settings-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:12px; }
.settings-grid label { color:var(--muted); font-size:10px; }
.settings-grid input,.settings-grid select { display:block; width:100%; height:34px; margin-top:5px; padding:0 9px; border:1px solid var(--line); border-radius:4px; outline:0; background:#071116; color:var(--text); font:10px 'DM Mono',monospace; }
.settings-actions { margin-top:12px; }
.settings-actions button { width:auto; flex:1; }
.settings-refresh { width:100%; margin-top:12px; }
.secondary-button { margin-top:14px; }
.is-hidden { display:none !important; }
@media (min-width:1101px) { body { overflow:hidden; } }
@media (max-width:1280px) and (min-width:1101px) { .workspace { grid-template-columns:240px minmax(580px,1fr) 320px; } .main-panel { padding-left:24px; padding-right:24px; } .topbar { padding:0 18px; } }
@media (min-width:761px) and (max-width:900px) {
  .workspace { grid-template-columns:190px minmax(0,1fr); }
  .watchlist-panel { padding:17px 10px 12px; }
  .main-panel { min-width:0; padding:20px 16px 28px; }
  .insight-panel { grid-column:2; min-width:0; padding:20px 16px; }
  .topbar { padding:0 12px; }
  .brand-lockup, .topbar-actions { min-width:190px; }
  .overview-row { gap:12px; }
  .metric { margin-right:10px; }
}
@media (max-width:760px) { body { overflow:auto; } .workspace { height:auto; min-height:calc(100vh - 58px); overflow:visible; } .topbar { height:58px; padding:0 12px; } .brand-lockup, .topbar-actions { min-width:0; } .topbar-actions { gap:3px; } .icon-button { width:38px; height:38px; } .main-panel, .insight-panel, .watchlist-panel { overflow:visible; } .chart-toolbar { position:static; background:none; padding:0; } .chart-tools { padding-bottom:2px; } }
@media (max-width:760px) {
  .watchlist-panel { max-height:none; }
  .watchlist-panel .watchlist { min-height:108px; max-height:150px; flex:none; overflow-y:auto; }
  .watchlist-panel .watch-item { grid-template-columns:25px minmax(0,1fr) 20px; grid-template-rows:auto auto; gap:3px 7px; min-height:68px; align-items:start; }
  .watchlist-panel .watch-item > .mini-coin { grid-column:1; grid-row:1 / span 2; align-self:center; }
  .watchlist-panel .watch-item > div:nth-child(2) { grid-column:2; grid-row:1; min-width:0; }
  .watchlist-panel .watch-item > div:nth-child(3) { grid-column:2; grid-row:2; display:flex; align-items:baseline; gap:5px; min-width:0; }
  .watchlist-panel .watch-symbol,.watchlist-panel .watch-name,.watchlist-panel .watch-price,.watchlist-panel .watch-change { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .watchlist-panel .watch-name { margin-top:1px; }
  .watchlist-panel .watch-price,.watchlist-panel .watch-change { text-align:left; font-size:9px; }
  .watchlist-panel .watch-change { margin-top:0; }
  .watchlist-panel .favorite-remove { grid-column:3; grid-row:1 / span 2; align-self:center; width:20px; }
  .quote-consensus { padding:12px 10px; }
  .quote-consensus-heading { display:block; }
  .quote-consensus-status { margin-top:7px; text-align:left; line-height:1.5; }
  .quote-source-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { scroll-behavior:auto !important; transition-duration:0.01ms !important; animation-duration:0.01ms !important; animation-iteration-count:1 !important; } }

/* Desktop market-focus layout: the live quote and OHLC chart own the first viewport. */
@media (min-width:1101px) {
  .workspace { grid-template-columns:210px minmax(0,1fr) 300px; }
  .watchlist-panel { padding:16px 12px 12px; }
  .panel-heading h2 { font-size:15px; }
  .search-field { height:34px; margin:13px 0 8px; }
  .market-filter { padding-bottom:8px; }
  .watch-item { min-height:50px; grid-template-columns:25px minmax(0,1fr) auto 22px; gap:7px; padding:8px 5px; }
  .watch-symbol { font-size:11px; }
  .watch-name { font-size:9px; margin-top:2px; }
  .watch-price, .watch-change { font-size:10px; }
  .watchlist-footer { padding:10px 4px 0; }

  .main-panel { padding:16px 20px 22px; }
  .overview-row { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); grid-template-rows:minmax(102px,auto); align-items:center; padding:0 4px 12px; border-bottom:1px solid var(--line); }
  .asset-title { grid-column:1; grid-row:1; justify-self:start; }
  .asset-meta { gap:7px; }
  .price-block { grid-column:2; grid-row:1; justify-self:center; min-width:230px; padding:0 22px; text-align:center; white-space:nowrap; }
  .big-price { font-size:clamp(42px,3.8vw,64px); line-height:1; letter-spacing:-1px; white-space:nowrap; }
  .price-change { margin-top:10px; font-size:14px; }
  .metric-strip { margin:12px 0 12px; }
  .metric { padding:9px 11px 8px 0; margin:7px 11px 7px 0; }
  .metric span { margin-bottom:5px; }
  .chart-toolbar { padding:6px 0 7px; }
  .chart-card { padding:10px 12px 8px; }
  .chart-wrap { height:clamp(420px,55vh,640px); margin-top:6px; }
  .rsi-wrap { height:48px; margin-top:7px; padding-top:7px; }
  .rsi-label { top:8px; }
  .volume-wrap { height:34px; margin-top:5px; padding-top:5px; }
  .volume-label { top:6px; }
  .chart-axis { padding-top:4px; }
  .lower-grid { gap:18px; margin-top:12px; }
  .signal-panel, .levels-panel { padding-top:10px; }
  .signal-list { margin-top:5px; }
  .signal-row { min-height:34px; padding:6px 0; }
  .signal-copy span { margin-top:1px; }
  .level-bar { height:42px; margin-top:14px; }
  .level-marker { height:55px; }
  .level-marker span { top:-16px; }
  .level-marker.current span { top:47px; }
  .level-rows { margin-top:10px; }
  .level-rows div { padding:5px 0; }
  .insight-panel { padding:16px 16px 16px; }
  .ai-summary { margin-top:14px; padding:14px; }
  .scenario-box { padding:13px 0; }
  .scenario-row { margin:8px 0; }
  .risk-box { padding:13px 0 11px; }
  .activity-heading { margin-top:12px; }
  .activity-list { margin:5px 0 10px; }
  .activity-row { padding:5px 0; }
}

@media (max-width:1280px) and (min-width:1101px) {
  .workspace { grid-template-columns:198px minmax(0,1fr) 286px; }
  .main-panel { padding-left:16px; padding-right:16px; }
  .price-block { min-width:205px; padding:0 14px; }
  .big-price { font-size:clamp(40px,3.4vw,54px); }
}

@media (max-width:760px) {
  .overview-row { display:grid; grid-template-columns:1fr; grid-template-rows:auto auto; gap:11px; align-items:center; }
  .asset-title { grid-column:1; grid-row:1; justify-self:center; width:100%; min-width:0; justify-content:center; }
  .asset-title > div:last-child { min-width:0; }
  .coin-avatar { flex:none; }
  .asset-meta { flex-wrap:wrap; justify-content:center; row-gap:5px; }
  .price-block { grid-column:1; grid-row:2; justify-self:center; min-width:0; padding:0; text-align:center; white-space:nowrap; }
  .big-price { font-size:clamp(28px,8vw,38px); white-space:nowrap; }
  .price-change { font-size:11px; }
}

.research-board { margin-top:14px; padding-top:13px; border-top:1px solid var(--line); }
.research-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.research-heading h3 { margin:4px 0 0; font-size:13px; }
.research-heading > span { color:var(--cyan); font:9px 'DM Mono',monospace; text-align:right; padding-top:3px; }
.research-disclaimer { color:var(--muted); font-size:9px; line-height:1.5; margin:9px 0 10px; }
.outlook-list { display:grid; gap:7px; }
.outlook-synthesis { padding:10px; border:1px solid rgba(71,214,175,.65); background:#102a2a; border-radius:5px; }
.outlook-synthesis-title { display:flex; justify-content:space-between; color:var(--cyan); font-size:9px; letter-spacing:.04em; }
.outlook-synthesis-title span { color:var(--muted); }
.outlook-synthesis strong { display:block; margin-top:6px; color:var(--soft); font-size:12px; }
.outlook-synthesis p { margin:5px 0; color:var(--green); font-size:10px; line-height:1.4; }
.outlook-synthesis small,.outlook-synthesis em { display:block; color:var(--muted); font-size:8px; line-height:1.4; font-style:normal; }
.outlook-synthesis .outlook-rule { margin-top:6px; }
.outlook-row { padding:9px 10px; border:1px solid rgba(46,74,83,.75); background:#0c1b21; border-radius:5px; }
.outlook-row-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.outlook-row-head strong { font-size:10px; }
.outlook-row-head span { color:var(--cyan); font:8px 'DM Mono',monospace; white-space:nowrap; }
.outlook-range { margin-top:6px; color:var(--soft); font:500 12px 'DM Mono',monospace; }
.outlook-row p { margin:5px 0 7px; color:var(--muted); font-size:9px; line-height:1.45; }
.outlook-rule { display:grid; grid-template-columns:28px 1fr; gap:6px; color:var(--green); font-size:9px; line-height:1.45; }
.outlook-rule span { color:var(--muted); }
.outlook-rule.invalid { color:var(--red); margin-top:3px; }
.outlook-validation { margin-top:5px; color:var(--cyan); font:8px 'DM Mono',monospace; }
.strategy-competition-panel { margin-top:16px; padding-top:14px; border-top:1px solid var(--line); }
.competition-heading { margin-bottom:9px; }
.competition-controls { display:grid; grid-template-columns:150px 150px 1fr; gap:9px; align-items:end; margin-bottom:10px; }
.competition-controls label { display:grid; gap:5px; color:var(--muted); font-size:9px; }
.competition-controls input,.competition-controls select { width:100%; min-height:30px; padding:6px 8px; border:1px solid var(--line-strong); border-radius:4px; background:#08151a; color:var(--soft); font:11px 'DM Mono',monospace; }
.competition-actions { display:flex; justify-content:flex-end; gap:7px; }
.competition-actions .secondary-button { min-height:30px; padding:0 12px; }
.competition-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.competition-card { padding:10px; border:1px solid rgba(46,74,83,.85); border-radius:5px; background:#0c1b21; }
.competition-card.leader { border-color:rgba(71,214,175,.8); box-shadow:inset 0 2px 0 var(--green); }
.competition-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }
.competition-card-head strong { color:var(--soft); font-size:12px; }
.competition-card-head small { display:block; color:var(--muted); font-size:8px; margin-top:3px; }
.competition-rank { color:var(--cyan); font:10px 'DM Mono',monospace; white-space:nowrap; }
.competition-badge { display:inline-block; margin-top:8px; padding:3px 6px; border-radius:3px; background:#18343a; color:var(--cyan); font-size:8px; }
.competition-badge.warn { color:var(--orange); background:#342b1c; }
.competition-metrics { display:grid; grid-template-columns:repeat(3,1fr); gap:7px 5px; margin-top:10px; }
.competition-metrics span { display:block; color:var(--muted); font-size:8px; }
.competition-metrics strong { display:block; margin-top:3px; color:var(--soft); font:11px 'DM Mono',monospace; }
.competition-card-note { margin-top:9px; color:var(--muted); font-size:8px; line-height:1.45; }
.competition-footer { margin-top:8px; color:var(--muted); font-size:8px; line-height:1.4; }
.source-details { margin-top:9px; color:var(--cyan); font-size:9px; }
.source-details summary { cursor:pointer; padding:4px 0; }
.source-list { display:grid; gap:4px; margin-top:4px; }
.source-row { display:flex; justify-content:space-between; gap:8px; padding:6px 0; border-top:1px solid rgba(46,74,83,.55); color:var(--soft); text-decoration:none; }
.source-row:hover { color:var(--text); }
.source-row strong, .source-row small { display:block; }
.source-row strong { font-size:9px; }
.source-row small { color:var(--muted); font-size:8px; margin-top:2px; }
.source-row em { color:var(--muted); font:8px 'DM Mono',monospace; white-space:nowrap; font-style:normal; }
@media (min-width:1101px) { .research-board { margin-top:10px; padding-top:10px; } .outlook-row { padding:8px 9px; } .outlook-row p { margin:4px 0 5px; } }
@media (max-width:1100px) { .competition-controls { grid-template-columns:1fr 1fr; } .competition-actions { grid-column:1/-1; justify-content:flex-start; } .competition-grid { grid-template-columns:1fr; } }
.forecast-validation { margin-top:10px; padding-top:9px; border-top:1px solid rgba(46,74,83,.65); }
.validation-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.validation-heading h4 { margin:3px 0 0; font-size:11px; font-weight:600; }
.validation-heading > span { color:var(--muted); font:8px 'DM Mono',monospace; padding-top:2px; text-align:right; }
.validation-metrics { display:grid; grid-template-columns:repeat(3,1fr); gap:5px; margin-top:7px; }
.validation-metrics div { padding:6px 7px; background:#0c1b21; border:1px solid rgba(46,74,83,.55); }
.validation-metrics span { display:block; color:var(--muted); font-size:8px; }
.validation-metrics strong { display:block; margin-top:3px; color:var(--cyan); font:11px 'DM Mono',monospace; }
.learning-feedback { margin-top:9px; padding-top:8px; border-top:1px solid rgba(46,74,83,.45); }
.learning-feedback-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.learning-feedback-heading strong { color:var(--soft); font-size:9px; font-weight:600; }
.learning-feedback-heading span { color:var(--muted); font:8px/1.4 'DM Mono',monospace; text-align:right; }
.learning-feedback-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0; margin-top:7px; }
.learning-feedback-metrics div { min-width:0; padding:0 7px; border-right:1px solid rgba(46,74,83,.45); }
.learning-feedback-metrics div:first-child { padding-left:0; }
.learning-feedback-metrics div:last-child { padding-right:0; border-right:0; }
.learning-feedback-metrics span,.learning-feedback-metrics strong { display:block; overflow-wrap:anywhere; }
.learning-feedback-metrics span { color:var(--muted); font-size:8px; line-height:1.35; }
.learning-feedback-metrics strong { margin-top:3px; color:var(--cyan); font:10px/1.35 'DM Mono',monospace; }
.learning-feedback > p { margin:7px 0 0; color:var(--muted); font-size:8px; line-height:1.5; }
.validation-note { margin:6px 0 5px; color:var(--muted); font-size:8px; line-height:1.45; }
.validation-list { display:grid; gap:3px; }
.validation-row { display:flex; justify-content:space-between; gap:7px; padding:4px 0; border-top:1px solid rgba(46,74,83,.45); font-size:8px; }
.validation-row span { color:var(--soft); }
.validation-row em { color:var(--muted); font:8px 'DM Mono',monospace; font-style:normal; white-space:nowrap; }
.validation-row .hit { color:var(--green); }
.validation-row .miss { color:var(--red); }
.forecast-daily-report { margin-top:14px; padding-top:14px; border-top:1px solid var(--line-strong); }
.daily-report-controls { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-top:10px; }
.daily-report-controls label { color:var(--muted); font-size:9px; }
.daily-report-controls select { display:block; width:100%; height:27px; margin-top:4px; padding:0 6px; border:1px solid var(--line); background:#071116; color:var(--text); font:9px 'DM Mono',monospace; }
.daily-summary-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:5px; margin-top:8px; }
.daily-summary-grid div { padding:7px; background:#0c1b21; border:1px solid rgba(46,74,83,.55); }
.daily-summary-grid span { display:block; color:var(--muted); font-size:8px; }
.daily-summary-grid strong { display:block; margin-top:3px; color:var(--cyan); font:12px 'DM Mono',monospace; }
.daily-chart-wrap { position:relative; height:146px; margin-top:10px; background:#071116; border:1px solid rgba(46,74,83,.55); }
.daily-chart-wrap canvas { width:100%; height:100%; display:block; }
.daily-chart-empty { position:absolute; inset:0; display:none; align-items:center; justify-content:center; color:var(--muted); font-size:9px; }
.daily-chart-empty.show { display:flex; }
.daily-legend { display:flex; gap:11px; margin-top:6px; color:var(--muted); font-size:8px; }
.daily-legend span { display:flex; align-items:center; gap:4px; }
.daily-key { width:8px; height:2px; display:inline-block; }
.daily-key.stop { background:var(--red); }.daily-key.target1 { background:var(--green); }.daily-key.target2 { background:var(--orange); }
.daily-detail-list { margin-top:8px; max-height:220px; overflow:auto; border-top:1px solid rgba(46,74,83,.45); }
.daily-detail-row { display:flex; justify-content:space-between; gap:8px; padding:7px 0; border-bottom:1px solid rgba(46,74,83,.4); }
.daily-detail-row strong,.daily-detail-row small { display:block; }
.daily-detail-row strong { color:var(--soft); font-size:9px; font-weight:500; }
.daily-detail-row small { margin-top:3px; color:var(--muted); font:8px 'DM Mono',monospace; }
.daily-detail-row em { max-width:52%; color:var(--muted); font:8px/1.45 'DM Mono',monospace; font-style:normal; text-align:right; }
.daily-detail-empty { padding:14px 0; color:var(--muted); font-size:9px; text-align:center; }
@media (max-width:760px) { .forecast-validation { margin-top:13px; } .validation-metrics strong { font-size:12px; } }
@media (min-width:1101px) {
  .ai-summary { padding:17px 16px 16px; }
  .ai-summary .summary-tag { font-size:11px; }
  .ai-summary h3 { font-size:18px; line-height:1.45; text-wrap:balance; }
  .ai-summary p { font-size:13px; line-height:1.8; text-wrap:pretty; }
  .ai-summary .ai-confidence { font-size:11px; }
  .ai-summary .ai-confidence strong { font-size:13px; font-variant-numeric:tabular-nums; }
  .ai-summary .confidence-track { height:4px; margin-top:1px; }
}

/* ===== 重新排版：左宽右压缩，预测验证和活动移到左侧 ===== */
@media (min-width:1101px) {
  .workspace { grid-template-columns:310px minmax(0,1fr) 340px !important; }

  /* 左侧：限制自选列表高度，让新增板块上移 */
  .watchlist { max-height:240px; flex:none; }

  /* 左侧：预测验证模块 — 更宽松，字体更大 */
  .left-forecast {
    margin-top:14px; padding-top:14px; border-top:1px solid var(--line-strong);
  }
  .left-forecast .validation-heading h4 { font-size:16px; }
  .left-forecast .validation-heading > span { font-size:11px; padding-top:5px; }
  .left-forecast .validation-metrics { gap:10px; margin-top:12px; }
  .left-forecast .validation-metrics div { padding:12px 14px; }
  .left-forecast .validation-metrics span { font-size:11px; }
  .left-forecast .validation-metrics strong { font-size:17px; margin-top:6px; }
  .left-forecast .learning-feedback { margin-top:13px; padding-top:12px; }
  .left-forecast .learning-feedback-heading strong { font-size:12px; }
  .left-forecast .learning-feedback-heading span { font-size:10px; }
  .left-forecast .learning-feedback-metrics { margin-top:10px; }
  .left-forecast .learning-feedback-metrics div { padding:0 10px; }
  .left-forecast .learning-feedback-metrics div:first-child { padding-left:0; }
  .left-forecast .learning-feedback-metrics div:last-child { padding-right:0; }
  .left-forecast .learning-feedback-metrics span { font-size:10px; }
  .left-forecast .learning-feedback-metrics strong { margin-top:5px; font-size:13px; }
  .left-forecast .learning-feedback > p { margin-top:9px; font-size:10px; line-height:1.55; }
  .left-forecast .validation-note { font-size:11px; line-height:1.65; margin:12px 0 10px; }
  .left-forecast .validation-list { gap:6px; }
  .left-forecast .validation-row { padding:8px 0; font-size:11px; border-top-color:rgba(46,74,83,.5); }
  .left-forecast .validation-row span { font-size:12px; }
  .left-forecast .validation-row em { font-size:11px; }

  /* 左侧：活动提醒 — 字体更大 */
  .left-activity { margin-top:14px; padding-top:13px; border-top:1px solid var(--line-strong); }
  .left-activity .eyebrow { font-size:11px; }
  .left-activity .text-button { font-size:12px; }
  .left-activity-list { margin:11px 0 18px; }
  .left-activity-list .activity-row { padding:9px 0; }
  .left-activity-list .activity-row p { font-size:12px; }
  .left-activity-list .activity-row time { font-size:10px; }

  /* 右侧：压缩后字体全面放大，间距适中 */
  .insight-panel { padding:18px 20px 22px; }
  .insight-heading h2 { font-size:20px; }
  .ai-status { font-size:12px; }
  .ai-summary { margin-top:16px; padding:17px 17px 15px; }
  .ai-summary .summary-tag { font-size:12px; }
  .ai-summary h3 { font-size:19px; }
  .ai-summary p { font-size:13.5px; line-height:1.8; }
  .ai-confidence { font-size:12px; }
  .ai-confidence strong { font-size:14px; }

  /* 策略观察层 */
  .research-board { margin-top:16px; padding-top:15px; }
  .research-heading h3 { font-size:16px; }
  .research-heading > span { font-size:11px; }
  .research-disclaimer { font-size:11.5px; line-height:1.65; margin:12px 0 13px; }
  .outlook-list { gap:11px; }
  .outlook-row { padding:13px 15px; }
  .outlook-row-head strong { font-size:13.5px; }
  .outlook-row-head span { font-size:10px; }
  .outlook-range { font-size:16px; margin-top:9px; }
  .outlook-row p { font-size:11.5px; line-height:1.6; margin:8px 0 10px; }
  .outlook-rule { font-size:11px; line-height:1.55; gap:9px; }
  .source-details { font-size:11.5px; margin-top:13px; }
  .source-row { padding:9px 0; }
  .source-row strong { font-size:11.5px; }
  .source-row small { font-size:10.5px; }

  /* 情景分析 */
  .scenario-box { padding:17px 0; }
  .scenario-title { font-size:14px; margin-bottom:15px; }
  .scenario-row { margin:13px 0; gap:13px; }
  .scenario-bullet { width:26px; height:26px; font-size:14px; }
  .scenario-row strong { font-size:14px; }
  .scenario-row small { font-size:11.5px; margin-top:6px; }

  /* 风险温度 */
  .risk-box { padding:17px 0 15px; }
  .risk-header { font-size:14px; }
  .risk-header strong { font-size:14px; }
  .risk-meter { height:7px; margin:17px 0 9px; }
  .risk-meter b { height:16px; top:-5px; }
  .risk-scale { font-size:11px; }
  .risk-box p { font-size:12px; line-height:1.7; margin:15px 0 0; }

  /* 分析按钮 */
  .primary-button { height:44px; font-size:13.5px; margin-top:10px; }
}

/* 中等屏幕适配 */
@media (max-width:1400px) and (min-width:1101px) {
  .workspace { grid-template-columns:290px minmax(0,1fr) 310px !important; }
  .insight-panel { padding:16px 17px 20px; }
  .watchlist { max-height:220px; }
}

@media (max-width:1100px) {
  .left-activity { display:none; }
}

@media (max-width:1100px) and (min-width:761px) {
  .left-forecast .validation-metrics,.left-forecast .learning-feedback-metrics { grid-template-columns:1fr; }
  .left-forecast .validation-metrics { gap:5px; }
  .left-forecast .learning-feedback-metrics div { padding:6px 0; border-right:0; border-bottom:1px solid rgba(46,74,83,.45); }
  .left-forecast .learning-feedback-metrics div:last-child { border-bottom:0; }
}

/* ===== AI Copilot Widget (悬浮挂件) ===== */
.copilot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: inherit;
}

@media (max-width:1100px) and (min-width:761px) {
  body { overflow:auto; }
  .workspace { height:auto; min-height:calc(100vh - 64px); overflow:visible; grid-template-rows:auto auto; }
  .watchlist-panel { grid-row:1 / span 2; }
  .main-panel, .insight-panel, .watchlist-panel { overflow:visible; }
}

/* 悬浮按钮 */
.copilot-fab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 14px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  border: none;
  border-radius: 28px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4), 0 2px 8px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
  position: relative;
}
.copilot-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(99, 102, 241, 0.5), 0 4px 12px rgba(0,0,0,0.3);
}
.copilot-fab:active { transform: translateY(0); }
.fab-icon {
  width: 20px;
  height: 20px;
  fill: #fff;
}
.fab-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #6366f1;
  display: none;
}
.fab-dot.show { display: block; animation: fabPulse 1.5s ease-in-out infinite; }
@keyframes fabPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* 弹出面板 */
.copilot-popup {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  width: 340px;
  height: 440px;
  background: linear-gradient(160deg, #0f1d24 0%, #0a161b 100%);
  border: 1px solid #1e3a44;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5), 0 4px 16px rgba(0,0,0,0.3);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: popupIn 0.2s ease-out;
}
.copilot-popup.show { display: flex; }
@keyframes popupIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(139,92,246,0.1) 100%);
  border-bottom: 1px solid #1e3a44;
}
.popup-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.popup-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.popup-title strong {
  display: block;
  font-size: 13px;
  color: #e0edf0;
  font-weight: 600;
}
.popup-title span {
  display: block;
  font-size: 10px;
  color: #53d49a;
  margin-top: 1px;
}
.popup-close {
  width: 26px;
  height: 26px;
  border: none;
  background: rgba(255,255,255,0.06);
  color: #8aa4aa;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.popup-close:hover { background: rgba(255,255,255,0.12); color: #e0edf0; }

/* 快捷按钮 */
.popup-quick {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid #16282e;
  flex-wrap: wrap;
}
.pq-btn {
  padding: 5px 10px;
  font-size: 11px;
  color: #a8c0c6;
  background: rgba(255,255,255,0.04);
  border: 1px solid #1e3a44;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.pq-btn:hover {
  color: #fff;
  background: rgba(99,102,241,0.2);
  border-color: #6366f1;
}

/* 消息区 */
.popup-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.popup-messages::-webkit-scrollbar { width: 4px; }
.popup-messages::-webkit-scrollbar-track { background: transparent; }
.popup-messages::-webkit-scrollbar-thumb { background: #1e3a44; border-radius: 2px; }

.pm-msg {
  display: flex;
  gap: 8px;
  max-width: 90%;
}
.pm-msg.assistant { align-self: flex-start; }
.pm-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.pm-avatar {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.pm-msg.assistant .pm-avatar {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
}
.pm-msg.user .pm-avatar {
  background: #1e3a44;
  color: #a8c0c6;
}
.pm-bubble {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.55;
  color: #c8dde2;
  white-space: pre-wrap;
  word-break: break-word;
}
.pm-msg.assistant .pm-bubble {
  background: rgba(255,255,255,0.04);
  border: 1px solid #1e3a44;
  border-top-left-radius: 3px;
}
.pm-msg.user .pm-bubble {
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.25);
  color: #e0edf0;
  border-top-right-radius: 3px;
}

/* 输入区 */
.popup-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #1e3a44;
  background: rgba(0,0,0,0.2);
}
.popup-input input {
  flex: 1;
  padding: 8px 12px;
  font-size: 12px;
  color: #e0edf0;
  background: rgba(255,255,255,0.05);
  border: 1px solid #1e3a44;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s;
}
.popup-input input:focus { border-color: #6366f1; }
.popup-input input::placeholder { color: #4a6066; }
.popup-send {
  width: 34px;
  height: 34px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.popup-send:hover { transform: scale(1.05); }
.popup-send:active { transform: scale(0.95); }
.popup-send svg { width: 16px; height: 16px; fill: #fff; }

/* 气泡提醒 */
.copilot-bubble {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  width: 280px;
  background: linear-gradient(135deg, #1a2d35 0%, #132229 100%);
  border: 1px solid #2a4a55;
  border-radius: 12px;
  padding: 12px 14px;
  display: none;
  align-items: flex-start;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: bubbleIn 0.3s ease-out;
}
.copilot-bubble.show { display: flex; }
@keyframes bubbleIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.bubble-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.bubble-text {
  flex: 1;
  font-size: 12px;
  line-height: 1.5;
  color: #c8dde2;
}
.bubble-text strong {
  color: #f59e0b;
  font-weight: 600;
}
.bubble-close {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: #6b848a;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}
.bubble-close:hover { color: #e0edf0; }

/* ===== Copilot Widget v2 (圆形挂饰+气泡) ===== */
.copilot-widget { position: fixed; bottom: 20px; right: 20px; z-index: 9999; }

/* 圆形悬浮按钮 */
.copilot-fab {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(99,102,241,0.45), 0 2px 6px rgba(0,0,0,0.3);
  transition: all 0.25s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.copilot-fab:hover { transform: scale(1.08) translateY(-2px); box-shadow: 0 6px 24px rgba(99,102,241,0.55); }
.copilot-fab:active { transform: scale(0.95); }
.copilot-fab .fab-icon { width: 22px; height: 22px; fill: #fff; }
.fab-dot {
  position: absolute; top: 2px; right: 2px;
  width: 10px; height: 10px;
  background: #ef4444; border-radius: 50%;
  border: 2px solid #6366f1;
  display: none;
}
.fab-dot.show { display: block; animation: fabPulse 1.5s ease-in-out infinite; }
@keyframes fabPulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.3);opacity:.7} }

/* 气泡弹出窗口 */
.copilot-popup {
  position: absolute;
  bottom: calc(100% + 14px); right: 0;
  width: 300px; max-height: 420px;
  background: linear-gradient(160deg, #0f1d24 0%, #0a161b 100%);
  border: 1px solid #1e3a44;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  display: none; flex-direction: column;
  overflow: visible;
  animation: popupIn 0.2s ease-out;
}
.copilot-popup.show { display: flex; }
@keyframes popupIn { from{opacity:0;transform:translateY(8px) scale(.96)} to{opacity:1;transform:translateY(0) scale(1)} }

/* 小尾巴 */
.popup-tail {
  position: absolute; bottom: -7px; right: 16px;
  width: 12px; height: 12px;
  background: #0f1d24;
  border-right: 1px solid #1e3a44;
  border-bottom: 1px solid #1e3a44;
  transform: rotate(45deg);
}

.popup-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(99,102,241,.15), rgba(139,92,246,.08));
  border-bottom: 1px solid #1e3a44;
  border-radius: 14px 14px 0 0;
}
.popup-title { display: flex; align-items: center; gap: 8px; }
.popup-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff;
}
.popup-title strong { display: block; font-size: 12px; color: #e0edf0; font-weight: 600; }
.popup-title span { display: block; font-size: 9px; color: #53d49a; margin-top: 0; }
.popup-close {
  width: 22px; height: 22px; border: none;
  background: rgba(255,255,255,.06); color: #8aa4aa;
  border-radius: 50%; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; padding: 0; line-height: 1;
}
.popup-close:hover { background: rgba(255,255,255,.12); color: #e0edf0; }

/* 快捷按钮 */
.popup-quick {
  display: flex; gap: 5px; padding: 8px 10px;
  border-bottom: 1px solid #16282e;
  overflow-x: auto; flex-wrap: nowrap;
}
.popup-quick::-webkit-scrollbar { display: none; }
.pq-btn {
  padding: 4px 10px; font-size: 11px; white-space: nowrap;
  color: #a8c0c6; background: rgba(255,255,255,.04);
  border: 1px solid #1e3a44; border-radius: 10px;
  cursor: pointer; transition: all .15s; flex-shrink: 0;
}
.pq-btn:hover { color: #fff; background: rgba(99,102,241,.2); border-color: #6366f1; }
.pq-btn:active { transform: scale(.95); }

/* 消息区 */
.popup-messages {
  flex: 1; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 120px; max-height: 240px;
}
.popup-messages::-webkit-scrollbar { width: 3px; }
.popup-messages::-webkit-scrollbar-thumb { background: #1e3a44; border-radius: 2px; }
.pm-msg { display: flex; max-width: 88%; }
.pm-msg.assistant { align-self: flex-start; }
.pm-msg.user { align-self: flex-end; }
.pm-bubble {
  padding: 7px 11px; border-radius: 12px;
  font-size: 11.5px; line-height: 1.55;
  color: #c8dde2; white-space: pre-wrap; word-break: break-word;
}
.pm-msg.assistant .pm-bubble {
  background: rgba(255,255,255,.04);
  border: 1px solid #1e3a44;
  border-top-left-radius: 3px;
}
.pm-msg.user .pm-bubble {
  background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(139,92,246,.15));
  border: 1px solid rgba(99,102,241,.3);
  color: #e8eef0;
  border-top-right-radius: 3px;
}

/* 输入区 */
.popup-input {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid #1e3a44;
  background: rgba(0,0,0,.2);
  border-radius: 0 0 14px 14px;
}
.popup-input input {
  flex: 1; padding: 7px 10px; font-size: 11.5px;
  color: #e0edf0; background: rgba(255,255,255,.05);
  border: 1px solid #1e3a44; border-radius: 8px;
  outline: none; transition: border-color .15s; min-width: 0;
}
.popup-input input:focus { border-color: #6366f1; }
.popup-input input::placeholder { color: #4a6066; }
.popup-send {
  width: 30px; height: 30px; border: none;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0; padding: 0;
}
.popup-send:hover { transform: scale(1.08); }
.popup-send:active { transform: scale(.92); }
.popup-send svg { width: 14px; height: 14px; fill: #fff; }

/* 提醒气泡 */
.copilot-bubble {
  position: absolute; bottom: calc(100% + 14px); right: 0;
  width: 260px;
  background: linear-gradient(135deg, #1a2d35, #132229);
  border: 1px solid #2a4a55; border-radius: 12px;
  padding: 10px 12px; display: none;
  align-items: flex-start; gap: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,.4);
  animation: bubbleIn .3s ease-out;
}
.copilot-bubble.show { display: flex; }
@keyframes bubbleIn { from{opacity:0;transform:translateX(16px)} to{opacity:1;transform:translateX(0)} }
.bubble-icon {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.bubble-text { flex: 1; font-size: 11px; line-height: 1.5; color: #c8dde2; }
.bubble-text strong { color: #f59e0b; font-weight: 600; }
.opportunity-accuracy {
  display: block;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(83, 212, 154, .2);
  color: #8fdcba;
  font: 10px 'DM Mono', monospace;
  line-height: 1.55;
}
.bubble-close {
  width: 18px; height: 18px; border: none; background: transparent;
  color: #6b848a; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; padding: 0; line-height: 1;
}
.bubble-close:hover { color: #e0edf0; }

/* ===== Copilot 拖拽定位 ===== */
.copilot-widget {
  /* 支持JS设置left/top，默认保持右下角 */
  left: auto; top: auto;
}
/* 挂件在屏幕左半边时，面板向右展开 */
.copilot-widget.pop-left .copilot-popup {
  right: auto; left: 0;
}
.copilot-widget.pop-left .copilot-bubble {
  right: auto; left: 0;
}
.copilot-widget.pop-left .popup-tail {
  right: 16px; left: auto;
  border-right: none; border-left: 1px solid #1e3a44;
  transform: rotate(-45deg);
}
/* 拖拽时的视觉反馈 */
.copilot-fab.dragging {
  transform: scale(1.12);
  box-shadow: 0 8px 28px rgba(99,102,241,0.6);
  cursor: grabbing;
}
.copilot-fab { cursor: grab; }
.copilot-fab:active { cursor: grabbing; }

/* 挂件靠近顶部时，面板向下展开 */
.copilot-widget.pop-down .copilot-popup {
  bottom: auto; top: calc(100% + 14px);
}
.copilot-widget.pop-down .copilot-bubble {
  bottom: auto; top: calc(100% + 14px);
}
.copilot-widget.pop-down .popup-tail {
  bottom: auto; top: -7px;
  border-right: 1px solid #1e3a44;
  border-bottom: none;
  border-top: 1px solid #1e3a44;
  transform: rotate(-135deg);
}
.copilot-widget.pop-down.pop-left .popup-tail {
  transform: rotate(135deg);
}

/* ===== Trading validation gate ===== */
.trading-validation-panel { margin-top:24px; padding:18px 0 4px; border-top:1px solid var(--line); }
.trading-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:15px; }
.trading-heading h2 { margin:5px 0 0; font-size:16px; }
.trading-lock { display:grid; grid-template-columns:7px auto; align-items:center; column-gap:7px; text-align:right; }
.trading-lock .lock-dot { grid-row:1 / span 2; width:7px; height:7px; border-radius:50%; background:var(--orange); box-shadow:0 0 9px rgba(242,182,109,.65); }
.trading-lock strong { color:var(--orange); font:10px 'DM Mono',monospace; }
.trading-lock small { grid-column:2; color:var(--muted); font-size:9px; margin-top:3px; }
.trading-disclaimer { color:var(--muted); font-size:10px; line-height:1.6; margin:10px 0 13px; }
.paper-run-status { display:flex; align-items:center; gap:7px; min-height:28px; margin:-4px 0 9px; padding:6px 9px; background:#0b1a20; border:1px solid rgba(46,74,83,.8); color:var(--soft); }
.paper-run-dot { width:6px; height:6px; flex:0 0 auto; border-radius:50%; background:var(--muted); }
.paper-run-status.running .paper-run-dot { background:var(--green); box-shadow:0 0 8px rgba(97,217,160,.7); }
.paper-run-status.halted .paper-run-dot { background:var(--red); box-shadow:0 0 8px rgba(239,124,128,.6); }
.paper-run-status strong { font-size:10px; font-weight:500; }
.paper-run-status small { overflow:hidden; color:var(--muted); font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.trading-overview { display:grid; gap:10px; margin-bottom:10px; }
.paper-account-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:8px; }
.paper-account-grid > div { min-width:0; padding:12px; background:#0d2228; border:1px solid #23444b; }
.paper-account-grid span { display:block; color:var(--soft); font-size:9px; margin-bottom:7px; }
.paper-account-grid strong { display:block; overflow:hidden; color:var(--cyan); font:15px 'DM Mono',monospace; text-overflow:ellipsis; white-space:nowrap; }
.paper-account-grid small { display:block; overflow:hidden; margin-top:7px; color:var(--muted); font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.paper-equity-panel { min-width:0; padding:13px 14px 10px; border:1px solid var(--line-strong); background:#09181e; }
.paper-equity-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.paper-equity-heading h3 { margin:4px 0 0; font-size:13px; }
.paper-equity-result { min-width:0; text-align:right; }
.paper-equity-result span,.paper-equity-result strong { display:block; }
.paper-equity-result span { color:var(--muted); font-size:9px; }
.paper-equity-result strong { margin-top:4px; color:var(--cyan); font:11px 'DM Mono',monospace; white-space:nowrap; }
.paper-equity-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:12px 0 8px; }
.paper-equity-kpis div { min-width:0; padding-right:8px; border-right:1px solid var(--line); }
.paper-equity-kpis div:last-child { border-right:0; }
.paper-equity-kpis span,.paper-equity-kpis strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.paper-equity-kpis span { color:var(--muted); font-size:8px; }
.paper-equity-kpis strong { margin-top:4px; color:var(--soft); font:10px 'DM Mono',monospace; }
.paper-equity-chart-wrap { position:relative; height:190px; border-top:1px solid rgba(46,74,83,.65); border-bottom:1px solid rgba(46,74,83,.65); background:#071116; }
.paper-equity-chart-wrap svg { display:block; width:100%; height:100%; }
.paper-equity-empty { position:absolute; inset:0; display:none; place-items:center; color:var(--muted); font-size:10px; }
.equity-grid-line { stroke:#1d3038; stroke-width:1; vector-effect:non-scaling-stroke; }
.equity-grid-label { fill:#71878e; font:9px 'DM Mono',monospace; }
.equity-baseline { stroke:#f2bd76; stroke-width:1; stroke-dasharray:5 5; opacity:.6; vector-effect:non-scaling-stroke; }
.equity-current-label { fill:var(--text); font:10px 'DM Mono',monospace; }
.paper-equity-axis { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:7px; color:var(--muted); font:8px 'DM Mono',monospace; }
.paper-equity-axis span:nth-child(2) { overflow:hidden; text-align:center; text-overflow:ellipsis; white-space:nowrap; }
.sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
.trading-metrics { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.trading-metrics div { padding:10px; background:#101f26; border:1px solid rgba(29,48,56,.8); }
.trading-metrics span { display:block; color:var(--muted); font-size:9px; margin-bottom:7px; }
.trading-metrics strong { font:11px 'DM Mono',monospace; color:var(--cyan); }
.trading-controls { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin-top:12px; }
.trading-controls label { color:var(--muted); font-size:9px; }
.trading-controls input,.trading-controls select { display:block; width:100%; height:31px; margin-top:5px; padding:0 8px; border:1px solid var(--line); border-radius:4px; background:#071116; color:var(--text); outline:0; font:10px 'DM Mono',monospace; }
.trading-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:12px; }
.trading-actions button { width:auto; flex:1 1 120px; margin-top:0; }
.trading-actions .reset-paper { color:var(--red); background:#2d2022; }
.paper-operations { margin-top:13px; padding-top:12px; border-top:1px solid rgba(29,48,56,.7); }
.paper-operations-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom:8px; }
.paper-operations-heading h3 { margin:4px 0 0; font-size:12px; }
.paper-operations-heading > span { color:var(--muted); font:9px 'DM Mono',monospace; }
.paper-operation-list { min-height:39px; max-height:190px; overflow:auto; background:#071116; border:1px solid var(--line); }
.paper-operation-row { display:grid; grid-template-columns:82px 42px minmax(150px,1fr) 82px 68px; align-items:center; gap:8px; min-height:42px; padding:7px 9px; border-bottom:1px solid rgba(29,48,56,.65); }
.paper-operation-row:last-child { border-bottom:0; }
.paper-operation-row time { color:var(--muted); font:8px 'DM Mono',monospace; }
.operation-side { display:grid; place-items:center; height:22px; border:1px solid; font-size:9px; }
.operation-side.long { color:var(--green); border-color:rgba(83,212,154,.4); background:rgba(83,212,154,.08); }
.operation-side.short { color:var(--red); border-color:rgba(238,119,119,.4); background:rgba(238,119,119,.08); }
.operation-side.close { color:var(--orange); border-color:rgba(242,182,109,.4); background:rgba(242,182,109,.08); }
.paper-operation-row div { min-width:0; }
.paper-operation-row div strong { display:block; font:10px 'DM Mono',monospace; }
.paper-operation-row div strong i { margin-left:5px; color:var(--muted); font:8px 'Space Grotesk',sans-serif; font-style:normal; font-weight:400; }
.paper-operation-row div small { display:block; overflow:hidden; margin-top:3px; color:var(--muted); font-size:8px; text-overflow:ellipsis; white-space:nowrap; }
.paper-operation-row b,.paper-operation-row em { text-align:right; font:9px 'DM Mono',monospace; font-style:normal; white-space:nowrap; }
.paper-operation-row b { color:var(--soft); font-weight:400; }
.readiness-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:6px 14px; margin-top:13px; padding-top:12px; border-top:1px solid rgba(29,48,56,.7); }
.readiness-item { display:flex; justify-content:space-between; gap:10px; padding:5px 0; color:var(--muted); font-size:10px; }
.readiness-item strong { font:10px 'DM Mono',monospace; }
.readiness-item.pass strong { color:var(--green); }.readiness-item.fail strong { color:var(--orange); }
.audit-log { display:none; max-height:190px; overflow:auto; margin-top:10px; padding:9px; background:#071116; border:1px solid var(--line); font:9px 'DM Mono',monospace; color:var(--soft); }.audit-log.open { display:block; }
.audit-entry { padding:6px 0; border-bottom:1px solid rgba(29,48,56,.6); }.audit-entry:last-child { border-bottom:0; }.audit-entry time { color:var(--muted); margin-right:8px; }
@media(min-width:1500px){.workspace{grid-template-columns:272px minmax(0,1fr) 340px}.trading-overview{grid-template-columns:minmax(330px,.8fr) minmax(440px,1.4fr);align-items:stretch}.paper-account-grid{grid-template-columns:repeat(2,minmax(0,1fr));margin-bottom:0}.trading-controls{grid-template-columns:repeat(7,minmax(0,1fr))}}
@media(max-width:760px){.trading-validation-panel{margin-top:20px;padding-top:16px}.trading-heading{align-items:center}.trading-disclaimer{font-size:11px}.paper-run-status{align-items:flex-start;flex-wrap:wrap;padding:9px}.paper-run-status small{width:100%;white-space:normal;line-height:1.5}.paper-account-grid,.trading-metrics,.trading-controls{grid-template-columns:repeat(2,minmax(0,1fr))}.paper-account-grid>div{padding:10px}.paper-account-grid span,.paper-account-grid small,.trading-metrics span{font-size:10px}.paper-equity-panel{padding:12px 10px 9px}.paper-equity-kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 0}.paper-equity-kpis div:nth-child(2){border-right:0}.paper-equity-kpis div:nth-child(n+3){padding-top:7px;border-top:1px solid var(--line)}.paper-equity-chart-wrap{height:170px}.trading-controls input,.trading-controls select{height:44px;font-size:16px}.trading-actions button{min-height:44px;flex-basis:45%;font-size:11px}.paper-operation-row{grid-template-columns:64px 38px minmax(110px,1fr) 60px}.paper-operation-row em{display:none}.readiness-grid{grid-template-columns:1fr}}
@media(max-width:420px){.paper-account-grid,.trading-metrics,.trading-controls{grid-template-columns:1fr}.paper-equity-heading{display:block}.paper-equity-result{margin-top:8px;text-align:left}.trading-actions button{flex-basis:100%}}

/* ===== Account access ===== */
.account-button { border:0; padding:0; cursor:pointer; }
.account-modal { width:min(430px,calc(100vw - 28px)); }
.account-identity { display:grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:center; gap:10px; padding:12px 0 16px; border-bottom:1px solid var(--line); }
.account-avatar { display:grid; place-items:center; width:42px; height:42px; border-radius:50%; background:#17383a; color:var(--cyan); font:600 15px 'DM Mono',monospace; }
.account-identity strong,.account-identity span { display:block; }
.account-identity strong { font-size:14px; }.account-identity span { margin-top:4px; color:var(--muted); font:10px 'DM Mono',monospace; }
.account-identity em { padding:4px 6px; border:1px solid rgba(83,212,154,.35); color:var(--green); font:9px 'DM Mono',monospace; font-style:normal; }
.account-password-form { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-top:16px; }
.account-password-form h3 { grid-column:1/-1; margin:0; font-size:12px; }
.account-password-form label,.invite-form label { color:var(--muted); font-size:9px; }
.account-password-form input,.invite-form input { display:block; width:100%; height:36px; margin-top:5px; padding:0 9px; border:1px solid var(--line); border-radius:4px; background:#071116; color:var(--text); outline:0; }
.account-password-form input:focus,.invite-form input:focus { border-color:var(--cyan); }
.account-password-form button { grid-column:1/-1; margin:0; }
.account-actions { display:flex; gap:8px; margin-top:16px; }.account-actions button { margin:0; }
.danger-button { color:var(--red)!important; border-color:rgba(238,119,119,.35)!important; }
.admin-modal { width:min(760px,calc(100vw - 28px)); max-height:min(86vh,820px); overflow:auto; }
.invite-form { display:grid; grid-template-columns:2fr 1fr 1fr auto; align-items:end; gap:8px; padding:14px 0; border-bottom:1px solid var(--line); }
.invite-form button { height:36px; margin:0; white-space:nowrap; }
.generated-code { margin:12px 0; padding:10px; border:1px solid rgba(83,212,154,.35); background:rgba(83,212,154,.06); }
.generated-code span,.generated-code strong { display:block; }.generated-code span { color:var(--muted); font-size:9px; }.generated-code strong { margin-top:6px; overflow-wrap:anywhere; color:var(--green); font:12px 'DM Mono',monospace; }
.admin-section { padding-top:15px; }.admin-section-heading { display:flex; justify-content:space-between; align-items:center; margin-bottom:7px; }.admin-section-heading h3 { margin:0; font-size:12px; }.admin-section-heading span { color:var(--muted); font:9px 'DM Mono',monospace; }
.admin-list { border:1px solid var(--line); background:#071116; }
.admin-row { display:grid; grid-template-columns:minmax(130px,1fr) minmax(130px,1fr) auto; align-items:center; gap:10px; min-height:48px; padding:8px 10px; border-bottom:1px solid rgba(29,48,56,.7); }
.admin-row:last-child { border-bottom:0; }.admin-row strong,.admin-row small { display:block; }.admin-row strong { font-size:10px; }.admin-row small { margin-top:3px; color:var(--muted); font:8px 'DM Mono',monospace; }
.admin-row em { color:var(--soft); font:9px 'DM Mono',monospace; font-style:normal; }
.admin-row-actions { display:flex; gap:6px; }.admin-row-actions button { min-height:28px; padding:0 8px; border:1px solid var(--line); border-radius:4px; background:#10252b; color:var(--soft); font-size:9px; cursor:pointer; }
.admin-empty { padding:16px; color:var(--muted); font-size:10px; text-align:center; }

.auth-gate { position:fixed; inset:0; z-index:10000; display:grid; grid-template-rows:auto 1fr auto; min-height:100dvh; padding:28px clamp(18px,5vw,64px) 18px; overflow:auto; background:#071116; color:var(--text); }
.auth-gate[hidden] { display:none; }
.auth-brand { display:flex; align-items:center; gap:11px; }
.auth-panel { align-self:center; justify-self:center; width:min(420px,100%); padding:26px; border:1px solid var(--line-strong); border-radius:7px; background:#0b1a20; box-shadow:0 24px 70px rgba(0,0,0,.35); }
.auth-heading h1 { margin:6px 0 8px; font-size:24px; letter-spacing:0; }.auth-heading p { margin:0; color:var(--muted); font-size:12px; line-height:1.6; }
.auth-tabs { display:grid; grid-template-columns:repeat(3,1fr); gap:3px; margin:20px 0 16px; padding:3px; border:1px solid var(--line); border-radius:5px; background:#071116; }
.auth-tabs button { min-height:36px; padding:0 5px; border:0; border-radius:3px; background:transparent; color:var(--muted); font-size:10px; cursor:pointer; }.auth-tabs button.active { background:#17353c; color:var(--text); }
.auth-form { display:none; gap:11px; }.auth-form.active { display:grid; }.auth-form p { margin:0 0 3px; color:var(--muted); font-size:11px; line-height:1.6; }
.auth-form label { color:var(--soft); font-size:10px; }.auth-form label small { display:block; margin-top:4px; color:var(--muted); font-size:9px; }
.auth-form input { display:block; width:100%; height:44px; margin-top:6px; padding:0 11px; border:1px solid var(--line); border-radius:4px; background:#071116; color:var(--text); outline:0; font:12px 'DM Mono',monospace; }.auth-form input:focus { border-color:var(--cyan); box-shadow:0 0 0 2px rgba(82,209,211,.1); }
.auth-form .primary-button { height:44px; margin:3px 0 0; }.auth-link { justify-self:center; min-height:32px; border:0; background:transparent; color:var(--cyan); font-size:10px; cursor:pointer; }
.auth-feedback { min-height:18px; margin-top:10px; color:var(--red); font-size:10px; line-height:1.5; text-align:center; }.auth-feedback.success { color:var(--green); }
.auth-insecure { margin-bottom:14px; padding:10px; border-left:2px solid var(--orange); background:rgba(242,182,109,.07); }.auth-insecure strong,.auth-insecure span { display:block; }.auth-insecure strong { color:var(--orange); font-size:11px; }.auth-insecure span { margin-top:4px; color:var(--muted); font-size:9px; line-height:1.55; }
.auth-foot { align-self:end; color:var(--muted); font:9px 'DM Mono',monospace; text-align:center; }
body.auth-locked { overflow:hidden; }

@media(max-width:760px){
  .auth-gate { padding:18px 14px 14px; }.auth-panel { padding:20px 16px; }.auth-heading h1 { font-size:21px; }.auth-tabs button { font-size:9px; }
  .account-password-form { grid-template-columns:1fr; }.account-password-form h3,.account-password-form button { grid-column:auto; }
  .invite-form { grid-template-columns:1fr 1fr; }.invite-form label:first-child,.invite-form button { grid-column:1/-1; }
  .admin-row { grid-template-columns:minmax(0,1fr) auto; }.admin-row > em { grid-column:1/-1; }.admin-row-actions { grid-column:2; grid-row:1; }
}
