/* ============================================================
   Polymarket Oracle — 组件与布局（全部引用 tokens.css 令牌）
   ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--background);
  color: var(--text);
  font-family: 'Noto Sans SC', -apple-system, sans-serif;
  font-size: 0.9375rem; line-height: 1.6;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + var(--sp-4));
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }

/* ── 顶栏 ── */
.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.brand { display: flex; gap: var(--sp-3); align-items: center; max-width: var(--container); margin: 0 auto; }
.brand-name { font-family: 'Noto Serif SC', serif; font-weight: 900; font-size: 1.05rem; letter-spacing: 0.05em; }
.brand-en { color: var(--mystic); font-size: 0.8rem; letter-spacing: 0.22em; font-weight: 600; }
.brand-sub { color: var(--text-muted); font-size: 0.72rem; }

.container { max-width: var(--container); margin: 0 auto; padding: var(--sp-4); }

/* ── 标签栏 ── */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: var(--z-sticky);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
}
.tab {
  flex: 1; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--text-muted); font-size: 0.7rem;
  transition: color var(--dur-fast) var(--ease-out);
}
.tab svg { width: 20px; height: 20px; }
.tab.is-active { color: var(--text); }
.tab.is-active svg { color: var(--data); }
.tab:focus-visible { outline: 2px solid var(--data); outline-offset: -4px; border-radius: var(--radius-sm); }

/* ── 通用组件 ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.card-title {
  font-family: 'Noto Serif SC', serif; font-weight: 700;
  font-size: 0.95rem; margin: 0 0 var(--sp-3);
  display: flex; align-items: center; gap: var(--sp-2);
}
.card-title .dot { width: 8px; height: 8px; border-radius: var(--radius-full); }
.dot-data { background: var(--data); box-shadow: var(--shadow-glow-data); }
.dot-mystic { background: var(--mystic); box-shadow: var(--shadow-glow-mystic); }
.dot-verdict { background: var(--text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 44px; padding: 0 var(--sp-5);
  border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--surface-subtle); color: var(--text);
  font-size: 0.9rem; font-weight: 500; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--data); outline-offset: 2px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--data); border-color: var(--data); color: var(--data-foreground); font-weight: 700; }
.btn-primary:hover { background: var(--data-hover); border-color: var(--data-hover); }
.btn-mystic { background: var(--mystic); border-color: var(--mystic); color: var(--mystic-foreground); font-weight: 700; }
.btn-mystic:hover { background: var(--mystic-hover); border-color: var(--mystic-hover); }
.btn-block { width: 100%; }

/* 搜索 */
.searchbar { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.searchbar input {
  flex: 1; min-height: 44px; padding: 0 var(--sp-3);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-size: 0.95rem;
}
.searchbar input::placeholder { color: var(--text-muted); }
.searchbar input:focus { outline: none; border-color: var(--data); box-shadow: var(--shadow-glow-data); }

/* 市场列表 */
.mkt {
  width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3); color: var(--text);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.mkt:hover { border-color: var(--data-muted); background: var(--surface-hover); }
.mkt:focus-visible { outline: 2px solid var(--data); outline-offset: 2px; }
.mkt-q { font-weight: 500; font-size: 0.92rem; margin-bottom: var(--sp-1); }
.mkt-zh { color: var(--text-muted); font-size: 0.78rem; margin-bottom: var(--sp-2); line-height: 1.45; }
.mkt-head .mkt-zh { font-size: 0.85rem; margin: var(--sp-1) 0 var(--sp-2); }
.tagchip {
  background: var(--surface-subtle); color: var(--data); cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-full);
  padding: 4px 14px; font-size: 0.78rem; font-family: inherit;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.tagchip:hover { border-color: var(--data-muted); background: var(--surface-hover); }
.tagchip:active { transform: translateY(1px); }
.mkt-meta { display: flex; justify-content: space-between; color: var(--text-muted); font-size: 0.75rem; }
.probbar { height: 6px; border-radius: var(--radius-full); background: var(--surface-subtle); overflow: hidden; margin: var(--sp-2) 0; }
.probbar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--data-muted), var(--data)); border-radius: var(--radius-full); }
.probbar .num { color: var(--data); font-weight: 700; font-size: 0.78rem; }

