:root {
  --tb-sidebar: 330px;
  --tb-sidebar-collapsed: 82px;
  --tb-header: 72px;
  --tb-max: 1340px;
  --tb-primary: #1b84ff;
  --tb-primary-soft: #eef6ff;
  --tb-text: #111827;
  --tb-text-soft: #374151;
  --tb-muted: #78829d;
  --tb-border: #e6e9ef;
  --tb-surface: #ffffff;
  --tb-surface-soft: #f8f9fb;
  --tb-success: #17c653;
  --tb-danger: #f1416c;
  --tb-warning: #f6b100;
  --tb-shadow: 0 1px 2px rgba(16,24,40,.03), 0 2px 8px rgba(16,24,40,.03);
  --tb-shadow-menu: 0 16px 48px rgba(15,23,42,.14);
  color-scheme: light;
}
html[data-theme="dark"] {
  --tb-text: #f1f5f9;
  --tb-text-soft: #d1d5db;
  --tb-muted: #94a3b8;
  --tb-border: #273449;
  --tb-surface: #111827;
  --tb-surface-soft: #0f172a;
  --tb-primary-soft: #10243f;
  --tb-shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--tb-text); background: var(--tb-surface); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
.tb-icon { width: 20px; height: 20px; display: block; }
.tb-icon-sm { width: 16px; height: 16px; }
.tb-icon-lg { width: 24px; height: 24px; }
.tb-container { width: min(var(--tb-max), calc(100% - 54px)); margin: 0 auto; }
.tb-app { min-height: 100vh; }

/* Sidebar */
.tb-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--tb-sidebar); background: var(--tb-surface); border-right: 1px solid var(--tb-border); display: flex; flex-direction: column; transition: width .22s ease, transform .22s ease; }
.tb-sidebar-head { height: var(--tb-header); padding: 0 28px; display: flex; align-items: center; position: relative; flex: 0 0 auto; }
.tb-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tb-brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: linear-gradient(135deg,#1b84ff,#4f46e5); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: -.02em; }
.tb-brand-name { font-size: 18px; font-weight: 750; letter-spacing: -.025em; white-space: nowrap; }
.tb-sidebar-toggle { position: absolute; right: -16px; top: 50%; translate: 0 -50%; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--tb-surface); border: 1px solid var(--tb-border); box-shadow: var(--tb-shadow); cursor: pointer; color: var(--tb-muted); z-index: 2; }
.tb-nav { flex: 1; overflow-y: auto; padding: 28px 24px 24px 30px; scrollbar-width: thin; }
.tb-nav-group { margin-bottom: 12px; }
.tb-nav-parent, .tb-nav-item { width: 100%; min-height: 42px; border: 0; background: transparent; display: flex; align-items: center; gap: 12px; border-radius: 9px; color: var(--tb-text); cursor: pointer; padding: 0 8px; font-weight: 500; font-size: 15px; }
.tb-nav-parent { justify-content: space-between; }
.tb-nav-parent-main { display: flex; align-items: center; gap: 12px; }
.tb-nav-parent-toggle { color: var(--tb-muted); font-size: 18px; font-weight: 400; }
.tb-nav-icon { width: 22px; color: var(--tb-muted); display: grid; place-items: center; flex: 0 0 22px; }
.tb-nav-heading { margin: 24px 0 9px; color: var(--tb-muted); text-transform: uppercase; font-size: 12px; letter-spacing: .045em; font-weight: 600; }
.tb-nav-item { margin: 2px 0; }
.tb-nav-item:hover, .tb-nav-parent:hover { color: var(--tb-primary); background: var(--tb-surface-soft); }
.tb-nav-children { position: relative; margin: 2px 0 2px 12px; padding-left: 26px; display: grid; gap: 2px; }
.tb-nav-children::before { content: ""; position: absolute; left: 9px; top: 0; bottom: 0; border-left: 1px solid var(--tb-border); }
.tb-nav-child { min-height: 42px; display: flex; align-items: center; gap: 16px; position: relative; padding: 0 12px; border-radius: 9px; font-size: 15px; }
.tb-nav-bullet { position: absolute; left: -20px; width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.tb-nav-child:hover, .tb-nav-child.active { background: var(--tb-surface-soft); color: var(--tb-primary); }
.tb-nav-child.active { font-weight: 600; }
.tb-nav-child.active .tb-nav-bullet { background: var(--tb-primary); }
.tb-sidebar-foot { flex: 0 0 auto; border-top: 1px solid var(--tb-border); padding: 16px 28px; }
.tb-sidebar-foot a { display: flex; align-items: center; gap: 9px; color: var(--tb-muted); font-size: 13px; }
.tb-sidebar-overlay { display: none; }

/* Main + header */
.tb-main { min-height: 100vh; padding-left: var(--tb-sidebar); transition: padding-left .22s ease; }
.tb-header { height: var(--tb-header); border-bottom: 1px solid var(--tb-border); background: color-mix(in srgb, var(--tb-surface) 96%, transparent); position: sticky; top: 0; z-index: 30; backdrop-filter: blur(10px); }
.tb-header-inner { height: 100%; width: min(var(--tb-max), calc(100% - 54px)); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.tb-header-left, .tb-header-actions { display: flex; align-items: center; gap: 10px; }
.tb-topnav { display: flex; align-items: center; gap: 38px; }
.tb-topnav a { font-size: 15px; font-weight: 500; color: var(--tb-text); }
.tb-topnav a:hover, .tb-topnav a.active { color: var(--tb-primary); }
.tb-header-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: transparent; color: var(--tb-muted); border-radius: 9px; cursor: pointer; }
.tb-header-icon:hover { background: var(--tb-surface-soft); color: var(--tb-text); }
.tb-mobile-menu { display: none; }
.tb-theme-dark { display: none; }
html[data-theme="dark"] .tb-theme-light { display: none; }
html[data-theme="dark"] .tb-theme-dark { display: inline-flex; }
.tb-avatar-button { border: 0; background: transparent; padding: 2px; cursor: pointer; }
.tb-avatar-ring { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--tb-success); padding: 2px; }
.tb-avatar-ring > span { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; background: var(--tb-primary-soft); color: var(--tb-primary); font-weight: 700; }
.tb-avatar-ring.large { width: 46px; height: 46px; flex: 0 0 auto; }
.tb-user { position: relative; }
.tb-user-dropdown { position: absolute; right: 0; top: calc(100% + 12px); width: 280px; padding: 12px; border: 1px solid var(--tb-border); background: var(--tb-surface); border-radius: 12px; box-shadow: var(--tb-shadow-menu); }
.tb-user-dropdown-head { display: flex; align-items: center; gap: 12px; padding: 8px; margin-bottom: 6px; }
.tb-user-dropdown-head strong, .tb-user-dropdown-head small { display: block; }
.tb-user-dropdown-head small { color: var(--tb-muted); margin-top: 3px; font-size: 12px; }
.tb-dropdown-link { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.tb-dropdown-link:hover { background: var(--tb-surface-soft); }
.tb-dropdown-link.danger { color: var(--tb-danger); }
.tb-content { padding: 34px 0 50px; }

/* Page header */
.tb-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding-bottom: 28px; }
.tb-page-head h1 { margin: 0; font-size: 25px; line-height: 1.2; font-weight: 600; letter-spacing: -.025em; }
.tb-page-head p { margin: 8px 0 0; color: var(--tb-muted); font-size: 14px; line-height: 1.45; }
.tb-btn { min-height: 42px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--tb-border); background: var(--tb-surface); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 500; font-size: 14px; cursor: pointer; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.tb-btn:hover { border-color: #cfd5df; }
.tb-btn-primary { background: var(--tb-primary); border-color: var(--tb-primary); color: white; }

/* Cards */
.tb-card { background: var(--tb-surface); border: 1px solid var(--tb-border); border-radius: 14px; box-shadow: var(--tb-shadow); overflow: hidden; }
.tb-card-header { min-height: 66px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--tb-border); }
.tb-card-title { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.tb-card-subtitle { margin: 4px 0 0; color: var(--tb-muted); font-size: 12px; }
.tb-card-body { padding: 24px; }
.tb-grid-top { display: grid; grid-template-columns: 1fr 2fr; gap: 30px; margin-bottom: 30px; }
.tb-mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.tb-mini-stat { min-height: 178px; padding: 22px 24px; display: flex; flex-direction: column; justify-content: space-between; position: relative; }
.tb-mini-stat-icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--tb-primary); background: var(--tb-primary-soft); }
.tb-mini-stat-value { display: block; font-size: 34px; font-weight: 650; letter-spacing: -.035em; line-height: 1; }
.tb-mini-stat-label { display: block; margin-top: 8px; font-size: 14px; color: var(--tb-text-soft); }
.tb-hero { min-height: 386px; display: grid; grid-template-rows: 1fr auto; }
.tb-hero-main { padding: 46px 50px; position: relative; overflow: hidden; }
.tb-hero-main::after { content: ""; position: absolute; width: 480px; height: 480px; border: 1px solid color-mix(in srgb, var(--tb-primary) 15%, transparent); right: -180px; top: -160px; transform: rotate(22deg); border-radius: 34px; box-shadow: inset 0 0 0 38px color-mix(in srgb, var(--tb-primary) 2.5%, transparent), inset 0 0 0 76px color-mix(in srgb, var(--tb-primary) 2%, transparent); pointer-events: none; }
.tb-hero-kickers { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; position: relative; z-index: 1; }
.tb-dot-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--tb-text-soft); font-size: 12px; font-weight: 500; }
.tb-dot-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #a1a8b4; }
.tb-dot-badge.ok::before { background: var(--tb-success); }
.tb-dot-badge.info::before { background: var(--tb-primary); }
.tb-dot-badge.danger::before { background: var(--tb-danger); }
.tb-hero h2 { position: relative; z-index: 1; margin: 0; max-width: 560px; font-size: 31px; line-height: 1.22; font-weight: 650; letter-spacing: -.035em; }
.tb-hero p { position: relative; z-index: 1; max-width: 610px; margin: 18px 0 0; color: var(--tb-muted); font-size: 15px; line-height: 1.65; }
.tb-hero-metrics { position: relative; z-index: 1; display: flex; gap: 34px; margin-top: 30px; }
.tb-hero-metric span, .tb-highlight-label { display: block; color: var(--tb-muted); font-size: 12px; }
.tb-hero-metric strong { display: block; margin-top: 6px; font-size: 18px; font-weight: 650; }
.tb-hero-foot { min-height: 58px; display: flex; justify-content: center; align-items: center; border-top: 1px solid var(--tb-border); }
.tb-hero-foot a { color: var(--tb-primary); font-weight: 500; border-bottom: 1px dashed currentColor; padding-bottom: 2px; }

