/* ============================================================
   ORDER INTELLIGENCE — PLANNING PAGE (Step 1-6 flow)
   Path: ibkr/assets/css/order-intelligence.css (append)
   ============================================================ */

/* Selected-stocks table on the plan page reuses .data-table styling */
#oiPlanSelectedTable{
  width:100%; border-collapse:separate; border-spacing:0; overflow:hidden;
  border:1px solid var(--line); border-radius:var(--r); background:var(--bg);
}
#oiPlanSelectedTable thead th{
  padding:10px 14px; background:var(--bg-soft); color:var(--ink-3);
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em;
  border-bottom:1px solid var(--line); text-align:left;
}
#oiPlanSelectedTable tbody td{
  padding:10px 14px; font-size:13px; color:var(--ink-2);
  border-bottom:1px solid var(--line); vertical-align:middle;
}
#oiPlanSelectedTable tbody tr:last-child td{ border-bottom:none; }
#oiPlanSelectedTable tbody tr:hover{ background:var(--bg-tint); }

/* Result table reuses the shared .data-table look already defined for
   #t20Table-daily/weekly/swing — just extend the selector list so we don't
   duplicate the whole ruleset. */
#oiPlanResultTable{
  width:100%; border-collapse:separate; border-spacing:0; overflow:hidden;
  border:1px solid var(--line); border-radius:var(--r); background:var(--bg);
}
#oiPlanResultTable thead th{
  padding:12px 14px; background:var(--bg-soft); color:var(--ink-3);
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em;
  border-bottom:1px solid var(--line); white-space:nowrap; text-align:left;
}
#oiPlanResultTable tbody td{
  padding:12px 14px; font-size:13px; color:var(--ink-2);
  border-bottom:1px solid var(--line); vertical-align:middle; white-space:nowrap;
}
#oiPlanResultTable tbody tr:last-child td{ border-bottom:none; }
#oiPlanResultTable tbody tr:hover{ background:var(--bg-tint); }

/* Execution log table (simulated fills) */
#oiPlanExecTable{
  width:100%; border-collapse:separate; border-spacing:0; overflow:hidden;
  border:1px solid var(--line); border-radius:var(--r); background:var(--bg);
  margin-top:12px;
}
#oiPlanExecTable thead th{
  padding:10px 14px; background:var(--bg-soft); color:var(--ink-3);
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em;
  border-bottom:1px solid var(--line); text-align:left;
}
#oiPlanExecTable tbody td{
  padding:10px 14px; font-size:13px; color:var(--ink-2);
  border-bottom:1px solid var(--line);
}
#oiPlanExecTable tbody tr:last-child td{ border-bottom:none; }

/* Back button spacing on the plan page header */
#dash-orderIntelPlan .page-header .btn{ margin-bottom:12px; }

/* ============================================================
   ORDER INTELLIGENCE — PAGE HEADER
   ============================================================ */

.oi-header-row{
  display:flex; align-items:flex-start; gap:16px;
}

.oi-header-icon{
  flex-shrink:0;
  width:52px; height:52px;
  display:flex; align-items:center; justify-content:center;
  border-radius:16px;
  background:var(--accent-grad);
  box-shadow:var(--accent-glow);
  color:#fff;
}
.oi-header-icon svg{ width:26px; height:26px; }

.oi-header-text h2{ margin-bottom:6px; }
.oi-header-text p{ margin:0; max-width:60ch; }

/* ============================================================
   ORDER INTELLIGENCE — STEPPER
   ============================================================ */

.oi-stepper{
  display:flex; align-items:center;
  margin-bottom:20px;
  padding:14px 20px;
  background:var(--bg-soft);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
}

.oi-step{
  display:flex; align-items:center; gap:9px;
  color:var(--ink-3);
}

.oi-step-num{
  flex-shrink:0;
  width:26px; height:26px;
  display:flex; align-items:center; justify-content:center;
  border-radius:50%;
  background:var(--bg-tint);
  border:1px solid var(--line);
  font-size:12px; font-weight:800;
  color:var(--ink-3);
  transition:background .2s ease, border-color .2s ease, color .2s ease;
}