/* 状态 */
.skeleton { position: relative; overflow: hidden; background: var(--surface-subtle); border-radius: var(--radius-md); }
.skeleton::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, oklch(35% 0.05 255 / 0.06), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.empty { text-align: center; color: var(--text-muted); padding: var(--sp-12) var(--sp-4); }
.empty .glyph { font-size: 2rem; opacity: 0.5; margin-bottom: var(--sp-3); font-family: 'Noto Serif SC', serif; }
.error-box {
  background: var(--danger-subtle); border: 1px solid oklch(80% 0.07 25);
  border-radius: var(--radius-md); padding: var(--sp-3) var(--sp-4); color: var(--text-secondary);
  font-size: 0.85rem; margin-bottom: var(--sp-4);
}
.error-box b { color: var(--danger); }

/* ── 市场裁决头部 ── */
.mkt-head { border-left: 3px solid var(--data); padding-left: var(--sp-3); margin-bottom: var(--sp-4); }
.mkt-head h2 { font-size: 1.05rem; margin: 0 0 var(--sp-1); line-height: 1.45; }
.mkt-head .sub { color: var(--text-muted); font-size: 0.78rem; }

/* ── 系统A：数据卡 ── */
.bigp { font-size: 2.2rem; font-weight: 700; color: var(--data); line-height: 1.1; font-variant-numeric: tabular-nums; }
.bigp small { font-size: 0.9rem; color: var(--text-muted); font-weight: 400; margin-left: var(--sp-2); }
.drivers { list-style: none; margin: var(--sp-3) 0 0; padding: 0; }
.drivers li {
  display: flex; gap: var(--sp-2); align-items: baseline;
  color: var(--text-secondary); font-size: 0.82rem; padding: var(--sp-1) 0;
}
.drivers li::before { content: '▪'; color: var(--data-muted); font-size: 0.7rem; }
.conftrack { height: 5px; background: var(--surface-subtle); border-radius: var(--radius-full); overflow: hidden; margin-top: var(--sp-3); }
.conftrack > i { display: block; height: 100%; background: var(--data); border-radius: var(--radius-full); }

/* ── 系统B：九宫排盘 ── */
.pan { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: var(--sp-3) 0; }
.palace {
  aspect-ratio: 1 / 1; position: relative;
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--sp-1);
  display: flex; flex-direction: column; justify-content: space-between;
  font-size: 0.72rem; line-height: 1.35;
}
.palace .pn { position: absolute; top: 3px; left: 5px; color: var(--text-muted); font-size: 0.62rem; }
.palace .pn .hm, .hm {
  display: inline-block; margin-left: 3px; padding: 0 3px;
  background: oklch(52% 0.12 160); color: #fff;
  border-radius: var(--radius-sm); font-size: 0.55rem; font-style: normal;
  vertical-align: 1px;
}
.palace .pk { position: absolute; top: 3px; right: 5px; color: var(--text-muted); font-size: 0.62rem; }
.palace .g1 { text-align: center; margin-top: 14px; }
.palace .g2 { text-align: center; }
.palace .gan { font-family: 'Noto Serif SC', serif; font-size: 1rem; font-weight: 900; text-align: center; letter-spacing: 2px; }
.palace .gan .hv { color: var(--text); }
.palace .gan .ea { color: var(--text-muted); }
.palace .gate { text-align: center; color: var(--text-secondary); }
.palace.is-zhifu { border-color: var(--mystic); box-shadow: inset 0 0 0 1px var(--mystic), var(--shadow-glow-mystic); }
.palace.is-yong { border-color: var(--data); box-shadow: inset 0 0 0 1px var(--data), var(--shadow-glow-data); }
.palace.is-kong { opacity: 0.72; }
.palace.is-kong .pn::after { content: ' ◎空'; color: var(--text-muted); }
.palace--center { background: transparent; border-style: dashed; justify-content: center; align-items: center; color: var(--text-muted); font-size: 0.68rem; text-align: center; }
.qimen-meta { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); color: var(--text-secondary); font-size: 0.8rem; margin-bottom: var(--sp-2); }
.qimen-meta b { color: var(--mystic); font-weight: 600; }
.verdict-lines { margin: var(--sp-2) 0 0; padding: 0; list-style: none; }
.verdict-lines li { padding: 2px 0; color: var(--text-secondary); font-size: 0.82rem; }
.scorebadge {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-family: 'Noto Serif SC', serif;
}
.scorebadge .v { font-size: 1.9rem; font-weight: 900; color: var(--mystic); }
.scorebadge .l { font-size: 0.75rem; color: var(--text-muted); }