.tb-grid-main { display: grid; grid-template-columns: 1fr 2fr; gap: 30px; margin-bottom: 30px; align-items: stretch; }
.tb-highlight-total { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.tb-highlight-total strong { font-size: 34px; font-weight: 650; letter-spacing: -.03em; }
.tb-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--tb-border); font-size: 11px; font-weight: 600; }
.tb-badge.success { color: #0f9f45; border-color: color-mix(in srgb, var(--tb-success) 35%, var(--tb-border)); background: color-mix(in srgb, var(--tb-success) 7%, var(--tb-surface)); }
.tb-badge.danger { color: #d7335b; border-color: color-mix(in srgb, var(--tb-danger) 35%, var(--tb-border)); background: color-mix(in srgb, var(--tb-danger) 7%, var(--tb-surface)); }
.tb-segment-bar { display: flex; gap: 5px; height: 9px; margin: 22px 0 18px; }
.tb-segment-bar span { border-radius: 3px; }
.tb-segment-bar .wins { background: var(--tb-success); }
.tb-segment-bar .losses { background: var(--tb-danger); }
.tb-segment-bar .fees { background: #8b5cf6; }
.tb-highlight-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.tb-highlight-legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.tb-highlight-legend i { width: 8px; height: 8px; border-radius: 50%; }
.tb-highlight-rows { border-top: 1px solid var(--tb-border); padding-top: 14px; display: grid; gap: 14px; }
.tb-highlight-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tb-highlight-row span { color: var(--tb-text-soft); }
.tb-highlight-row strong { font-weight: 600; }
.tb-money-pos { color: var(--tb-success) !important; }
.tb-money-neg { color: var(--tb-danger) !important; }
.tb-chart-wrap { min-height: 355px; padding: 4px 16px 4px 10px; }
.tb-select { min-height: 38px; border: 1px solid var(--tb-border); border-radius: 8px; background: var(--tb-surface); color: var(--tb-text); padding: 0 34px 0 12px; }

/* System card */
.tb-health-list { display: grid; gap: 17px; }
.tb-health-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tb-health-main { display: flex; align-items: center; gap: 12px; }
.tb-health-icon { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--tb-surface-soft); color: var(--tb-muted); }
.tb-health-copy strong { display: block; font-size: 14px; font-weight: 550; }
.tb-health-copy small { display: block; color: var(--tb-muted); font-size: 12px; margin-top: 3px; }
.tb-health-state { width: 9px; height: 9px; border-radius: 50%; background: #a1a8b4; }
.tb-health-state.ok { background: var(--tb-success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tb-success) 12%, transparent); }
.tb-health-state.info { background: var(--tb-primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tb-primary) 12%, transparent); }
.tb-health-state.danger { background: var(--tb-danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tb-danger) 12%, transparent); }