.oi-step-label{
  font-size:13px; font-weight:600;
  white-space:nowrap;
}

.oi-step.active .oi-step-num,
.oi-step.done .oi-step-num{
  background:var(--accent-grad);
  border-color:transparent;
  color:#fff;
}

.oi-step.active .oi-step-label,
.oi-step.done .oi-step-label{
  color:var(--ink-1,var(--ink));
}

.oi-step-line{
  flex:1;
  height:1px;
  margin:0 14px;
  background:var(--line);
}

@media (max-width:680px){
  .oi-stepper{ padding:12px 14px; }
  .oi-step-label{ display:none; }
  .oi-step-line{ margin:0 8px; }
}

/* ============================================================
   ORDER INTELLIGENCE — SECTION CARD HEADERS
   (shared by the Selected Stocks / Result cards + the Configure Plan card)
   ============================================================ */

.oi-section-card{ padding-top:20px; }

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

.oi-section-title h3{
  font-size:16px; margin:0;
}

.oi-section-eyebrow{
  display:block;
  margin-bottom:4px;
  font-size:10px; font-weight:700;
  text-transform:uppercase; letter-spacing:.08em;
  color:var(--accent);
}

.oi-count-badge{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:20px; height:20px;
  padding:0 6px;
  margin-left:4px;
  border-radius:999px;
  background:var(--bg-tint);
  font-size:11px; font-weight:800;
  color:var(--ink-2);
}

.oi-plan-card-head{
  padding:18px 20px 0;
  margin-bottom:0;
}

/* Leftover-cash line already uses .oi-plan-total from the base file;
   upgrade it from a plain right-aligned line into a highlighted banner. */
#oiPlanLeftover{
  margin-top:14px;
  padding:12px 16px;
  background:var(--bg-soft);
  border:1px solid var(--line);
  border-radius:10px;
  text-align:left;
  font-size:13px;
  font-weight:600;
  color:var(--ink-2);
}
#oiPlanLeftover span{ color:var(--accent); font-weight:800; }

@media (max-width:768px){
  #oiPlanSelectedTable, #oiPlanResultTable, #oiPlanExecTable{ min-width:560px; }
  #dash-orderIntelPlan .table-wrap{ overflow-x:auto; }
}

/* ============================================================
   ORDER INTELLIGENCE — Account Selector Header (custom dropdown)
   ============================================================ */
.oi-acct-header{ display:grid; grid-template-columns: auto auto auto auto auto auto; align-items:stretch; gap:16px; flex-wrap:wrap; margin-bottom:18px; }
.oi-acct-field{ position:relative; flex:1 1 380px; min-width:300px; }
.oi-acct-field label{ display:block; font-size:11px; font-weight:700; color:var(--ink-3);
  text-transform:uppercase; letter-spacing:.06em; margin-bottom:8px; }