/* ── 裁决卡 ── */
.verdict-final { display: flex; align-items: center; gap: var(--sp-6); flex-wrap: wrap; }
.vf-num { font-size: 3rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.vf-num.yes { color: var(--data); }
.vf-num.no { color: var(--warning); }
.vf-label { color: var(--text-muted); font-size: 0.8rem; }
.gauge { position: relative; width: 84px; height: 84px; }
.gauge svg { transform: rotate(-90deg); }
.gauge .gv { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge .gv b { font-size: 1.25rem; }
.gauge .gv span { font-size: 0.6rem; color: var(--text-muted); }
.action {
  margin-top: var(--sp-4); padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md); font-weight: 700;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap;
}
.action.buy { background: var(--data-subtle); border: 1px solid var(--data-muted); color: var(--data); }
.action.wait { background: var(--surface-subtle); border: 1px solid var(--border); color: var(--text-secondary); }
.action .note { font-size: 0.78rem; font-weight: 400; color: var(--text-secondary); }
.weights { color: var(--text-muted); font-size: 0.72rem; margin-top: var(--sp-3); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
@media (max-width: 480px) { .row2 { grid-template-columns: 1fr; } }

/* ── 历史 ── */
.hist { padding: var(--sp-3) 0; border-bottom: 1px solid var(--border-subtle); font-size: 0.82rem; }
.hist:last-child { border-bottom: 0; }
.hist .q { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist .zh { color: var(--text-muted); font-size: 0.72rem; margin-top: 2px; line-height: 1.45; }

/* 结算统计卡 */
.statcard {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2);
  background: var(--surface-subtle); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: var(--sp-3); margin-bottom: var(--sp-4);
}
.statcard .stat { text-align: center; }
.statcard .stat b { display: block; font-size: 1.15rem; font-weight: 700; }
.statcard .stat span { font-size: 0.68rem; color: var(--text-muted); }

/* 结算徽标 */
.badge {
  display: inline-block; margin-left: 8px; padding: 1px 8px;
  border-radius: var(--radius-full); font-size: 0.62rem; vertical-align: 2px; white-space: nowrap;
}
.badge.hit { background: var(--success-subtle); color: var(--success); }
.badge.miss { background: var(--danger-subtle); color: var(--danger); }
.badge.pending { background: var(--surface-hover); color: var(--text-muted); }
.badge.tappable { background: var(--surface-hover); color: var(--text-secondary); cursor: pointer; border: 1px dashed var(--border-strong); }
.badge.tappable:active { transform: scale(0.96); }

/* toast */
.deeptext {
  background: var(--surface-subtle); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: var(--sp-3);
  font-size: 0.8rem; line-height: 1.75; color: var(--text-secondary);
  white-space: pre-wrap; word-break: break-word;
}
.modal-mask {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: var(--overlay);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  width: 100%; max-width: var(--container);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--sp-5) var(--sp-5) calc(var(--sp-5) + env(safe-area-inset-bottom, 0px));
  animation: slideup var(--dur-slow) var(--ease-out);
  /* V25 修复：内容超屏时弹窗自身可滚动（实盘设置区块撑高后，顶部内容必须够得着） */
  max-height: 92vh;
  max-height: calc(100dvh - 18px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
.flabel { display: block; font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 6px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 16px);
  transform: translateX(-50%) translateY(16px);
  background: var(--surface-hover); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-full);
  padding: var(--sp-2) var(--sp-5); font-size: 0.82rem;
  opacity: 0; pointer-events: none; z-index: var(--z-modal);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
  max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.legal { color: var(--text-muted); font-size: 0.7rem; line-height: 1.7; padding: var(--sp-4) 0 var(--sp-8); text-align: center; }
.section-gap { height: var(--sp-2); }
.fade-in { animation: fadein var(--dur-slow) var(--ease-out) backwards; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } }

/* ===== V16 事后体检卡 ===== */
/* 校准分桶表 */
.cal-table { width: 100%; border-collapse: collapse; font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.cal-table th { color: var(--text-muted); font-weight: 500; text-align: right; padding: 5px 3px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.cal-table td { text-align: right; padding: 6px 3px; border-bottom: 1px solid var(--border-subtle); }
.cal-table th:first-child, .cal-table td:first-child { text-align: left; }
.cal-table tr.dim td { color: var(--text-muted); opacity: 0.5; }
.cal-table .bias.ok { color: var(--success); }
.cal-table .bias.over { color: var(--danger); font-weight: 700; }   /* 高估：价差可能是幻觉 */
.cal-table .bias.under { color: var(--warning); font-weight: 700; } /* 低估：漏掉了肉 */

/* 影子盘对比行 */
.shadow-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border-subtle); }
.shadow-row:last-of-type { border-bottom: none; }
.shadow-row .lbl { font-size: 0.78rem; color: var(--text-secondary); }
.shadow-row .lbl b { color: var(--text); font-weight: 600; }
.shadow-row .num { font-variant-numeric: tabular-nums; font-size: 0.88rem; font-weight: 700; white-space: nowrap; }
.shadow-row .pnl-pos { color: var(--success); }
.shadow-row .pnl-neg { color: var(--danger); }

/* 通道对决 */
.chan-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.chan-row .lbl { width: 62px; flex: none; font-size: 0.75rem; color: var(--text-secondary); }
.chan-row .bar { flex: 1; height: 8px; background: var(--surface-subtle); border-radius: var(--radius-full); overflow: hidden; }
.chan-row .bar i { display: block; height: 100%; border-radius: var(--radius-full); }
.chan-row .score { width: 96px; flex: none; text-align: right; font-size: 0.72rem; font-variant-numeric: tabular-nums; color: var(--text-muted); white-space: nowrap; }

/* 单条记录的影子盘徽标 */
.mini-badge { font-size: 0.62rem; padding: 2px 8px; border-radius: var(--radius-full); border: 1px solid var(--border); color: var(--text-muted); white-space: nowrap; }
.mini-badge.pos { color: var(--success); border-color: var(--success); }
.mini-badge.neg { color: var(--danger); border-color: var(--danger); }

/* ===== V17 发现页分类 chips ===== */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 34px; padding: 0 16px; border-radius: var(--radius-full); border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); font-size: 0.78rem; cursor: pointer; transition: all var(--dur-fast) var(--ease-out); }
.chip.is-on { background: var(--data); border-color: var(--data); color: var(--text-inverse); font-weight: 600; }