/* Data table */
.tb-table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.tb-search { position: relative; width: 260px; }
.tb-search svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--tb-muted); width: 18px; height: 18px; }
.tb-search input { width: 100%; height: 40px; border: 1px solid var(--tb-border); border-radius: 8px; background: var(--tb-surface); color: var(--tb-text); padding: 0 12px 0 39px; outline: none; }
.tb-search input:focus { border-color: color-mix(in srgb, var(--tb-primary) 50%, var(--tb-border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tb-primary) 10%, transparent); }
.tb-table-wrap { overflow-x: auto; }
.tb-table { width: 100%; border-collapse: collapse; min-width: 780px; }
.tb-table th { padding: 15px 18px; text-align: left; color: var(--tb-muted); font-size: 12px; font-weight: 500; border-bottom: 1px solid var(--tb-border); white-space: nowrap; cursor: default; }
.tb-table th[data-sort] { cursor: pointer; user-select: none; }
.tb-table th[data-sort]::after { content: "↕"; margin-left: 6px; color: #a1a8b4; font-size: 11px; }
.tb-table td { padding: 15px 18px; border-bottom: 1px solid var(--tb-border); font-size: 13px; vertical-align: middle; }
.tb-table tbody tr:last-child td { border-bottom: 0; }
.tb-table tbody tr:hover td { background: color-mix(in srgb, var(--tb-surface-soft) 70%, transparent); }
.tb-table-main { font-weight: 550; }
.tb-table-sub { color: var(--tb-muted); font-size: 11px; margin-top: 4px; }
.tb-table-footer { min-height: 62px; border-top: 1px solid var(--tb-border); padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--tb-muted); font-size: 12px; }
.tb-pager { display: flex; gap: 5px; }
.tb-page-btn { min-width: 32px; height: 32px; border: 1px solid transparent; background: transparent; border-radius: 7px; cursor: pointer; color: var(--tb-text-soft); }
.tb-page-btn:hover { background: var(--tb-surface-soft); }
.tb-page-btn.active { background: var(--tb-primary); color: #fff; }
.tb-table-empty { color: var(--tb-muted); text-align: center; padding: 38px !important; }

.tb-footer { border-top: 1px solid var(--tb-border); min-height: 70px; display: flex; align-items: center; color: var(--tb-muted); font-size: 12px; }
.tb-footer .tb-container { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* Collapsed desktop sidebar */
body.tb-sidebar-collapsed .tb-sidebar { width: var(--tb-sidebar-collapsed); }
body.tb-sidebar-collapsed .tb-main { padding-left: var(--tb-sidebar-collapsed); }
body.tb-sidebar-collapsed .tb-brand-name,
body.tb-sidebar-collapsed .tb-nav-parent-main span:not(.tb-nav-icon),
body.tb-sidebar-collapsed .tb-nav-parent-toggle,
body.tb-sidebar-collapsed .tb-nav-heading,
body.tb-sidebar-collapsed .tb-nav-item span:not(.tb-nav-icon),
body.tb-sidebar-collapsed .tb-nav-children,
body.tb-sidebar-collapsed .tb-sidebar-foot span { display: none; }
body.tb-sidebar-collapsed .tb-sidebar-head { padding: 0 24px; }
body.tb-sidebar-collapsed .tb-nav { padding-left: 20px; padding-right: 20px; }
body.tb-sidebar-collapsed .tb-nav-parent, body.tb-sidebar-collapsed .tb-nav-item { justify-content: center; padding: 0; }
body.tb-sidebar-collapsed .tb-sidebar-toggle .tb-icon { transform: rotate(180deg); }
body.tb-sidebar-collapsed .tb-sidebar-foot a { justify-content: center; }

@media (max-width: 1220px) {
  .tb-grid-top, .tb-grid-main { gap: 20px; }
  .tb-mini-grid { gap: 20px; }
  .tb-topnav { gap: 24px; }
}
@media (max-width: 1023px) {
  .tb-sidebar, body.tb-sidebar-collapsed .tb-sidebar { width: 300px; transform: translateX(-100%); box-shadow: var(--tb-shadow-menu); }
  body.tb-sidebar-open .tb-sidebar { transform: translateX(0); }
  .tb-sidebar-toggle { display: none; }
  .tb-main, body.tb-sidebar-collapsed .tb-main { padding-left: 0; }
  .tb-mobile-menu { display: grid; }
  .tb-topnav { display: none; }
  .tb-sidebar-overlay { position: fixed; inset: 0; z-index: 35; background: rgba(15,23,42,.38); backdrop-filter: blur(2px); }
  body.tb-sidebar-open .tb-sidebar-overlay { display: block; }
  .tb-grid-top, .tb-grid-main { grid-template-columns: 1fr; }
  .tb-mini-stat { min-height: 150px; }
}
@media (max-width: 700px) {
  .tb-container, .tb-header-inner { width: min(100% - 28px, var(--tb-max)); }
  .tb-content { padding-top: 24px; }
  .tb-page-head { align-items: flex-start; flex-direction: column; }
  .tb-mini-grid { grid-template-columns: 1fr; }
  .tb-hero-main { padding: 32px 26px; }
  .tb-hero h2 { font-size: 26px; }
  .tb-hero-metrics { flex-wrap: wrap; gap: 18px 28px; }
  .tb-card-header { padding: 0 18px; }
  .tb-card-body { padding: 18px; }
  .tb-table-toolbar { align-items: stretch; flex-direction: column; }
  .tb-search { width: 100%; }
  .tb-footer .tb-container { flex-direction: column; justify-content: center; padding: 16px 0; }
}

/* TradeBridge application components */
.tb-nav-count{margin-left:auto;min-width:24px;height:20px;padding:0 7px;border-radius:10px;background:var(--tb-surface-soft);border:1px solid var(--tb-border);display:inline-flex;align-items:center;justify-content:center;color:var(--tb-muted);font-size:10px;font-weight:650}
.tb-nav-item.active{background:var(--tb-primary-soft);color:var(--tb-primary);font-weight:600}.tb-nav-item.active .tb-nav-icon{color:var(--tb-primary)}
.tb-section{margin-bottom:30px}.tb-stack{display:grid;gap:30px}.tb-grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:30px}.tb-grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:30px}.tb-grid-4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px}.tb-grid-aside{display:grid;grid-template-columns:minmax(0,2fr) minmax(300px,1fr);gap:30px;align-items:start}
.tb-stat{padding:22px 24px;min-height:118px}.tb-stat-label{color:var(--tb-muted);font-size:11px;text-transform:uppercase;letter-spacing:.055em;font-weight:650}.tb-stat-value{display:block;margin-top:12px;font-size:27px;line-height:1;font-weight:650;letter-spacing:-.03em}.tb-stat-note{display:block;margin-top:9px;color:var(--tb-muted);font-size:12px;line-height:1.45}
.tb-alert{padding:14px 16px;border:1px solid var(--tb-border);border-radius:9px;font-size:13px;line-height:1.5;margin-bottom:18px}.tb-alert.success{background:color-mix(in srgb,var(--tb-success) 7%,var(--tb-surface));border-color:color-mix(in srgb,var(--tb-success) 28%,var(--tb-border));color:#0f8f40}.tb-alert.danger{background:color-mix(in srgb,var(--tb-danger) 7%,var(--tb-surface));border-color:color-mix(in srgb,var(--tb-danger) 28%,var(--tb-border));color:#c73055}.tb-alert.warning{background:color-mix(in srgb,var(--tb-warning) 8%,var(--tb-surface));border-color:color-mix(in srgb,var(--tb-warning) 35%,var(--tb-border));color:#9a6d00}.tb-alert.info{background:var(--tb-primary-soft);border-color:color-mix(in srgb,var(--tb-primary) 25%,var(--tb-border));color:color-mix(in srgb,var(--tb-primary) 75%,var(--tb-text))}
.tb-form{display:grid;gap:18px}.tb-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 22px}.tb-form-grid.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.tb-field{display:grid;gap:7px}.tb-field.full{grid-column:1/-1}.tb-field label,.tb-label{font-size:12px;font-weight:600;color:var(--tb-text-soft)}.tb-input,.tb-textarea,.tb-form select{width:100%;min-height:42px;border:1px solid var(--tb-border);border-radius:8px;background:var(--tb-surface);color:var(--tb-text);padding:9px 12px;outline:none}.tb-textarea{min-height:100px;resize:vertical}.tb-input:focus,.tb-textarea:focus,.tb-form select:focus{border-color:color-mix(in srgb,var(--tb-primary) 55%,var(--tb-border));box-shadow:0 0 0 3px color-mix(in srgb,var(--tb-primary) 9%,transparent)}.tb-hint{color:var(--tb-muted);font-size:11px;line-height:1.45}.tb-checkbox{display:flex;align-items:flex-start;gap:9px;font-size:13px;color:var(--tb-text-soft)}.tb-checkbox input{margin-top:2px}.tb-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.tb-btn.danger{color:#fff;background:var(--tb-danger);border-color:var(--tb-danger)}.tb-btn.success{color:#fff;background:var(--tb-success);border-color:var(--tb-success)}.tb-btn.small{min-height:34px;padding:0 12px;font-size:12px}.tb-btn:disabled{opacity:.5;cursor:not-allowed}
.tb-status{display:inline-flex;align-items:center;min-height:24px;padding:0 9px;border-radius:7px;border:1px solid var(--tb-border);font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.025em;white-space:nowrap}.tb-status.success{color:#0f8f40;background:color-mix(in srgb,var(--tb-success) 7%,var(--tb-surface));border-color:color-mix(in srgb,var(--tb-success) 30%,var(--tb-border))}.tb-status.danger{color:#c73055;background:color-mix(in srgb,var(--tb-danger) 7%,var(--tb-surface));border-color:color-mix(in srgb,var(--tb-danger) 30%,var(--tb-border))}.tb-status.warning{color:#976800;background:color-mix(in srgb,var(--tb-warning) 8%,var(--tb-surface));border-color:color-mix(in srgb,var(--tb-warning) 30%,var(--tb-border))}.tb-status.info{color:var(--tb-primary);background:var(--tb-primary-soft);border-color:color-mix(in srgb,var(--tb-primary) 25%,var(--tb-border))}.tb-status.neutral{color:var(--tb-muted);background:var(--tb-surface-soft)}
.tb-side{display:inline-flex;min-width:44px;justify-content:center;font-size:10px;font-weight:700;border-radius:6px;padding:5px 8px}.tb-side.buy{color:#0f8f40;background:color-mix(in srgb,var(--tb-success) 10%,var(--tb-surface))}.tb-side.sell{color:#c73055;background:color-mix(in srgb,var(--tb-danger) 10%,var(--tb-surface))}.tb-side.neutral{color:var(--tb-muted);background:var(--tb-surface-soft)}
.tb-code{display:block;padding:14px;border-radius:8px;background:#0f172a;color:#e2e8f0;overflow:auto;font:12px/1.55 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;word-break:break-word}.tb-kv{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;background:var(--tb-border);border:1px solid var(--tb-border);border-radius:10px;overflow:hidden}.tb-kv>div{background:var(--tb-surface);padding:15px}.tb-kv span{display:block;color:var(--tb-muted);font-size:10px;text-transform:uppercase;letter-spacing:.05em;font-weight:650}.tb-kv strong{display:block;margin-top:7px;font-size:14px}.tb-card-copy{color:var(--tb-muted);font-size:13px;line-height:1.65}.tb-empty{padding:38px 24px;text-align:center;color:var(--tb-muted)}.tb-empty strong{display:block;color:var(--tb-text);font-size:14px;margin-bottom:6px}
.tb-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}.tb-toolbar-group{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.tb-card-section{padding:24px;border-top:1px solid var(--tb-border)}.tb-card-section:first-child{border-top:0}.tb-subtitle{margin:0;font-size:14px;font-weight:600}.tb-muted{color:var(--tb-muted)}.tb-small{font-size:11px}.tb-mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.tb-divider{height:1px;background:var(--tb-border);margin:20px 0}.tb-details summary{cursor:pointer;font-weight:600;list-style:none}.tb-details summary::-webkit-details-marker{display:none}.tb-details[open] summary{margin-bottom:16px}
.tb-position-card .tb-card-header{align-items:flex-start;padding-top:20px;padding-bottom:20px}.tb-position-title{display:flex;align-items:center;gap:10px}.tb-position-title h2{margin:0;font-size:21px}.tb-live-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:1px;background:var(--tb-border);border-bottom:1px solid var(--tb-border)}.tb-live-strip>div{background:var(--tb-surface-soft);padding:15px 18px}.tb-live-strip span{display:block;color:var(--tb-muted);font-size:10px;text-transform:uppercase;font-weight:650}.tb-live-strip strong{display:block;margin-top:6px;font-size:16px}.tb-metrics{display:grid;grid-template-columns:repeat(5,1fr);gap:18px;padding:22px 24px}.tb-metrics span{display:block;color:var(--tb-muted);font-size:10px;text-transform:uppercase;font-weight:650}.tb-metrics strong{display:block;margin-top:6px;font-size:14px}.tb-lots{padding:0 24px 24px}
.tb-profile-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.tb-profile-card{border:1px solid var(--tb-border);border-radius:12px;padding:20px}.tb-profile-card.disabled{opacity:.68}.tb-profile-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.tb-profile-head h3{margin:0;font-size:16px}.tb-profile-meta{color:var(--tb-muted);font-size:11px;margin-top:5px}.tb-profile-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:18px}.tb-profile-stats>div{background:var(--tb-surface-soft);border-radius:8px;padding:11px}.tb-profile-stats span{display:block;color:var(--tb-muted);font-size:10px}.tb-profile-stats strong{display:block;margin-top:4px;font-size:12px}
.tb-readiness-row{display:grid;grid-template-columns:minmax(220px,1fr) 120px minmax(320px,2fr);gap:18px;align-items:center;padding:14px 18px;border-bottom:1px solid var(--tb-border)}.tb-readiness-row:last-child{border-bottom:0}.tb-research-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.tb-research-item{border:1px solid var(--tb-border);border-radius:10px;padding:16px}.tb-research-item h4{margin:0 0 8px;font-size:13px}.tb-research-item p{margin:0;color:var(--tb-text-soft);font-size:12px;line-height:1.55}
.tb-page-tabs{display:flex;gap:24px;border-bottom:1px solid var(--tb-border);margin-bottom:24px}.tb-page-tab{padding:0 2px 13px;color:var(--tb-muted);font-size:13px}.tb-page-tab.active{color:var(--tb-primary);border-bottom:2px solid var(--tb-primary);font-weight:600}
@media(max-width:1100px){.tb-grid-4{grid-template-columns:repeat(2,1fr)}.tb-grid-aside,.tb-grid-3{grid-template-columns:1fr}.tb-metrics{grid-template-columns:repeat(3,1fr)}}
@media(max-width:760px){.tb-grid-2,.tb-grid-4,.tb-form-grid,.tb-form-grid.cols-3,.tb-profile-grid,.tb-research-grid{grid-template-columns:1fr}.tb-grid-4{gap:14px}.tb-live-strip{grid-template-columns:repeat(2,1fr)}.tb-metrics{grid-template-columns:repeat(2,1fr)}.tb-readiness-row{grid-template-columns:1fr;gap:8px}.tb-kv{grid-template-columns:1fr}.tb-stat{min-height:96px}.tb-stat-value{font-size:24px}}

/* AI control center + decision inspector */
.tb-ai-hero{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(420px,.95fr);overflow:hidden;border:1px solid var(--tb-border);border-radius:14px;background:var(--tb-surface)}
.tb-ai-hero-copy{padding:40px 42px;background:linear-gradient(135deg,var(--tb-surface) 0%,color-mix(in srgb,var(--tb-primary) 5%,var(--tb-surface)) 100%)}
.tb-eyebrow{display:block;color:var(--tb-primary);font-size:10px;font-weight:750;letter-spacing:.12em;margin-bottom:14px}.tb-ai-hero h2{margin:0;max-width:680px;font-size:28px;line-height:1.18;letter-spacing:-.025em}.tb-ai-hero p{max-width:720px;margin:15px 0 22px;color:var(--tb-muted);font-size:14px;line-height:1.65}
.tb-ai-hero-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));background:var(--tb-border);gap:1px}.tb-ai-hero-metrics>div{display:flex;flex-direction:column;justify-content:center;min-height:124px;padding:22px 24px;background:var(--tb-surface)}.tb-ai-hero-metrics span,.tb-metric-box span,.tb-readiness-stat span,.tb-outcome>span{color:var(--tb-muted);font-size:10px;font-weight:700;letter-spacing:.055em;text-transform:uppercase}.tb-ai-hero-metrics strong{display:block;margin-top:8px;font-size:21px}.tb-ai-hero-metrics small{margin-top:5px;color:var(--tb-muted);font-size:10px}
.tb-readiness-stat,.tb-metric-box{min-height:84px;padding:15px 16px;border:1px solid var(--tb-border);border-radius:9px;background:var(--tb-surface-soft)}.tb-readiness-stat strong,.tb-metric-box strong{display:block;margin-top:7px;font-size:20px}.tb-readiness-stat.success{background:color-mix(in srgb,var(--tb-success) 6%,var(--tb-surface))}.tb-readiness-stat.info{background:var(--tb-primary-soft)}.tb-readiness-stat.danger{background:color-mix(in srgb,var(--tb-danger) 5%,var(--tb-surface))}
.tb-stack.compact{gap:12px}.tb-table-reason{max-width:360px;font-size:11px;line-height:1.45;color:var(--tb-text-soft)}.tb-stat-model{font-size:16px!important;letter-spacing:0!important;word-break:break-word}.tb-breadcrumb{display:flex;align-items:center;gap:9px;margin-bottom:8px;color:var(--tb-muted);font-size:11px}.tb-breadcrumb a{color:var(--tb-primary)}
.tb-callout{padding:15px 16px;border:1px solid var(--tb-border);border-radius:9px;background:var(--tb-surface-soft);color:var(--tb-text-soft);font-size:12px;line-height:1.6}.tb-chip-row{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:16px}.tb-outcome{padding:18px;border:1px solid var(--tb-border);border-radius:10px;background:var(--tb-surface-soft)}.tb-outcome strong{display:block;margin:10px 0 12px;font-size:18px}.tb-outcome div{margin-top:6px;color:var(--tb-text-soft);font-size:11px}.tb-outcome small{display:block;margin-top:10px;color:var(--tb-muted)}
.tb-money-pos{color:var(--tb-success)!important}.tb-money-neg{color:var(--tb-danger)!important}

