:root{--bg:#ffffff;--panel:#ffffff;--text:#000000;--muted:#333333;--grid:#e6e6e6}*{box-sizing:border-box}body{margin:0;font:14px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,Arial;color:var(--text);background:var(--bg)}.container,main{max-width:1100px;margin:0 auto;padding:16px 20px}.navbar{display:block;padding:0;border-bottom:1px solid #eee}.navbar .container{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 20px 12px}.navbar .brand{text-decoration:none;color:#222;font-weight:600}.navbar .nav-note{color:#777;font-size:12px;margin-left:12px;white-space:nowrap}.navbar .nav-left{display:flex;align-items:center;flex:1 1 auto}.navbar .nav-right{display:flex;align-items:center;gap:12px;flex:0 0 auto}.navbar .nav-link{text-decoration:none;color:#555}.navbar .nav-link:hover{color:#000}.navbar .nav-link.active{color:#000;font-weight:600}.navbar .nav-toggle{display:inline-flex;align-items:center;gap:6px;color:#555}.agent-header{display:flex;align-items:flex-start;gap:12px}.agent-prompt{flex:1 1 auto;display:flex;align-items:center;gap:8px}.agent-prompt textarea{flex:1 1;min-height:32px;max-height:100px;resize:vertical;padding:6px 8px;font-size:14px}.agent-metrics{display:flex;align-items:center;gap:12px;flex:0 0 auto}.prompt-actions{display:inline-flex;align-items:center;gap:8px}.history-wrap,.prompt-actions{position:relative}.history-menu{position:absolute;right:0;top:120%;min-width:240px;max-width:60vw;max-height:280px;overflow:auto;background:#fff;border:1px solid #eee;border-radius:6px;box-shadow:0 4px 12px rgba(0,0,0,.08);padding:6px;z-index:20}.history-item{display:block;width:100%;text-align:left;padding:6px 8px;background:transparent;border:0;cursor:pointer;color:#333}.history-item:hover{background:#f6f6f6}.history-empty{color:var(--muted);padding:6px 8px}.chart-section{margin:12px 0;padding:0}.chart-layout{display:flex;gap:16px;align-items:stretch;flex-wrap:nowrap}.chart-main{flex:1 1 720px;min-width:0}.chart-side-col{display:flex;flex-direction:column;gap:16px;flex:0 0 300px;min-width:300px;height:100%}.chart-aside{flex:0 0 auto;min-width:300px;max-width:300px;height:480px;background:var(--panel);border:1px solid #eee;border-radius:6px;padding:12px;box-shadow:0 1px 2px rgba(0,0,0,.04);overflow:auto}.news-data-count{color:var(--muted);font-size:12px;margin-top:6px;padding-left:2px}.chart-toolbar{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:6px 8px;color:var(--muted)}.chart-toolbar .left-tools{display:flex;flex-direction:column;gap:4px;align-items:flex-start}.chart-toolbar .right-tools{display:flex;flex-direction:column;gap:4px;align-items:flex-end}.ticker-badge{color:var(--muted);font-size:18px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}.segmented{display:inline-flex;gap:0;border:0}.segmented>button{background:transparent;color:#555;border:0;padding:6px 10px;cursor:pointer;border-radius:6px;transition:background-color .12s ease}.segmented>button:hover{background:#f6f6f6}.segmented>button:active{background:#eee}.segmented>button.active{color:#000;font-weight:600}canvas{width:100%;display:block;background:#ffffff;border:0;border-radius:0}#chart{height:360px}canvas#overview{height:80px;cursor:crosshair;touch-action:none}.window-stats{padding:6px 2px;color:var(--muted);font-feature-settings:"tnum";font-variant-numeric:tabular-nums}.table-toolbar{display:none}.backtest-section{margin-top:12px;padding-top:0}.backtest-section h2{margin:6px 0 10px;font-size:16px;color:var(--muted)}.backtest-layout{display:flex;gap:20px;flex-wrap:wrap;align-items:flex-start;margin-top:12px}.backtest-primary{flex:1 1 520px;min-width:280px;background:var(--panel);border:1px solid #eee;border-radius:6px;padding:16px;box-shadow:0 1px 2px rgba(0,0,0,.04);display:flex;flex-direction:column;gap:14px}.backtest-primary h2{margin:0}.backtest-controls{display:block}.backtest-controls label{display:grid;grid-template-columns:160px 1fr;grid-gap:10px;gap:10px}.backtest-controls input[type=number]{padding:8px;max-width:240px}.backtest-actions{display:flex;gap:10px;align-items:center;margin-top:8px}.backtest-controls label{display:inline-flex;gap:6px;align-items:center}.backtest-controls input[type=number]{width:120px;padding:6px}.backtest-controls button{padding:6px 10px;cursor:pointer}.backtest-input{margin-top:10px}.backtest-input textarea{width:100%;min-height:140px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,Liberation Mono,monospace;font-size:12px;padding:8px}.backtest-output{margin-top:10px;padding:8px;border:1px solid #eee;max-height:260px;overflow:auto}.backtest-output,.viewer-output{background:#f8f8f8}.trade-table{width:100%;border-collapse:collapse;margin-top:10px;font-feature-settings:"tnum";font-variant-numeric:tabular-nums;table-layout:fixed}.trade-table-title{margin:0 0 6px;font-size:16px;color:var(--muted)}.trade-table td,.trade-table th{padding:6px 8px;border-bottom:1px solid #eee}.trade-table th{text-align:left;font-weight:500;background:#fff}.trade-table td{font-weight:400}.trade-table td.right{text-align:right}.trade-table td.col-date,.trade-table td.col-time,.trade-table th.col-date,.trade-table th.col-time{width:120px;white-space:nowrap}.trade-table th.right{text-align:right}.trade-table td.col-num,.trade-table th.col-num{text-align:right;width:90px}.trade-table td.col-volume,.trade-table th.col-volume{text-align:right;width:110px}.trade-table td.col-return,.trade-table th.col-return{width:90px}.trade-table td.col-prompt,.trade-table th.col-prompt{width:auto}.trade-table td.col-return.ret-pos{color:#2e7d32}.trade-table td.col-return.ret-neg{color:#c62828}.trade-table .trade-action.buy{color:#2e7d32;font-weight:600}.trade-table .trade-action.sell{color:#c62828;font-weight:600}.trade-table tbody tr:hover{background:#f5f5f5}.trade-table tr.bench-highlight{background:#fff9e6}.results-top{margin:16px 0 12px}.results-card{background:var(--panel);border:1px solid #eee;border-radius:6px;padding:12px 14px;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;box-shadow:0 1px 2px rgba(0,0,0,.04)}.ending-hero{min-width:220px}.ending-hero .ending-label{color:var(--muted);font-size:12px;margin-bottom:2px}.ending-hero .ending-value{font-size:28px;font-weight:700;line-height:1.1}.ending-hero.pos .ending-value{color:#2e7d32}.ending-hero.neg .ending-value{color:#c62828}.results-meta{display:flex;flex-direction:column;gap:4px;min-width:300px}.results-inline{display:flex;flex-wrap:wrap;gap:10px;align-items:baseline;color:var(--muted);font-size:12px}.results-inline .meta-item strong{font-weight:500;color:var(--text);margin-left:2px}.results-inline .meta-sep{opacity:.5}@media (max-width:768px){.results-card{flex-direction:column;align-items:flex-start}.results-meta{width:100%}}.mini-table{border-collapse:collapse}.mini-table td,.mini-table th{padding:2px 8px}.mini-table th{text-align:left;font-weight:600}.mini-table td.label,.mini-table th{color:var(--muted)}.mini-table td.right,.mini-table td.value{text-align:right}.row-linked{background:#fff7e6}.backtest-trades-card,.chart-card{margin-top:12px;background:var(--panel);border:1px solid #eee;border-radius:6px;padding:16px;box-shadow:0 1px 2px rgba(0,0,0,.04)}.debug-card{border-color:#e53935;box-shadow:inset 0 0 0 1px rgba(229,57,53,.35)}.ai-progress{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-size:12px;margin-left:6px}.ai-progress .ai-bar{position:relative;width:160px;height:8px;background:linear-gradient(#f0f0f0,#e9e9e9);border-radius:9999px;overflow:hidden;display:inline-block;box-shadow:inset 0 1px 2px rgba(0,0,0,.06)}.ai-progress .ai-fill{display:block;height:100%;background:linear-gradient(90deg,#4c8bf5,#7da2f8);transition:width .22s ease-in-out}.ai-progress .ai-fill.pos{background:linear-gradient(90deg,#2e7d32,#43a047)}.ai-progress .ai-fill.neg{background:linear-gradient(90deg,#c62828,#ef5350)}.ai-progress .ai-fill.loading{background:linear-gradient(90deg,#bdbdbd,#d6d6d6)}.ai-progress .ai-segs{position:absolute;inset:0;pointer-events:none;border-radius:inherit;background-image:linear-gradient(90deg,rgba(0,0,0,.12) 0 1px,transparent 1px);background-repeat:repeat-x;mix-blend-mode:multiply}.prompt-status{max-width:1100px;margin:4px auto 0;padding:0 20px 8px;display:flex;align-items:center;gap:12px;color:#777;font-size:12px}.prompt-status .prompt-metrics{font-feature-settings:"tnum";font-variant-numeric:tabular-nums}.debug-toggle{display:inline-flex;align-items:center;gap:6px;margin-top:0;color:inherit;font-weight:inherit}.debug-toggle input{accent-color:#555}.llm-prompt{margin-top:8px}.llm-prompt details{cursor:pointer}.llm-prompt pre{white-space:pre-wrap;background:#fafafa;border:1px solid #eee;padding:8px;margin:6px 0 0;font-size:12px}.backtest-summary-card{flex:0 0 300px;min-width:300px;max-width:300px;background:var(--panel);border:1px solid #eee;border-radius:6px;padding:16px;box-shadow:0 1px 2px rgba(0,0,0,.04);display:flex;flex-direction:column;gap:12px}.backtest-summary-card h2{margin:0;font-size:16px;color:var(--muted)}.backtest-summary{display:grid;grid-gap:10px;gap:10px;font-feature-settings:"tnum";font-variant-numeric:tabular-nums}.summary-row{display:grid;grid-template-columns:160px 1fr;grid-gap:12px;gap:12px;align-items:center}.summary-row span{color:var(--muted);font-weight:400}.summary-row .summary-value{text-align:right;font-weight:400;color:var(--text)}.llm-editors{display:grid;grid-template-columns:1fr;grid-gap:8px;gap:8px;margin-top:10px}.llm-editors label{display:grid;grid-template-columns:160px 1fr;grid-gap:10px;gap:10px;align-items:start}.llm-editors textarea{width:100%;min-height:80px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,Liberation Mono,monospace;font-size:12px;padding:8px}.llm-editors label.compact>span{font-size:12px;color:var(--muted)}.settings{display:flex;flex-direction:column;gap:12px;margin-top:10px}.settings-row{display:grid;grid-template-columns:160px 1fr;grid-gap:10px;gap:10px;align-items:center}.settings-row input{padding:8px}.metric-input{width:100%;padding:8px}.metric-input.compact{width:90px;padding:6px}.settings-row input[type=range]{accent-color:#888}.stepper{display:inline-flex;gap:6px}.stepper button{padding:6px 10px;border:1px solid #ddd;background:#fafafa;border-radius:4px;cursor:pointer}.stepper.compact{gap:4px}.stepper.compact button{padding:4px 6px}.stepper button:active{background:#f0f0f0}.settings-actions{display:flex;gap:10px}.hint{color:var(--muted);font-size:12px}.notice{padding:10px 12px;border:1px solid #f0e6b5;border-radius:6px}.notice,.notice.warn{background:#fff9e6;color:#5c4b00}.notice.warn{border-color:#f0e6b5}.settings-row select{padding:8px}.settings-row textarea{padding:8px;min-height:120px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,Liberation Mono,monospace;font-size:12px}.settings-title-row{display:flex;align-items:center;justify-content:space-between;margin:6px 0}.settings-title{margin:0;font-size:16px;color:var(--muted)}.settings-page .settings{background:var(--panel);border:1px solid #eee;border-radius:6px;padding:16px;box-shadow:0 1px 2px rgba(0,0,0,.04);margin-bottom:16px}.settings-page .settings-title-row{margin:16px 0 8px}.settings strong,.settings th{font-weight:500}.sticky-save{display:none;position:fixed;left:0;right:0;bottom:0;background:var(--panel);border-top:1px solid #eee;padding:8px 0;z-index:1000}.sticky-save .bar{display:flex;gap:10px;justify-content:flex-end;max-width:1100px;margin:0 auto;padding:0 20px}@media (max-width:768px){.settings-row{grid-template-columns:1fr}.sticky-save{display:block}.sticky-save .bar{justify-content:space-between}.llm-editors label{grid-template-columns:1fr}.llm-editors label>span{margin-bottom:4px}}.has-footer{padding-bottom:0}@media (max-width:768px){.has-footer{padding-bottom:calc(64px + env(safe-area-inset-bottom))}}.top-actions{position:fixed;top:10px;right:16px;display:flex;flex-direction:column;align-items:flex-end;gap:8px}.top-item{background:rgba(255,255,255,.9);padding:6px 10px;border:1px solid #eee;border-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.04)}.top-settings{text-decoration:none;color:#555;font-weight:400;display:inline-flex;align-items:center;gap:6px}.top-settings:hover{color:#000}.top-debug{color:#c62828;font-weight:400;border:none;box-shadow:none}.top-debug input{accent-color:#c62828}@media (max-width:768px){#chart{height:240px}canvas#overview{height:60px}.chart-layout{flex-direction:column;gap:8px}.overview{margin:0;padding:0}.chart-main{flex:0 0 auto}.chart-section{margin:12px 0}.chart-side-col{min-width:100%;max-width:100%;flex:0 0 auto;height:auto}.chart-aside{min-width:0;max-width:100%;width:100%;max-height:40vh;overflow-y:auto}.backtest-trades-card{overflow-x:auto}.backtest-trades-card .trade-table{min-width:720px}}@media (max-width:768px){.mobile-hide{display:none!important}}.prompt-bar{position:-webkit-sticky;position:sticky;top:0;z-index:9;background:var(--panel);border-bottom:0}.prompt-bar .prompt-inner{max-width:1100px;margin:0 auto;padding:8px 20px;display:flex;align-items:center;gap:10px}.prompt-bar textarea{flex:1 1;min-height:32px;max-height:72px;resize:vertical;padding:6px 8px;font-size:14px}.prompt-bar .prompt-actions{display:inline-flex;align-items:center;gap:8px;position:relative}.prompt-bar .history-wrap{position:relative}.prompt-bar .history-menu{position:absolute;right:0;top:120%;min-width:240px;max-width:60vw;max-height:280px;overflow:auto;background:#fff;border:1px solid #eee;border-radius:6px;box-shadow:0 4px 12px rgba(0,0,0,.08);padding:6px}.prompt-bar .history-item{display:block;width:100%;text-align:left;padding:6px 8px;background:transparent;border:0;cursor:pointer;color:#333}.prompt-bar .history-item:hover{background:#f6f6f6}.prompt-bar .history-empty{color:var(--muted);padding:6px 8px}.table-scroll{margin-top:12px;overflow:auto;border:1px solid #eee;border-radius:6px}.table-scroll thead th{position:-webkit-sticky;position:sticky;top:0;z-index:1}.news-page .trade-table th{font-weight:500}