:root {
  --ibkr-red: #c41230;
  --ibkr-red-dark: #990d25;
  --ibkr-black: #111318;
  --ibkr-charcoal: #202329;
  --ibkr-surface: #ffffff;
  --ibkr-canvas: #f1f2f4;
  --ibkr-line: #d8dadd;
  --ibkr-text: #17191d;
  --ibkr-muted: #656a73;
  --ibkr-positive: #087a49;
  --ibkr-negative: #c41230;
  --ibkr-radius: 2px;
}

html { background: var(--ibkr-canvas); }
body.ibkr-theme-ready {
  margin: 0 !important;
  background: var(--ibkr-canvas) !important;
  color: var(--ibkr-text) !important;
  font-family: Arial, Helvetica, sans-serif !important;
  line-height: 1.45;
}
body.ibkr-theme-ready .internal-header { display: none !important; }

.ibkr-global-header {
  position: relative;
  z-index: 10000;
  display: flex;
  align-items: stretch;
  min-height: 68px;
  border-bottom: 3px solid var(--ibkr-red);
  background: #fff;
  color: var(--ibkr-text);
  box-shadow: 0 2px 9px rgba(0, 0, 0, .14);
}
.ibkr-global-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 245px;
  padding: 0 22px;
  border-right: 1px solid var(--ibkr-line);
  color: var(--ibkr-text) !important;
  text-decoration: none !important;
}
.ibkr-global-mark {
  position: relative;
  width: 28px;
  height: 34px;
  transform: skew(-12deg);
}
.ibkr-global-mark:before,
.ibkr-global-mark:after {
  content: '';
  position: absolute;
  left: 5px;
  width: 8px;
  height: 28px;
  background: var(--ibkr-red);
}
.ibkr-global-mark:before { top: 0; }
.ibkr-global-mark:after { top: 7px; left: 16px; background: #e45a6f; }
.ibkr-global-brand strong { display: block; font-size: 17px; letter-spacing: -.3px; }
.ibkr-global-brand small { display: block; margin-top: 1px; color: var(--ibkr-muted); font-size: 9px; font-weight: 700; letter-spacing: 1.4px; }
.ibkr-global-nav { display: flex; align-items: stretch; flex: 1; }
.ibkr-global-nav a {
  display: flex;
  align-items: center;
  padding: 0 17px;
  border-right: 1px solid #ececee;
  color: #292c31 !important;
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 700;
}
.ibkr-global-nav a:hover,
.ibkr-global-nav a.active { background: #f8e9ed; color: var(--ibkr-red) !important; }
.ibkr-system-chip {
  display: flex;
  align-items: center;
  margin: 14px 18px 14px auto;
  padding: 0 12px;
  border: 1px solid var(--ibkr-line);
  border-left: 3px solid var(--ibkr-red);
  background: #fafafa;
  color: #4e535b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .45px;
  text-transform: uppercase;
}

body.ibkr-theme-ready h1,
body.ibkr-theme-ready h2,
body.ibkr-theme-ready h3 { font-family: Arial, Helvetica, sans-serif; letter-spacing: -.25px; }
body.ibkr-theme-ready a { color: #a20f28; }
body.ibkr-theme-ready a:hover { color: var(--ibkr-red); }

body.ibkr-theme-ready input[type='button'],
body.ibkr-theme-ready input[type='submit'],
body.ibkr-theme-ready button:not(.category-button):not(.system-filter):not(.favorite):not(.info-button):not(.quick-period-button),
body.ibkr-theme-ready .button,
body.ibkr-theme-ready .btn {
  min-height: 34px;
  padding: 7px 15px !important;
  border: 1px solid var(--ibkr-red-dark) !important;
  border-radius: var(--ibkr-radius) !important;
  background: var(--ibkr-red) !important;
  color: #fff !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-weight: 700 !important;
  cursor: pointer;
}
body.ibkr-theme-ready input[type='button']:hover,
body.ibkr-theme-ready input[type='submit']:hover,
body.ibkr-theme-ready button:hover { filter: brightness(.92); }
body.ibkr-theme-ready input[type='text'],
body.ibkr-theme-ready input[type='password'],
body.ibkr-theme-ready input[type='search'],
body.ibkr-theme-ready input[type='number'],
body.ibkr-theme-ready input[type='date'],
body.ibkr-theme-ready select,
body.ibkr-theme-ready textarea {
  min-height: 34px;
  border: 1px solid #aeb2b8 !important;
  border-radius: var(--ibkr-radius) !important;
  background: #fff !important;
  color: var(--ibkr-text) !important;
  font-family: Arial, Helvetica, sans-serif !important;
}
body.ibkr-theme-ready input:focus,
body.ibkr-theme-ready select:focus,
body.ibkr-theme-ready textarea:focus {
  border-color: var(--ibkr-red) !important;
  outline: 2px solid rgba(196, 18, 48, .13) !important;
  outline-offset: 0;
}

body.ibkr-theme-ready table {
  border-collapse: collapse;
  border: 1px solid var(--ibkr-line);
  background: #fff;
  color: var(--ibkr-text);
  font-family: Arial, Helvetica, sans-serif;
}
body.ibkr-theme-ready table th {
  padding: 9px 10px;
  border: 1px solid #343840;
  background: var(--ibkr-charcoal) !important;
  color: #fff !important;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .35px;
  text-align: left;
  text-transform: uppercase;
}
body.ibkr-theme-ready table td { padding: 8px 10px; border: 1px solid #e0e2e5; color: var(--ibkr-text) !important; }
body.ibkr-theme-ready .login-form-wrap span { color: var(--ibkr-text) !important; }
body.ibkr-theme-ready table tr:nth-child(even) td { background: #f7f7f8; }
body.ibkr-theme-ready table tr:hover td { background: #fff2f4; }
body.ibkr-theme-ready fieldset,
body.ibkr-theme-ready .panel,
body.ibkr-theme-ready .card {
  border-color: var(--ibkr-line) !important;
  border-radius: var(--ibkr-radius) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}
body.ibkr-theme-ready .positive,
body.ibkr-theme-ready .pos { color: var(--ibkr-positive) !important; }
body.ibkr-theme-ready .negative,
body.ibkr-theme-ready .neg { color: var(--ibkr-negative) !important; }

@media (max-width: 900px) {
  .ibkr-global-header { flex-wrap: wrap; }
  .ibkr-global-brand { min-width: 0; flex: 1; min-height: 58px; }
  .ibkr-system-chip { order: 2; margin: 8px 12px 8px auto; min-height: 34px; }
  .ibkr-global-nav { order: 3; width: 100%; overflow-x: auto; border-top: 1px solid var(--ibkr-line); }
  .ibkr-global-nav a { min-height: 42px; padding: 0 13px; white-space: nowrap; }
}

/* Final light-surface layer: overrides legacy dark workstation styles. */
:root {
  color-scheme: light;
  --bg: #f3f4f6;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --panel2: #f7f7f8;
  --line: #d8dadd;
  --soft: #e8e9eb;
  --text: #17191d;
  --muted: #626872;
  --red: #c41230;
  --red-bright: #a90f29;
  --green: #087a49;
  --negative: #c41230;
  --amber: #8a5a00;
  --blue: #1f5f9e;
  --ib-bg: #f3f4f6;
  --ib-surface: #ffffff;
  --ib-raised: #ffffff;
  --ib-hover: #f7ecef;
  --ib-border: #d8dadd;
  --ib-soft: #e8e9eb;
  --ib-text: #17191d;
  --ib-muted: #626872;
  --ib-red: #c41230;
  --ib-red-hover: #a90f29;
  --ib-green: #087a49;
  --ib-amber: #8a5a00;
}

body.ibkr-theme-ready,
body.ibkr-theme-ready main,
body.ibkr-theme-ready .shell,
body.ibkr-theme-ready .ops-shell,
body.ibkr-theme-ready .login-layout {
  background: #f3f4f6 !important;
  color: #17191d !important;
}

body.ibkr-theme-ready .sidebar,
body.ibkr-theme-ready .topbar,
body.ibkr-theme-ready .panel,
body.ibkr-theme-ready .panel-head,
body.ibkr-theme-ready .kpi,
body.ibkr-theme-ready .kpi.primary,
body.ibkr-theme-ready .system-banner-card,
body.ibkr-theme-ready .system-nav-card,
body.ibkr-theme-ready .worker-card,
body.ibkr-theme-ready .config-card,
body.ibkr-theme-ready .ops-topbar,
body.ibkr-theme-ready .ops-card,
body.ibkr-theme-ready .login-card,
body.ibkr-theme-ready .login-card-head,
body.ibkr-theme-ready .login-form-wrap,
body.ibkr-theme-ready .page-card,
body.ibkr-theme-ready .page-info,
body.ibkr-theme-ready .dashboard-launcher,
body.ibkr-theme-ready .dashboard-launcher.system-one,
body.ibkr-theme-ready .dashboard-launcher.system-two {
  background: #ffffff !important;
  color: #17191d !important;
  border-color: #d8dadd !important;
  background-image: none !important;
}

body.ibkr-theme-ready .page-shell,
body.ibkr-theme-ready .hero,
body.ibkr-theme-ready .hero-panel,
body.ibkr-theme-ready .system-card,
body.ibkr-theme-ready .link-card,
body.ibkr-theme-ready .naming-note,
body.ibkr-theme-ready .note-grid article,
body.ibkr-theme-ready .nav-callout {
  background: #ffffff !important;
  color: #17191d !important;
  border-color: #d8dadd !important;
  background-image: none !important;
}

body.ibkr-theme-ready .login-card,
body.ibkr-theme-ready .kpi.primary,
body.ibkr-theme-ready .panel,
body.ibkr-theme-ready .page-card,
body.ibkr-theme-ready .dashboard-launcher {
  border-top-color: #c41230 !important;
}

body.ibkr-theme-ready h1,
body.ibkr-theme-ready h2,
body.ibkr-theme-ready h3,
body.ibkr-theme-ready h4,
body.ibkr-theme-ready .brand strong,
body.ibkr-theme-ready .system-title,
body.ibkr-theme-ready .kpi-value,
body.ibkr-theme-ready .worker-name,
body.ibkr-theme-ready .worker-symbol,
body.ibkr-theme-ready .config-title,
body.ibkr-theme-ready .page-title,
body.ibkr-theme-ready .dashboard-launcher strong,
body.ibkr-theme-ready .login-card-head h1 {
  color: #17191d !important;
}
body.ibkr-theme-ready .hero h1,
body.ibkr-theme-ready .hero-panel strong,
body.ibkr-theme-ready .system-card h2,
body.ibkr-theme-ready .link-card strong,
body.ibkr-theme-ready .note-grid h3,
body.ibkr-theme-ready .nav-callout strong {
  color: #17191d !important;
}

body.ibkr-theme-ready .brand small,
body.ibkr-theme-ready .sidebar-foot small,
body.ibkr-theme-ready .lede,
body.ibkr-theme-ready .system-copy,
body.ibkr-theme-ready .section-kicker,
body.ibkr-theme-ready .kpi-label,
body.ibkr-theme-ready .kpi-sub,
body.ibkr-theme-ready .check-detail,
body.ibkr-theme-ready .pretrade-line span,
body.ibkr-theme-ready .event-time,
body.ibkr-theme-ready .event p,
body.ibkr-theme-ready .worker-role,
body.ibkr-theme-ready .worker-meta,
body.ibkr-theme-ready .sub,
body.ibkr-theme-ready .muted-line,
body.ibkr-theme-ready .page-path,
body.ibkr-theme-ready .summary,
body.ibkr-theme-ready .shortcut,
body.ibkr-theme-ready .dashboard-launcher p,
body.ibkr-theme-ready .dashboard-launcher small,
body.ibkr-theme-ready .login-card-head p {
  color: #626872 !important;
}
body.ibkr-theme-ready .hero-panel p,
body.ibkr-theme-ready .system-card p,
body.ibkr-theme-ready .system-card li,
body.ibkr-theme-ready .link-card p,
body.ibkr-theme-ready .note-grid p,
body.ibkr-theme-ready .nav-callout p {
  color: #626872 !important;
}

body.ibkr-theme-ready .brand-mark {
  background: #c41230 !important;
  color: #ffffff !important;
}

body.ibkr-theme-ready .nav-item,
body.ibkr-theme-ready .category-button,
body.ibkr-theme-ready .system-filter {
  background: transparent !important;
  color: #34383f !important;
}
body.ibkr-theme-ready .nav-item:hover,
body.ibkr-theme-ready .nav-item.active,
body.ibkr-theme-ready .category-button:hover,
body.ibkr-theme-ready .category-button.active,
body.ibkr-theme-ready .system-filter:hover,
body.ibkr-theme-ready .system-filter.active {
  background: #f8e9ed !important;
  color: #9b1027 !important;
}
body.ibkr-theme-ready .sidebar-foot { border-color: #d8dadd !important; }

body.ibkr-theme-ready .system-label,
body.ibkr-theme-ready .meta-pill,
body.ibkr-theme-ready .system-link,
body.ibkr-theme-ready .status-chip,
body.ibkr-theme-ready .count-chip,
body.ibkr-theme-ready .stage,
body.ibkr-theme-ready .symbol-pill,
body.ibkr-theme-ready .favorite,
body.ibkr-theme-ready .info-button,
body.ibkr-theme-ready .sidebar-links a,
body.ibkr-theme-ready .toggle,
body.ibkr-theme-ready .clear,
body.ibkr-theme-ready .market-badge,
body.ibkr-theme-ready .refresh-link {
  background: #f7f7f8 !important;
  color: #34383f !important;
  border-color: #cfd2d6 !important;
}
body.ibkr-theme-ready .system-link.active,
body.ibkr-theme-ready .favorite.active,
body.ibkr-theme-ready .toggle.active {
  background: #f8e9ed !important;
  color: #9b1027 !important;
  border-color: #c41230 !important;
}
body.ibkr-theme-ready .system-link span { color: #626872 !important; }
body.ibkr-theme-ready .system-link strong { color: #17191d !important; }

body.ibkr-theme-ready .toolbar { background: rgba(243, 244, 246, .96) !important; }
body.ibkr-theme-ready .search,
body.ibkr-theme-ready .progress,
body.ibkr-theme-ready .skeleton:empty {
  background: #ffffff !important;
  color: #17191d !important;
  border-color: #b9bdc3 !important;
  background-image: none !important;
}
body.ibkr-theme-ready .progress { background: #e2e4e7 !important; }
body.ibkr-theme-ready .alert-rail {
  background: #fff0f2 !important;
  color: #8e1025 !important;
  border-color: #e4a7b1 !important;
}
body.ibkr-theme-ready .alert-rail-copy { color: #731020 !important; }
body.ibkr-theme-ready .check-row,
body.ibkr-theme-ready .event,
body.ibkr-theme-ready .panel-head { border-color: #e0e2e5 !important; }

body.ibkr-theme-ready .status-chip.good,
body.ibkr-theme-ready .check-icon {
  background: #e4f4ec !important;
  color: #087a49 !important;
}
body.ibkr-theme-ready .status-chip.bad,
body.ibkr-theme-ready .check-icon.bad {
  background: #fde8ec !important;
  color: #b10f29 !important;
}
body.ibkr-theme-ready .status-chip.warn {
  background: #fff3d6 !important;
  color: #765000 !important;
}

body.ibkr-theme-ready .login-form-wrap table,
body.ibkr-theme-ready .login-form-wrap tr,
body.ibkr-theme-ready .login-form-wrap td,
body.ibkr-theme-ready .login-form-wrap span,
body.ibkr-theme-ready .login-form-wrap label {
  background: #ffffff !important;
  color: #17191d !important;
}

/* Command-center links use light cards in this theme, so keep their text dark. */
body.ibkr-theme-ready .ops-link {
  color: #34383f !important;
}
body.ibkr-theme-ready .ops-link::after {
  color: #626872 !important;
}
body.ibkr-theme-ready .ops-link:hover,
body.ibkr-theme-ready .ops-link:focus-visible {
  background: #f8e9ed !important;
  color: #9b1027 !important;
}
body.ibkr-theme-ready .ops-link:hover::after,
body.ibkr-theme-ready .ops-link:focus-visible::after {
  color: #9b1027 !important;
}
