:root {
  color-scheme: dark;
  --bg:#0b1017; --surface:#121923; --surface-up:#19222e; --line:#253140;
  --ink:#f1f4f8; --muted:#9ba9ba; --accent:#d7fa65; --accent-ink:#192317;
  --up:#ff8d95; --down:#8bb1ff; --success:#a8e9a8;
  font:16px/1.5 -apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Malgun Gothic",system-ui,sans-serif;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;color:var(--ink);background:radial-gradient(ellipse at 15% 8%,#14202b 0,transparent 32rem),var(--bg)}
button,input,select{font:inherit}
button,a,input,select{outline-offset:4px}
button{cursor:pointer}
button:disabled{cursor:default;opacity:.55}
a{color:inherit;text-decoration:none}
h1,h2,p{margin:0}
h1{font-size:clamp(2rem,4vw,3.3rem);letter-spacing:-.065em;line-height:1.15}
h2{font-size:1.125rem;letter-spacing:-.035em;font-weight:750}
.shell{width:min(100% - 64px,1200px);margin-inline:auto}
.top{border-bottom:1px solid var(--line);background:#0d131be6}
.header{display:flex;align-items:center;justify-content:space-between;gap:1rem;min-height:72px}
.brand{display:inline-flex;align-items:center;gap:.26rem;font-weight:900;letter-spacing:.045em;font-size:1.02rem;white-space:nowrap}
.brand>span:last-child{color:var(--accent)}
.logo{width:34px;height:34px;display:inline-flex;align-items:end;justify-content:center;gap:3px;padding:7px;border-radius:9px;background:var(--accent);margin-right:.43rem}
.logo i{width:4px;height:8px;background:var(--accent-ink);border-radius:1px}
.logo i:nth-child(2){height:13px}.logo i:nth-child(3){height:19px}
nav,.header-actions,.actions,.segmented{display:flex;align-items:center;gap:.4rem}
nav{min-height:72px;gap:1.55rem}
.navbtn{min-height:72px;border:0;border-bottom:2px solid transparent;background:none;color:var(--muted);font-size:.9rem;font-weight:700;padding:.1rem .15rem}
.navbtn:hover,.navbtn.active{color:var(--ink)}.navbtn.active{border-bottom-color:var(--accent)}
.button,.icon-button{display:inline-flex;align-items:center;justify-content:center;border:1px solid #354456;border-radius:8px;padding:.61rem .9rem;background:var(--surface-up);color:var(--ink);font-weight:700;font-size:.9rem;white-space:nowrap;min-height:40px}
.button:hover,.icon-button:hover{border-color:#728390;background:#253241}
.icon-button{width:40px;padding:.2rem;font-size:1.17rem}
.button.small{min-height:36px;padding:.35rem .68rem;font-size:.83rem}
.button.primary{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}.button.primary:hover{background:#e4ff94}
.intro{display:flex;justify-content:space-between;align-items:end;gap:1rem;padding:45px 0 27px}
.intro p{color:var(--muted);margin-top:.65rem}
.overline{display:flex;align-items:center;gap:.5rem;margin-bottom:.68rem;color:var(--muted);font-size:.8rem;font-weight:750;letter-spacing:.045em}
.signal{width:7px;height:7px;background:var(--accent);border-radius:50%;box-shadow:0 0 10px #d7fa6555}
.overline-divider{height:.85rem;width:1px;background:#3e4d5f;margin-inline:.21rem}
.card{background:var(--surface);border:1px solid var(--line);border-radius:14px}
.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:16px}
.metric{padding:17px 19px;display:grid;gap:.23rem}
.metric>span,.metric small,.muted,.chart-foot,.watch-label{color:var(--muted);font-size:.83rem}
.metric strong{font-size:clamp(1.18rem,2.35vw,1.85rem);letter-spacing:-.035em;font-variant-numeric:tabular-nums;min-height:2.1rem}
.unit{font-size:.94rem;color:var(--muted);font-weight:600;margin-left:.35rem}
.metric-status{color:var(--accent)}
.market-grid{display:grid;grid-template-columns:minmax(0,2.18fr) minmax(269px,1fr);gap:16px}
.chart-card,.watch-card,.panel,.data-card{padding:19px 20px}
.card-header{display:flex;justify-content:space-between;align-items:center;gap:.7rem;min-height:30px}
.card-header p{color:var(--muted);font-size:.85rem;margin-top:.18rem}
.tag{border:1px solid #354356;color:#aebfd2;border-radius:5px;padding:.12rem .43rem;font-size:.75rem;white-space:nowrap}
.quote-row{display:flex;justify-content:space-between;align-items:end;gap:.6rem;margin:19px 0 11px}
.market-symbol{color:var(--muted);font-size:.91rem;font-weight:650}.market-symbol b{font-size:.76rem;color:var(--muted);margin-left:.3rem;font-weight:500}
.price-row{display:flex;align-items:center;gap:.64rem}.price-row strong{font-size:1.7rem;letter-spacing:-.04em;font-variant-numeric:tabular-nums}
.price-row span{font-size:.82rem;font-weight:750}
.segmented{background:#0d141d;border:1px solid var(--line);padding:3px;border-radius:8px;gap:2px}
.segmented button{border:0;border-radius:5px;padding:.39rem .66rem;color:var(--muted);background:none;font-weight:650;font-size:.84rem;white-space:nowrap}
.segmented button.active{background:#283443;color:var(--ink)}
.segmented.compact button{font-size:.73rem;padding:.27rem .51rem}
.chart-area{height:241px;position:relative}
#chart{height:100%;width:100%;display:block}
#chart-empty{position:absolute;inset:0;display:grid;place-items:center;color:var(--muted)}
#chart-tip{position:absolute;top:.3rem;left:.3rem;background:#07111e;color:var(--ink);padding:.35rem .58rem;border-radius:5px;font-size:.78rem;pointer-events:none}
.chart-foot{display:flex;justify-content:space-between;gap:.4rem;border-top:1px solid var(--line);padding-top:.65rem;margin-top:.35rem}
.watch-label{display:flex;justify-content:space-between;padding:.66rem .25rem .4rem;border-bottom:1px solid var(--line);margin-top:.25rem}
.watch-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.1rem .45rem;text-align:left;width:100%;background:none;border:0;border-bottom:1px solid var(--line);padding:.53rem .42rem;color:var(--ink);font-size:.88rem}
.watch-item:last-child{border-bottom:0}.watch-item:hover,.watch-item.active{background:#1a2633}
.watch-item.active{box-shadow:inset 2px 0 var(--accent)}
.watch-item span:nth-child(even){text-align:right;font-variant-numeric:tabular-nums}.watch-item .muted{font-size:.75rem}
.up{color:var(--up)}.down{color:var(--down)}.yes{color:var(--success)}
.ranking{padding:19px 20px;margin-top:16px}
.scroll{overflow-x:auto}
table{border-collapse:collapse;text-align:left;width:100%;font-size:.87rem;margin-top:.55rem}
td,th{border-bottom:1px solid var(--line);padding:.58rem .52rem;white-space:nowrap}
th{color:var(--muted);font-size:.8rem;font-weight:600}
tr:last-child td{border-bottom:0}
.ranking td:nth-child(1){width:13%;font-weight:750;color:var(--accent)}
.ranking td:nth-child(3),.ranking td:nth-child(4),.ranking th:nth-child(3),.ranking th:nth-child(4){text-align:right;font-variant-numeric:tabular-nums}
.portfolio-grid,.guide-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:16px}
.subpage{min-height:67vh}
.panel{margin-bottom:15px}.guide-grid .panel{margin-bottom:0}
.panel p,.panel ol,.panel ul{color:var(--muted);margin:.55rem 0 .8rem}
.panel li+li{margin-top:.33rem}.panel ul,.panel ol{padding-left:1.35rem}
.form-row{display:flex;align-items:end;gap:.7rem;flex-wrap:wrap;margin:.8rem 0}
label{display:grid;gap:.25rem;color:#c8d4e4;font-size:.88rem;font-weight:650}
input,select{width:100%;min-height:40px;border:1px solid #354456;border-radius:7px;background:#0d141d;color:var(--ink);padding:.45rem .68rem}
input:focus,select:focus{border-color:var(--accent)}
.check{display:flex;align-items:center;gap:.3rem;min-height:40px}.check input{width:1rem;min-height:0;accent-color:var(--accent)}
.actions{flex-wrap:wrap;margin:.45rem 0}
.mono,code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;overflow-wrap:anywhere}
.secret-box,.notice{border:1px solid #486139;background:#19291e;padding:.7rem .9rem;border-radius:9px;margin:.8rem 0}
.secret-box p{margin:.15rem 0 .5rem}.secret-box code{display:block;margin-bottom:.5rem;color:var(--accent)}
.key-list{list-style:none;padding:0!important}.key-list li{display:flex;gap:.5rem;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);padding:.42rem 0}
footer{display:flex;justify-content:space-between;gap:1rem;padding:23px 0 30px;color:var(--muted);font-size:.77rem;letter-spacing:.035em}
footer span:first-child{font-weight:850}
dialog{width:min(460px,100% - 2rem);background:var(--surface);border:1px solid #465770;color:var(--ink);border-radius:15px;padding:20px}
dialog::backdrop{background:#04070acc}
dialog label{margin-top:.7rem}
dialog p{margin:.45rem 0;color:var(--muted)}
dialog .form-error{color:var(--up)}
.toast{position:fixed;bottom:18px;right:18px;max-width:calc(100% - 36px);background:#263548;border:1px solid #597089;border-radius:9px;padding:.65rem .94rem;z-index:5}
@media(max-width:850px){.shell{width:calc(100% - 32px)}.market-grid{grid-template-columns:minmax(0,1.65fr) minmax(224px,1fr)}.chart-card,.watch-card,.panel,.ranking,.data-card{padding:15px}.metric{padding:13px}}
@media(max-width:650px){.header{flex-wrap:wrap;gap:0;min-height:0;padding-top:.65rem}.header nav{order:3;width:100%;min-height:47px;gap:1.2rem}.navbtn{min-height:47px}.intro{padding:28px 0 20px;align-items:start;flex-wrap:wrap}.metrics{grid-template-columns:1fr 1fr;gap:9px}.market-grid,.portfolio-grid,.guide-grid{grid-template-columns:minmax(0,1fr);gap:11px}.chart-area{height:205px}.watch-item{padding:.53rem}.subpage .intro{padding-bottom:18px}}

.profile-trigger {
  display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: .2rem .45rem;
  min-height: 36px; max-width: 25rem; padding: .25rem 0; border: 0;
  background: none; color: var(--ink); text-align: left; font-weight: 700;
  text-decoration: underline; text-decoration-color: #637746; text-underline-offset: .24em;
}
.profile-trigger:hover { color: var(--accent); }
.profile-trigger small { font-weight: 500; }
#agent-profile { width: min(670px, 100% - 2rem); }
.profile-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.profile-heading h2 { font-size: 1.45rem; overflow-wrap: anywhere; }
.profile-heading p { margin: .2rem 0 .4rem; }
#profile-content { display: grid; grid-template-columns: minmax(0, 1.36fr) minmax(166px, 1fr); gap: 1.05rem; align-items: center; }
.profile-radar { display: block; width: 100%; aspect-ratio: 1.26; }
.radar-grid { fill: none; stroke: #425165; stroke-width: 1; }
.radar-area { fill: #d7fa6533; stroke: var(--accent); stroke-width: 2; }
.radar-dot { fill: var(--accent); }
.radar-label { fill: var(--muted); font: 650 .79rem system-ui, sans-serif; }
.radar-score { fill: var(--ink); font: 750 .87rem system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.profile-metrics { display: grid; gap: .32rem; margin: 0; }
.profile-metrics div { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; border-top: 1px solid var(--line); padding-top: .35rem; }
.profile-metrics dt { color: var(--ink); font-size: .8rem; white-space: nowrap; }
.profile-metrics dd { margin: 0; text-align: end; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
@media (max-width: 580px) {
  #profile-content { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .profile-radar { max-height: 270px; }
}

.strategy-notice{margin:0 0 16px}
.strategy-grid{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,1fr);gap:16px;align-items:start}
.strategy-side{display:grid;gap:16px;min-width:0}
.strategy-card{min-width:0;margin-bottom:0}
.strategy-form,.strategy-fields{display:grid;gap:14px}
.strategy-form{margin-top:15px}
.strategy-form label{display:grid;gap:.35rem;font-size:.86rem;font-weight:650}
.strategy-form textarea{width:100%;resize:vertical;color:var(--ink);background:#0d141d;border:1px solid #354456;border-radius:8px;padding:.65rem .75rem;font:inherit;line-height:1.55}
.strategy-form input:not([type=radio]),.strategy-form select{min-width:0;width:100%}
.strategy-fields{min-width:0;padding:0;border:0;margin:0}
.strategy-fields legend{padding:0;margin-bottom:.45rem;font-size:.86rem;font-weight:650}
.strategy-modes,.strategy-rule-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.strategy-modes label{display:flex;gap:.45rem;border:1px solid var(--line);border-radius:8px;padding:.6rem;align-items:flex-start;background:#0d141d}
.strategy-modes label>input[type=radio]{flex:none;inline-size:17px;block-size:17px;min-block-size:17px;margin:3px 0 0;padding:0;accent-color:var(--accent)}
.strategy-modes label:has(:checked){border-color:#aacc55}
.strategy-modes small{display:block;font-size:.73rem;color:var(--muted);font-weight:400}
.strategy-inline{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;margin-top:7px;gap:8px}
.strategy-actions{flex-wrap:wrap}
.strategy-actions button{min-width:105px}
.strategy-details{display:grid;grid-template-columns:minmax(65px,.44fr) minmax(0,1fr);gap:.35rem .6rem;font-size:.86rem;margin:.65rem 0}
.strategy-details dt{color:var(--muted)}
.strategy-details dd{margin:0;overflow-wrap:anywhere;white-space:pre-wrap;font-variant-numeric:tabular-nums}
.strategy-card details summary{color:#b9c9da;cursor:pointer;font-size:.82rem}
.strategy-card pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:250px;overflow:auto;background:#0d141d;border:1px solid var(--line);border-radius:8px;padding:10px;font-size:.78rem;line-height:1.5}
.strategy-test-form button{justify-self:start}
.strategy-result{margin-top:.85rem;border-top:1px solid var(--line);padding-top:.65rem}
.strategy-result strong{font-size:1rem}
.strategy-policy{grid-template-columns:repeat(4,minmax(0,1fr))}
.strategy-policy>p{grid-column:1/-1}
.strategy-roster{border-top:1px solid var(--line);margin-top:.9rem;padding-top:.75rem}
@media(max-width:780px){.strategy-grid{grid-template-columns:minmax(0,1fr)}.strategy-policy{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:470px){.strategy-modes{grid-template-columns:minmax(0,1fr)}}
