/* ============================================================
   IB Dashboard 新版
   结构：收益 → 漏斗/活跃 → 贡献 → 下级网络 → 待办 → 等级 → 资金
   所有颜色走 theme.css 的 token，深浅色自动切换
   ============================================================ */

.ibn-page {
  min-height: calc(100vh - var(--app-chrome-height, 131px));
  padding: 20px 22px 76px;
  background:
    linear-gradient(180deg, rgba(var(--blue-rgb), 0.055), rgba(248, 251, 255, 0) 320px),
    var(--page-bg, linear-gradient(180deg, #ffffff 0%, #f8fbff 100%));
}

.ibn-shell {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  color: var(--text, #0f172a);
}

/* ------------------------------------------------------------- 顶栏 */

.ibn-topbar {
  position: static;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 0 0 14px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--border-light, #e8edf5);
}

.ibn-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
}

.ibn-heading { display: grid; gap: 5px; }

.ibn-title h1 {
  margin: 0;
  color: var(--text-strong, #0f172a);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
}

.ibn-title small {
  color: var(--muted, #64748b);
  font-size: 11px;
}

.ibn-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ibn-segment {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-muted, #f3f6fb);
  border: 1px solid var(--border-light, #e8edf5);
  border-radius: 10px;
}

.ibn-segment button {
  padding: 6px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted, #64748b);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.ibn-segment button:hover {
  color: var(--text-strong, #0f172a);
}

.ibn-segment button.is-active {
  background: var(--surface, #fff);
  color: var(--blue, #247fff);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.ibn-segment.is-mini button {
  padding: 4px 10px;
  font-size: 12px;
}

.ibn-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 12px;
  height: 34px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #d8e1ef);
  border-radius: 10px;
}

.ibn-select span {
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 700;
}

.ibn-select select {
  border: 0;
  background: transparent;
  color: var(--text-strong, #0f172a);
  font-size: 13px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

/* ------------------------------------------------------------ 区块骨架 */

.ibn-section {
  margin-bottom: 28px;
}

.ibn-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.ibn-eyebrow {
  display: block;
  color: var(--blue, #247fff);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ibn-section-head h2 {
  margin: 3px 0 0;
  color: var(--text-strong, #0f172a);
  font-size: 18px;
  font-weight: 900;
}

.ibn-section-note {
  color: var(--muted, #64748b);
  font-size: 12px;
}

.ibn-card {
  padding: 18px;
  background: var(--surface, #fff);
  border: 1px solid var(--border-light, #e8edf5);
  border-radius: 16px;
  box-shadow: var(--shadow-soft, 0 12px 28px rgba(15, 23, 42, 0.05));
}

.ibn-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ibn-card-head h3 {
  margin: 0;
  color: var(--text-strong, #0f172a);
  font-size: 15px;
  font-weight: 800;
}

.ibn-inline-note {
  margin-left: 7px;
  padding: 2px 7px;
  background: var(--surface-muted, #f3f6fb);
  border-radius: 999px;
  color: var(--muted, #64748b);
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}

.ibn-card-note {
  color: var(--muted, #64748b);
  font-size: 12px;
}

.ibn-link {
  color: var(--blue, #247fff);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.ibn-link:hover { text-decoration: underline; }

.ibn-empty {
  margin: 12px 0;
  color: var(--muted, #64748b);
  font-size: 13px;
  text-align: center;
}

.ibn-delta {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 800;
}

.ibn-delta.is-up { color: #16a34a; }
.ibn-delta.is-down { color: #dc2626; }
.ibn-delta.is-flat { color: var(--muted, #64748b); }

.ibn-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-muted, #f3f6fb);
  overflow: hidden;
}

.ibn-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--blue, #247fff);
}

.ibn-bar span.is-tier1 { background: #247fff; }
.ibn-bar span.is-tier2 { background: #38bdf8; }
.ibn-bar span.is-tier3 { background: #a78bfa; }
.ibn-bar span.is-symbol { background: linear-gradient(90deg, #247fff, #6aa6ff); }

/* ------------------------------------------------------------- ① 佣金 */

.ibn-commission-summary-card { margin-bottom: 14px; cursor: pointer; }
.ibn-commission-summary-card > .ibn-section-head { align-items: center; flex-wrap: nowrap; gap: 6px 16px; margin-bottom: 16px; }
.ibn-commission-summary-card > .ibn-section-head h2 { margin: 0; font-size: 16px; }
.ibn-card-actions { display: inline-flex; align-items: center; justify-content: flex-end; flex-shrink: 0; gap: 16px; margin-left: auto; }

.ibn-earnings-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) minmax(0, 2fr);
  grid-template-areas: "performance cumulative metrics";
  align-items: stretch;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.ibn-earnings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--blue, #247fff);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.ibn-earnings-toggle:focus-visible { outline: 2px solid var(--blue, #247fff); outline-offset: 3px; border-radius: 4px; }
.ibn-earnings-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ibn-earnings-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.ibn-earnings-grid > .ibn-card {
  min-width: 0;
  min-height: 0;
  padding: 14px 16px;
  background: var(--surface, #fff);
  border: 1px solid var(--border-light, #e8edf5);
  border-radius: 12px;
  box-shadow: none;
}
.ibn-earnings-grid > .ibn-card:hover { border-color: var(--blue-light, #6aa6ff); }


.ibn-earnings-section [hidden] { display: none !important; }

.ibn-performance-card {
  grid-area: performance;
  display: flex;
  flex-direction: column;
}

.ibn-cumulative-commission {
  grid-area: cumulative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  color: var(--muted, #64748b);
  font-size: 13px;
  font-weight: 750;
}
.ibn-cumulative-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; font-variant-numeric: tabular-nums; }
.ibn-cumulative-value strong { color: var(--text-strong, #0f172a); font-size: 24px; line-height: 1.2; letter-spacing: -.025em; overflow-wrap: anywhere; }
.ibn-cumulative-value small { font-size: 12px; }
.ibn-today-commission { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.5; }
.ibn-today-commission strong { color: var(--text-strong); font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ibn-today-commission small { font-size: 11px; }

.ibn-performance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted, #64748b);
  font-size: 13px;
  font-weight: 750;
}

.ibn-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 5px;
  min-height: 28px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--blue, #247fff);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.ibn-card-action:hover { text-decoration: underline; }
.ibn-card-action:focus-visible { outline: 2px solid var(--blue, #247fff); outline-offset: 3px; border-radius: 4px; }
.ibn-trend-card > .ibn-legend { justify-content: flex-end; margin-bottom: 12px; }

.ibn-performance-value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
  margin: 7px 0 5px;
  color: var(--text-strong, #0f172a);
  font-variant-numeric: tabular-nums;
}

.ibn-performance-value strong {
  font-size: 30px;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.ibn-performance-value > small {
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 750;
}

.ibn-period-compare {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 10px;
  min-height: 16px;
  margin-bottom: 0;
  color: var(--muted, #64748b);
  font-size: 10px;
  line-height: 1.5;
}

.ibn-period-compare .ibn-delta { margin-left: 0; }

.ibn-commission-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(0, 2fr);
  gap: 14px;
}

.ibn-commission-grid > .ibn-card { min-width: 0; }
.ibn-earnings-section .ibn-commission-grid > .ibn-card { padding: 20px; }

/* 来源拆解 */

.ibn-earnings-section .ibn-source-card > .ibn-card-head { margin-bottom: 12px; }
.ibn-earnings-section .ibn-source-card > .ibn-segment { margin-bottom: 13px; }

.ibn-source-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-bottom: 12px;
}

.ibn-source-summary strong {
  color: var(--text-strong, #0f172a);
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.ibn-source-summary small { color: var(--muted, #64748b); font-size: 10px; font-weight: 750; }
.ibn-source-summary > span { color: var(--muted, #64748b); font-size: 11px; }

.ibn-stack-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-muted, #f3f6fb);
}

.ibn-stack-bar span.is-trading { background: #247fff; }
.ibn-stack-bar span.is-fee { background: #38bdf8; }
.ibn-stack-bar span.is-deposit { background: #f59e0b; }

.ibn-source-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.ibn-source-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border-light, #e8edf5);
}

.ibn-source-list li:last-child { border-bottom: 0; padding-bottom: 0; }

.ibn-source-list i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex: none;
}

.ibn-source-list i.is-trading { background: #247fff; }
.ibn-source-list i.is-fee { background: #38bdf8; }
.ibn-source-list i.is-deposit { background: #f59e0b; }

.ibn-source-list li div { flex: 1; min-width: 0; }
.ibn-source-list li b { display: block; font-size: 13px; font-weight: 800; }
.ibn-source-list li small { color: var(--muted, #64748b); font-size: 11px; }
.ibn-source-list li span { text-align: right; }
.ibn-source-list li span strong { display: block; font-size: 14px; font-weight: 800; }
.ibn-source-list li span small { color: var(--muted, #64748b); font-size: 11px; }

.ibn-deposit-reference {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 10px;
  width: 100%;
  margin-top: 15px;
  padding: 10px 12px;
  border: 1px solid rgba(245, 158, 11, .2);
  border-radius: 10px;
  background: rgba(245, 158, 11, .065);
  color: var(--text, #0f172a);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.ibn-deposit-reference:hover { border-color: rgba(245, 158, 11, .45); background: rgba(245, 158, 11, .12); }
.ibn-deposit-reference strong { color: #b45309; font-size: 13px; font-weight: 850; font-variant-numeric: tabular-nums; }
.ibn-deposit-reference small { display: block; color: var(--muted, #64748b); font-size: 10px; line-height: 1.4; }
.ibn-deposit-reference > small { flex-basis: 100%; }

/* 单位经济 + 层级 */

.ibn-unit-econ {
  grid-area: metrics;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: center;
  gap: 10px 16px;
  min-width: 0;
  padding-left: 20px;
  border-left: 1px solid var(--border-light, #e8edf5);
}

.ibn-econ-item { min-width: 0; }

.ibn-econ-item span {
  display: block;
  color: var(--muted, #64748b);
  font-size: 11px;
  font-weight: 700;
}

.ibn-econ-item strong {
  display: block;
  margin-top: 3px;
  color: var(--text-strong, #0f172a);
  font-size: 17px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.ibn-econ-item strong b {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted, #64748b);
}

.ibn-tier-row { margin-bottom: 11px; }
.ibn-tier-row:last-child { margin-bottom: 0; }

.ibn-tier-row header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-bottom: 5px;
}

.ibn-tier-row header span { font-size: 12px; font-weight: 700; }
.ibn-tier-row header strong { font-size: 14px; font-weight: 800; }
.ibn-tier-row header strong small { font-size: 10px; color: var(--muted, #64748b); }
.ibn-tier-row > small { display: block; margin-top: 4px; color: var(--muted, #64748b); font-size: 11px; }

.ibn-trend-card .ibn-chart {
  height: 200px;
  width: 100%;
}

.ibn-trend-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 10px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border-light, #e8edf5);
}

.ibn-trend-summary > div { min-width: 0; }
.ibn-trend-summary span { display: block; color: var(--muted, #64748b); font-size: 11px; }
.ibn-trend-summary strong { display: block; margin-top: 4px; color: var(--text-strong, #0f172a); font-size: 18px; font-weight: 850; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ibn-trend-summary strong small { color: var(--muted, #64748b); font-size: 10px; font-weight: 700; }

.ibn-legend {
  display: flex;
  gap: 14px;
  color: var(--muted, #64748b);
  font-size: 12px;
}

.ibn-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ibn-legend i { width: 10px; height: 10px; border-radius: 2px; }
.ibn-legend i.is-bar { background: #247fff; }
.ibn-legend i.is-line { width: 14px; height: 3px; border-radius: 2px; background: #f59e0b; }

/* --------------------------------------------------------- ② 漏斗活跃 */

.ibn-funnel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 14px;
}

.ibn-funnel-grid > .ibn-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px 16px;
}

.ibn-funnel-grid .ibn-card-head { margin-bottom: 10px; }

.ibn-funnel-columns,
.ibn-funnel-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 84px;
  align-items: center;
  gap: 10px;
}

.ibn-funnel-columns {
  padding: 0 10px 6px;
  color: var(--muted, #64748b);
  font-size: 10px;
  line-height: 16px;
}

.ibn-funnel-columns span:not(:first-child) { text-align: right; }

.ibn-funnel { display: grid; gap: 5px; }

.ibn-funnel-stage {
  position: relative;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--surface-muted, #f3f6fb);
  overflow: hidden;
  line-height: 22px;
}

.ibn-funnel-bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, rgba(var(--blue-rgb), 0.22), rgba(var(--blue-rgb), 0.07));
  border-right: 2px solid rgba(var(--blue-rgb), 0.45);
}

.ibn-funnel-label,
.ibn-funnel-value,
.ibn-funnel-rate {
  position: relative;
}

.ibn-funnel-label { font-size: 12px; font-weight: 700; }
.ibn-funnel-value { font-size: 16px; font-weight: 900; text-align: right; font-variant-numeric: tabular-nums; }

.ibn-funnel-rate {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  color: var(--muted, #64748b);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.ibn-funnel-rate.is-weak { color: #dc2626; }
.ibn-funnel-rate small { font-size: 10px; font-weight: 500; }

.ibn-activity {
  display: grid;
  flex: 1;
  grid-auto-rows: minmax(44px, 1fr);
  gap: 6px;
}

.ibn-activity-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 10px;
  padding: 5px 10px;
  border: 1px solid var(--border-light, #e8edf5);
  border-left: 3px solid var(--border, #d8e1ef);
  border-radius: 7px;
}

.ibn-activity-card span { grid-column: 1; grid-row: 1; font-size: 12px; font-weight: 700; line-height: 16px; }
.ibn-activity-card strong { grid-column: 2; grid-row: 1 / 3; font-size: 20px; font-weight: 900; line-height: 24px; text-align: right; font-variant-numeric: tabular-nums; }
.ibn-activity-card small { grid-column: 1; grid-row: 2; color: var(--muted, #64748b); font-size: 11px; line-height: 14px; }

.ibn-activity-card.is-good { border-left-color: #16a34a; }
.ibn-activity-card.is-warn { border-left-color: #f59e0b; }
.ibn-activity-card.is-risk { border-left-color: #dc2626; }
.ibn-activity-card.is-risk strong { color: #dc2626; }

/* ----------------------------------------------------------- ③ 贡献 */

.ibn-contrib-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 14px;
}

.ibn-concentration {
  margin: 0 0 12px;
  padding: 9px 12px;
  background: var(--surface-muted, #f3f6fb);
  border-radius: 8px;
  color: var(--text-soft, #475569);
  font-size: 12px;
}

.ibn-concentration .is-warn { color: #dc2626; }

.ibn-rank { display: grid; gap: 10px; }

.ibn-rank-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ibn-rank-no {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-muted, #f3f6fb);
  color: var(--muted, #64748b);
  font-size: 11px;
  font-weight: 900;
}

.ibn-rank-no.is-top { background: rgba(var(--blue-rgb), 0.12); color: var(--blue, #247fff); }

.ibn-rank-main { flex: 1; min-width: 0; }

.ibn-rank-main header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.ibn-rank-main header span { font-size: 13px; font-weight: 800; }
.ibn-rank-main header strong { font-size: 13px; font-weight: 800; }
.ibn-rank-main > small { display: block; margin-top: 4px; color: var(--muted, #64748b); font-size: 11px; }

.ibn-symbols { display: grid; gap: 12px; }

.ibn-symbol-row header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 5px;
}

.ibn-symbol-row header span { font-size: 13px; font-weight: 800; letter-spacing: 0.02em; }
.ibn-symbol-row header strong { font-size: 13px; font-weight: 800; }
.ibn-symbol-row header strong small { font-size: 10px; color: var(--muted, #64748b); }
.ibn-symbol-row > small { display: block; margin-top: 4px; color: var(--muted, #64748b); font-size: 11px; }

/* --------------------------------------------------------- ④ 下级网络 */

.ibn-network-grid { display: grid; gap: 14px; }

.ibn-network-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.ibn-stat-card span {
  display: block;
  color: var(--muted, #64748b);
  font-size: 12px;
  font-weight: 700;
}

.ibn-stat-card strong {
  display: block;
  margin: 5px 0 3px;
  color: var(--text-strong, #0f172a);
  font-size: 26px;
  font-weight: 900;
  line-height: 1.05;
}

.ibn-stat-card small { color: var(--muted, #64748b); font-size: 11px; }

.ibn-table-wrap { overflow-x: auto; }

.ibn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ibn-table th {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border, #d8e1ef);
  color: var(--muted, #64748b);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.ibn-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-light, #e8edf5);
  vertical-align: middle;
}

.ibn-table tbody tr:last-child td { border-bottom: 0; }
.ibn-table tbody tr:hover { background: var(--surface-hover, #f8fbff); }

.ibn-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ibn-table td b { display: block; font-weight: 800; }
.ibn-table td small { color: var(--muted, #64748b); font-size: 11px; }

/* 推广区独立链接卡片：纵向排列四步，条长同基准，数量和上步转化率分别对齐。 */
.ibn-promo-section { min-width: 0; }
.ibn-promo-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ibn-promo-link-card { min-width: 0; box-shadow: none; }
.ibn-promo-link-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.ibn-promo-link-head .ibn-promo-name { flex: 1; min-width: 0; min-height: 36px; color: var(--text-strong, #0f172a); font-weight: 600; overflow-wrap: anywhere; }
.ibn-promo-url { display: block; margin-top: 3px; color: var(--muted, #64748b); font: 11px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: normal; overflow-wrap: anywhere; user-select: all; }
.ibn-promo-copy { display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex-shrink: 0; min-width: 64px; min-height: 36px; padding: 6px 9px; border: 0; border-radius: 7px; background: var(--blue-soft, #eff6ff); color: var(--blue, #247fff); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.ibn-promo-copy svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.7; }
.ibn-promo-copy:hover { background: var(--blue-faint, #f3f8ff); }
.ibn-promo-copy.is-copied { background: var(--success-soft, #ecfdf5); color: var(--success, #16a34a); }
.ibn-promo-copy:disabled { cursor: wait; opacity: .7; }
.ibn-promo-link-head :is(.ibn-promo-name, .ibn-promo-copy):focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.ibn-promo-funnel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.ibn-promo-funnel-head strong { margin-left: 4px; color: var(--blue); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ibn-promo-funnel-columns { display: grid; grid-template-columns: minmax(0, 1fr) 56px 64px; gap: 10px; margin: 14px 0 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.ibn-promo-funnel-columns span:not(:first-child) { text-align: right; }
.ibn-promo-funnel { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.ibn-promo-funnel li { display: grid; grid-template-columns: 28px minmax(0, 1fr) 56px 64px; align-items: center; gap: 10px; min-width: 0; min-height: 36px; }
.ibn-promo-stage-label { color: var(--text-soft, var(--muted)); font-size: 12px; line-height: 1.5; }
.ibn-promo-stage-track { display: block; min-width: 0; height: 8px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.ibn-promo-stage-track i { display: block; height: 100%; border-radius: inherit; background: rgba(var(--blue-rgb, 36, 127, 255), .4); }
.ibn-promo-funnel li:nth-child(2) .ibn-promo-stage-track i { background: rgba(var(--blue-rgb, 36, 127, 255), .6); }
.ibn-promo-funnel li:nth-child(3) .ibn-promo-stage-track i { background: rgba(var(--blue-rgb, 36, 127, 255), .8); }
.ibn-promo-funnel li:last-child .ibn-promo-stage-track i { background: var(--blue); }
.ibn-promo-stage-value { min-width: 0; color: var(--text-strong); font-size: 16px; font-weight: 650; line-height: 1.3; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ibn-promo-stage-rate { color: var(--muted); font-size: 12px; line-height: 1.5; text-align: right; font-variant-numeric: tabular-nums; }
.ibn-promo-funnel-note { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

.ibn-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.ibn-tag.is-tier1 { background: rgba(36, 127, 255, 0.12); color: #247fff; }
.ibn-tag.is-tier2 { background: rgba(56, 189, 248, 0.16); color: #0284c7; }
.ibn-tag.is-tier3 { background: rgba(167, 139, 250, 0.18); color: #7c3aed; }
.ibn-tag.is-good { background: rgba(22, 163, 74, 0.12); color: #16a34a; }
.ibn-tag.is-flat { background: var(--surface-muted, #f3f6fb); color: var(--muted, #64748b); }

.ibn-mini-bar {
  display: inline-block;
  width: 52px;
  height: 5px;
  margin-right: 6px;
  vertical-align: middle;
  border-radius: 999px;
  background: var(--surface-muted, #f3f6fb);
  overflow: hidden;
}

.ibn-mini-bar span {
  display: block;
  height: 100%;
  background: var(--blue, #247fff);
}

/* ----------------------------------------------------------- ⑤ 待办 */

.ibn-todo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.ibn-todo {
  display: block;
  border-left: 3px solid var(--border, #d8e1ef);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.ibn-todo:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow, 0 16px 40px rgba(15, 23, 42, 0.07));
}

.ibn-todo span { display: block; font-size: 13px; font-weight: 700; }

.ibn-todo strong {
  display: block;
  margin: 6px 0 4px;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.ibn-todo strong b { margin-left: 3px; font-size: 12px; font-weight: 700; color: var(--muted, #64748b); }
.ibn-todo small { color: var(--muted, #64748b); font-size: 11px; }

.ibn-todo.is-warn { border-left-color: #f59e0b; }
.ibn-todo.is-warn strong { color: #d97706; }
.ibn-todo.is-risk { border-left-color: #dc2626; }
.ibn-todo.is-risk strong { color: #dc2626; }

/* ----------------------------------------------------------- ⑥ 等级 */

.ibn-level-section[hidden] { display: none; }

.ibn-level-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}

.ibn-level-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted, #64748b);
  cursor: pointer;
}

.ibn-level-dismiss:hover {
  background: var(--surface-muted, #f3f6fb);
  color: var(--text-strong, #0f172a);
}

.ibn-level-dismiss:focus-visible {
  outline: 2px solid var(--blue, #247fff);
  outline-offset: 2px;
}

.ibn-level-dismiss svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.ibn-level-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
}

.ibn-level-grid > .ibn-card {
  min-width: 0;
  padding: 14px 16px;
  align-self: stretch;
}

.ibn-level-tasks {
  display: flex;
  flex-direction: column;
}

.ibn-level-tasks > .ibn-card-head { margin-bottom: 10px; }

.ibn-level-label { color: var(--muted, #64748b); font-size: 12px; font-weight: 700; }

.ibn-level-name {
  display: block;
  margin: 2px 0 6px;
  color: var(--text-strong, #0f172a);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
}

.ibn-level-progress { margin-bottom: 8px; }
.ibn-level-progress small { display: block; margin-top: 4px; color: var(--muted, #64748b); font-size: 11px; line-height: 1.35; }

.ibn-progress-rail {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-muted, #f3f6fb);
  overflow: hidden;
}

.ibn-progress-rail span {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue, #247fff), #6aa6ff);
}

.ibn-reward {
  padding: 6px 10px;
  margin-bottom: 6px;
  background: var(--surface-muted, #f3f6fb);
  border-radius: 8px;
  line-height: 1.35;
}

.ibn-reward b { display: block; font-size: 12px; font-weight: 800; }
.ibn-reward small { display: block; margin-top: 2px; color: var(--muted, #64748b); font-size: 11px; }
.ibn-level-profile > .ibn-reward:last-child { margin-bottom: 0; }

.ibn-reward.is-next {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.24);
}

.ibn-reward.is-next b { color: #b45309; }

.ibn-task-grid {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: center;
  gap: 10px 14px;
}

.ibn-task header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 8px;
  margin-bottom: 6px;
}

.ibn-task header span { font-size: 12px; font-weight: 800; }
.ibn-task header small { color: var(--muted, #64748b); font-size: 11px; font-variant-numeric: tabular-nums; }

.ibn-task-done,
.ibn-task-left {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  font-weight: 700;
}

.ibn-task-done { color: #16a34a; }
.ibn-task-left { color: var(--muted, #64748b); }
.ibn-task.is-done .ibn-progress-rail span { background: linear-gradient(90deg, #16a34a, #4ade80); }

/* ----------------------------------------------------------- ⑦ 资金 */

.ibn-funds-section { margin-top: 20px; }

.ibn-funds-heading { align-items: flex-start; margin-bottom: 12px; }

.ibn-funds-heading h2 {
  margin: 0;
  color: var(--text-strong, #0f172a);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}

.ibn-funds-main {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ibn-funds-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 9px 14px;
  border: 1px solid var(--border-light, #e8edf5);
  border-radius: 10px;
  background: var(--surface-muted, #f3f6fb);
}

.ibn-funds-card span { display: block; color: var(--muted, #64748b); font-size: 11px; font-weight: 700; line-height: 14px; }

.ibn-funds-card strong {
  display: block;
  margin: 0;
  font-size: 20px;
  font-weight: 850;
  line-height: 22px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.ibn-funds-card strong.is-good { color: #16a34a; }
.ibn-funds-card strong.is-warn { color: #d97706; }
.ibn-funds-card strong.is-risk { color: #dc2626; }

.ibn-funds-title-group { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ibn-funds-help { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; padding: 8px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.ibn-funds-help:hover, .ibn-funds-help[aria-expanded="true"] { background: var(--blue-soft); color: var(--blue); }
.ibn-funds-help:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.ibn-funds-help svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ibn-funds-help-popover { position: fixed; inset: auto; width: min(300px, calc(100vw - 32px)); box-sizing: border-box; margin: 0; padding: 14px 16px; border: 1px solid var(--border-light); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 8px 28px rgba(0, 0, 0, .16); font-size: 13px; line-height: 1.65; }
.ibn-funds-help-popover p { margin: 0; }
.ibn-funds-help-popover p + p { margin-top: 8px; }
.ibn-funds-card:not(.ibn-funds-net) strong { color: var(--text-strong, #0f172a); }
.ibn-funds-detail-trigger,
.ibn-funds-client-source { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin-top: 12px; padding: 8px 0; border: 0; background: transparent; color: var(--blue); font: inherit; font-size: 12px; font-weight: 650; text-align: left; cursor: pointer; }
.ibn-funds-detail-trigger > span:last-child,
.ibn-funds-client-source > span { margin-left: auto; }
.ibn-funds-detail-trigger svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ibn-funds-detail-trigger:focus-visible,
.ibn-funds-drawer :is(button, select):focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.ibn-funds-detail {
  display: grid;
  gap: 24px;
  min-width: 0;
}
.ibn-funds-breakdown { min-width: 0; }
.ibn-funds-breakdown h3 { margin: 0; font-size: 14px; }
.ibn-funds-breakdown-note { margin: 8px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.7; }
body.ibn-funds-open { overflow: hidden; }
.ibn-funds-drawer { position: fixed; inset: 0 0 0 auto; width: min(720px, 96vw); height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 20px 0 0 20px; background: var(--surface); color: var(--text-strong); box-shadow: -16px 0 60px rgba(15,23,42,.18); }
.ibn-funds-drawer[open] { display: flex; flex-direction: column; }
.ibn-funds-drawer::backdrop { background: rgba(15,23,42,.4); }
.ibn-funds-drawer-handle { display: none; }
.ibn-funds-drawer .ibn-detail-header { padding: 18px 24px; }
.ibn-funds-drawer .ibn-detail-header [data-ibn-funds-close] { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.ibn-funds-drawer [data-ibn-funds-close] svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ibn-funds-drawer .ibn-detail-header [data-ibn-funds-close]:is(:hover, :active) { background: var(--surface-muted); color: var(--text-strong); }
.ibn-funds-drawer .ibn-detail-heading h2 { margin: 0 0 5px; font-size: 20px; }
.ibn-funds-drawer .ibn-detail-body { overscroll-behavior: contain; }
.ibn-funds-drawer .ibn-funds-chart { margin-top: 0; }
.ibn-funds-client-source { border-top: 1px solid var(--border-light); margin-top: 20px; }

.ibn-funds-chart {
  --funds-deposit: #16a34a;
  --funds-withdraw: #d97706;
  display: grid;
  gap: 14px;
  min-width: 0;
  margin-top: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.ibn-funds-trend-head,
.ibn-funds-trend-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.ibn-funds-chart h3 { margin: 0; color: var(--text-strong, #0f172a); font-size: 14px; font-weight: 750; }
.ibn-funds-trend-head p { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 5px 0 0; color: var(--muted, #64748b); font-size: 11px; }
.ibn-funds-source { padding: 2px 6px; border-radius: 4px; background: var(--surface-muted, #f3f6fb); color: var(--muted, #64748b); font-size: 10px; }
.ibn-funds-segment { display: inline-flex; flex-shrink: 0; gap: 2px; padding: 3px; border: 1px solid var(--border-light, #e8edf5); border-radius: 8px; background: var(--surface-muted, #f3f6fb); }
.ibn-funds-segment button { min-width: 40px; min-height: 28px; padding: 4px 9px; border: 0; border-radius: 5px; color: var(--muted, #64748b); background: transparent; font: inherit; font-size: 11px; cursor: pointer; }
.ibn-funds-segment button[aria-pressed="true"] { color: var(--blue, #247fff); background: var(--surface, #fff); box-shadow: 0 1px 4px #0f172a12; font-weight: 700; }
.ibn-funds-segment button:focus-visible,
.ibn-funds-basis select:focus-visible { outline: 2px solid var(--blue, #247fff); outline-offset: 2px; }
.ibn-funds-basis { display: inline-flex; align-items: center; gap: 8px; color: var(--muted, #64748b); font-size: 11px; }
.ibn-funds-basis select { max-width: 150px; min-height: 32px; padding: 4px 24px 4px 8px; border: 1px solid var(--border-light, #e8edf5); border-radius: 6px; background: var(--surface, #fff); color: var(--text-strong, #0f172a); font: inherit; }
.ibn-funds-trend-totals { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; color: var(--muted, #64748b); font-size: 11px; }
.ibn-funds-trend-totals > span { display: inline-flex; align-items: center; gap: 6px; }
.ibn-funds-trend-totals strong { color: var(--text-strong, #0f172a); font-weight: 700; font-variant-numeric: tabular-nums; }
.ibn-funds-trend-totals i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.ibn-funds-trend-totals .is-deposit { background: var(--funds-deposit); }
.ibn-funds-trend-totals .is-withdraw { background: var(--funds-withdraw); }
.ibn-funds-plot { min-width: 0; width: 100%; height: 246px; }
.ibn-funds-plot svg { display: block; overflow: visible; }
.ibn-funds-axis { fill: var(--muted, #64748b); font-size: 10px; font-family: inherit; }
.ibn-funds-grid { stroke: var(--border-light, #e8edf5); stroke-dasharray: 3 4; }
.ibn-funds-series { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.ibn-funds-series.is-deposit { stroke: var(--funds-deposit); }
.ibn-funds-series.is-withdraw { stroke: var(--funds-withdraw); stroke-dasharray: 5 4; }
.ibn-funds-dot { stroke: var(--surface, #fff); stroke-width: 2; }
.ibn-funds-dot.is-deposit, .ibn-funds-bar.is-deposit { fill: var(--funds-deposit); }
.ibn-funds-dot.is-withdraw, .ibn-funds-bar.is-withdraw { fill: var(--funds-withdraw); }
.ibn-funds-hit { fill: transparent; }
.ibn-funds-crosshair { stroke: var(--muted, #64748b); stroke-dasharray: 3 3; opacity: 0; pointer-events: none; }
.ibn-funds-day { outline: none; cursor: crosshair; }
.ibn-funds-day.is-selected .ibn-funds-crosshair { opacity: .35; }
.ibn-funds-day:is(:focus-visible, :hover) .ibn-funds-hit { fill: var(--blue-soft, #eff6ff); fill-opacity: .4; }
.ibn-funds-day-detail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; min-height: 32px; padding: 8px 10px; border-radius: 6px; background: var(--surface-muted, #f3f6fb); color: var(--muted, #64748b); font-size: 11px; font-variant-numeric: tabular-nums; }
.ibn-funds-day-detail > strong { color: var(--text-strong, #0f172a); font-weight: 600; }
.ibn-funds-day-detail b { margin-left: 4px; font-weight: 700; }
.ibn-funds-day-detail .is-deposit { color: var(--funds-deposit); }
.ibn-funds-day-detail .is-withdraw { color: var(--funds-withdraw); }
.ibn-funds-trend-note { margin: 0; color: var(--muted, #64748b); font-size: 10px; line-height: 1.6; }
.ibn-funds-table caption { padding: 0 0 8px; color: var(--muted, #64748b); font-size: 11px; text-align: left; }

.ibn-funds-table { width: 100%; min-width: 400px; border-collapse: collapse; font-size: 13px; line-height: 1.4; }
.ibn-funds-table :is(th, td) { padding: 11px 12px; border-bottom: 1px solid var(--border-light, #e8edf5); white-space: nowrap; }
.ibn-funds-table thead th { color: var(--muted, #64748b); font-size: 11px; font-weight: 700; }
.ibn-funds-table th:first-child { padding-left: 0; text-align: left; }
.ibn-funds-table :is(th, td):last-child { padding-right: 0; }
.ibn-funds-table tbody th { color: var(--text, #334155); font-size: 12px; font-weight: 700; }
.ibn-funds-table thead th:not(:first-child),
.ibn-funds-table td { text-align: left; font-variant-numeric: tabular-nums; }
.ibn-funds-table td { color: var(--text-strong, #0f172a); font-weight: 750; }
.ibn-funds-table .is-risk { color: #dc2626; }
.ibn-funds-table tbody tr:last-child :is(th, td) { border-bottom: 0; }

/* -------------------------------------------------------- 交易账号总览 */

.ibn-trading-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; margin-bottom: 13px; }
.ibn-trading-title-group,
.ibn-trading-controls { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ibn-trading-controls { grid-column: 1 / -1; flex-wrap: wrap; justify-content: flex-start; gap: 10px; }
.ibn-trading-heading h2 { margin: 0; color: var(--text-strong, #0f172a); font-size: 16px; font-weight: 800; }
.ibn-trading-help { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 3px; border: 0; border-radius: 50%; background: transparent; color: var(--muted, #64748b); cursor: pointer; }
.ibn-trading-help:hover { background: var(--blue-soft, #eff6ff); color: var(--blue, #247fff); }
.ibn-trading-help svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ibn-trading-controls .ibn-select { height: 36px; padding: 0 9px; }
.ibn-trading-controls .ibn-select select { max-width: 185px; font-size: 11px; }
.ibn-trading-client-trigger { display: none; }
.ibn-trading-client { position: relative; flex: 1 1 220px; min-width: 0; max-width: 320px; }
.ibn-trading-client-input { display: flex; align-items: center; gap: 7px; min-height: 36px; padding-left: 10px; border: 1px solid var(--border-light, #e8edf5); border-radius: 8px; background: var(--surface, #fff); }
.ibn-trading-client-label { display: none; }
.ibn-trading-client-input:focus-within { border-color: var(--blue, #247fff); box-shadow: 0 0 0 2px rgba(var(--blue-rgb, 36, 127, 255), .1); }
.ibn-trading-client-input > svg { flex: 0 0 16px; width: 16px; height: 16px; fill: none; stroke: var(--muted, #64748b); stroke-width: 1.7; stroke-linecap: round; }
.ibn-trading-client-input input { width: 100%; min-width: 0; padding: 8px 6px 8px 0; border: 0; outline: none; background: transparent; color: var(--text-strong, #0f172a); font: inherit; font-size: 12px; }
.ibn-trading-client-input input::placeholder { color: var(--muted, #64748b); }
.ibn-page .ibn-trading-client .ibn-trading-client-input input:focus-visible { outline: none; }
:root[data-theme="dark"] .ibn-trading-client-input input { background: transparent; }
.ibn-trading-client-clear { flex: 0 0 34px; align-self: stretch; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted, #64748b); font-size: 20px; cursor: pointer; }
.ibn-trading-client-popup { position: absolute; z-index: 35; top: calc(100% + 5px); left: 0; width: 100%; min-width: 220px; max-height: 240px; overflow-y: auto; overscroll-behavior: contain; padding: 4px; border: 1px solid var(--border-light, #e8edf5); border-radius: 10px; background: var(--surface, #fff); box-shadow: 0 8px 24px rgba(15, 23, 42, .12); }
.ibn-trading-client-popup.is-above { top: auto; bottom: calc(100% + 5px); }
.ibn-trading-client-option { display: flex; flex-direction: column; gap: 3px; width: 100%; min-height: 48px; padding: 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text-strong, #0f172a); font: inherit; text-align: left; cursor: pointer; }
.ibn-trading-client-option strong { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.ibn-trading-client-option small { color: var(--muted, #64748b); font-size: 11px; overflow-wrap: anywhere; }
.ibn-trading-client-option:is(:hover, .is-active, [aria-selected="true"]) { background: var(--blue-soft, #eff6ff); color: var(--blue, #247fff); }
.ibn-trading-client-popup p { margin: 0; padding: 12px 8px; color: var(--muted, #64748b); font-size: 12px; line-height: 1.5; }
.ibn-trading-client [hidden] { display: none; }
.ibn-trading-client-sheet .ibn-trading-client { width: 100%; max-width: none; }
.ibn-trading-client-sheet .ibn-trading-client-input { min-height: 48px; border-radius: 10px; }
.ibn-trading-client-sheet .ibn-trading-client-input input { min-height: 46px; font-size: 16px; }
.ibn-trading-client-sheet .ibn-trading-client-input input:focus-visible { outline: none; }
.ibn-trading-client-sheet .ibn-trading-client-popup { position: static; width: 100%; min-width: 0; margin-top: 12px; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
.ibn-trading-client-sheet .ibn-trading-client-option { position: relative; min-height: 62px; padding: 12px 36px 12px 12px; border-radius: 10px; }
.ibn-trading-client-sheet .ibn-trading-client-option + .ibn-trading-client-option { margin-top: 4px; }
.ibn-trading-client-sheet .ibn-trading-client-option[aria-selected="true"]::after { content: "✓"; position: absolute; top: 20px; right: 14px; color: var(--blue, #247fff); font-size: 16px; }
:root[data-theme="dark"] .ibn-trading-client-sheet .ibn-trading-client-input input { background: transparent; }
:root[data-theme="dark"] .ibn-trading-client-sheet .ibn-trading-client-input input:focus-visible { outline: none; }
:root[data-theme="dark"] .ibn-trading-client-sheet .ibn-trading-client-option { background: transparent; }
:root[data-theme="dark"] .ibn-trading-client-sheet .ibn-trading-client-option:is(:hover, .is-active, [aria-selected="true"]) { background: var(--blue-soft); color: var(--blue); }
.ibn-trading-apply { min-height: 36px; padding: 7px 16px; border: 1px solid var(--blue, #247fff); border-radius: 8px; background: var(--blue, #247fff); color: #fff; font: inherit; font-size: 12px; font-weight: 650; white-space: nowrap; cursor: pointer; }
.ibn-trading-apply:hover { filter: brightness(.95); }
.ibn-trading-filter-status { margin: -3px 0 10px; color: var(--muted, #64748b); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.ibn-trading-filter-status.is-pending { color: var(--blue, #247fff); }
.ibn-trading-filter-status.is-error { color: var(--danger, #dc2626); }
.ibn-trading-controls :is(button, select):focus-visible { outline: 2px solid var(--blue, #247fff); outline-offset: 2px; }
.ibn-trading-report-link { color: var(--blue, #247fff); font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.ibn-trading-report-link:hover { text-decoration: underline; }
.ibn-trading-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
.ibn-trading-metric { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; min-width: 0; min-height: 82px; padding: 11px 12px; border: 1px solid var(--border-light, #e8edf5); border-radius: 10px; background: var(--surface-muted, #f7f9fd); color: var(--text-strong, #0f172a); font: inherit; text-align: left; }
.ibn-trading-metric-label { display: block; color: var(--muted, #64748b); font-size: 11px; font-weight: 700; line-height: 1.5; }
.ibn-trading-metric strong { display: block; font-size: clamp(16px, 1.3vw, 20px); font-weight: 850; line-height: 1.2; letter-spacing: -.025em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ibn-trading-metric strong.is-good { color: #16a34a; }
.ibn-trading-metric strong.is-risk { color: #dc2626; }
.ibn-trading-metric-status { position: absolute; right: 12px; bottom: 12px; color: var(--muted, #64748b); font-size: 10px; line-height: 1.4; }
.ibn-trading-note { margin: 10px 0 0; color: var(--muted, #64748b); font-size: 10px; line-height: 1.5; }
.ibn-trading-empty { margin: 12px 0 0; color: var(--muted, #64748b); font-size: 12px; }
.ibn-trading-empty[hidden] { display: none; }
[data-theme="dark"] .ibn-trading-metric strong.is-good { color: #4ade80; }

/* -------------------------------------------------------- 快捷入口 */

/* 快捷入口放在收益分析之后，维持区内 14px 的间距。 */
.ibn-quicknav {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.ibn-quicknav a {
  min-width: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 16px 12px;
  background: var(--surface, #fff);
  border: 1px solid var(--border-light, #e8edf5);
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.ibn-quicknav a:hover {
  border-color: var(--blue, #247fff);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(var(--blue-rgb), 0.12);
}

/* 图标底板沿用本项目 .ib-metric-icon 那套：圆角方块 + blue-soft 底 + 线性图标 */
.ibn-quicknav-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--blue-soft, #eff6ff);
  color: var(--blue, #247fff);
}

.ibn-quicknav-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ibn-quicknav-label {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.ibn-quicknav-label b {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 750;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ibn-quicknav-label small {
  overflow: hidden;
  color: var(--muted, #64748b);
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------ 深色 */

[data-theme="dark"] .ibn-page {
  background:
    linear-gradient(180deg, rgba(var(--neutral-panel-rgb, var(--blue-rgb)), 0.07), rgba(var(--neutral-panel-rgb, 17, 24, 39), 0) 320px),
    var(--page-bg, #0b1220);
}

/* 保持分段控件的状态层次，避免全局暗色 button 规则覆盖选中态。 */
:root[data-theme="dark"] .ibn-segment > button[role="tab"] {
  background: var(--ibn-segment-button-bg, transparent);
  color: var(--text-soft);
  box-shadow: none;
}
:root[data-theme="dark"] .ibn-segment > button[role="tab"]:hover:not(.is-active) {
  background: var(--surface-hover);
  color: var(--text-strong);
}
:root[data-theme="dark"] .ibn-segment > button[role="tab"].is-active {
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(var(--blue-rgb), .4);
}
:root[data-theme="dark"] .ibn-segment > button[role="tab"]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
@media (max-width: 760px) {
  :root[data-theme="dark"] .ibn-range-control { --ibn-segment-button-bg: var(--surface-muted); }
  :root[data-theme="dark"] .ibn-range-control > button[role="tab"].is-active {
    border-color: rgba(var(--blue-rgb), .4);
    box-shadow: none;
  }
}

[data-theme="dark"] .ibn-deposit-reference strong { color: #fbbf24; }
[data-theme="dark"] .ibn-quicknav a { background: var(--surface-raised, #151f2f); }
[data-theme="dark"] .ibn-tag.is-tier2 { color: #7dd3fc; }
[data-theme="dark"] .ibn-tag.is-tier3 { color: #c4b5fd; }
[data-theme="dark"] .ibn-reward.is-next b { color: #fbbf24; }
[data-theme="dark"] .ibn-funds-card strong.is-warn { color: #fbbf24; }
[data-theme="dark"] .ibn-funds-chart { --funds-deposit: #4ade80; --funds-withdraw: #fbbf24; }
[data-theme="dark"] .ibn-todo.is-warn strong { color: #fbbf24; }

/* ---------------------------------------------------------- 响应式 */

@media (max-width: 1180px) {
  .ibn-trading-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ibn-unit-econ { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ibn-network-stats { grid-template-columns: repeat(2, 1fr); }
  .ibn-todo-grid { grid-template-columns: repeat(2, 1fr); }
  .ibn-quicknav { grid-template-columns: repeat(3, 1fr); }
  .ibn-task-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1000px) {
  .ibn-funnel-grid,
  .ibn-contrib-grid,
  .ibn-level-grid { grid-template-columns: 1fr; }
  .ibn-commission-grid { grid-template-columns: 1fr; }
  .ibn-earnings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "performance cumulative" "metrics metrics";
    gap: 14px 18px;
  }
  .ibn-unit-econ {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 12px 0 0;
    border-left: 0;
    border-top: 1px solid var(--border-light, #e8edf5);
  }
}

@media (max-width: 760px) {
  .ibn-page { padding: 16px 14px 60px; }
  .ibn-topbar { margin: 0 0 12px; padding: 0 0 10px; }
  .ibn-topbar .ibn-controls { width: 100%; gap: 8px; }
  .ibn-range-control { display: flex; width: 100%; }
  .ibn-range-control button { flex: 1; padding-inline: 8px; white-space: nowrap; }
  .ibn-funnel-columns,
  .ibn-funnel-stage { grid-template-columns: minmax(0, 1fr) 56px 74px; gap: 8px; }
  .ibn-unit-econ { grid-template-columns: 1fr 1fr; }
  .ibn-funds-card { padding: 9px 7px; }
  .ibn-funds-card strong { font-size: clamp(13px, 2.8vw, 18px); line-height: 22px; }
  .ibn-network-stats,
  .ibn-todo-grid,
  .ibn-task-grid { grid-template-columns: 1fr; }
  .ibn-quicknav { grid-template-columns: repeat(2, 1fr); }
  .ibn-earnings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "performance cumulative"; gap: 10px; }
  .ibn-commission-summary-card .ibn-unit-econ { display: none; }
  .ibn-earnings-section .ibn-commission-grid > .ibn-card { padding: 16px; }
  .ibn-performance-value strong { font-size: 28px; }
  .ibn-earnings-section .ibn-card-head { flex-wrap: wrap; gap: 8px; }
  .ibn-trend-summary { gap: 8px; }
  .ibn-trend-summary strong { font-size: 16px; }
  .ibn-trend-summary strong small { display: block; margin-top: 2px; }
  .ibn-earnings-section .ibn-chart-foot { align-items: flex-start; flex-wrap: wrap; }
}

/* Monthly overview above the existing analysis sections. */
.ibm-overview {
  padding: 17px 18px;
  border: 1px solid var(--border-light, #e8edf5);
  border-radius: 16px;
  background: var(--surface, #fff);
  box-shadow: var(--shadow-soft, 0 12px 28px rgba(15, 23, 42, .05));
}

.ibm-heading,
.ibm-controls,
.ibm-metric-foot,
.ibm-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ibm-heading { flex-wrap: wrap; margin-bottom: 13px; }
.ibm-eyebrow { color: var(--blue, #247fff); font-size: 10px; font-weight: 850; letter-spacing: .09em; }
.ibm-title-group { display: flex; align-items: center; gap: 7px; min-width: 0; max-width: 100%; }
.ibm-heading h2 { margin: 0; color: var(--text-strong, #0f172a); font-size: 16px; font-weight: 800; }
.ibm-help-trigger { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 26px; height: 26px; padding: 3px; border: 0; border-radius: 50%; background: transparent; color: var(--muted, #64748b); cursor: pointer; }
.ibm-help-trigger:hover { background: var(--blue-soft, #eff6ff); color: var(--blue, #247fff); }
.ibm-help-trigger svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ibm-controls { flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.ibm-client-picker { position: relative; min-width: 0; max-width: 100%; }
.ibm-client-picker summary { display: flex; align-items: center; gap: 9px; box-sizing: border-box; width: 210px; max-width: 100%; min-height: 38px; padding: 7px 12px; border: 1px solid var(--border-light); border-radius: 8px; background: var(--surface); color: var(--text-strong); font-size: 14px; cursor: pointer; list-style: none; }
.ibm-client-picker summary::-webkit-details-marker { display: none; }
.ibm-client-picker summary svg { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.ibm-client-picker summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ibm-client-picker[open] summary, .ibm-client-picker summary:focus-visible { border-color: var(--blue); }
.ibm-client-popup { position: absolute; z-index: 45; top: calc(100% + 6px); left: 0; box-sizing: border-box; width: 320px; max-width: calc(100vw - 52px); padding: 10px; border: 1px solid var(--border-light); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-soft); }
.ibm-client-popup input { box-sizing: border-box; width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text-strong); font: inherit; font-size: 14px; }
.ibm-client-options { max-height: 230px; margin-top: 6px; overflow: auto; overscroll-behavior: contain; }
.ibm-client-options button { display: grid; gap: 2px; width: 100%; padding: 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text-strong); font: inherit; font-size: 13px; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.ibm-client-options button:is(:hover, :focus-visible, [aria-pressed="true"]) { background: var(--blue-soft); }
.ibm-client-options :is(small, p) { color: var(--muted); font-size: 12px; }
.ibm-client-options p { margin: 8px; }
.ibm-scope-label { display: none; }
.ibm-scope-filter { display: none; }
.ibm-mode-control,
.ibm-scope-control { display: inline-flex; align-items: center; gap: 2px; min-height: 32px; padding: 3px; border: 1px solid var(--border-light, #e8edf5); border-radius: 9px; background: var(--surface-muted, #f7f9fd); }
.ibm-mode-control button,
.ibm-scope-control button { padding: 5px 9px; border: 0; border-radius: 6px; background: transparent; color: var(--muted, #64748b); font: inherit; font-size: 11px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.ibm-mode-control button:hover,
.ibm-scope-control button:hover { color: var(--blue, #247fff); }
.ibm-mode-control button.is-active,
.ibm-scope-control button.is-active { background: var(--surface, #fff); color: var(--blue, #247fff); box-shadow: 0 1px 3px rgba(15, 23, 42, .08); }
.ibm-mode-control button:focus-visible,
.ibm-scope-control button:focus-visible { outline: 2px solid var(--blue, #247fff); outline-offset: 2px; }
.ibm-period-picker { position: relative; min-width: 0; }
.ibm-period-control { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 0; }
.ibm-period-control h2 { min-width: 0; }
.ibm-period-control button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; background: transparent; color: var(--text-strong, #0f172a); font: inherit; cursor: pointer; transition: background .15s, color .15s; }
.ibm-period-control button:hover { background: var(--blue-soft, #eff6ff); color: var(--blue, #247fff); }
.ibm-period-control button:focus-visible { outline: 2px solid var(--blue, #247fff); outline-offset: 2px; }
.ibm-period-control button[hidden] { display: none; }
.ibm-period-control svg { width: 14px; height: 14px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ibm-period-control .ibm-period-step { width: 24px; height: 28px; flex-shrink: 0; color: var(--muted, #64748b); }
.ibm-period-control .ibm-period-toggle { max-width: 100%; min-height: 28px; gap: 5px; padding: 2px 3px 2px 0; font-size: inherit; font-weight: inherit; line-height: 1.4; }
.ibm-period-toggle [data-ibm-period-title] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ibm-period-control .ibm-period-chevron { width: 12px; height: 12px; color: var(--muted, #64748b); transition: transform .15s; }
.ibm-period-toggle[aria-expanded="true"] .ibm-period-chevron { transform: rotate(180deg); }
.ibm-period-panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 50; box-sizing: border-box; width: 330px; max-width: calc(100vw - 66px); margin: 0; padding: 16px; overflow: hidden; border: 1px solid var(--border, #d8e1ef); border-radius: 13px; background: var(--surface, #fff); color: var(--text-strong, #0f172a); box-shadow: 0 12px 36px rgba(15, 23, 42, .15); }
.ibm-period-panel[open] { display: flex; flex-direction: column; }
.ibm-period-panel::backdrop { background: var(--overlay, rgba(15, 23, 42, .42)); }
.ibm-period-panel.is-above { top: auto; bottom: calc(100% + 8px); }
.ibm-period-panel[hidden],
.ibm-period-error[hidden] { display: none; }
.ibm-period-handle { display: none; }
.ibm-period-header { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ibm-period-panel-title { margin: 0; font-size: 14px; font-weight: 750; outline: none; }
.ibm-period-close { display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.ibm-period-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ibm-period-close:hover { background: var(--surface-muted); }
.ibm-period-close:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.ibm-period-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; }
.ibm-period-presets button:focus-visible,
.ibm-period-actions button:focus-visible { outline: 2px solid var(--blue, #247fff); outline-offset: 2px; }
.ibm-month-control { display: grid; gap: 6px; color: var(--muted, #64748b); font-size: 12px; font-weight: 650; }
.ibm-month-control input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 38px; padding: 7px 9px; border: 1px solid var(--border, #d8e1ef); border-radius: 7px; background: var(--surface, #fff); color: var(--text-strong, #0f172a); font: inherit; font-size: 13px; }
.ibm-period-presets { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.ibm-period-presets button { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 4px 8px; border: 1px solid var(--border-light, #e8edf5); border-radius: 6px; background: transparent; color: var(--muted, #64748b); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.ibm-period-presets button:hover,
.ibm-period-presets button.is-active { border-color: var(--blue, #247fff); background: var(--blue-soft, #eff6ff); color: var(--blue, #247fff); }
.ibm-period-error { margin: 8px 0 0; color: #dc2626; font-size: 11px; line-height: 1.5; }
.ibm-period-panel :is(input, select)[aria-invalid="true"] { border-color: var(--danger, #dc2626); }
.ibm-period-actions { display: flex; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-light, #e8edf5); }
.ibm-period-actions .ibm-period-error { flex-basis: 100%; margin: 0; }
.ibm-period-actions button { min-height: 33px; padding: 6px 12px; border: 1px solid var(--border, #d8e1ef); border-radius: 7px; background: var(--surface, #fff); color: var(--muted, #64748b); font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.ibm-period-actions button[type="submit"] { border-color: var(--blue, #247fff); background: var(--blue, #247fff); color: #fff; }
.ibm-period-actions button:hover { filter: brightness(.97); }

.ibm-metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.ibm-metric {
  position: relative;
  min-width: 0;
  min-height: 113px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--border-light, #e8edf5);
  border-radius: 12px;
  background: var(--surface-muted, #f7f9fd);
  color: var(--text, #0f172a);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ibm-metric:hover,
.ibm-metric.is-active {
  border-color: var(--blue, #247fff);
  background: rgba(var(--blue-rgb, 36, 127, 255), .055);
}
.ibm-metric-label { padding-right: 20px; color: var(--muted, #64748b); font-size: 11px; font-weight: 750; }
.ibm-metric-value {
  display: block;
  color: var(--text-strong, #0f172a);
  font-size: clamp(18px, 1.7vw, 24px);
  font-weight: 850;
  letter-spacing: -.035em;
  white-space: nowrap;
}
.ibm-metric-value small { margin-left: 4px; color: var(--muted, #64748b); font-size: 10px; font-weight: 650; letter-spacing: 0; }
.ibm-metric-foot { justify-content: flex-start; color: var(--muted, #64748b); font-size: 10px; line-height: 1.4; }
.ibm-metric-source { position: absolute; top: 10px; right: 10px; display: inline-flex; width: 18px; height: 18px; color: var(--blue, #247fff); }
.ibm-metric-source svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.ibm-detail-panel[hidden] { display: none; }
.ibm-detail-panel { margin-top: 14px; border-top: 1px solid var(--border-light, #e8edf5); }
body.ibm-detail-open { overflow: hidden; }
.ibm-detail-panel.ibm-detail-drawer { position: fixed; inset: 0 0 0 auto; width: min(720px, 96vw); height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 20px 0 0 20px; background: var(--surface); color: var(--text-strong); box-shadow: -16px 0 60px rgba(15,23,42,.18); }
.ibm-detail-drawer[open] { display: flex; flex-direction: column; }
.ibm-detail-drawer::backdrop { background: rgba(15,23,42,.4); }
.ibm-detail-drawer-handle { display: none; }
.ibm-detail-drawer .ibm-detail-head { flex: 0 0 auto; align-items: flex-start; padding: 22px 24px 18px; border-bottom: 1px solid var(--border-light); }
.ibm-detail-drawer .ibm-detail-heading { display: grid; gap: 6px; }
.ibm-detail-drawer .ibm-detail-head h3 { font-size: 20px; line-height: 1.4; }
.ibm-detail-drawer .ibm-detail-head h3:focus { outline: none; }
.ibm-detail-drawer .ibm-detail-heading small { color: var(--muted); font-size: 11px; line-height: 1.6; }
.ibm-detail-drawer .ibm-detail-head .ibm-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.ibm-detail-drawer .ibm-close svg { width: 22px; height: 22px; }
.ibm-detail-drawer .ibm-detail-head .ibm-close:is(:hover, :active) { background: var(--surface-muted); color: var(--text-strong); }
.ibm-detail-body { flex: 1 1 auto; min-height: 0; padding: 18px 24px 24px; overflow-y: auto; overscroll-behavior: contain; }
.ibm-detail-drawer .ibm-table-wrap { max-height: none; }
.ibm-detail-drawer .ibm-segment { gap: 3px; padding: 3px; border-radius: 10px; background: var(--surface-muted); }
.ibm-detail-drawer .ibm-detail-tools .ibm-segment button { padding: 6px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 550; }
.ibm-detail-drawer .ibm-detail-tools .ibm-segment button.is-active { background: var(--surface); color: var(--blue); box-shadow: 0 1px 4px rgba(15,23,42,.08); font-weight: 650; }
.ibm-detail-drawer .ibm-table .ibn-row-link { background: transparent; color: var(--blue); }
.ibm-data-note { margin: 0 0 8px; color: var(--muted, #64748b); font-size: 11px; line-height: 1.5; }
.ibm-data-note[hidden] { display: none; }
.ibm-detail-head { min-height: 44px; padding: 10px 0 8px; }
.ibm-detail-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; min-width: 0; }
.ibm-detail-heading [data-ibm-source-filter]:empty { display: none; }
.ibm-detail-head h3 { margin: 0; color: var(--text-strong, #0f172a); font-size: 14px; font-weight: 800; }
.ibm-detail-summary { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 6px; color: var(--muted, #64748b); font-size: 12px; }
.ibm-detail-summary b { color: var(--text-strong, #0f172a); font-weight: 750; font-variant-numeric: tabular-nums; }
.ibm-segment { display: inline-flex; align-self: stretch; gap: 16px; }
.ibm-segment button { padding: 7px 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted, #64748b); font: inherit; font-size: 12px; cursor: pointer; }
.ibm-segment button.is-active { border-bottom-color: var(--blue, #247fff); color: var(--blue, #247fff); font-weight: 700; }
.ibm-segment button:hover { color: var(--blue, #247fff); }
.ibm-close { display: inline-flex; align-items: center; flex-shrink: 0; gap: 4px; padding: 4px 0 4px 6px; border: 0; background: transparent; color: var(--muted, #64748b); font: inherit; font-size: 12px; cursor: pointer; }
.ibm-close:hover { color: var(--blue, #247fff); }
.ibm-close svg, .ibm-export svg, .ibm-detail-search svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ibm-clear-source { padding: 3px 6px; border: 0; border-radius: 4px; color: var(--blue, #247fff); background: var(--blue-soft, #eaf2ff); font: inherit; font-size: 11px; cursor: pointer; }
.ibm-table-wrap { max-height: 300px; overflow: auto; }
.ibm-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ibm-table th { position: sticky; top: 0; padding: 8px; border-bottom: 1px solid var(--border-light, #e8edf5); background: var(--surface-muted, #f7f9fd); color: var(--muted, #64748b); font-size: 11px; font-weight: 650; text-align: left; white-space: nowrap; }
.ibm-table td { padding: 10px 8px; border-bottom: 1px solid var(--border-light, #e8edf5); white-space: nowrap; }
.ibm-table tbody tr:last-child td { border-bottom: 0; }
.ibm-table tbody tr:hover { background: var(--blue-faint, #f3f8ff); }
.ibm-table .num { text-align: right; }
.ibm-table .num strong { font-weight: 750; font-variant-numeric: tabular-nums; }
.ibm-empty { margin: 0; padding: 24px 0; color: var(--muted, #64748b); font-size: 12px; text-align: center; }
.ibm-metric:focus-visible,
.ibm-segment button:focus-visible,
.ibm-table [data-ibm-source]:focus-visible,
.ibm-close:focus-visible { outline: 3px solid rgba(var(--blue-rgb, 36, 127, 255), .3); outline-offset: 2px; }

.ibn-section { margin-bottom: 24px; }
.ibn-eyebrow,
.ibm-eyebrow,
.ibn-section-note { display: none; }
.ibn-earnings-section .ibn-section-note { display: block; font-variant-numeric: tabular-nums; }
.ibn-quicknav-label small { display: none; }

/* Interactive drill-downs keep the overview visible behind a detail drawer. */
[data-layout-page="ib-dashboard-new"] .topbar .search { cursor: pointer; }
[data-layout-page="ib-dashboard-new"] .topbar .search:hover { border-color: var(--blue, #247fff); }
[data-layout-page="ib-dashboard-new"] .topbar .search:focus-visible { outline: 2px solid var(--blue, #247fff); outline-offset: 3px; }
.ibn-filter-reset,
.ibm-detail-tools button,
.ibn-chart-foot button {
  border: 1px solid var(--border-light, #e8edf5);
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--surface, #fff);
  color: var(--blue, #247fff);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.ibn-row-link,
button.ibn-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue, #247fff);
  font: inherit;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}
.ibn-row-link:hover { text-decoration: underline; }
.ibn-legend button { display: inline-flex; align-items: center; gap: 5px; padding: 4px 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.ibn-legend button.is-muted { opacity: .4; text-decoration: line-through; }
.ibn-chart-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 7px; }
.ibn-chart-foot small { color: var(--muted, #64748b); font-size: 11px; }
.ibn-chart-foot button { border: 0; padding: 0; background: transparent; }
.ibn-page [role="button"] { cursor: pointer; }
.ibn-page :is(.ibn-source-list li, .ibn-tier-row, .ibn-rank-row, .ibn-symbol-row, .ibn-task, .ibn-activity-card, .ibn-funds-card, .ibn-stat-card, .ibn-funnel-stage) { transition: background .15s, box-shadow .15s; }
.ibn-page :is(.ibn-source-list li, .ibn-tier-row, .ibn-rank-row, .ibn-symbol-row, .ibn-task, .ibn-activity-card, .ibn-funds-card, .ibn-stat-card, .ibn-funnel-stage):hover {
  background: var(--blue-soft, #eff6ff);
  box-shadow: 0 0 0 4px var(--blue-soft, #eff6ff);
  border-radius: 8px;
}
.ibn-page .ibn-funds-card:hover { box-shadow: none; border-radius: 10px; }
.ibn-page :is(button, a, input, select, [role="button"]):focus-visible,
.ibn-detail-drawer :is(button, a, input):focus-visible {
  outline: 2px solid var(--blue, #247fff);
  outline-offset: 3px;
}
.ibm-detail-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 8px; }
.ibm-detail-utilities { display: flex; align-items: center; gap: 12px; min-width: 0; margin-left: auto; }
.ibm-detail-search { position: relative; display: block; width: 240px; max-width: 100%; }
.ibm-detail-search svg { position: absolute; top: 50%; left: 10px; transform: translateY(-50%); color: var(--muted, #64748b); pointer-events: none; }
.ibm-detail-tools .ibm-export { display: inline-flex; align-items: center; gap: 5px; padding: 6px 0; border: 0; background: transparent; color: var(--muted, #64748b); font-weight: 650; }
.ibm-detail-tools .ibm-export:hover { color: var(--blue, #247fff); }
.ibm-detail-panel { scroll-margin-top: 16px; }
.ibm-detail-tools input,
.ibn-detail-toolbar input,
.ibn-wallet-config-name input {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--border, #d8e1ef);
  border-radius: 9px;
  padding: 10px 12px;
  background: var(--surface, #fff);
  color: var(--text-strong, #0f172a);
  font: inherit;
  font-size: 13px;
}
.ibm-detail-tools input { max-width: none; min-height: 32px; padding: 6px 10px 6px 30px; border-radius: 8px; font-size: 12px; }
.ibm-detail-tools button { white-space: nowrap; }
.ibm-table th button { border: 0; padding: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.ibn-page button:disabled { cursor: default; }
.ibm-detail-tools button:disabled { opacity: .45; }

body.ibn-detail-open { overflow: hidden; }
body.ibn-analysis-open { overflow: hidden; }
.ibn-analysis-drawer {
  position: fixed;
  inset: auto 0 0;
  width: min(760px, 100%);
  max-width: 100%;
  height: min(850px, 88dvh);
  max-height: 88dvh;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 20px 20px 0 0;
  background: var(--page-bg, #f8fbff);
  color: var(--text-strong, #0f172a);
  box-shadow: 0 -16px 60px rgba(15,23,42,.18);
}
.ibn-analysis-drawer[open] { display: flex; flex-direction: column; }
.ibn-analysis-drawer::backdrop { background: rgba(15,23,42,.4); animation: ibn-analysis-backdrop-in .24s ease both; }
.ibn-analysis-drawer.is-closing::backdrop { animation: ibn-analysis-backdrop-out .2s ease both; }
.ibn-analysis-handle { flex: 0 0 24px; display: grid; place-items: center; background: var(--surface); touch-action: none; cursor: grab; }
.ibn-analysis-handle span { width: 32px; height: 4px; border-radius: 999px; background: var(--border, #d8e1ef); }
.ibn-analysis-drawer .ibn-detail-header { padding: 0 16px 14px; touch-action: none; }
.ibn-analysis-drawer.is-dragging :is(.ibn-analysis-handle, .ibn-detail-header) { cursor: grabbing; user-select: none; }
.ibn-analysis-drawer .ibn-detail-header button { width: 44px; height: 44px; }
.ibn-analysis-drawer .ibn-detail-heading h2 { font-size: 19px; }
.ibn-analysis-drawer .ibn-detail-heading small { display: block; margin-top: 5px; font-size: 11px; }
.ibn-analysis-drawer .ibn-detail-heading h2:focus { outline: none; }
.ibn-analysis-drawer .ibn-detail-body { margin: 0; padding: 14px 16px calc(24px + env(safe-area-inset-bottom, 0px)); overscroll-behavior: contain; }
.ibn-analysis-drawer .ibn-commission-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.ibn-analysis-drawer .ibn-commission-grid > .ibn-card { padding: 16px; }
.ibn-analysis-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; padding: 14px 16px; border: 1px solid var(--border-light); border-radius: 12px; background: var(--surface); }
.ibn-analysis-drawer :is(.ibn-segment button, .ibn-legend button, .ibn-chart-foot button) { min-height: 44px; }
.ibn-analysis-drawer .ibn-trend-card .ibn-card-head { flex-wrap: wrap; }
.ibn-analysis-drawer .ibn-legend { flex-wrap: wrap; }
.ibn-analysis-drawer [hidden] { display: none !important; }
@keyframes ibn-analysis-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ibn-analysis-backdrop-out { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .ibn-analysis-drawer::backdrop, .ibn-analysis-drawer.is-closing::backdrop { animation: none; }
}
.ibn-detail-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(800px, 96vw);
  height: 100dvh;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--border-light, #e8edf5);
  border-radius: 18px 0 0 18px;
  background: var(--page-bg, #f8fbff);
  color: var(--text-strong, #0f172a);
  box-shadow: -14px 0 50px rgba(15,23,42,.15);
}
.ibn-detail-drawer[open] { display: flex; flex-direction: column; }
.ibn-detail-drawer::backdrop { background: rgba(15,23,42,.3); backdrop-filter: blur(2px); animation: ibn-analysis-backdrop-in .24s ease both; }
.ibn-detail-drawer.is-closing::backdrop { animation: ibn-analysis-backdrop-out .2s ease both; }
.ibn-detail-sheet-handle { display: none; }
.ibn-detail-drawer.is-sheet { width: min(640px, 96vw); }
.ibn-detail-sheet-handle span { display: block; width: 32px; height: 4px; border-radius: 999px; background: var(--border); }
.ibn-detail-drawer.is-sheet .ibn-detail-header { padding: 20px 24px; gap: 12px; }
.ibn-detail-drawer.is-sheet .ibn-detail-header button { width: 40px; height: 40px; }
.ibn-detail-drawer.is-sheet .ibn-detail-heading h2 { margin-top: 3px; font-size: 18px; }
.ibn-detail-drawer.is-sheet .ibn-detail-heading small { font-size: 11px; }
.ibn-detail-drawer.is-sheet .ibn-detail-body { padding: 20px 24px; overscroll-behavior: contain; }
.ibn-trading-guide { display: grid; gap: 12px; font-size: 12px; line-height: 1.65; }
.ibn-trading-guide h3 { margin: 0; color: var(--text-strong); font-size: 13px; font-weight: 650; }
.ibn-trading-guide p { margin: 8px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.ibn-trading-guide-scope, .ibn-trading-guide-field, .ibn-trading-guide-foot { padding: 14px; border: 1px solid var(--border-light); border-radius: 12px; background: var(--surface); }
.ibn-trading-guide-scope dl { display: grid; gap: 5px; margin: 10px 0 0; font-size: 11px; }
.ibn-trading-guide-scope dl > div { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 8px; }
.ibn-trading-guide-scope dt { color: var(--muted); }
.ibn-trading-guide-scope dd { margin: 0; color: var(--text-strong); overflow-wrap: anywhere; }
.ibn-trading-guide-scope p { font-size: 11px; }
.ibn-trading-guide .ibn-trading-guide-hint { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--blue-soft); color: var(--text); font-size: 11px; }
.ibn-trading-guide-hint b { font-weight: 600; }
.ibn-trading-guide-fields { display: grid; gap: 10px; }
.ibn-trading-guide-field > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ibn-trading-guide-field > header > span { flex-shrink: 0; padding: 2px 6px; border-radius: 5px; background: var(--surface-muted); color: var(--muted); font-size: 10px; }
.ibn-trading-guide-field > header > .is-unavailable { background: var(--warning-soft, #fff7ed); color: var(--warning, #b45309); }
.ibn-trading-guide-value { display: flex; align-items: baseline; gap: 5px; margin-top: 7px; }
.ibn-trading-guide-value strong { color: var(--text-strong); font-size: 21px; font-weight: 750; font-variant-numeric: tabular-nums; }
.ibn-trading-guide-value small { color: var(--muted); font-size: 10px; }
.ibn-trading-guide-value > span { margin-left: auto; color: var(--muted); font-size: 10px; }
.ibn-trading-guide-formula { margin-top: 9px; padding: 8px 10px; border-radius: 6px; background: var(--surface-muted); color: var(--text-strong); font-size: 11px; overflow-wrap: anywhere; }
.ibn-trading-guide .ibn-trading-guide-note, .ibn-trading-guide-foot p { font-size: 11px; }
@media (prefers-reduced-motion: reduce) {
  .ibn-detail-drawer::backdrop, .ibn-detail-drawer.is-closing::backdrop { animation: none; }
}
.ibn-detail-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--border-light, #e8edf5);
  background: var(--surface, #fff);
}
.ibn-detail-heading { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ibn-detail-heading small { color: var(--muted, #64748b); font-size: 12px; }
.ibn-detail-heading h2 { margin: 6px 0 0; font-size: 23px; line-height: 1.3; }
.ibn-detail-heading h2:focus { outline: 0; }
.ibn-detail-header button { flex-shrink: 0; width: 36px; height: 36px; padding: 0; border: 1px solid var(--border-light, #e8edf5); border-radius: 9px; background: var(--surface-muted, #f3f6fb); color: inherit; font-size: 23px; cursor: pointer; }
.ibn-detail-body { min-height: 0; overflow-y: auto; padding: 24px; }
.ibm-help-intro { margin: 0 0 16px; color: var(--text, #334155); font-size: 13px; line-height: 1.7; }
.ibm-help-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; line-height: 1.65; }
.ibm-help-table :is(th, td) { padding: 12px; border-bottom: 1px solid var(--border-light, #e8edf5); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.ibm-help-table th { background: var(--surface-muted, #f7f9fd); color: var(--text-strong, #0f172a); font-size: 12px; font-weight: 750; }
.ibm-help-table :is(th, td):first-child { width: 20%; }
.ibm-help-table td:first-child { color: var(--text-strong, #0f172a); font-weight: 700; }
.ibm-help-table td { color: var(--text, #334155); }
.ibm-help-note { margin: 16px 0 0; color: var(--muted, #64748b); font-size: 12px; line-height: 1.7; }
.ibn-detail-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.ibn-detail-summary > div { padding: 16px; border: 1px solid var(--border-light, #e8edf5); border-radius: 12px; background: var(--surface, #fff); }
.ibn-detail-summary span { display: block; color: var(--muted, #64748b); font-size: 12px; margin-bottom: 8px; }
.ibn-detail-summary strong { font-size: 21px; font-weight: 850; }
.ibn-detail-note { margin: 0 0 18px; color: var(--muted, #64748b); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.ibn-detail-note-disclosure > summary, .ibn-detail-mobile-sort { display: none; }
.ibn-detail-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 20px; }
.ibn-detail-actions :is(button, a),
.ibn-detail-toolbar button,
.ibn-detail-empty button,
.ibn-wallet-config-form button {
  border: 1px solid var(--border, #d8e1ef);
  border-radius: 9px;
  padding: 9px 12px;
  background: var(--surface, #fff);
  color: var(--blue, #247fff);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.ibn-detail-toolbar { display: flex; align-items: center; gap: 12px; }
.ibn-detail-toolbar button { flex-shrink: 0; }
.ibn-detail-toolbar button:disabled { opacity: .45; cursor: default; }
.ibn-detail-count { margin: 12px 0; color: var(--muted, #64748b); font-size: 12px; }
.ibn-detail-table-wrap { overflow-x: auto; border: 1px solid var(--border-light, #e8edf5); border-radius: 12px; background: var(--surface, #fff); }
.ibn-detail-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ibn-detail-table :is(th, td) { padding: 13px 12px; text-align: left; border-bottom: 1px solid var(--border-light, #e8edf5); white-space: nowrap; }
.ibn-detail-table th { background: var(--surface-muted, #f3f6fb); color: var(--muted, #64748b); font-weight: 700; }
.ibn-detail-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ibn-detail-table th button { border: 0; background: transparent; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.ibn-detail-table th button span { color: var(--blue, #247fff); }
.ibn-detail-table tr[data-detail-row]:hover { background: var(--blue-soft, #eff6ff); cursor: pointer; }
.ibn-detail-table tbody tr:last-child td { border-bottom: 0; }
.ibn-detail-row-link { border: 0; background: transparent; padding: 0; color: var(--blue, #247fff); font: inherit; font-weight: 750; cursor: pointer; }
.ibn-detail-row-link span { padding-left: 5px; }
.ibn-detail-empty { text-align: center; padding: 36px 20px; }
.ibn-detail-empty p { color: var(--muted, #64748b); font-size: 12px; }
.ibn-wallet-config-form { display: grid; gap: 20px; max-width: 480px; }
.ibn-wallet-config-meta { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--surface-muted, #f3f6fb); }
.ibn-wallet-config-meta dt { color: var(--muted, #64748b); font-size: 12px; }
.ibn-wallet-config-meta dd { margin: 6px 0 0; font-size: 13px; font-weight: 700; }
.ibn-wallet-config-name { display: grid; gap: 8px; font-size: 13px; font-weight: 700; }
.ibn-wallet-config-notices { display: grid; gap: 14px; margin: 0; padding: 0; border: 0; }
.ibn-wallet-config-notices legend { padding: 0 0 12px; font-size: 13px; font-weight: 700; }
.ibn-wallet-config-notices label { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; cursor: pointer; }
.ibn-wallet-config-notices input { flex-shrink: 0; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--blue, #247fff); }
.ibn-wallet-config-notices small { display: block; margin-top: 4px; color: var(--muted, #64748b); font-size: 12px; }
.ibn-wallet-config-form [type="submit"] { color: white; background: var(--blue, #247fff); border-color: var(--blue, #247fff); }
.ibn-wallet-config-form p { margin: 0; color: var(--muted, #64748b); font-size: 12px; }
.ibn-feedback { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 10000; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 10px; background: var(--text-strong, #0f172a); color: var(--surface, #fff); box-shadow: 0 8px 24px rgba(15,23,42,.15); font-size: 13px; pointer-events: none; }
.ibn-detail-drawer [hidden] { display: none !important; }
@media (min-width: 761px) and (max-width: 860px) {
  .ibn-detail-drawer.is-reminder-list {
    inset: auto 0 0;
    width: 100%;
    height: min(760px, 82dvh);
    max-height: calc(100dvh - 80px);
    max-width: 100%;
    border: 0;
    border-radius: 22px 22px 0 0;
  }
  .ibn-detail-drawer.is-reminder-list .ibn-detail-sheet-handle {
    display: grid;
    place-items: center;
    flex: 0 0 26px;
    touch-action: none;
    cursor: grab;
  }
}
@media (max-width: 760px) {
  .ibn-detail-drawer, .ibn-detail-drawer.is-sheet { inset: auto 0 0; width: 100%; height: min(760px, 82dvh); max-height: calc(100dvh - 80px); max-width: 100%; margin: 0 auto; border: 0; border-radius: 22px 22px 0 0; box-shadow: 0 -16px 60px rgba(15,23,42,.18); }
  .ibn-detail-sheet-handle { display: grid; place-items: center; flex: 0 0 26px; background: var(--surface); touch-action: none; cursor: grab; }
  .ibn-detail-drawer .ibn-detail-header, .ibn-detail-drawer.is-sheet .ibn-detail-header { padding: 0 16px 14px; }
  .ibn-detail-drawer .ibn-detail-body, .ibn-detail-drawer.is-sheet .ibn-detail-body { padding: 14px 16px calc(24px + env(safe-area-inset-bottom, 0px)); overscroll-behavior: contain; }
  .ibn-detail-header, .ibn-detail-body { padding: 18px; }
  .ibn-detail-heading h2 { font-size: 20px; }
  .ibn-detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ibn-detail-summary strong { font-size: 18px; }
  .ibm-help-table { font-size: 12px; }
  .ibm-help-table :is(th, td) { padding: 9px 7px; }
  .ibm-help-table :is(th, td):first-child { width: 22%; }
}
@media (prefers-reduced-motion: reduce) {
  .ibn-page :is(button, a, [role="button"]) { transition: none; }
}

@media (max-width: 1180px) {
  .ibm-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .ibm-overview { padding: 14px 12px; }
  .ibn-trading-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ibn-trading-controls { gap: 10px; }
  .ibm-heading, .ibm-detail-head { align-items: flex-start; flex-wrap: wrap; }
  .ibm-detail-head { flex-wrap: nowrap; }
  .ibm-detail-utilities { width: 100%; margin-left: 0; }
  .ibm-detail-search { flex: 1; width: auto; min-width: 0; }
  .ibm-controls { justify-content: flex-start; }
  .ibm-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ibm-metric { min-height: 104px; }
  .ibm-metric-value { font-size: 23px; }
  .ibm-table { min-width: 520px; }
}

/* 整页暗色交互：与主题 token 配合，涵盖页内、抽屉和移动端控件。 */
:root[data-theme="dark"] body[data-layout-page="ib-dashboard-new"] :is(
  .ibm-scope-control, .ibn-funds-segment, .ibm-detail-drawer .ibm-segment
) > button {
  background: transparent;
  color: var(--text-soft);
  box-shadow: none;
}
:root[data-theme="dark"] body[data-layout-page="ib-dashboard-new"] :is(
  .ibm-scope-control, .ibn-funds-segment, .ibm-detail-drawer .ibm-segment
) > button:is(.is-active, [aria-selected="true"], [aria-pressed="true"]) {
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(var(--blue-rgb), .4);
}
@media (min-width: 761px) {
  :root[data-theme="dark"] .ibm-mode-control > button { background: transparent; color: var(--text-soft); }
  :root[data-theme="dark"] .ibm-mode-control > button.is-active {
    background: var(--blue-soft);
    color: var(--blue);
    box-shadow: inset 0 0 0 1px rgba(var(--blue-rgb), .4);
  }
}
:root[data-theme="dark"] body[data-layout-page="ib-dashboard-new"] :is(
  .ibm-period-presets button.is-active, .ibm-metric.is-active,
  .ibn-tag-choice.is-selected, .ibn-mobile-filter-choices button[aria-pressed="true"]
) {
  background: var(--blue-soft);
  border-color: rgba(var(--blue-rgb), .5);
}
:root[data-theme="dark"] body[data-layout-page="ib-dashboard-new"] :is(
  .ibn-trading-apply, .ibm-period-actions button[type="submit"],
  .ibn-tag-selector button.is-primary, .ibn-wallet-config-form [type="submit"],
  .ibn-mobile-filter-sheet [data-mobile-filter-apply], .ibn-mobile-filter-trigger b
) {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--neutral-ink, #111827);
}
:root[data-theme="dark"] body[data-layout-page="ib-dashboard-new"] :is(
  .ibn-delta.is-down, .ibn-funnel-rate.is-weak, .ibn-activity-card.is-risk strong,
  .ibn-concentration .is-warn, .ibn-todo.is-risk strong,
  .ibn-funds-card strong.is-risk, .ibn-trading-metric strong.is-risk,
  .ibn-funds-table .is-risk, .ibm-period-error, .ibn-tag-status
) { color: var(--danger); }
:root[data-theme="dark"] body[data-layout-page="ib-dashboard-new"] :is(
  .ibn-delta.is-up, .ibn-task-done, .ibn-funds-card strong.is-good,
  .ibn-trading-metric strong.is-good, .ibn-tag.is-good
) { color: var(--success); }
:root[data-theme="dark"] body[data-layout-page="ib-dashboard-new"] .ibn-tag.is-tier1 { color: var(--blue); background: var(--blue-soft); }
:root[data-theme="dark"] body[data-layout-page="ib-dashboard-new"] .ibn-tag.is-good { background: var(--success-soft); }
:root[data-theme="dark"] body[data-layout-page="ib-dashboard-new"] :is(.ibn-activity-card.is-risk, .ibn-todo.is-risk, [data-tag-color="red"]) { border-left-color: var(--danger); }
:root[data-theme="dark"] body[data-layout-page="ib-dashboard-new"] :is(.ibn-activity-card.is-good, [data-tag-color="green"]) { border-left-color: var(--success); }
:root[data-theme="dark"] body[data-layout-page="ib-dashboard-new"] [data-tag-color="blue"] { border-left-color: var(--blue); }
:root[data-theme="dark"] body[data-layout-page="ib-dashboard-new"] [data-tag-color="purple"] { border-left-color: var(--purple); }
:root[data-theme="dark"] body[data-layout-page="ib-dashboard-new"] :is(
  .ibn-analysis-drawer, .ibn-detail-drawer, .ibn-funds-drawer,
  .ibm-detail-drawer, .ibn-tag-selector, .ibn-mobile-filter-sheet
)::backdrop { background: var(--overlay); }
:root[data-theme="dark"] body[data-layout-page="ib-dashboard-new"] :is(
  .ibm-period-panel, .ibn-tag-selector, .ibn-trading-client-sheet
) { box-shadow: var(--shadow-floating); }
:root[data-theme="dark"] body[data-layout-page="ib-dashboard-new"] :is(
  .ibn-page, .ibn-analysis-drawer, .ibn-detail-drawer, .ibn-funds-drawer,
  .ibm-detail-drawer, .ibn-tag-selector, .ibn-mobile-filter-sheet
) button:disabled { opacity: .45; cursor: default; }