.oi-acct-trigger{
  width:100%; display:flex; align-items:center; gap:16px;
  padding:16px 20px; background:var(--bg-soft); border:1px solid var(--line);
  border-radius:16px; cursor:pointer; text-align:left; color:var(--ink-1,#fff);
  transition:border-color .15s ease;
}
.oi-acct-trigger:hover{ border-color:var(--accent); }
.oi-acct-trigger[disabled]{ cursor:default; opacity:.7; }

.oi-acct-avatar{
  width:48px; height:48px; border-radius:50%; background:var(--accent);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
  color:#fff; font-size:20px; font-weight:700;
}
.oi-acct-info{ display:flex; flex-direction:column; gap:8px; flex:1; min-width:0; }
.oi-acct-id{ font-size:19px; font-weight:700; color:var(--ink-1,#fff); line-height:1; }
.oi-acct-row2{ display:flex; align-items:center; gap:8px; }

.oi-acct-badge{
  display:inline-block; padding:4px 11px; border-radius:7px;
  font-size:11px; font-weight:700; letter-spacing:.04em; border:1px solid transparent;
  text-transform:uppercase; white-space:nowrap;
}
.oi-acct-badge.env-paper{ color:var(--warn,#d97706); border-color:var(--warn,#d97706); background:rgba(217,119,6,.12); }
.oi-acct-badge.env-live{ color:var(--info,#3b82f6); border-color:var(--info,#3b82f6); background:rgba(59,130,246,.12); }
.oi-acct-badge.status-connected{ color:var(--pos,#16a34a); border-color:var(--pos,#16a34a); background:rgba(22,163,74,.12); }
.oi-acct-badge.status-disconnected{ color:var(--neg,#dc2626); border-color:var(--neg,#dc2626); background:rgba(220,38,38,.12); }

.oi-acct-chevron{ width:18px; height:18px; flex-shrink:0; color:var(--ink-3); transition:transform .15s ease; margin-left:auto; }
.oi-acct-trigger.open .oi-acct-chevron{ transform:rotate(180deg); }

.oi-acct-menu{
  position:absolute; top:calc(100% + 8px); left:0; right:0; z-index:40;
  background:var(--bg-soft); border:1px solid var(--line); border-radius:14px;
  box-shadow:0 12px 28px rgba(0,0,0,.35); overflow:hidden; display:none;
}
.oi-acct-menu.open{ display:block; }
.oi-acct-menu-item{
  display:flex; align-items:center; gap:12px; padding:13px 18px; cursor:pointer;
  border-bottom:1px solid var(--line);
}
.oi-acct-menu-item:last-child{ border-bottom:none; }
.oi-acct-menu-item:hover{ background:var(--bg-tint); }
.oi-acct-menu-item[data-disabled="1"]{ cursor:not-allowed; opacity:.55; }
.oi-acct-menu-check{ width:16px; color:var(--accent); font-size:14px; flex-shrink:0; }
.oi-acct-menu-id{ font-size:14px; font-weight:700; color:var(--ink-1,#fff); flex:1; }

.oi-acct-total-box{
  flex:0 0 auto; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:6px; padding:14px 34px; background:var(--bg-soft); border:1px solid var(--line);
  border-radius:16px; min-width:150px;
}
.oi-acct-total-icon{ font-size:17px; color:var(--ink-3); }
.oi-acct-total-label{ font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--ink-3); }
.oi-acct-total-num{ font-size:24px; font-weight:800; color:var(--ink-1,#fff); }

.oi-acct-stats{ display:flex; gap:16px; flex-wrap:wrap; margin-bottom:18px; }
.oi-acct-stat-card{ flex:1 1 240px; padding:18px 20px; background:var(--bg-soft); border:1px solid var(--line); border-radius:16px; }
.oi-acct-stat-label{ font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--ink-3); margin-bottom:8px; }
.oi-acct-stat-value{ width:100%; display:flex; align-items:center; gap:16px;
  padding:16px 20px; background:var(--bg-soft); border:1px solid var(--line);
  border-radius:16px; cursor:pointer; text-align:left; color:var(--ink-1,#fff);
  transition:border-color .15s ease;
}
.oi-acct-stat-value.loading{ color:var(--ink-3); font-size:14px; font-weight:600; }

.oi-acct-skel{
  height:16px; border-radius:4px;
  background:linear-gradient(90deg, var(--line) 25%, var(--bg-tint) 50%, var(--line) 75%);
  background-size:200% 100%; animation:oiSkelShine 1.2s ease-in-out infinite;
}
@keyframes oiSkelShine{ 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }

@media (max-width:640px){
  .oi-acct-header{ flex-direction:column; }
  .oi-acct-total-box{ width:100%; }
}

/* ============================================================
   ORDER INTELLIGENCE — PLANNING CONTROL PANEL
   ============================================================ */

.oi-plan-card {
  padding: 0;
  overflow: visible;
}


/* ============================================================
   TOP SECTION
   ============================================================ */

.oi-plan-top {
  display: grid;
  grid-template-columns: minmax(360px, 1.8fr) minmax(200px, 1fr) minmax(200px, 1fr);
  gap: 14px;
  padding: 20px;
}


/* ============================================================
   ACCOUNT
   ============================================================ */

.oi-account-section {
  min-width: 0;
}

.oi-account-section > label,
.oi-amount-field > label {
  display: block;
  margin-bottom: 8px;

  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;

  color: var(--ink-3);
}

.oi-account-wrap {
  position: relative;
}

.oi-account-trigger {
  width: 100%;
  min-height: 76px;

  display: flex;
  align-items: center;
  gap: 13px;

  padding: 12px 15px;

  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;

  color: var(--ink-1, #fff);
  text-align: left;

  cursor: pointer;

  transition:
    border-color .15s ease,
    background .15s ease,
    box-shadow .15s ease;
}

.oi-account-trigger:hover {
  border-color: var(--accent);
  background: var(--bg-tint);
}

.oi-account-trigger[disabled] {
  cursor: default;
  opacity: .75;
}

.oi-account-trigger.open {
  border-color: var(--accent);
}


/* Avatar */

.oi-account-avatar {
  width: 42px;
  height: 42px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  border-radius: 11px;

  background: var(--accent-grad);
  color: #fff;

  font-size: 15px;
  font-weight: 800;
}

.oi-account-avatar svg {
  width: 20px;
  height: 20px;
}


/* Account information */

.oi-account-info {
  min-width: 0;
  flex: 1;

  display: flex;
  flex-direction: column;
  gap: 6px;
}

.oi-account-id {
  display: block;

  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;

  color: var(--ink-1, #fff);

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.oi-account-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}


/* Chevron */

.oi-account-chevron {
  width: 17px;
  height: 17px;

  flex-shrink: 0;

  color: var(--ink-3);

  transition: transform .15s ease;
}

.oi-account-trigger.open .oi-account-chevron {
  transform: rotate(180deg);
}


/* ============================================================
   ACCOUNT DROPDOWN
   ============================================================ */

.oi-account-menu {
  position: absolute;

  top: calc(100% + 7px);
  left: 0;
  right: 0;

  z-index: 100;

  display: none;

  overflow: hidden;

  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;

  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
}

.oi-account-menu.open {
  display: block;
}

.oi-account-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 12px 14px;

  border-bottom: 1px solid var(--line);

  cursor: pointer;

  transition: background .15s ease;
}

.oi-account-menu-item:last-child {
  border-bottom: none;
}

.oi-account-menu-item:hover {
  background: var(--bg-tint);
}

.oi-account-menu-item[data-disabled="1"] {
  cursor: not-allowed;
  opacity: .5;
}

.oi-acct-menu-check {
  width: 16px;
  flex-shrink: 0;

  color: var(--accent);
}

.oi-acct-menu-id {
  flex: 1;

  font-size: 13px;
  font-weight: 700;

  color: var(--ink-1, #fff);
}


/* ============================================================
   METRIC CARDS
   ============================================================ */

.oi-metric {
  min-width: 0;

  display: flex;
  flex-direction: column;
  justify-content: center;

  min-height: 76px;

  padding: 14px 16px;

  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;

  transition:
    border-color .15s ease,
    background .15s ease;
}

.oi-metric:hover {
  border-color: var(--accent);
  background: var(--bg-tint);
}

.oi-metric-label {
  display: flex;
  align-items: center;
  gap: 7px;

  margin-bottom: 7px;

  font-size: 10px;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: .06em;

  color: var(--ink-3);
}

.oi-metric-dot {
  width: 6px;
  height: 6px;

  border-radius: 50%;

  background: var(--accent);
}

.oi-metric-dot.buying {
  background: var(--pos, #16a34a);
}

.oi-metric-dot.cash {
  background: var(--info, #3b82f6);
}

.oi-metric-value {
  font-size: 20px;
  line-height: 1.1;

  font-weight: 800;

  color: var(--ink-1, #fff);

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.oi-metric-value.loading {
  font-size: 12px;
  font-weight: 600;

  color: var(--ink-3);
}


/* ============================================================
   DIVIDER
   ============================================================ */

.oi-plan-actions {
  display: flex;
  align-items: flex-end;
  gap: 14px;

  padding: 16px 20px 20px;

  border-top: 1px solid var(--line);
}


/* ============================================================
   AMOUNT
   ============================================================ */

.oi-amount-field {
  flex: 1;
  min-width: 220px;
}

.oi-input-wrap {
  position: relative;
}

.oi-currency {
  position: absolute;

  left: 13px;
  top: 50%;

  transform: translateY(-50%);

  font-size: 14px;
  font-weight: 700;

  color: var(--ink-3);

  pointer-events: none;
}

#oiPlanAmount {
  width: 100%;
  height: 44px;

  padding: 0 14px 0 32px;

  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;

  color: var(--ink-1, #fff);

  font-size: 14px;
  font-weight: 600;

  outline: none;

  transition:
    border-color .15s ease,
    box-shadow .15s ease;
}

#oiPlanAmount::placeholder {
  color: var(--ink-3);
  font-weight: 500;
}

#oiPlanAmount:focus {
  border-color: var(--accent);

  box-shadow:
    0 0 0 3px color-mix(
      in srgb,
      var(--accent) 12%,
      transparent
    );
}


/* ============================================================
   ACTION BUTTONS
   ============================================================ */

.oi-action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.oi-plan-btn {
  height: 44px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  padding: 0 18px;

  border-radius: 10px;

  font-size: 13px;
  font-weight: 700;
}

.oi-plan-btn svg {
  width: 15px;
  height: 15px;
}

.oi-reset-btn {
  height: 44px;

  padding: 0 16px;

  border-radius: 10px;

  font-size: 13px;
  font-weight: 600;
}


/* ============================================================
   STATUS
   ============================================================ */

.oi-plan-card > .t20-status {
  margin: 0 20px 18px;
}


/* ============================================================
   SKELETON
   ============================================================ */

.oi-acct-skel {
  height: 15px;

  border-radius: 4px;

  background:
    linear-gradient(
      90deg,
      var(--line) 25%,
      var(--bg-tint) 50%,
      var(--line) 75%
    );

  background-size: 200% 100%;

  animation: oiSkelShine 1.2s ease-in-out infinite;
}

@keyframes oiSkelShine {

  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }

}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1000px) {

  .oi-plan-top {
    grid-template-columns: 1.5fr 1fr;
  }

  .oi-account-section {
    grid-column: 1 / -1;
  }

}


@media (max-width: 680px) {

  .oi-plan-top {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .oi-account-section {
    grid-column: auto;
  }

  .oi-plan-actions {
    flex-direction: column;
    align-items: stretch;

    padding: 14px 16px 16px;
  }

  .oi-amount-field {
    min-width: 0;
  }

  .oi-action-buttons {
    width: 100%;
  }

  .oi-plan-btn,
  .oi-reset-btn {
    flex: 1;
  }

}

/* Leftover-cash: now a container (summary + choice cards + manual panel),
   not a single-line banner. Base padding/border/radius on #oiPlanLeftover
   still applies from the earlier rule; this just restyles its children. */
.oi-leftover-summary{
  font-size:13px; font-weight:600; color:var(--ink-2);
}
.oi-leftover-summary span{ color:var(--accent); font-weight:800; }

.oi-leftover-choices{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(200px,1fr));
  gap:10px; margin-top:12px;
}
.oi-leftover-card{
  display:flex; align-items:flex-start; gap:10px;
  padding:12px 14px; border:1px solid var(--line); border-radius:10px;
  background:var(--bg); cursor:pointer;
  transition:border-color .15s ease, background .15s ease;
}
.oi-leftover-card:hover{ border-color:var(--accent); }
.oi-leftover-card.selected{ border-color:var(--accent); background:var(--bg-tint); }
.oi-leftover-card.disabled{ opacity:.5; cursor:not-allowed; }
.oi-leftover-card-radio{ font-size:14px; color:var(--accent); line-height:1.4; flex-shrink:0; }
.oi-leftover-card-title{ font-size:13px; font-weight:700; color:var(--ink-1,#fff); margin-bottom:3px; }
.oi-leftover-card-desc{ font-size:12px; color:var(--ink-3); line-height:1.4; }

#oiManualPanel{ margin-top:12px; padding-top:12px; border-top:1px solid var(--line); }
.oi-manual-budget{ font-size:12px; font-weight:600; color:var(--ink-2); margin-bottom:10px; }
.oi-manual-budget span{ color:var(--accent); font-weight:800; }
.oi-manual-rows{ display:flex; flex-direction:column; gap:8px; }
.oi-manual-row{
  display:flex; align-items:center; gap:12px;
  padding:8px 12px; background:var(--bg); border:1px solid var(--line); border-radius:8px;
}
.oi-manual-ticker{ font-size:13px; font-weight:700; color:var(--ink-1,#fff); flex:0 0 60px; }
.oi-manual-price{ font-size:12px; color:var(--ink-3); flex:1; }
.oi-manual-stepper{ display:flex; align-items:center; gap:8px; }
.oi-manual-stepper button{
  width:26px; height:26px; border-radius:6px; border:1px solid var(--line);
  background:var(--bg-soft); color:var(--ink-1,#fff); font-size:14px; font-weight:700;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
}
.oi-manual-stepper button:hover{ border-color:var(--accent); }
.oi-manual-qty{ min-width:18px; text-align:center; font-size:13px; font-weight:700; color:var(--ink-1,#fff); }


/* ============================================================
   ORDER INTELLIGENCE + T20 MODULE — CSS
   Path: ibkr/assets/css/order-intelligence.css
   Reuses app theme vars (--bg, --ink, --line, --pos, --neg, --r,
   --sans, --mono, --ease) already defined by gateway.css.
   ============================================================ */

/* ---- T20 tab bar ---- */
.t20-tabbar{
  display:flex; align-items:center; flex-wrap:wrap; gap:4px;
  margin-bottom:18px;
  border-bottom:1px solid var(--line);
}
.t20-tab{
  appearance:none; border:none; background:transparent; cursor:pointer;
  padding:12px 4px; margin-right:26px;
  font-family:var(--sans); font-size:15px; font-weight:700;
  color:var(--ink-3);
  border-bottom:2px solid transparent;
  transition:color .15s var(--ease), border-color .15s var(--ease);
}
.t20-tab:hover{ color:var(--ink-2); }
.t20-tab:focus{ outline:none; box-shadow:none; }
.t20-tab.active{ color:var(--ink); border-bottom-color:var(--accent, #6366f1); border-radius:6px 6px 0 0; }

.t20-panel{ margin-top:2px; }

.t20-filter-row{
  display:flex; flex-wrap:wrap; align-items:end; gap:14px;
  margin-bottom:16px;
}
.t20-filter-row .oi-field{ min-width:150px; }
.t20-btn-field{ min-width:0; }

.t20-status{ margin-bottom:14px; font-size:13px; }
.t20-status.t20-status-ok{ color:var(--pos); }
.t20-status.t20-status-err{ color:var(--neg); }
.t20-status.t20-status-loading{ color:var(--ink-3); }

.t20-validation-strip{
  padding:10px 14px; background:var(--bg-soft); border:1px solid var(--line);
  border-radius:var(--r); margin-bottom:14px; font-size:12px; color:var(--ink-3); line-height:1.5;
}

/* ---- generic T20 results table ---- */
#t20Table-daily, #t20Table-weekly, #t20Table-swing{
  width:100%; border-collapse:separate; border-spacing:0; overflow:hidden;
  border:1px solid var(--line); border-radius:var(--r); background:var(--bg);
}
#t20Table-daily thead th, #t20Table-weekly thead th, #t20Table-swing thead th{
  padding:12px 14px; background:var(--bg-soft); color:var(--ink-3);
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em;
  border-bottom:1px solid var(--line); white-space:nowrap; text-align:left;
}
#t20Table-daily tbody td, #t20Table-weekly tbody td, #t20Table-swing tbody td{
  padding:12px 14px; font-size:13px; color:var(--ink-2);
  border-bottom:1px solid var(--line); vertical-align:middle; white-space:nowrap;
}
#t20Table-daily tbody tr:last-child td, #t20Table-weekly tbody tr:last-child td, #t20Table-swing tbody tr:last-child td{ border-bottom:none; }
#t20Table-daily tbody tr:hover, #t20Table-weekly tbody tr:hover, #t20Table-swing tbody tr:hover{ background:var(--bg-tint); }
#t20Table-daily .oi-row-selected td, #t20Table-weekly .oi-row-selected td, #t20Table-swing .oi-row-selected td{ background:var(--bg-tint); }

.t20-ticker{ font-family:var(--mono); font-weight:700; color:var(--ink); letter-spacing:.02em; }
.t20-num{ font-family:var(--mono); text-align:right; }

@media (max-width:768px){
  #t20Table-daily, #t20Table-weekly, #t20Table-swing{ min-width:640px; }
  .t20-panel .table-wrap{ overflow-x:auto; }
}

/* ---- form fields (Version / Universe / Group / Mode / Date / Show) ---- */
.oi-field{ display:flex; flex-direction:column; gap:6px; }
.oi-field label{
  font-size:11px; font-weight:600; color:var(--ink-3);
  text-transform:uppercase; letter-spacing:.05em;
}
.oi-field select,
.oi-field input[type="date"],
.oi-field input[type="number"],
.oi-field input[type="text"]{
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--bg);
  color:var(--ink);
  font-size:13px;
  font-family:var(--sans);
  outline:none;
  min-width:140px;
  transition:border-color .15s, box-shadow .15s;
}
.oi-field select:focus,
.oi-field input[type="date"]:focus,
.oi-field input[type="number"]:focus,
.oi-field input[type="text"]:focus{
  border-color:var(--ink);
  box-shadow:0 0 0 3px rgba(59,130,246,0.15);
}
.oi-field select option{
  background:var(--bg);
  color:var(--ink);
}
.oi-field input[type="date"]::-webkit-calendar-picker-indicator{
  filter:invert(1);
  cursor:pointer;
  opacity:0.7;
}

.oi-row-selected td{ background:var(--bg-tint); }

.oi-rec-badge{
  display:inline-block; padding:3px 10px; border-radius:999px;
  font-size:11px; font-weight:700; letter-spacing:.03em;
}
.oi-rec-buy{ background:var(--pos-soft, rgba(16,185,129,.12)); color:var(--pos, #10b981); }
.oi-rec-sell{ background:var(--neg-soft, rgba(239,68,68,.12)); color:var(--neg, #ef4444); }
.oi-rec-hold{ background:var(--bg-tint); color:var(--ink-3); }

/* ---- order plan (Order Intelligence page) ---- */
.oi-header{ display:flex; align-items:flex-start; justify-content:space-between; gap:14px; flex-wrap:wrap; }
.oi-header-actions{ display:flex; gap:8px; flex-wrap:wrap; }
.oi-qty-input{
  width:72px; padding:6px 8px; border:1px solid var(--line);
  border-radius:6px; background:var(--bg); color:var(--ink);
  font-family:var(--mono); font-size:13px;
}
.oi-order-status{ font-size:12px; color:var(--ink-3); }
.oi-plan-total{ margin-top:12px; text-align:right; font-size:14px; font-weight:700; color:var(--ink); }
.oi-plan-total span{ font-family:var(--mono); }

/* ============================================================
   "N selected" — sits inline on the T20 tab bar line, right side.
   NOT position:fixed — flows with the tabbar, pushed right via
   margin-left:auto since .t20-tabbar is display:flex.
   ============================================================ */
.oi-fab {
  position: fixed;
  top: 150px;
  right: 20px;
  display: none;
  align-items: center;
  gap: 10px;

  padding: 4px 4px 4px 14px;
  border-radius: 999px;

  background: var(--bg-soft);
  border: 1px solid var(--line);

  font-family: var(--sans);
  font-size: 13px;
  white-space: nowrap;

  z-index: 9999;
}

.oi-fab.is-fixed {
  position: fixed;
  top: 16px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
}
.oi-fab.show{
  display:inline-flex;
  animation:oiFabIn .18s ease;
}
@keyframes oiFabIn{
  from{ opacity:0; transform:translateY(-4px); }
  to{ opacity:1; transform:translateY(0); }
}
.oi-fab-count{
  font-weight:800;
  font-family:var(--mono);
  color:var(--ink);
  min-width:16px;
  text-align:center;
}
.oi-fab-label{
  color:var(--ink-3);
}
.oi-fab-view{
  padding:7px 16px !important;
  border-radius:999px !important;
  font-weight:500;
  white-space:nowrap;
  flex-shrink:0;
}

@media (max-width:640px){
  .oi-fab{ padding:4px 4px 4px 10px; font-size:12px; }
  .oi-fab-label{ display:none; }
}