/* TradeBridge authentication */
.tb-auth-body{min-height:100vh;margin:0;background:var(--tb-bg);color:var(--tb-text);font-family:var(--tb-font)}.tb-auth-wrap{width:min(430px,calc(100% - 32px));margin:0 auto;padding:9vh 0 40px}.tb-auth-brand{display:flex;align-items:center;justify-content:center;gap:12px;margin-bottom:28px}.tb-auth-brand .tb-brand-mark{position:static;width:42px;height:42px}.tb-auth-brand div{display:grid;gap:2px}.tb-auth-brand strong{font-size:18px}.tb-auth-brand span{color:var(--tb-muted);font-size:10px;text-transform:uppercase;letter-spacing:.12em}.tb-auth-card .tb-card-body{padding:34px}.tb-auth-card h1{margin:2px 0 8px;font-size:27px;letter-spacing:-.025em}.tb-auth-submit{width:100%;justify-content:center;min-height:44px}.tb-auth-note{text-align:center;color:var(--tb-muted);font-size:10px;margin-top:18px}

@media(max-width:1100px){.tb-ai-hero{grid-template-columns:1fr}.tb-ai-hero-metrics{grid-template-columns:repeat(4,minmax(0,1fr))}.tb-ai-hero-metrics>div{min-height:100px;padding:18px}}
@media(max-width:760px){.tb-ai-hero-copy{padding:28px 24px}.tb-ai-hero h2{font-size:23px}.tb-ai-hero-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.tb-table-reason{max-width:240px}}

/* =========================================================
   TradeBridge interface refinement
   ========================================================= */
:root{
  --tb-success-soft:color-mix(in srgb,var(--tb-success) 8%,var(--tb-surface));
  --tb-danger-soft:color-mix(in srgb,var(--tb-danger) 8%,var(--tb-surface));
  --tb-warning-soft:color-mix(in srgb,var(--tb-warning) 10%,var(--tb-surface));
  --tb-purple:#8b5cf6;
  --tb-purple-soft:color-mix(in srgb,var(--tb-purple) 9%,var(--tb-surface));
}

/* Deeper pages use the same roomier rhythm as the main dashboard. */
.tb-content{padding-top:38px}.tb-page-head{padding-bottom:30px}.tb-page-head h1{font-size:27px}.tb-section{margin-bottom:32px}.tb-card-header{min-height:70px;padding-left:26px;padding-right:26px}.tb-card-body{padding:26px}.tb-card-title{font-size:18px}.tb-card-subtitle{font-size:13px;line-height:1.45}.tb-card{box-shadow:0 1px 2px rgba(16,24,40,.025)}

