/* TFEX Strategy Bot — light theme, green brand (see the UX/UI canvas style guide) */
:root {
  --bg: #F4F7F5; --surface: #FFFFFF; --border: #E1E8E4; --line: #EEF2F0; --soft: #F7FAF8;
  --text: #0F1A15; --text2: #3A4A42; --muted: #5C6B64; --input: #C9D6CF;
  --brand: #0E7A55; --brand-dk: #0B6345; --brand-soft: #E3F3EC;
  --gain: #0E7A55; --loss: #C2343F; --loss-dk: #A82A34; --loss-soft: #FDE8EA;
  --warn-bg: #FDF2DC; --warn-tx: #6B4500; --warn-bd: #F1D79A; --warn-strong: #B07708;
  --info: #2558C9; --info-soft: #E8EEFB; --idle: #9DB3A8;
  --radius: 14px; --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --sans: "IBM Plex Sans", "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.45; }
a { color: var(--brand-dk); text-decoration: none; }
a:hover { color: #084D36; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.t2 { color: var(--text2); }
.gain { color: var(--gain); }
.loss { color: var(--loss); }
h1 { font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 600; margin: 0; }
h3 { font-size: 14px; font-weight: 600; margin: 0; }
.small { font-size: 12.5px; }
.xs { font-size: 12px; }
:focus-visible { outline: 3px solid #7CC6A8; outline-offset: 2px; border-radius: 6px; }

/* ---------- layout ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 232px; flex: none; background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px;
  display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.brand b { display: block; font-size: 15px; }
.navlabel { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text2); font-weight: 500; min-height: 44px; }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-dk); font-weight: 600; }
.nav a:hover { background: var(--soft); }
.nav svg { width: 18px; height: 18px; flex: none; }
.badge { margin-left: auto; font-size: 11px; background: var(--warn-bg); color: #7A4F00; border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px max(28px, calc((100% - 1480px) / 2 + 28px)); border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 5; }
.content { padding: 24px 28px 48px; max-width: 1480px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.livebar { background: #B42330; color: #fff; font-weight: 700; font-size: 13px; padding: 8px 28px; display: flex; gap: 10px; align-items: center; }
.livebar button { margin-left: auto; background: #fff; color: #8E1F29; border: 0; border-radius: 8px; padding: 4px 12px; font-weight: 700; min-height: 32px; cursor: pointer; }
.tabbar { display: none; }

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.card.warn { border-color: var(--warn-bd); padding: 0; overflow: hidden; gap: 0; }
.card.warn > .head { background: var(--warn-bg); color: var(--warn-tx); padding: 10px 16px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.grow { flex: 999 1 520px; min-width: 0; }
.side-col { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.kpi { gap: 4px; }
.kpi .v { font-family: var(--mono); font-size: 24px; font-weight: 600; }
.pill { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.pill.long { background: var(--brand-soft); color: var(--brand-dk); }
.pill.short { background: var(--loss-soft); color: var(--loss-dk); }
.pill.flat { background: var(--line); color: var(--text2); }
.pill.plan { background: var(--warn-bg); color: #7A4F00; }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.ok { background: var(--brand-soft); color: var(--brand-dk); }
.pill.bad { background: var(--loss-soft); color: #8E1F29; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; }
.chips li { display: flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 10px; background: var(--brand-soft); color: var(--brand-dk); }
.chips li.bad { background: var(--loss-soft); color: #8E1F29; }
.chips li.warn { background: var(--warn-bg); color: var(--warn-tx); }
.btn { border: 1px solid var(--input); background: var(--surface); color: var(--text); border-radius: 10px; padding: 0 16px; min-height: 44px;
  font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--brand-dk); }
.btn.danger { border: 1.5px solid var(--loss); color: var(--loss-dk); font-weight: 600; }
.btn.danger:hover { background: var(--loss-soft); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.seg { display: flex; background: var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--text2); border-radius: 8px; padding: 0 14px; min-height: 36px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(15,26,21,.12); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button { border: 1px solid var(--border); background: var(--surface); color: var(--text2); border-radius: 8px; padding: 0 14px; min-height: 40px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--brand-soft); color: var(--brand-dk); font-weight: 600; }
.meter { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.meter > div { height: 6px; }
.box { background: var(--soft); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.cap { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 10px; }
.check.ok { background: var(--brand-soft); }
.check.no { background: var(--loss-soft); }
.check.na { background: var(--line); }
.check b { width: 16px; flex: none; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px 8px; white-space: nowrap; }
td { padding: 9px 8px; border-top: 1px solid var(--line); vertical-align: top; }
td.r, th.r { text-align: right; }
.scroll { overflow-x: auto; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text2); }
.field input, .field select, .field textarea, input.inp, select.inp { min-height: 44px; background: #fff; color: var(--text); border: 1px solid var(--input);
  border-radius: 10px; padding: 0 12px; font-size: 14px; }
.field textarea { min-height: 80px; padding: 10px 12px; }
input.num { width: 76px; min-height: 38px; border: 1px solid var(--input); border-radius: 8px; padding: 0 10px; font-family: var(--mono); }
.form2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.toggle { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.toggle input { width: 20px; height: 20px; accent-color: var(--brand); }
.toggle input.red { accent-color: var(--loss); }
.list-plan > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.list-plan .who { font-weight: 600; width: 54px; flex: none; }
.list-plan .what { flex: 1 1 240px; min-width: 0; }
.ev { display: flex; gap: 12px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px;
  border-radius: 12px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: 90vw; }
.toast.show { opacity: 1; }
.hold { position: relative; height: 54px; border-radius: 14px; background: var(--loss-soft); border: 1.5px solid var(--loss); overflow: hidden;
  cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; }
.hold .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--loss); }
.hold span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--loss-dk); gap: 8px; }
.hold.full span { color: #fff; }
.login { max-width: 380px; margin: 12vh auto; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
/* signal chart */
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px; }
.chart-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg.sm button { min-height: 30px; padding: 0 11px; font-size: 12.5px; }
.ind { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text2);
  border-radius: 999px; padding: 0 11px; min-height: 30px; font: inherit; font-size: 12.5px; cursor: pointer; }
.chip i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.chip[aria-pressed="true"] { background: var(--soft); border-color: #CFDCD5; color: var(--text); }
.chip[aria-pressed="false"] { color: var(--muted); text-decoration: line-through; opacity: .7; }
.chip[aria-pressed="false"] i { background: var(--input) !important; }
.chart-wrap { position: relative; }
.chart { height: 400px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cleg { position: absolute; left: 12px; right: 84px; z-index: 3; pointer-events: none; display: flex; flex-direction: column; gap: 3px;
  font-size: 12px; color: var(--text2); }
.cleg > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.cleg > div > * { background: rgba(255,255,255,.82); border-radius: 4px; padding: 0 3px; }
.cleg b { font-weight: 600; font-variant-numeric: tabular-nums; }
.cleg .ohlc { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.cleg .ohlc b { color: var(--text); font-weight: 500; margin-right: 4px; }
.cleg i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; vertical-align: middle; margin-right: 5px; }
.pill.xs { font-size: 11px; padding: 1px 8px; }
tr.hl td { background: #F6FBF8; }
.rule-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 14px; align-items: start; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.status-ok { color: var(--brand-dk); font-weight: 600; }
.status-bad { color: var(--loss-dk); font-weight: 600; }
.status-warn { color: #8A5A00; font-weight: 600; }
.steps div { display: flex; gap: 8px; padding: 4px 0; font-size: 13px; }

/* ---------- phone ---------- */
@media (max-width: 900px) {
  .side { display: none; }
  .topbar { padding: 10px 16px; }
  .content { padding: 14px 16px 96px; }
  .livebar { padding: 8px 16px; }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .v { font-size: 19px; }
  .form2 { grid-template-columns: 1fr; }
  .tabbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface);
    border-top: 1px solid var(--border); padding: 6px 4px calc(10px + env(safe-area-inset-bottom)); z-index: 10; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 48px; justify-content: center; color: var(--muted); font-size: 11.5px; }
  .tabbar a[aria-current="page"] { color: var(--brand-dk); font-weight: 600; }
  .tabbar svg { width: 22px; height: 22px; }
  .hide-phone { display: none !important; }
  .rule-grid { grid-template-columns: 1fr; }
  .cleg { right: 64px; font-size: 11px; }
  h1 { font-size: 22px; }
}
@media (min-width: 901px) { .hide-desk { display: none !important; } }
.toggle.box { flex-direction: row; align-items: flex-start; }
#barlog thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }

/* money */
.pill.warn { background: var(--warn-bg); color: #7A4F00; }
.err { background: var(--loss-soft); color: #8E1F29; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.hidden { display: none !important; }
.guardbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--brand-soft);
  color: var(--brand-dk); border: 1px solid #CBE7DA; font-size: 13.5px; }
.guardbar svg { flex: none; }
.guardbar.off { background: var(--warn-bg); color: #7A4F00; border-color: #F0DCAE; }
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; }
.alert.error { background: var(--loss-soft); color: #8E1F29; }
.alert.warn { background: var(--warn-bg); color: #7A4F00; }
.alert span { flex: 1; }
.money-flow { gap: 14px; }
.mbar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--line); }
.mbar span { min-width: 3px; }
.mbar .pool, .mlegend i.pool { background: repeating-linear-gradient(135deg, #8FD3B6 0 5px, #C5EBDA 5px 10px); }
.mbar .rest, .mlegend i.rest { background: #DCE4E0; }
.mlegend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text2); }
.mlegend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.mtiles { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: stretch; }
.mtile { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
.mtile.hi { border-color: #9ED3BB; box-shadow: 0 0 0 3px var(--brand-soft); }
.mtile .big, .pool-box .big { font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.op { align-self: center; font-size: 20px; color: var(--muted); font-weight: 600; }
.pool-box { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px;
  border: 1.5px dashed #9ED3BB; background: #F6FBF8; }
.pool-box > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.mtable td { vertical-align: middle; }
.mtable tr.dim td { opacity: .62; }
.mtable tr.tot td { border-top: 2px solid var(--border); }
.sname { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.sname i, .sdot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; margin-right: 6px; }
.carry { display: flex; gap: 3px; margin-bottom: 3px; }
.carry i { width: 16px; height: 8px; border-radius: 3px; background: var(--line); }
.carry i.on { background: var(--brand); }
.carry i.miss { background: repeating-linear-gradient(135deg, #F1C3C7 0 3px, #FBE5E7 3px 6px); }
.acts { display: inline-flex; gap: 6px; flex-wrap: nowrap; }
.rules p { margin: 0 0 10px; color: var(--text2); font-size: 13.5px; }
.rules b { color: var(--text); }
.mdlg { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(15,26,21,.25); }
.mdlg::backdrop { background: rgba(15,26,21,.35); }
.mdlg form { display: flex; flex-direction: column; gap: 12px; padding: 20px 22px; }
.mdlg p { margin: 0; }
.dhead { display: flex; justify-content: space-between; align-items: center; }
.dhead .x { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); width: 40px; height: 40px; }
.dfoot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.qchips { display: flex; flex-wrap: wrap; gap: 6px; }
.qchips .chip[disabled] { opacity: .45; cursor: not-allowed; }
table.split input.num { width: 120px; text-align: right; }
table.split tr.dim td { opacity: .6; }
@media (max-width: 900px) {
  .mtiles { grid-template-columns: 1fr; }
  .op { display: none; }
  .tabbar { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
}
.sname b { white-space: nowrap; }

/* backtest */
.kpi.warnk { background: var(--warn-bg); }
.years { display: flex; flex-direction: column; gap: 6px; }
.yr { display: grid; grid-template-columns: 52px 1fr 110px; align-items: center; gap: 10px; }
.yr > span:last-child { text-align: right; }
.ybar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.ybar i { display: block; height: 10px; border-radius: 999px; }
.ybar i.up { background: var(--brand); }
.ybar i.dn { background: var(--loss); }
.bt-trades summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.bt-ov td { vertical-align: middle; }
.bt-ov td.mono, .bt-ov th { white-space: nowrap; }
[hidden] { display: none !important; }
.card > .btn, .card > div > .btn.primary:only-child { align-self: flex-start; }
.ev .kind { flex: none; width: 92px; display: flex; flex-direction: column; gap: 2px; }
.ev .kind .pill { align-self: flex-start; }
.afilter { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 900px) { .ev { flex-wrap: wrap; } .ev .kind { width: auto; flex-direction: row; } }
.afilter .chip { text-decoration: none !important; opacity: 1 !important; color: var(--text2); }
.afilter .chip[aria-pressed="true"] { background: var(--brand-soft); border-color: #9ED3BB; color: var(--brand-dk); font-weight: 600; }

/* ---------- Today · Strategies (v10) ---------- */
.col { display: flex; flex-direction: column; }
.nowrap { white-space: nowrap; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.xxs { font-size: 11px; }
.phead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.huge { font-size: 34px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin-top: 4px; }
.big2 { font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.hero { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 14px; }
.eqchart { height: 220px; }
i.lg { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }
i.lg.dash { height: 0; border-top: 2px dashed; background: none; }
.lcards .card { color: inherit; }
.lcards .card:hover, .scard:hover { border-color: #B9DCCB; }
.needrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 16px; border-top: 1px solid #F6E6BE; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; }
.note.info { background: var(--info-soft); color: #1D3F8F; }
.note.warn { background: var(--warn-bg); color: var(--warn-tx); }
.note.dip { background: #E5F5EC; color: #0B5A3F; border: 1px solid #BFE3CF; }
.note.dip .t2 { color: #2F6B53; }
.pill.dip1 { background: #E5F5EC; color: #0B6345; border: 1px solid #BFE3CF; }
.pill.dip2 { background: #0E7A55; color: #fff; }
.pill.ghost { background: transparent; border: 1px dashed currentColor; }
.scard.dipz { border-color: #8FD3B6; box-shadow: 0 0 0 3px #E5F5EC; }
.spark { display: block; flex: none; }
.act { display: inline-flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--text2); min-width: 0; }
.act i { font-style: normal; width: 14px; text-align: center; flex: none; }
.act.plan { color: #7A4F00; } .act.run { color: var(--info); font-weight: 600; } .act.bad { color: var(--loss-dk); font-weight: 600; } .act.idle { color: var(--muted); }
.nextcard { border-color: #BFE3CF; }
.subhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.gtitle { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding-bottom: 6px; }
.gtitle .mono { font-weight: 600; font-size: 15px; }
.list-plan .who { width: 70px; display: inline-flex; align-items: center; gap: 6px; }
table.otable td { vertical-align: middle; }
.ocards { display: flex; flex-direction: column; gap: 10px; }
.ocard { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.splitlist { display: flex; flex-direction: column; }
.srow2 { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 7px 6px; border-radius: 8px; color: var(--text); font-size: 13px; }
.srow2:hover { background: var(--soft); color: var(--text); }
.srow2 i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.srow2 i.pool { background: repeating-linear-gradient(135deg, #8FD3B6 0 3px, #C5EBDA 3px 6px); }
.srow2 i.rest { background: #DCE4E0; }
.sched { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.sched > .mono { width: 112px; flex: none; display: flex; flex-direction: column; }
.sched .ic { width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--line); color: var(--text2); font-size: 12px; }
.sched.order .ic { background: var(--warn-bg); color: #7A4F00; } .sched.roll .ic { background: var(--info-soft); color: var(--info); }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--input); background: var(--surface); cursor: pointer; font-size: 16px; line-height: 1; }
.stepper button:hover { background: var(--soft); }
.stepper button[disabled] { opacity: .4; cursor: not-allowed; }
.stepper b { min-width: 18px; text-align: center; }
.seg.ctl button[aria-pressed="true"] { color: var(--brand-dk); }
.seg.ctl button.stop { color: var(--loss-dk); }
.seg.ctl button.stop:hover { background: var(--loss-soft); }
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.srow { display: grid; grid-template-columns: minmax(230px, 1.35fr) minmax(170px, 1fr) minmax(190px, 1fr) minmax(160px, .9fr) minmax(270px, auto); gap: 16px;
  padding: 16px 18px; border-top: 1px solid var(--line); align-items: start; }
.srow.head { border-top: 0; padding-top: 12px; padding-bottom: 10px; background: var(--soft); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.donut { position: relative; flex: none; margin: 0 auto; }
.donut svg { display: block; overflow: visible; }
.donut path { cursor: pointer; transition: opacity .12s; }
.dcenter { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; padding: 0 40px; }
.dcenter b { font-size: 19px; }
.cover { display: grid; grid-template-columns: 96px minmax(0, 1fr) 230px; gap: 12px; align-items: center; color: var(--text); padding: 4px 0; }
.cbar { position: relative; height: 12px; background: var(--line); border-radius: 999px; display: flex; overflow: visible; }
.cbar i { height: 12px; display: block; }
.cbar i.mg { background: #B9C7C0; border-radius: 999px 0 0 999px; } .cbar i.fl { background: #E8A33D; } .cbar i.fl2 { background: #F4D9A8; border-radius: 0 999px 999px 0; }
.cbar b { position: absolute; top: -4px; width: 3px; height: 20px; background: var(--text); border-radius: 2px; transform: translateX(-1px); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tile { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.tile b { font-size: 16px; }
.tile.cur.long { border-color: #8FD3B6; background: #F3FAF6; box-shadow: 0 0 0 3px var(--brand-soft); }
.tile.cur.short { border-color: #EDB4BA; background: #FFF7F8; box-shadow: 0 0 0 3px var(--loss-soft); }
.tile.cur.flat { border-color: #C9D6CF; background: var(--soft); box-shadow: 0 0 0 3px var(--line); }
.linkbtn { border: 0; background: none; padding: 0; color: var(--brand-dk); font-weight: 600; cursor: pointer; text-decoration: underline; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.pchg { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
@media (max-width: 1180px) { .srow { grid-template-columns: minmax(200px, 1.3fr) minmax(160px, 1fr) minmax(170px, 1fr) minmax(150px, .9fr); } .srow > div:last-child { grid-column: 1 / -1; flex-direction: row !important; flex-wrap: wrap; align-items: center !important; } .srow.head > span:last-child { display: none; } }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .huge { font-size: 28px; }
  .srow { grid-template-columns: 1fr 1fr; gap: 10px 14px; padding: 14px; }
  .srow > a:first-child { grid-column: 1 / -1; }
  .srow.head { display: none; }
  .cover { grid-template-columns: 90px minmax(0, 1fr); }
  .cover > span:last-child { grid-column: 1 / -1; text-align: left !important; }
  .eqchart { height: 180px; }
  .sched > .mono { width: 92px; }
  .grid4.lcards .v { font-size: 17px !important; }
}
.hero > *, .row > .card { min-width: 0; }
details.cond > summary { cursor: pointer; list-style: none; }
details.cond > summary::-webkit-details-marker { display: none; }
details.cond > summary b::before { content: "▸ "; color: var(--muted); }
details.cond[open] > summary b::before { content: "▾ "; }
details.cond[open] > summary { margin-bottom: 4px; }
.sched .xs { white-space: nowrap; }
@media (max-width: 900px) {
  .ev > span:last-child { flex: 1 1 100% !important; }
  .sched > .mono { width: 104px; }
  .splitlist .srow2 { font-size: 12.5px; gap: 8px; }
}

/* expected return · planner · dip rows (v11) */
.tiles3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.etile { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rbar { position: relative; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #F6C9CD, #CBEBDC); margin: 10px 0 6px; }
.rbar .z { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--muted); }
.rbar .m { position: absolute; top: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--brand); }
table.etable td { vertical-align: top; }
table.etable td, table.etable th { white-space: nowrap; }
table.etable td:first-child { white-space: normal; min-width: 210px; }
table.etable tfoot td { border-top: 2px solid var(--border); font-weight: 600; }
.thsort { border: 0; background: none; padding: 0; font: inherit; color: var(--muted); font-weight: 500; cursor: pointer; white-space: nowrap; }
.thsort.on { color: var(--text); font-weight: 600; }
td.dimc { opacity: .55; }
tr.dipz1 td { background: #F1FAF5; }
tr.dipz2 td { background: #E3F4EB; }
tr.dipz1 td:first-child, tr.dipz2 td:first-child { box-shadow: inset 4px 0 0 #8FD3B6; }
tr.dipz2 td:first-child { box-shadow: inset 4px 0 0 #0E7A55; }
.srow.dipz1 { background: #F4FBF7; box-shadow: inset 4px 0 0 #8FD3B6; }
.srow.dipz2 { background: #E8F6EE; box-shadow: inset 4px 0 0 #0E7A55; }
.savedline { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; border: 1px dashed var(--input); border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.prows { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); column-gap: 28px; }
.prow { padding: 10px 2px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.prow input[type=range] { width: 100%; margin: 4px 0; }
.prow input.num { width: 76px; text-align: right; }
.lsw { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--text2); user-select: none; }
.lsw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lsw span { width: 36px; height: 20px; border-radius: 999px; background: #C9D6CF; position: relative; transition: background .15s; flex: none; }
.lsw span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.lsw input:checked + span { background: var(--brand); }
.lsw input:checked + span::after { left: 18px; }
.lsw input:focus-visible + span { outline: 3px solid #7CC6A8; outline-offset: 2px; }
.ccards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.ccard { background: var(--soft); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.ccard b { font-size: 15px; }
table.etable { font-size: 12.5px; }
table.etable td, table.etable th { padding: 8px 6px; }
table.etable td:first-child { min-width: 150px; max-width: 190px; }
table.etable td { white-space: normal; max-width: 130px; }
table.etable td > div:first-child, table.etable td > b { white-space: nowrap; }