/* ===== V18 体检表格化 + 明细总表 ===== */
.cal-table td.pos, .cal-table .pos { color: var(--success); }
.cal-table td.neg, .cal-table .neg { color: var(--danger); }
.cal-table td b { font-weight: 700; }
details.card summary.card-title { cursor: pointer; user-select: none; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary::marker { content: ''; }
.detail-table th, .detail-table td { white-space: nowrap; }
.detail-table .tq { min-width: 130px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; position: sticky; left: 0; background: var(--surface); box-shadow: 1px 0 0 var(--border-subtle); }
.detail-table thead .tq { background: var(--surface); z-index: 1; }

/* ===== V19 记录对账卡 ===== */
.cmp { width: 100%; border-collapse: collapse; margin: var(--sp-2) 0 0; table-layout: fixed; }
.cmp th { font-size: 0.64rem; color: var(--text-muted); font-weight: 500; padding: 5px 2px; border-bottom: 1px solid var(--border); }
.cmp td { text-align: center; padding: 9px 2px 7px; vertical-align: top; }
.cmp td b { display: block; font-size: 1.02rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cmp td small { display: block; color: var(--text-muted); font-size: 0.62rem; margin-top: 3px; line-height: 1.5; }
.cmp b.up { color: var(--data); }
.cmp b.dn { color: var(--mystic); }
.cmp b.cmp-result { color: var(--text); }
.hist-verdict { margin-top: var(--sp-2); font-size: 0.8rem; font-weight: 700; padding: 7px 10px; border-radius: var(--radius-md); text-align: center; }
.hist-verdict.ok { color: var(--success); background: var(--success-subtle); }
.hist-verdict.bad { color: var(--danger); background: var(--danger-subtle); }
.hist-verdict.wait { color: var(--text-muted); background: var(--surface-subtle); font-weight: 500; }
.hist-advice { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: var(--sp-2); font-size: 0.72rem; color: var(--text-secondary); min-width: 0; }
.hist-advice > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-advice > span:first-child { flex: none; }
.hist-advice > span:last-child { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-align: right; }
.hist-advice b { color: var(--text); }
.hist-advice .pos { color: var(--success); font-weight: 700; }
.hist-advice .neg { color: var(--danger); font-weight: 700; }
.btn-mini { min-height: 26px; padding: 2px 12px; font-size: 0.66rem; border-radius: var(--radius-full); border: 1px solid var(--data); color: var(--data); background: none; cursor: pointer; }
.btn-mini:active { background: var(--surface-hover); }

/* ===== V23 原始裁决折叠区 ===== */
.orig { margin-top: var(--sp-2); border-top: 1px dashed var(--border-subtle); padding-top: 6px; }
.orig summary { cursor: pointer; list-style: none; user-select: none; font-size: 0.68rem; color: var(--text-muted); }
.orig summary::-webkit-details-marker { display: none; }
.orig summary::marker { content: ''; }
.orig summary::before { content: '▸ '; }
.orig[open] summary::before { content: '▾ '; }
.orig-body { margin-top: 6px; display: flex; flex-direction: column; gap: 5px; }
.orig-row { font-size: 0.72rem; line-height: 1.6; color: var(--text-secondary); background: var(--surface-subtle); border-left: 2px solid var(--border-strong); padding: 5px 8px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.orig-row .ol { display: inline-block; min-width: 58px; color: var(--text-muted); font-size: 0.65rem; margin-right: 6px; }

/* ===== V26 交易面板（店面：手动/自动切换 + 执行 + 记录） ===== */
.seg {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface-subtle); border: 1px solid var(--border);
  border-radius: var(--radius-full); margin-bottom: var(--sp-4);
}
.seg button {
  flex: 1; min-height: 40px; border: none; border-radius: var(--radius-full);
  background: transparent; color: var(--text-secondary);
  font-size: 0.88rem; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.seg button.is-on { background: var(--data); color: var(--data-foreground); }
.seg button.is-on.seg-manual { background: var(--mystic); color: var(--mystic-foreground); }
.seg-hint { color: var(--text-muted); font-size: 0.72rem; margin: -8px 0 var(--sp-4); text-align: center; }

.acct {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  background: var(--surface-subtle); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: var(--sp-2) var(--sp-3);
  font-size: 0.75rem; color: var(--text-secondary);
}
.acct.is-ready { border-color: var(--data-muted); background: var(--data-subtle); }
.acct.is-missing { border-color: var(--warning); background: var(--warning-subtle); }
.acct b { color: var(--text); }
.acct .spacer { flex: 1; }

.kv { display: flex; justify-content: space-between; gap: var(--sp-3); padding: 7px 0; border-bottom: 1px dashed var(--border-subtle); font-size: 0.8rem; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-muted); flex: none; }
.kv .v { color: var(--text); text-align: right; font-variant-numeric: tabular-nums; word-break: break-all; }
.kv .v b { font-size: 0.95rem; }

.trade-rec { display: flex; align-items: baseline; gap: var(--sp-2); padding: 8px 0; border-bottom: 1px dashed var(--border-subtle); font-size: 0.78rem; }
.trade-rec:last-child { border-bottom: none; }
.trade-rec .tq2 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.trade-rec .amt { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.trade-rec .st { flex: none; font-size: 0.66rem; color: var(--text-muted); }
.trade-rec .st.ok { color: var(--success); }
.trade-rec .st.warn { color: var(--warning); }

.mode-flag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.62rem; padding: 2px 8px; border-radius: var(--radius-full); white-space: nowrap;
}
.mode-flag.manual { background: var(--mystic-subtle); color: var(--mystic); border: 1px solid var(--mystic-muted); }
.mode-flag.auto { background: var(--data-subtle); color: var(--data); border: 1px solid var(--data-muted); }

.trade-log {
  margin-top: 8px; font-size: 0.7rem; line-height: 1.7; color: var(--text-secondary);
  background: var(--surface-subtle); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 8px 10px;
  white-space: pre-wrap; word-break: break-all; max-height: 180px; overflow-y: auto;
}