/* Buttons + controls */
.tb-btn{min-height:40px;border-radius:9px;font-weight:550;transition:border-color .15s ease,background .15s ease,color .15s ease,transform .15s ease}.tb-btn:hover{background:var(--tb-surface-soft)}.tb-btn-primary:hover{background:color-mix(in srgb,var(--tb-primary) 90%,#000);border-color:color-mix(in srgb,var(--tb-primary) 90%,#000)}.tb-btn.success:hover,.tb-btn.danger:hover{filter:brightness(.96)}
.tb-input,.tb-textarea,.tb-form select,.tb-select{min-height:44px;border-radius:9px;border-color:#dfe3ea;background-color:var(--tb-surface);font-size:13px;color:var(--tb-text);transition:border-color .15s ease,box-shadow .15s ease,background .15s ease}.tb-input::placeholder,.tb-textarea::placeholder{color:#a1a8b4}.tb-input:hover,.tb-textarea:hover,.tb-form select:hover,.tb-select:hover{border-color:#cfd5df}.tb-input:focus,.tb-textarea:focus,.tb-form select:focus,.tb-select:focus{border-color:color-mix(in srgb,var(--tb-primary) 60%,var(--tb-border));box-shadow:0 0 0 3px color-mix(in srgb,var(--tb-primary) 10%,transparent);outline:0}.tb-form select,.tb-select{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2378829d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 13px center;padding-right:38px}.tb-field label,.tb-label{font-size:12px;font-weight:650;color:var(--tb-text-soft)}.tb-hint{font-size:11.5px}.tb-textarea{min-height:112px}

/* Semantic stat cards */
.tb-stat{position:relative;overflow:hidden}.tb-stat::after{content:"";position:absolute;right:-24px;top:-24px;width:82px;height:82px;border-radius:50%;background:var(--tb-surface-soft);opacity:.75}.tb-stat.info::after{background:var(--tb-primary-soft)}.tb-stat.success::after{background:var(--tb-success-soft)}.tb-stat.danger::after{background:var(--tb-danger-soft)}.tb-stat.warning::after{background:var(--tb-warning-soft)}.tb-stat.info{border-color:color-mix(in srgb,var(--tb-primary) 18%,var(--tb-border))}.tb-stat.success{border-color:color-mix(in srgb,var(--tb-success) 20%,var(--tb-border))}.tb-stat.danger{border-color:color-mix(in srgb,var(--tb-danger) 20%,var(--tb-border))}.tb-stat.warning{border-color:color-mix(in srgb,var(--tb-warning) 25%,var(--tb-border))}.tb-stat-value,.tb-stat-label,.tb-stat-note{position:relative;z-index:1}.tb-stat.success .tb-stat-value:not(.tb-money-pos):not(.tb-money-neg){color:#0f9f45}.tb-stat.danger .tb-stat-value:not(.tb-money-pos):not(.tb-money-neg){color:#d7335b}.tb-stat.info .tb-stat-value.tb-stat-model{color:var(--tb-primary)}.tb-stat.warning .tb-stat-value.tb-stat-model{color:#a36f00}

/* Status badges are deliberately more colorful, like Demo 1. */
.tb-status{gap:6px;min-height:25px;padding:0 9px;border-radius:7px;font-size:10.5px}.tb-status::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.85}.tb-status.neutral::before{opacity:.45}.tb-status.success{color:#0f9f45;background:var(--tb-success-soft)}.tb-status.danger{color:#d7335b;background:var(--tb-danger-soft)}.tb-status.warning{color:#a36f00;background:var(--tb-warning-soft)}.tb-status.info{color:var(--tb-primary);background:var(--tb-primary-soft)}
.pill-count{display:inline-flex;align-items:center;gap:6px;min-height:25px;padding:0 9px;border-radius:7px;border:1px solid var(--tb-border);font-size:10.5px;font-weight:700;text-transform:uppercase}.pill-count::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}.pill-green{color:#0f9f45;background:var(--tb-success-soft);border-color:color-mix(in srgb,var(--tb-success) 30%,var(--tb-border))}.pill-red{color:#d7335b;background:var(--tb-danger-soft);border-color:color-mix(in srgb,var(--tb-danger) 30%,var(--tb-border))}.webhook-builder-note{margin-top:12px;padding:11px 13px;border-radius:8px;font-size:11.5px;line-height:1.5}.webhook-builder-note.ok{color:#0f8f40;background:var(--tb-success-soft)}.webhook-builder-note.warn{color:#9a6d00;background:var(--tb-warning-soft)}

/* Compatibility with existing shared V1 runtime JS. */
.money-pos{color:var(--tb-success)!important}.money-neg{color:var(--tb-danger)!important}.muted{color:var(--tb-muted)!important}.small{font-size:11px!important}.symbol{font-weight:650;color:var(--tb-text)}
[data-live-price-status].ok{color:#0f9f45!important;background:var(--tb-success-soft)!important;border-color:color-mix(in srgb,var(--tb-success) 30%,var(--tb-border))!important}[data-live-price-status].warn{color:#a36f00!important;background:var(--tb-warning-soft)!important;border-color:color-mix(in srgb,var(--tb-warning) 30%,var(--tb-border))!important}

/* Sidebar nested sections */
.tb-nav-group.active>.tb-nav-parent{color:var(--tb-primary)}.tb-nav-group.active>.tb-nav-parent .tb-nav-icon{color:var(--tb-primary)}.tb-nav-parent-main>.tb-nav-count{margin-left:auto}.tb-nav-parent-main{min-width:0;flex:1}.tb-nav-child>.tb-nav-count{margin-left:auto}.tb-nav-children[hidden]{display:none}.tb-nav-child{padding-right:9px}

/* Page tabs */
.tb-page-tabs{gap:30px;margin:-4px 0 28px}.tb-page-tab{display:inline-flex;align-items:center;gap:8px;padding-bottom:15px;font-size:13px;font-weight:550}.tb-page-tab span{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:20px;padding:0 6px;border-radius:6px;background:var(--tb-surface-soft);font-size:10px}.tb-page-tab.active span{background:var(--tb-primary-soft);color:var(--tb-primary)}

/* Tables */
.tb-table{min-width:820px}.tb-table th{padding:16px 20px;font-size:11px;font-weight:650;letter-spacing:.02em;color:#6f7890;background:color-mix(in srgb,var(--tb-surface-soft) 58%,var(--tb-surface));border-bottom-color:var(--tb-border)}.tb-table td{padding:17px 20px;font-size:13px}.tb-table-main{font-weight:600}.tb-table-sub{font-size:11.5px}.tb-table-detail{max-width:420px;white-space:normal;line-height:1.5;color:var(--tb-text-soft)}.tb-table tbody tr:hover td{background:color-mix(in srgb,var(--tb-primary) 2.25%,var(--tb-surface))}.tb-table-footer{min-height:66px}.tb-side{border:1px solid transparent;min-width:50px}.tb-side.buy{color:#0f9f45;background:var(--tb-success-soft);border-color:color-mix(in srgb,var(--tb-success) 25%,var(--tb-border))}.tb-side.sell{color:#d7335b;background:var(--tb-danger-soft);border-color:color-mix(in srgb,var(--tb-danger) 25%,var(--tb-border))}

/* Empty states */
.tb-empty-lg{padding:56px 24px;display:flex;flex-direction:column;align-items:center;gap:9px}.tb-empty-lg strong{font-size:16px}.tb-empty-lg .tb-btn{margin-top:8px}.tb-empty-icon{width:48px;height:48px;border-radius:12px;display:grid;place-items:center;background:var(--tb-primary-soft);color:var(--tb-primary);margin-bottom:4px}

/* Positions */
.tb-position-card{border-color:color-mix(in srgb,var(--tb-primary) 10%,var(--tb-border))}.tb-position-card .tb-card-header{padding:22px 26px}.tb-position-title{gap:12px}.tb-position-title>div{min-width:0}.tb-position-title h2{font-size:19px}.tb-position-opened{margin:8px 0 0 48px;color:var(--tb-muted);font-size:11.5px}.tb-market-icon,.tb-asset-icon{width:36px;height:36px;display:grid;place-items:center;border-radius:10px;background:var(--tb-primary-soft);color:var(--tb-primary);font-weight:750;flex:0 0 auto}.tb-live-strip>div{background:color-mix(in srgb,var(--tb-surface-soft) 70%,var(--tb-surface));padding:18px 20px}.tb-live-strip strong{font-size:18px}.tb-metrics{padding:25px 26px}.tb-lots{padding:0 26px 26px}

/* Forms — sectioned, clean and consistent */
.tb-form-section-block{padding:26px 0;border-top:1px solid var(--tb-border)}.tb-form-section-block:first-of-type{padding-top:0;border-top:0}.tb-form-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:22px}.tb-form-section-head h3{margin:0;font-size:16px;font-weight:650}.tb-form-section-head p{margin:6px 0 0;color:var(--tb-muted);font-size:12.5px;line-height:1.5}.tb-section-number{font-size:11px;font-weight:700;color:var(--tb-primary);background:var(--tb-primary-soft);padding:5px 8px;border-radius:6px}.tb-setting-grid{gap:20px}.tb-setting-panel{padding:22px;border:1px solid var(--tb-border);border-radius:12px;background:var(--tb-surface)}.tb-setting-panel.success{border-color:color-mix(in srgb,var(--tb-success) 24%,var(--tb-border));background:linear-gradient(180deg,var(--tb-success-soft),var(--tb-surface) 32%)}.tb-setting-panel.danger{border-color:color-mix(in srgb,var(--tb-danger) 22%,var(--tb-border));background:linear-gradient(180deg,var(--tb-danger-soft),var(--tb-surface) 32%)}.tb-setting-head{display:flex;gap:13px;align-items:flex-start;margin-bottom:20px}.tb-setting-head h4{margin:0;font-size:14px}.tb-setting-head p{margin:4px 0 0;font-size:11.5px;color:var(--tb-muted)}.tb-setting-icon{min-width:42px;height:28px;padding:0 8px;border-radius:7px;display:grid;place-items:center;font-size:9px;font-weight:800}.tb-setting-panel.success .tb-setting-icon{background:var(--tb-success-soft);color:#0f9f45}.tb-setting-panel.danger .tb-setting-icon{background:var(--tb-danger-soft);color:#d7335b}.tb-option-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.tb-option-card{display:flex;align-items:flex-start;gap:12px;padding:16px 17px;border:1px solid var(--tb-border);border-radius:11px;background:var(--tb-surface);cursor:pointer}.tb-option-card:hover{border-color:color-mix(in srgb,var(--tb-primary) 30%,var(--tb-border));background:color-mix(in srgb,var(--tb-primary) 1.5%,var(--tb-surface))}.tb-option-card input{width:17px;height:17px;margin:2px 0 0;accent-color:var(--tb-primary)}.tb-option-card span{display:block}.tb-option-card strong,.tb-option-card small{display:block}.tb-option-card strong{font-size:13px}.tb-option-card small{margin-top:4px;color:var(--tb-muted);font-size:11.5px;line-height:1.45}.tb-option-card.compact{padding:14px 15px}.tb-form-submit-row{display:grid;grid-template-columns:minmax(280px,460px) auto;align-items:end;gap:22px;padding-top:26px;border-top:1px solid var(--tb-border)}
.tb-info-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;background:var(--tb-border);border-top:1px solid var(--tb-border)}.tb-info-grid>div{display:flex;gap:12px;padding:18px 20px;background:color-mix(in srgb,var(--tb-primary) 2%,var(--tb-surface))}.tb-info-grid strong{font-size:12px}.tb-info-grid p{margin:4px 0 0;color:var(--tb-muted);font-size:11px;line-height:1.45}.tb-info-icon{width:30px;height:30px;border-radius:8px;display:grid;place-items:center;background:var(--tb-primary-soft);color:var(--tb-primary);flex:0 0 auto}

/* Trading profile list — full-width rows instead of square cards. */
.tb-profile-list{display:grid;gap:14px}.tb-profile-row{border:1px solid var(--tb-border);border-radius:12px;background:var(--tb-surface);overflow:hidden;transition:border-color .15s ease,box-shadow .15s ease}.tb-profile-row:hover{border-color:#d3d8e1;box-shadow:0 3px 12px rgba(16,24,40,.035)}.tb-profile-row.disabled{opacity:.7}.tb-profile-row-main{padding:20px 22px}.tb-profile-head{align-items:center}.tb-profile-name-line{display:flex;align-items:center;gap:10px}.tb-profile-name-line h3{font-size:15px}.tb-profile-metrics{display:grid;grid-template-columns:1.35fr 1.35fr .8fr .7fr 1fr;gap:0;margin-top:18px;border:1px solid var(--tb-border);border-radius:9px;overflow:hidden}.tb-profile-metrics>div{padding:13px 15px;border-right:1px solid var(--tb-border);background:var(--tb-surface-soft)}.tb-profile-metrics>div:last-child{border-right:0}.tb-profile-metrics span{display:block;color:var(--tb-muted);font-size:10px;text-transform:uppercase;letter-spacing:.04em;font-weight:650}.tb-profile-metrics strong{display:block;margin-top:5px;font-size:12px}.tb-profile-row-actions{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 22px;border-top:1px solid var(--tb-border);background:color-mix(in srgb,var(--tb-surface-soft) 60%,var(--tb-surface))}.tb-profile-toggle{display:flex;align-items:center;gap:8px}.tb-profile-toggle .tb-input{width:210px;min-height:36px}.tb-profile-json{flex:1}.tb-alert-json-grid{margin-top:14px}.tb-profile-json .tb-code{margin-top:8px}

/* Webhook configuration */
.tb-equal-grid{align-items:stretch}.tb-service-card{position:relative}.tb-service-card.success{border-color:color-mix(in srgb,var(--tb-success) 20%,var(--tb-border))}.tb-service-card.warning{border-color:color-mix(in srgb,var(--tb-warning) 25%,var(--tb-border))}.tb-service-card.info{border-color:color-mix(in srgb,var(--tb-primary) 18%,var(--tb-border))}.tb-service-title{display:flex;align-items:center;gap:12px}.tb-service-icon{width:38px;height:38px;border-radius:9px;display:grid;place-items:center;background:var(--tb-primary-soft);color:var(--tb-primary)}.tb-service-card.success .tb-service-icon{background:var(--tb-success-soft);color:#0f9f45}.tb-service-card.warning .tb-service-icon{background:var(--tb-warning-soft);color:#a36f00}.tb-copy-row{display:flex;gap:10px;align-items:stretch}.tb-code-inline{flex:1;min-height:42px;padding:11px 13px;background:var(--tb-surface-soft);color:var(--tb-text-soft);border:1px solid var(--tb-border);white-space:nowrap;text-overflow:ellipsis}.tb-service-actions{display:flex;align-items:end;justify-content:space-between;gap:16px;margin-top:22px;padding-top:18px;border-top:1px solid var(--tb-border)}.tb-service-actions strong{display:block;margin-top:4px;font-size:12px}.tb-meta-label{color:var(--tb-muted);font-size:10px;text-transform:uppercase;font-weight:650}.tb-inline-security-form{grid-template-columns:1fr auto;align-items:end;margin-top:18px}.tb-builder-top{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(340px,.85fr);gap:24px}.tb-builder-controls{display:grid;gap:18px}.tb-input-action{display:flex;gap:10px}.tb-builder-profile{border:1px solid var(--tb-border);border-radius:12px;background:var(--tb-surface-soft);padding:20px}.tb-builder-profile-head{padding-bottom:16px;border-bottom:1px solid var(--tb-border)}.tb-builder-profile-head strong,.tb-builder-profile-head small{display:block}.tb-builder-profile-head strong{font-size:16px;margin-top:10px}.tb-builder-profile-head small{color:var(--tb-muted);margin-top:5px}.tb-builder-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}.tb-builder-metrics>div{padding:12px;border-radius:8px;background:var(--tb-surface)}.tb-builder-metrics span{display:block;color:var(--tb-muted);font-size:9.5px;text-transform:uppercase;font-weight:650}.tb-builder-metrics strong{display:block;margin-top:5px;font-size:12px}.tb-payload-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-top:24px;padding-top:24px;border-top:1px solid var(--tb-border)}.tb-payload-panel{border:1px solid var(--tb-border);border-radius:11px;overflow:hidden}.tb-payload-panel.buy{border-color:color-mix(in srgb,var(--tb-success) 20%,var(--tb-border))}.tb-payload-panel.sell{border-color:color-mix(in srgb,var(--tb-danger) 20%,var(--tb-border))}.tb-payload-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 15px;background:var(--tb-surface-soft)}.tb-payload-head>div{display:flex;align-items:center;gap:9px}.tb-payload-panel .tb-code{border-radius:0;margin:0;min-height:210px}

/* Binance connection */
.tb-connection-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;background:var(--tb-border);border:1px solid var(--tb-border);border-radius:10px;overflow:hidden}.tb-connection-summary>div{padding:16px;background:var(--tb-surface)}.tb-connection-summary span{display:block;color:var(--tb-muted);font-size:10px;text-transform:uppercase;letter-spacing:.04em;font-weight:650}.tb-connection-summary strong{display:block;margin-top:6px;font-size:12px}.tb-permission-list{display:grid;gap:10px;margin-top:20px}.tb-permission-list>div,.tb-security-list>div{display:flex;gap:12px;align-items:flex-start;padding:13px 14px;border:1px solid var(--tb-border);border-radius:9px}.tb-permission-list>div.success,.tb-security-list>div.success{border-color:color-mix(in srgb,var(--tb-success) 20%,var(--tb-border));background:var(--tb-success-soft)}.tb-permission-list>div.warning,.tb-security-list>div.warning{border-color:color-mix(in srgb,var(--tb-warning) 25%,var(--tb-border));background:var(--tb-warning-soft)}.tb-permission-list>div.danger,.tb-security-list>div.danger{border-color:color-mix(in srgb,var(--tb-danger) 20%,var(--tb-border));background:var(--tb-danger-soft)}.tb-security-list>div.info{border-color:color-mix(in srgb,var(--tb-primary) 18%,var(--tb-border));background:var(--tb-primary-soft)}.tb-permission-icon,.tb-security-list>div>span{width:28px;height:28px;border-radius:7px;display:grid;place-items:center;background:var(--tb-surface);flex:0 0 auto}.tb-permission-list strong,.tb-permission-list small,.tb-security-list strong,.tb-security-list small{display:block}.tb-permission-list strong,.tb-security-list strong{font-size:12px}.tb-permission-list small,.tb-security-list small{margin-top:4px;color:var(--tb-muted);font-size:10.5px;line-height:1.45}.tb-accordion-stack{display:grid;gap:10px;margin-top:20px}.tb-action-panel{border:1px solid var(--tb-border);border-radius:10px;background:var(--tb-surface)}.tb-action-panel.danger{border-color:color-mix(in srgb,var(--tb-danger) 20%,var(--tb-border))}.tb-action-panel>summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px 16px}.tb-action-panel>summary strong,.tb-action-panel>summary small{display:block}.tb-action-panel>summary strong{font-size:12px}.tb-action-panel>summary small{margin-top:4px;color:var(--tb-muted);font-size:10.5px;font-weight:400}.tb-details-chevron{color:var(--tb-muted);font-size:17px}.tb-details-body{padding:0 16px 17px}.tb-action-panel[open] .tb-details-chevron{transform:rotate(45deg)}.tb-account-value{padding:3px 0 18px;border-bottom:1px solid var(--tb-border)}.tb-account-value span{display:block;color:var(--tb-muted);font-size:11px}.tb-account-value strong{display:block;margin-top:7px;font-size:30px;letter-spacing:-.03em}.tb-account-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:18px}.tb-account-stats>div{padding:12px;background:var(--tb-surface-soft);border-radius:8px}.tb-account-stats span{display:block;color:var(--tb-muted);font-size:9.5px;text-transform:uppercase}.tb-account-stats strong{display:block;margin-top:5px;font-size:12px}.tb-security-list{display:grid;gap:10px}.tb-balance-toolbar{display:flex;align-items:center;gap:10px;padding-top:15px;padding-bottom:15px;border-bottom:1px solid var(--tb-border)}.tb-asset-cell{display:flex;align-items:center;gap:9px}.tb-asset-icon{width:28px;height:28px;border-radius:8px;font-size:10px}

/* Overall semantic consistency for risk / AI / automation pages */
.tb-readiness-stat.success,.tb-metric-box.success{border-color:color-mix(in srgb,var(--tb-success) 22%,var(--tb-border))}.tb-readiness-stat.danger,.tb-metric-box.danger{border-color:color-mix(in srgb,var(--tb-danger) 22%,var(--tb-border))}.tb-readiness-stat.info,.tb-metric-box.info{border-color:color-mix(in srgb,var(--tb-primary) 20%,var(--tb-border))}.tb-callout strong{color:var(--tb-text)}

@media(max-width:1100px){
  .tb-info-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.tb-profile-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.tb-profile-metrics>div{border-right:0;border-bottom:1px solid var(--tb-border)}.tb-profile-metrics>div:last-child{border-bottom:0}.tb-builder-top{grid-template-columns:1fr}.tb-connection-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  .tb-option-grid,.tb-info-grid,.tb-payload-grid,.tb-builder-metrics{grid-template-columns:1fr}.tb-form-submit-row{grid-template-columns:1fr}.tb-profile-row-actions{align-items:stretch;flex-direction:column}.tb-profile-toggle{align-items:stretch;flex-direction:column}.tb-profile-toggle .tb-input{width:100%}.tb-profile-metrics{grid-template-columns:1fr}.tb-inline-security-form{grid-template-columns:1fr}.tb-input-action,.tb-copy-row{flex-direction:column}.tb-connection-summary,.tb-account-stats{grid-template-columns:1fr}.tb-position-opened{margin-left:0}.tb-position-title{flex-wrap:wrap}
}

/* Semantic metric color carries through every TradeBridge surface. */
.tb-stat.info>.tb-stat-value{color:var(--tb-primary)}
.tb-stat.warning>.tb-stat-value{color:#a36f00}
.tb-stat.success>.tb-stat-value{color:var(--tb-success)}
.tb-stat.danger>.tb-stat-value{color:var(--tb-danger)}
.tb-stat.neutral>.tb-stat-value{color:var(--tb-text)}
.tb-stat.info{background:linear-gradient(180deg,color-mix(in srgb,var(--tb-primary) 2.8%,var(--tb-surface)) 0%,var(--tb-surface) 46%)}
.tb-stat.success{background:linear-gradient(180deg,color-mix(in srgb,var(--tb-success) 3.8%,var(--tb-surface)) 0%,var(--tb-surface) 46%)}
.tb-stat.warning{background:linear-gradient(180deg,color-mix(in srgb,var(--tb-warning) 5%,var(--tb-surface)) 0%,var(--tb-surface) 46%)}
.tb-stat.danger{background:linear-gradient(180deg,color-mix(in srgb,var(--tb-danger) 3.6%,var(--tb-surface)) 0%,var(--tb-surface) 46%)}
.tb-table tbody tr:has(.tb-status.success){--tb-row-semantic:color-mix(in srgb,var(--tb-success) 2.5%,transparent)}
.tb-table tbody tr:has(.tb-status.danger){--tb-row-semantic:color-mix(in srgb,var(--tb-danger) 2%,transparent)}
.tb-table tbody tr:hover{background:color-mix(in srgb,var(--tb-primary) 2.3%,var(--tb-surface))}
.tb-table-main{font-weight:650;color:var(--tb-text)}
.tb-table-sub{margin-top:3px;color:var(--tb-muted);font-size:10.5px}
.tb-card-header .tb-status{flex:0 0 auto}
.tb-toolbar-group>.tb-select{min-width:138px}
.tb-account-value small{display:block;margin-top:6px;color:var(--tb-muted);font-size:10.5px}

/* Analytics + advanced data tables */
.tb-analytics-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(300px,1fr);gap:30px;align-items:stretch}
.tb-chart-wrap.compact{min-height:320px;padding:8px 18px 6px 12px}
.tb-chart-empty{min-height:320px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:7px;text-align:center;padding:30px;color:var(--tb-muted)}
.tb-chart-empty strong{color:var(--tb-text);font-size:14px;font-weight:600}.tb-chart-empty span{font-size:12px}
.tb-card-header-wrap{flex-wrap:wrap;padding-top:14px;padding-bottom:14px}
.tb-table-tools{flex:1;justify-content:flex-end;flex-wrap:wrap}
.tb-table-filterbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:14px 24px;border-bottom:1px solid var(--tb-border);background:color-mix(in srgb,var(--tb-surface-soft) 48%,var(--tb-surface))}
.tb-table-select{height:40px;min-width:138px;max-width:210px;border:1px solid var(--tb-border);border-radius:8px;background:var(--tb-surface);color:var(--tb-text);padding:0 34px 0 12px;outline:none;cursor:pointer}
.tb-table-select.compact{min-width:105px;max-width:125px}
.tb-table-select:focus{border-color:color-mix(in srgb,var(--tb-primary) 52%,var(--tb-border));box-shadow:0 0 0 3px color-mix(in srgb,var(--tb-primary) 9%,transparent)}
.tb-table th[aria-sort="ascending"]::after{content:"↑";color:var(--tb-primary)}
.tb-table th[aria-sort="descending"]::after{content:"↓";color:var(--tb-primary)}
.tb-page-btn.ellipsis{cursor:default;color:var(--tb-muted);background:transparent!important}
.tb-page-btn:disabled{opacity:.45;cursor:default}
.tb-table-footer{background:color-mix(in srgb,var(--tb-surface-soft) 35%,var(--tb-surface))}
.tb-table-filterbar+.tb-table-wrap{border-top:0}

@media(max-width:1100px){.tb-analytics-grid{grid-template-columns:1fr}.tb-table-tools{justify-content:flex-start}}
@media(max-width:760px){.tb-table-filterbar{align-items:stretch;flex-direction:column;padding:14px 18px}.tb-table-filterbar .tb-search,.tb-table-select,.tb-table-select.compact{width:100%;max-width:none}.tb-table-tools{align-items:stretch;flex-direction:column;width:100%}.tb-table-tools .tb-search,.tb-table-tools .tb-table-select,.tb-table-tools .tb-btn{width:100%;max-width:none}.tb-table-footer{align-items:flex-start;flex-direction:column;padding-top:14px;padding-bottom:14px}.tb-pager{flex-wrap:wrap}}

/* Layout QA — tighten rhythm, remove chart artifacts, clarify section boundaries. */
.apexcharts-legend{display:none!important}
.tb-section{margin-bottom:24px}
.tb-stack{gap:22px}
.tb-grid-2,.tb-grid-3{gap:22px}
.tb-grid-main{align-items:start;gap:24px;margin-bottom:24px}
.tb-analytics-grid{align-items:start;gap:24px}
.tb-card-header{min-height:64px}
.tb-card-body{padding:24px}
.tb-card-actions{display:flex;align-items:center;justify-content:flex-end;gap:14px;flex-wrap:wrap}
.tb-chart-wrap{min-height:250px;padding:8px 16px 8px 10px}
.tb-chart-wrap.compact{min-height:230px;padding:8px 16px 8px 10px}
.tb-chart-wrap.donut{min-height:210px;padding:4px 14px 0}
.tb-chart-empty{min-height:190px;padding:28px 24px}
.tb-chart-key{display:flex;align-items:center;gap:14px;flex-wrap:wrap;color:var(--tb-muted);font-size:11.5px;white-space:nowrap}
.tb-chart-key span{display:inline-flex;align-items:center;gap:7px}
.tb-chart-key i{width:9px;height:9px;border-radius:3px;display:inline-block;flex:0 0 auto}
.tb-key-blue{background:var(--tb-primary)}
.tb-key-green{background:var(--tb-success)}
.tb-key-purple{background:#8b5cf6}
.tb-key-dual{background:linear-gradient(90deg,var(--tb-success) 0 50%,var(--tb-danger) 50% 100%)}
.tb-chart-status-list{display:flex;align-items:center;justify-content:center;gap:8px 14px;flex-wrap:wrap;padding:0 18px 18px;color:var(--tb-muted);font-size:11px}
.tb-chart-status{display:inline-flex;align-items:center;gap:6px}
.tb-chart-status i{width:7px;height:7px;border-radius:50%;background:#a1a8b4}
.tb-chart-status i.success{background:var(--tb-success)}
.tb-chart-status i.danger{background:var(--tb-danger)}
.tb-chart-status i.warning{background:var(--tb-warning)}
.tb-chart-status i.info{background:var(--tb-primary)}
.tb-chart-status strong{color:var(--tb-text);font-weight:650}
.tb-table-filterbar{gap:8px 10px;padding:12px 24px}
.tb-table-filterbar .tb-search{flex:1 1 220px;max-width:320px}
.tb-table-filterbar .tb-table-select{flex:0 1 170px}
.tb-table-filterbar .tb-table-select.compact{flex-basis:115px}
.tb-table-filterbar .tb-btn{margin-left:auto}
.tb-table th,.tb-table td{padding-top:13px;padding-bottom:13px}
.tb-empty-lg.tb-empty-compact{padding:34px 24px;min-height:220px}
.tb-empty-lg.tb-empty-compact .tb-empty-icon{width:42px;height:42px}
.tb-form-section-block{padding:20px;border:1px solid var(--tb-border);border-radius:12px;background:color-mix(in srgb,var(--tb-surface-soft) 58%,var(--tb-surface));margin-bottom:18px}
.tb-form-section-block:first-of-type{padding-top:20px;border-top:1px solid var(--tb-border)}
.tb-form-section-block:last-of-type{margin-bottom:20px}
.tb-form-section-head{margin-bottom:18px}
.tb-form-submit-row{padding:20px;border:1px solid var(--tb-border);border-radius:12px;background:var(--tb-surface);grid-template-columns:minmax(280px,460px) auto}
.tb-builder-controls{padding:20px;border:1px solid var(--tb-border);border-radius:12px;background:color-mix(in srgb,var(--tb-surface-soft) 55%,var(--tb-surface));align-content:start}
.tb-builder-top{align-items:start}
.tb-payload-grid{margin-top:20px;padding-top:20px}
.tb-service-card .tb-card-body{min-height:0}
.tb-grid-aside{gap:24px}
.tb-info-grid{border-radius:0 0 14px 14px;overflow:hidden}
.tb-info-grid>div{min-height:82px}
.tb-page-head{padding-bottom:24px}
.tb-page-tabs{margin-bottom:22px}
.tb-footer{min-height:58px}

/* Distinct order/fill views. */
.tb-context-strip{display:flex;align-items:center;gap:10px 18px;flex-wrap:wrap;padding:13px 18px;border:1px solid var(--tb-border);border-radius:10px;background:color-mix(in srgb,var(--tb-surface-soft) 62%,var(--tb-surface));color:var(--tb-muted);font-size:12px;margin-bottom:20px}
.tb-context-strip strong{color:var(--tb-text)}
.tb-context-strip a{color:var(--tb-primary);font-weight:600}

@media(max-width:1100px){
  .tb-card-actions{justify-content:flex-start}
  .tb-table-filterbar .tb-search{max-width:none;flex-basis:100%}
  .tb-table-filterbar .tb-table-select{flex:1 1 160px;max-width:none}
  .tb-table-filterbar .tb-btn{margin-left:0}
}
@media(max-width:760px){
  .tb-chart-wrap,.tb-chart-wrap.compact{min-height:210px;padding-left:6px;padding-right:6px}
  .tb-chart-wrap.donut{min-height:190px}
  .tb-chart-empty{min-height:160px}
  .tb-chart-key{white-space:normal}
  .tb-card-actions{width:100%;justify-content:space-between}
  .tb-form-section-block,.tb-form-submit-row,.tb-builder-controls{padding:16px}
}
.tb-copy-row>*:first-child,.tb-input-action>*:first-child{min-width:0}
.tb-service-actions{flex-wrap:wrap}
.tb-inline-security-form{grid-template-columns:minmax(0,1fr) auto}
.tb-builder-profile{min-width:0}
.tb-code-inline{overflow:hidden}
.tb-risk-panel .tb-card-body{padding-top:22px}

/* =========================================================
   Precision polish — chart hover, forms, builders, dense logs
   ========================================================= */

/* Charts: keep hover detail inside a readable floating card and never clip it at card edges. */
.tb-chart-card{overflow:visible;position:relative;z-index:1}
.tb-chart-card:hover{z-index:6}
.tb-chart-card .tb-card-header{border-radius:14px 14px 0 0}
.tb-chart-wrap,.tb-chart-wrap.compact,.tb-chart-wrap.donut{overflow:visible;position:relative}
.tb-chart-wrap .apexcharts-canvas,.tb-chart-wrap .apexcharts-svg{overflow:visible!important}
.apexcharts-tooltip{background:transparent!important;border:0!important;box-shadow:none!important;overflow:visible!important;pointer-events:none!important}
.apexcharts-xaxistooltip,.apexcharts-yaxistooltip{display:none!important}
.tb-chart-tooltip{min-width:190px;padding:11px 12px;border:1px solid var(--tb-border);border-radius:10px;background:var(--tb-surface);box-shadow:0 12px 30px rgba(15,23,42,.14);color:var(--tb-text);font-size:12px}
.tb-chart-tooltip-title{padding-bottom:8px;margin-bottom:7px;border-bottom:1px solid var(--tb-border);font-weight:700;white-space:nowrap}
.tb-chart-tooltip-row{display:grid;grid-template-columns:8px minmax(0,1fr) auto;align-items:center;gap:8px;padding:3px 0;color:var(--tb-text-soft)}
.tb-chart-tooltip-row strong{color:var(--tb-text);font-weight:700;white-space:nowrap}
.tb-chart-tooltip-dot{width:7px;height:7px;border-radius:50%}
.tb-chart-status-list{padding:4px 16px 16px;gap:8px;justify-content:center}
.tb-chart-status{padding:6px 9px;border:1px solid var(--tb-border);border-radius:8px;background:var(--tb-surface-soft);line-height:1;white-space:nowrap}
.tb-chart-status i{width:6px;height:6px}
.tb-chart-status strong{margin-left:2px}

/* Trading Profile editor: every control shares one visual height and the save action lines up with its password field. */
.tb-profile-editor .tb-form-grid.cols-3{align-items:start}
.tb-profile-editor .tb-form-grid.cols-3 .tb-field{grid-template-rows:18px 46px auto;align-content:start}
.tb-profile-editor .tb-form-grid.cols-3 .tb-input,
.tb-profile-editor .tb-form-grid.cols-3 .tb-select,
.tb-profile-editor .tb-form-grid.cols-3 select{height:46px;min-height:46px}
.tb-profile-editor .tb-form-grid.cols-3 .tb-field label{align-self:end}
.tb-profile-editor .tb-form-grid.cols-3 .tb-hint{padding-top:1px}
.tb-form-submit-row{display:block;padding:20px}
.tb-profile-submit-main{display:grid;gap:7px;max-width:690px}
.tb-submit-control-line{display:grid;grid-template-columns:minmax(280px,460px) auto;gap:16px;align-items:center}
.tb-submit-control-line .tb-input,.tb-submit-control-line .tb-btn{height:46px;min-height:46px}
.tb-submit-control-line .tb-btn{white-space:nowrap}

/* Webhooks: long URLs must shrink inside their cards; builder stacks before columns can collide. */
.tb-copy-row,.tb-input-action,.tb-builder-controls,.tb-builder-profile{min-width:0;max-width:100%}
.tb-copy-row .tb-code-inline{display:block;flex:1 1 0;width:0;min-width:0;max-width:100%;overflow:hidden!important;text-overflow:ellipsis;white-space:nowrap}
.tb-copy-row .tb-btn,.tb-input-action .tb-btn{flex:0 0 auto}
.tb-input-action .tb-input{flex:1 1 0;width:0;min-width:0}
.tb-builder-top{grid-template-columns:minmax(0,1.2fr) minmax(300px,.8fr)}
.tb-builder-controls{overflow:hidden}
.tb-builder-profile{overflow:hidden}
.tb-builder-profile small,.tb-builder-profile strong{overflow-wrap:anywhere}

/* Live execution: separate the password confirmation from state summary above it. */
.tb-live-execution-form{margin-top:24px!important;padding-top:20px;border-top:1px solid var(--tb-border);gap:15px}
.tb-live-execution-form .tb-field{gap:8px}
.tb-live-execution-form .tb-btn{margin-top:2px}

/* Dense operational tables: prioritize scanning, reveal long text only when requested. */
.tb-table-compact{min-width:920px}
.tb-table-compact th{padding:11px 14px;font-size:10.5px}
.tb-table-compact td{padding:11px 14px;font-size:12px;line-height:1.35}
.tb-table-compact .tb-table-sub{font-size:10px;line-height:1.35}
.tb-table-action{width:1%;white-space:nowrap;text-align:right}
.tb-table-summary-clip{display:block;max-width:310px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--tb-text-soft)}
.tb-text-clip{display:block;max-width:310px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tb-ai-decision-table td:nth-child(1){width:132px}
.tb-ai-decision-table td:nth-child(2){width:150px}
.tb-ai-decision-table td:nth-child(3){width:125px}
.tb-ai-decision-table td:nth-child(4){width:150px}
.tb-ai-decision-table td:nth-child(5){width:190px}
.tb-ai-decision-table td:nth-child(6){min-width:260px}
.tb-ai-usage-table td:nth-child(1){width:135px}
.tb-ai-usage-table td:nth-child(2){width:135px}
.tb-ai-usage-table td:nth-child(3){width:120px}
.tb-ai-usage-table td:nth-child(4){width:110px}
.tb-ai-usage-table td:nth-child(5){width:190px}
.tb-ai-usage-table td:nth-child(6){width:80px}
.tb-ai-usage-table td:nth-child(7){width:80px}
.tb-usage-tokens{display:flex;align-items:center;gap:5px;white-space:nowrap}
.tb-inline-details{min-width:240px;max-width:380px}
.tb-inline-details>summary{display:flex;align-items:center;gap:10px;cursor:pointer;list-style:none;min-width:0}
.tb-inline-details>summary::-webkit-details-marker{display:none}
.tb-inline-details>summary .tb-table-summary-clip{flex:1;min-width:0;max-width:300px}
.tb-details-label{color:var(--tb-primary);font-size:10.5px;font-weight:700;white-space:nowrap}
.tb-inline-details-body{margin-top:9px;padding:10px 11px;border:1px solid var(--tb-border);border-radius:8px;background:var(--tb-surface-soft);max-width:380px}
.tb-inline-details-body p{margin:0;color:var(--tb-text-soft);line-height:1.5;font-size:11.5px}
.tb-inline-details-body .tb-mono{overflow-wrap:anywhere;margin-top:7px}

@media(max-width:1280px){
  .tb-builder-top{grid-template-columns:1fr}
  .tb-builder-profile{margin-top:0}
}
@media(max-width:760px){
  .tb-submit-control-line{grid-template-columns:1fr}
  .tb-submit-control-line .tb-btn{width:100%}
  .tb-profile-editor .tb-form-grid.cols-3 .tb-field{grid-template-rows:auto 46px auto}
  .tb-inline-details{max-width:280px}
}

/* Contextual metric help */
.tb-label-with-help{display:inline-flex;align-items:center;gap:5px;overflow:visible}
.tb-help-icon{
  position:relative;
  display:inline-grid;
  place-items:center;
  width:15px;
  height:15px;
  min-width:15px;
  padding:0;
  border:1px solid color-mix(in srgb,var(--tb-primary) 32%,var(--tb-border));
  border-radius:50%;
  background:color-mix(in srgb,var(--tb-primary) 7%,var(--tb-surface));
  color:var(--tb-primary);
  font-family:Arial,Helvetica,sans-serif;
  font-size:9px;
  font-weight:700;
  line-height:1;
  cursor:help;
  appearance:none;
  vertical-align:middle;
  flex:0 0 15px;
  z-index:12;
}
.tb-help-icon:hover{background:color-mix(in srgb,var(--tb-primary) 12%,var(--tb-surface));border-color:color-mix(in srgb,var(--tb-primary) 48%,var(--tb-border))}
.tb-help-icon::before{display:none}
.tb-help-icon::after{
  content:attr(data-tip);
  position:absolute;
  left:50%;
  bottom:calc(100% + 9px);
  width:290px;
  max-width:calc(100vw - 40px);
  padding:10px 11px;
  border:1px solid var(--tb-border);
  border-radius:9px;
  background:var(--tb-surface);
  color:var(--tb-text);
  box-shadow:0 12px 28px rgba(15,23,42,.14);
  font-family:inherit;
  font-size:11px;
  font-weight:500;
  line-height:1.45;
  letter-spacing:0;
  text-transform:none;
  text-align:left;
  white-space:pre-line;
  overflow-wrap:anywhere;
  transform:translateX(-50%);
  opacity:0;
  visibility:hidden;
  transition:opacity .12s ease,visibility .12s ease;
  pointer-events:none;
  z-index:100;
}
.tb-help-icon:hover::after,.tb-help-icon:focus-visible::after{opacity:1;visibility:visible}
.tb-help-icon:focus-visible{outline:2px solid color-mix(in srgb,var(--tb-primary) 35%,transparent);outline-offset:2px}

/* Open-position calculation help */
.tb-live-strip strong.tb-value-with-help,
.tb-metrics strong.tb-value-with-help{
  display:inline-flex;
  align-items:center;
  gap:6px;
  overflow:visible;
  max-width:100%;
}
.tb-value-with-help>b{font:inherit;color:inherit;font-weight:inherit}

/* Keep popovers inside the card/viewport at the outer columns. */
.tb-position-card .tb-live-strip>div:first-child .tb-help-icon::after,
.tb-position-card .tb-metrics>div:first-child .tb-help-icon::after{left:-4px;transform:none}
.tb-position-card .tb-live-strip>div:last-child .tb-help-icon::after,
.tb-position-card .tb-metrics>div:last-child .tb-help-icon::after{left:auto;right:-4px;transform:none}

/* The live strip sits high on the card, so its help opens downward instead of covering the position heading. */
.tb-position-card .tb-live-strip .tb-help-icon::after{top:calc(100% + 9px);bottom:auto}

@media(max-width:900px){
  .tb-position-card .tb-live-strip>div:nth-child(odd) .tb-help-icon::after,
  .tb-position-card .tb-metrics>div:nth-child(odd) .tb-help-icon::after{left:-4px;right:auto;transform:none}
  .tb-position-card .tb-live-strip>div:nth-child(even) .tb-help-icon::after,
  .tb-position-card .tb-metrics>div:nth-child(even) .tb-help-icon::after{left:auto;right:-4px;transform:none}
}
@media(max-width:700px){
  .tb-help-icon::after{width:260px;max-width:calc(100vw - 28px);font-size:10.5px}
}

/* Open-position net-after-fees presentation */
.tb-metrics.tb-metrics-6{grid-template-columns:repeat(6,minmax(0,1fr))}
.tb-live-subvalue{display:block;margin-top:4px;color:var(--tb-muted);font-size:10.5px;font-weight:650;line-height:1.25}
.tb-live-subvalue.money-pos{color:var(--tb-success)!important}
.tb-live-subvalue.money-neg{color:var(--tb-danger)!important}
@media(max-width:1250px){.tb-metrics.tb-metrics-6{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){.tb-metrics.tb-metrics-6{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Dashboard Binance.US balance overview */
.tb-balance-overview-card{overflow:hidden;border-color:#cfe0ff;box-shadow:0 10px 30px rgba(63,102,251,.04)}
.tb-balance-overview-card.is-top-card{margin-bottom:2px}
.tb-balance-overview-head{display:flex;align-items:center;gap:18px}
.tb-balance-overview-head>div{text-align:right}
.tb-balance-overview-head span:not(.tb-status){display:block;color:var(--tb-muted);font-size:10px;text-transform:uppercase;letter-spacing:.05em;font-weight:700}
.tb-balance-overview-head strong{display:block;margin-top:4px;font-size:19px;letter-spacing:-.02em}
.tb-balance-asset-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;background:var(--tb-border);border-bottom:1px solid var(--tb-border)}
.tb-balance-asset{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px 18px;align-items:center;padding:20px 22px;background:linear-gradient(180deg,#fff 0%,#fdfdff 100%);min-width:0;transition:background .16s ease,transform .16s ease}
.tb-balance-asset:hover{background:#fbfcff}
.tb-balance-asset-main{display:flex;align-items:center;gap:12px;min-width:0}
.tb-balance-asset-main>div{min-width:0}
.tb-balance-asset-main strong,.tb-balance-asset-main span,.tb-balance-asset-value strong,.tb-balance-asset-value span{display:block}
.tb-balance-asset-main strong{font-size:13px}
.tb-balance-asset-main>div>span{margin-top:4px;color:var(--tb-muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tb-balance-asset-icon{width:44px;height:44px;display:grid;place-items:center;flex:0 0 auto}
.tb-balance-asset-icon>img{width:42px;height:42px;display:block;object-fit:contain}
.tb-balance-asset-fallback{width:40px;height:40px;display:grid;place-items:center;border-radius:50%;background:var(--tb-primary-soft);color:var(--tb-primary);font-size:14px;font-weight:800}
.tb-balance-asset-value{text-align:right;min-width:92px}
.tb-balance-asset-value strong{font-size:13px}
.tb-balance-asset-value span{margin-top:4px;color:var(--tb-muted);font-size:10px}
.tb-balance-share{grid-column:1/-1;height:4px;border-radius:999px;background:var(--tb-surface-soft);overflow:hidden}
.tb-balance-share>span{display:block;height:100%;border-radius:inherit;background:var(--tb-primary);min-width:0}
.tb-balance-asset[data-asset="BTC"] .tb-balance-share>span{background:#f7931a}
.tb-balance-asset[data-asset="USD"] .tb-balance-share>span{background:var(--tb-success)}
.tb-balance-asset[data-asset="USDT"] .tb-balance-share>span{background:#26a17b}
.tb-balance-asset[data-asset="ETH"] .tb-balance-share>span{background:#627eea}
.tb-balance-asset[data-asset="LINK"] .tb-balance-share>span{background:#2A5ADA}
.tb-balance-asset[data-asset="ADA"] .tb-balance-share>span{background:#2A6BC4}
.tb-balance-overview-foot{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 22px;color:var(--tb-muted);font-size:11px}
.tb-balance-overview-foot a{color:var(--tb-primary);font-weight:650;white-space:nowrap}
.tb-balance-overview-empty{padding:28px 24px;text-align:center;color:var(--tb-muted);font-size:12px}
@media(max-width:1100px){.tb-balance-asset-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.tb-balance-overview-head{gap:10px;align-items:flex-start;flex-direction:column}.tb-balance-overview-head>div{text-align:left}.tb-balance-asset-grid{grid-template-columns:1fr}.tb-balance-asset{padding:17px 18px;grid-template-columns:1fr}.tb-balance-asset-value{text-align:left}.tb-balance-overview-foot{align-items:flex-start;flex-direction:column}.tb-balance-overview-foot a{white-space:normal}}


/* Hosted asset marks used consistently across trading/account data tables. */
.tb-table-asset-cell-logo{min-width:145px}
.tb-table-asset-layout{display:flex;align-items:center;gap:10px;min-width:0}
.tb-table-asset-copy{min-width:0;flex:1}
.tb-table-asset-logo-wrap,.tb-account-asset-logo-wrap,.tb-position-asset-logo-wrap{display:grid;place-items:center;flex:0 0 auto;border-radius:50%;overflow:hidden;background:var(--tb-surface);box-shadow:0 0 0 1px color-mix(in srgb,var(--tb-border) 82%,transparent)}
.tb-table-asset-logo-wrap{width:28px;height:28px}
.tb-table-asset-logo{width:28px;height:28px;display:block;object-fit:contain}
.tb-table-asset-logo-fallback{width:28px;height:28px;place-items:center;background:var(--tb-primary-soft);color:var(--tb-primary);font-size:10px;font-weight:800}
.tb-table-asset-logo-fallback::before{content:attr(data-letter)}
.tb-table-asset-logo-fallback:not([hidden]){display:grid}
.tb-table-asset-simple{display:flex;align-items:center;gap:9px}
.tb-account-asset-logo-wrap{width:30px;height:30px}
.tb-account-asset-logo{width:30px;height:30px;display:block;object-fit:contain}
.tb-account-asset-logo-fallback{width:30px;height:30px;place-items:center;background:var(--tb-primary-soft);color:var(--tb-primary);font-size:10px;font-weight:800}
.tb-account-asset-logo-fallback::before{content:attr(data-letter)}
.tb-account-asset-logo-fallback:not([hidden]){display:grid}
.tb-asset-cell .tb-account-asset-logo-wrap{margin-right:0}
.tb-market-icon.has-asset-logo{background:transparent!important;border-radius:50%;overflow:visible;width:38px;height:38px}
.tb-position-asset-logo-wrap{width:38px;height:38px}
.tb-position-asset-logo{width:38px;height:38px;display:block;object-fit:contain}
.tb-position-asset-logo-fallback{width:38px;height:38px;place-items:center;background:var(--tb-primary-soft);color:var(--tb-primary);font-size:12px;font-weight:800}
.tb-position-asset-logo-fallback::before{content:attr(data-letter)}
.tb-position-asset-logo-fallback:not([hidden]){display:grid}
.tb-profile-asset-heading{display:grid!important;grid-template-columns:40px minmax(0,1fr);column-gap:12px;align-items:center;min-width:0}
.tb-profile-asset-heading>.tb-profile-asset-logo-wrap{grid-column:1;grid-row:1/3;align-self:center}
.tb-profile-asset-heading>.tb-profile-name-line{grid-column:2;grid-row:1;min-width:0}
.tb-profile-asset-heading>.tb-profile-meta{grid-column:2;grid-row:2;min-width:0}
.tb-profile-asset-logo-wrap{width:40px;height:40px;display:grid;place-items:center}
.tb-profile-asset-logo{width:40px;height:40px;display:block;object-fit:contain}
.tb-profile-asset-logo-fallback{width:40px;height:40px;place-items:center;border-radius:50%;background:var(--tb-primary-soft);color:var(--tb-primary);font-size:12px;font-weight:800}
.tb-profile-asset-logo-fallback::before{content:attr(data-letter)}
.tb-profile-asset-logo-fallback:not([hidden]){display:grid}
@media(max-width:700px){.tb-table-asset-cell-logo{min-width:130px}.tb-table-asset-layout{gap:8px}.tb-table-asset-logo-wrap,.tb-table-asset-logo{width:24px;height:24px}.tb-table-asset-logo-fallback{width:24px;height:24px}}

@media(max-width:700px){.tb-profile-asset-heading{grid-template-columns:34px minmax(0,1fr);column-gap:10px}.tb-profile-asset-logo-wrap,.tb-profile-asset-logo{width:34px;height:34px}.tb-profile-asset-logo-fallback{width:34px;height:34px}}
