:root{
  --bg: #071126;
  --panel-grad: linear-gradient(180deg,#071126,#0b1522);
  --muted: #9aa4b2;
  --accent: #2dd4bf;
  --accent2: #60a5fa;
  --glass: rgba(255,255,255,0.03);
  --card: #081226;
  --success:#10b981;
  --danger:#ef4444;
  --text: #e6eef6;
  --input-bg: rgba(255,255,255,0.02);
  --input-border: rgba(255,255,255,0.04);
  --radius: 12px;
  --shadow-strong: 0 12px 48px rgba(2,6,23,0.6);
  --shadow-soft: 0 6px 28px rgba(3,7,18,0.5);

  --btn-fore: #ffffff;
  --btn-bg-1: linear-gradient(180deg,var(--accent),var(--accent2));
  --btn-ghost-fore: var(--muted);
}

/* Light theme overrides */
.light-theme {
  --bg: #f6f8fb;
  --panel-grad: linear-gradient(180deg,#ffffff,#f7f9fc);
  --muted: #556076;
  --accent: #0ea5a5;
  --accent2: #2563eb;
  --glass: rgba(0,0,0,0.03);
  --card: #ffffff;
  --success:#059669;
  --danger:#dc2626;
  --text: #061028;
  --input-bg: rgba(2,6,23,0.03);
  --input-border: rgba(2,6,23,0.06);
  --shadow-strong: 0 10px 30px rgba(16,24,40,0.06);
  --shadow-soft: 0 6px 18px rgba(16,24,40,0.04);

  --btn-fore: #021428;
  --btn-bg-1: linear-gradient(180deg,#7ee8d8,#3b82f6);
  --btn-ghost-fore: #556076;
}

.light-theme select {
  background-color: #ffffff !important;
  color: #061028 !important;
  border: 1px solid #cbd5e1;
}

.light-theme select option {
  background-color: #ffffff !important;
  color: #061028 !important;
}

.light-theme select option:hover,
.light-theme select option:checked {
  background-color: #2563eb !important;
  color: #ffffff !important;
}

/* ---------- Reset + base ---------- */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Fira Mono", monospace;
  background: radial-gradient(1200px 400px at 10% 10%, rgba(36,58,84,0.12), transparent), var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  padding:18px;
  transition: background .18s ease, color .18s ease;
}
/* ----- Kite redirect instruction banner ----- */
.kite-instr {
  box-sizing: border-box;
  margin: 10px auto 18px;
  max-width: 1200px;
  padding: 10px 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255,250,240,1), rgba(245,249,255,1));
  border: 1px solid rgba(0,0,0,0.06);
  display:flex;
  gap:12px;
  align-items:center;
  font-size:14px;
  color: #0b1220;
  z-index: 9999;
}
.kite-instr code { background: #f3f4f6; padding:4px 6px; border-radius:4px; font-family: monospace; }
.kite-instr .kite-instr-actions { margin-left:auto; display:flex; gap:8px; align-items:center; }
.kite-instr .btn.dismiss-instr { padding:6px 10px; border-radius:6px; cursor:pointer; border:1px solid rgba(0,0,0,0.06); background:transparent; color:#0b1220; }
.kite-instr .btn.copy-link { padding:6px 10px; border-radius:6px; cursor:pointer; border:1px solid rgba(0,0,0,0.06); background:#eef2ff; color:#0b1220; font-weight:700; }
@media (max-width:700px) {
  .kite-instr { font-size:13px; padding:8px; flex-direction:column; align-items:flex-start; gap:8px; }
  .kite-instr .kite-instr-actions { width:100%; justify-content:space-between; }
}


/* ---------- Top bar / header ---------- */
.topbar{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  max-width:1200px;
  margin:0 auto 18px;
}
.brand { display:flex; gap:12px; align-items:center; }
.logo {
  width:44px;height:44px;border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,var(--accent2),var(--accent));
  font-weight:800;color:#021428;font-size:18px;
  box-shadow: var(--shadow-soft);
}
.brand-title{font-weight:700;font-size:18px;color:var(--text);line-height:1}
.brand-sub{font-size:12px;color:var(--muted)}

.top-actions{display:flex;gap:10px;align-items:center}
.btn{
  display:inline-flex;align-items:center;gap:8px;
  background:var(--btn-bg-1);
  color:var(--btn-fore);
  padding:10px 14px;border-radius:10px;font-weight:700;border:0;cursor:pointer;
  box-shadow: var(--shadow-soft);
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s;
}
.btn.ghost{
  background:transparent;border:1px solid rgba(255,255,255,0.05);color:var(--btn-ghost-fore);box-shadow:none;
}
.btn:focus{outline:none; box-shadow: 0 4px 18px rgba(0,0,0,0.12)}
.btn:hover{transform:translateY(-3px);opacity:.98}
.home-btn{background:transparent;border:0;color:var(--muted);font-weight:600; cursor:pointer; padding:6px 10px}
.home-btn:hover{color:var(--accent2); transform:translateX(-6px)}
/* Colorful Add Row button */
.btn.add-row {
  background: linear-gradient(90deg,#22c55e,#16a34a);
  color: #ffffff;
  border: 0;
}

.btn.add-row:hover {
  opacity: 0.95;
}

/* Tabs (Orders / Holdings) */
.tabbar .btn { border-radius:10px; padding:8px 12px; font-weight:700; }
.tabbar .btn.active {
  background: linear-gradient(90deg, #60a5fa, #3b82f6);
  color: #fff;
  border: 0;
  box-shadow: 0 8px 24px rgba(59,130,246,0.18);
}
#holdingsTable thead th { text-align:left; padding:8px 6px; color: var(--muted); font-weight:700; }
#holdingsTable tbody td { font-size:13px; color: var(--text); }

/* ---------- Layout ---------- */
/* make right column narrower so left inputs are fully visible */
.content{
  max-width:1200px;margin:0 auto;display:grid;grid-template-columns: 1fr 300px;gap:18px;
}
@media (max-width:980px){ .content{grid-template-columns:1fr; padding: 0 6px;} }

/* panels */
.panel{
  background: var(--panel-grad);
  border-radius:var(--radius);
  padding:18px;
  box-shadow: var(--shadow-strong);
  border:1px solid rgba(255,255,255,0.03);
  overflow: visible; /* important so dropdowns can overflow */
}
.panel h1{margin:0 0 10px;font-size:20px}
.panel p{margin:0 0 16px;color:var(--muted);font-size:13px}

/* status row */
.status-row{display:flex;align-items:center;gap:12px;margin-bottom:14px}
.badge{padding:8px 12px;border-radius:999px;font-weight:700;font-size:13px;background:transparent;color:var(--muted);border:1px solid rgba(255,255,255,0.03)}
.badge.ok{background: linear-gradient(90deg, rgba(16,185,129,0.12), rgba(45,212,191,0.06)); color:var(--success); border-color: rgba(16,185,129,0.12) }
.badge.err{background: linear-gradient(90deg, rgba(239,68,68,0.06), rgba(255,255,255,0.02)); color:var(--danger); border-color: rgba(239,68,68,0.08) }

/* order table form: tune columns to show selects properly */
table{width:100%; border-collapse:collapse; margin-bottom:12px}
th, td{padding:10px 8px;text-align:left; vertical-align:middle; font-size:14px; color:var(--text)}
thead th{color:var(--muted); font-weight:700; font-size:13px}
tbody tr{border-radius:8px}

/* explicit column width balance so selects don't overlap */
th.symbol { width: 34%; }
th.qty { width: 8%; text-align:center; }
th.price { width: 12%; text-align:center; }
th.otype { width: 12%; text-align:center; }
th.exchange { width: 8%; text-align:center; }
th.product { width: 10%; text-align:center; }
th.session { width: 10%; text-align:center; }
th.dryrun { width: 6%; text-align:center; }

input[type="text"], input, select {
  width:100%; padding:10px 12px; background:var(--input-bg); border:1px solid var(--input-border);
  color:var(--text); border-radius:8px; outline:none; font-size:14px;
}
/* make select box more spacious and pill-like */
select {
  padding:10px 14px;
  border-radius:10px;
  min-width:90px;

  background-color: #0b1b2b !important;
  color: #e6f0ff !important;
  border: 1px solid rgba(255,255,255,0.15);

  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.25) 50%),
    linear-gradient(135deg, rgba(255,255,255,0.25) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(1em + 2px),
    calc(100% - 13px) calc(1em + 2px);
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

input::placeholder{color:rgba(230,238,246,0.35)}
input:focus, select:focus{box-shadow:0 8px 30px rgba(10,30,40,0.08); border-color: rgba(96,165,250,0.18) }
/* ===== FIX: dropdown option visibility (dark theme) ===== */
select option {
  background-color: #0b1b2b !important;
  color: #e6f0ff !important;
}

select option:hover,
select option:checked {
  background-color: #2563eb !important;
  color: #ffffff !important;
}


/* controls */
.controls{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:6px}
.controls .btn{padding:10px 16px;border-radius:10px;font-size:14px}
.controls .btn.secondary{background:linear-gradient(90deg,#60a5fa,#2563eb); color:#052033}

#scheduleInput{width:170px;padding:10px;border-radius:8px;background:var(--input-bg);border:1px solid var(--input-border); color:var(--text)}
/* FORCE schedule text visible in light theme */
.light-theme #scheduleInput {
  color: #000000 !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1;
}

#scheduleFrom, #scheduleTo, #scheduleInput {
  display: inline-block;
  vertical-align: middle;
  margin-left:6px;
  padding:10px 12px;
  border-radius:8px;
}


/* Also fix placeholder visibility */
.light-theme #scheduleInput::placeholder {
  color: #64748b;
}

/* Light theme fix for schedule input visibility */
.light-theme #scheduleInput {
  color: #000000 !important;
  background: #ffffff !important;
  border: 1px solid rgba(0,0,0,0.15);
}

/* Colorful Schedule button */
.btn.schedule-btn {
  background: linear-gradient(90deg,#a855f7,#6366f1);
  color: #ffffff;
  border: 0;
}

.btn.schedule-btn:hover {
  opacity: 0.95;
}

/* right panel — log (terminal) */
.log-panel{display:flex;flex-direction:column;height:calc(100% - 4px); min-height:420px;}
.log-header{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-radius:10px 10px 0 0;background:transparent;border-bottom:1px solid rgba(255,255,255,0.02)}
.log-body{
  background: linear-gradient(180deg, rgba(0,0,0,0.7), rgba(0,0,0,0.5));
  padding:14px;border-radius:0 0 10px 10px;margin-top:-1px;flex:1; overflow:auto; font-family:"Fira Mono", monospace;
  font-size:13px; color:#cfeef5; box-shadow: inset 0 2px 12px rgba(0,0,0,0.4);
}
#log{white-space:pre-wrap; min-height:320px; line-height:1.45; color: var(--text) }

/* ---------- EXCEL-LIKE AUTOCOMPLETE overlay ---------- */
/* container */
.autocomplete-list {
  position: absolute;
  z-index: 2147483647; /* max to avoid being clipped */
  width: 360px;
  max-height: 420px;
  overflow: hidden;
  background: linear-gradient(180deg, #02202a, #041829);
  border-radius:8px;
  padding:8px;
  border:1px solid rgba(255,255,255,0.06);
  box-shadow: 0 20px 60px rgba(2,6,23,0.95);
  display:flex;
  flex-direction:column;
}

/* search box inside dropdown */
.autocomplete-search {
  display:flex; gap:8px; align-items:center; padding:6px;
  border-bottom:1px solid rgba(255,255,255,0.03);
}
.autocomplete-search input {
  flex:1; padding:8px 10px; border-radius:6px; border:1px solid rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.02); color:var(--text);
}

/* list area */
.autocomplete-items {
  overflow-y:auto; padding:6px; display:flex; flex-direction:column; gap:6px;
  max-height: calc(100% - 110px);
}

/* each item row shows checkbox + label (excel-like) */
.ac-item {
  display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:6px;
  cursor:pointer; background: rgba(255,255,255,0.01); color:var(--text);
}
.ac-item:hover { background: rgba(255,255,255,0.03); transform:translateX(6px); }
.ac-item .label { font-weight:700; color:var(--accent2); flex:1; font-size:13px; }
.ac-item .meta { font-size:12px; color:var(--muted); margin-left:8px; }

/* footer buttons (OK/Cancel) — optional, kept for Excel parity */
.autocomplete-footer {
  display:flex; justify-content:flex-end; gap:8px; padding-top:8px; border-top:1px solid rgba(255,255,255,0.03);
}
.autocomplete-footer .btn { padding:8px 12px; font-size:13px; border-radius:8px; }

/* ensure input containers are relative so dropdown positions correctly */
tbody td { position: relative; z-index: 1; }

/* allow dropdown to fully overlay page content (no clipping) */
html, body, .content { overflow: visible; }

/* subtle scrollbars */
.autocomplete-items::-webkit-scrollbar, .log-body::-webkit-scrollbar { width:10px; }
.autocomplete-items::-webkit-scrollbar-thumb, .log-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius:8px; border: 2px solid transparent; background-clip: padding-box; }

/* smaller tweaks */
.muted{color:var(--muted);font-size:13px}
.small{font-size:12px;color:var(--muted)}
.panel-footer{display:flex;justify-content:space-between;align-items:center;margin-top:10px}
.hint{background:var(--glass);padding:8px;border-radius:8px;color:var(--muted);font-size:12px}
.popup-suggestion {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius:10px;padding:8px;border:1px solid rgba(255,255,255,0.03);
  color:var(--text);font-size:13px;
}

/* responsive */
@media (max-width:980px){
  .content{grid-template-columns:1fr}
  .log-panel{order:2}
  .autocomplete-list{ width: calc(100% - 40px); left: 20px !important; }
}

/* =========================
   MOBILE LAYOUT PATCH
   Append this to the end of terminal.css
   ========================= */

/* 1) Safe-area + sticky header so top buttons don't get clipped on iPhone notch/Android status bar */
.topbar{
  position: sticky;
  top: calc(env(safe-area-inset-top, 6px));
  z-index: 9999;
  padding-top: calc(env(safe-area-inset-top, 6px));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* Ensure page respects safe area insets (only overriding padding top/bottom safely) */
body{
  padding-top: calc(env(safe-area-inset-top, 18px));
  padding-bottom: calc(env(safe-area-inset-bottom, 18px));
}

/* 2) Make the panel "give room" for keyboard/suggestions on small screens.
   This uses :focus-within to add bottom-padding when any input inside panel is focused.
   Only active on small devices to avoid breaking desktop spacing.
*/
@media (max-width:800px){
  .panel:focus-within{
    padding-bottom: 320px !important;
    transition: padding .14s ease;
  }
}

/* 3) Force autocomplete suggestions into a fixed bottom overlay (above keyboard).
   This will make the suggestions visible even when the on-screen keyboard is open.
*/
.autocomplete-list{
  position: fixed !important;
  left: 12px !important;
  right: 12px !important;
  bottom: calc(env(safe-area-inset-bottom,12px) + 12px) !important;
  z-index: 2147483647 !important;
  width: calc(100% - 24px) !important;
  max-height: 52vh !important;
  overflow: auto !important;
  -webkit-overflow-scrolling: touch;
  pointer-events: auto;
  box-sizing: border-box;
}

/* When panel is focused, nudge suggestions higher so keyboard doesn't overlap them */
@media (max-width:800px){
  .panel:focus-within + .autocomplete-list,
  .panel:focus-within .autocomplete-list,
  .panel:focus-within ~ .autocomplete-list {
    bottom: calc(env(safe-area-inset-bottom,12px) + 220px) !important;
    max-height: 38vh !important;
  }
}

/* 4) IMPORTANT: do NOT hide table headers or collapse columns.
   If your earlier CSS hid thead on tiny screens, override that and enable horizontal scroll.
*/
@media (max-width:420px){
  /* let table be horizontally scrollable rather than converting to stacked rows (keeps columns like dryrun visible) */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  /* restore header display in case another rule set it to display:none */
  table thead { display: table-header-group !important; }

  /* keep rows and cells behaving like table cells (not stacked) */
  tbody tr { display: table-row !important; }
  tbody td { display: table-cell !important; padding: 8px 10px !important; vertical-align: middle; white-space: nowrap; }

  /* reduce padding to better fit narrow screens */
  .panel{ padding-left: 12px; padding-right: 12px; }
}

/* 5) Small tweaks so inputs/selects stay visible in stacking contexts */
@media (max-width:600px){
  .autocomplete-list{ left:8px !important; right:8px !important; width: calc(100% - 16px) !important; }
  .controls .btn{ width:100%; box-sizing:border-box; }
}

/* 6) Ensure important interactive elements appear over overlays (keyboard suggestions etc) */
.topbar, .panel, .autocomplete-list, tbody td, input, select {
  z-index: 10000;
  position: relative;
}

/* 7) Optional helper JS-integrations:
   If you add small JS that toggles `document.documentElement.classList.add('keyboard-open')`
   when input focus is detected, this rule will also push the autocomplete up:
*/
.keyboard-open .autocomplete-list{
  bottom: calc(env(safe-area-inset-bottom,12px) + 220px) !important;
}

/* 8) Safety: ensure autocomplete never exceeds viewport width when inline style is applied */
.autocomplete-list[style] { max-width: calc(100vw - 28px) !important; box-sizing: border-box; }

/* End mobile layout patch */
.row-actions { display:flex; gap:10px; align-items:center; }
.btn.danger {
  background: linear-gradient(90deg,#ef4444,#dc2626);
  color: #fff;
  border: 0;
  padding:10px 14px;
  border-radius:10px;
}
.btn.danger:hover { opacity:0.95; transform:none; }

/* ===== LEFT COLUMN WRAPPER: ensure Orders + Holdings stack in same grid cell ===== */
.left-column {
  display: flex;
  flex-direction: column;
  gap: 18px;              /* spacing between Orders and Holdings panels */
  width: 100%;
  box-sizing: border-box;
}

/* Make sure the tabbar stays horizontal and not a tall vertical pill */
.tabbar {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

/* Keep each panel inside left-column full width */
.left-column .panel {
  width: 100%;
  box-sizing: border-box;
}

/* Make holdings panel height limited so it doesn't push layout weirdly */
#holdingsPanel {
  max-height: 420px;
  overflow: auto;
}

/* Responsive tweaks */
@media (max-width:980px){
  .left-column { gap: 12px; }
  #holdingsPanel { max-height: none; }
}/* ============================
   MOBILE ORDERS-ONLY PATCH
   Append to end of terminal.css
   (Targets common orders panel selectors; does NOT affect #holdingsTable or scheduled tables)
   ============================ */

@media (max-width: 420px) {

  /* ---------- SELECTORS: orders-only (try to match common names) ---------- */
  /* If your actual orders wrapper/class is different, add it to this comma list */
  /* Examples checked: #ordersPanel, .orders-panel, .orders-table, .orders, first .panel in .left-column */
  #ordersPanel table,
  .orders-panel table,
  .orders-table table,
  .orders table,
  .left-column .panel.orders table,
  .left-column .panel:nth-of-type(1) table
  {
    display: block !important;
    width: 100% !important;
    overflow: visible !important;
    -webkit-overflow-scrolling: touch;
    white-space: normal;
  }

  /* Be absolutely sure we DO NOT affect the holdings or scheduled tables */
  /* If your holdings table has an id/class other than #holdingsTable, add it to the list below */
  #holdingsTable,
  .holdings-table,
  .scheduled-table,
  #scheduleTable { display: table !important; }

  /* Hide the desktop header for orders table and convert each row into a card */
  #ordersPanel thead,
  .orders-panel thead,
  .orders-table thead,
  .orders thead,
  .left-column .panel.orders thead,
  .left-column .panel:nth-of-type(1) thead {
    display: none !important;
  }

  /* Stacked card container for each order row */
  #ordersPanel tbody,
  .orders-panel tbody,
  .orders-table tbody,
  .orders tbody,
  .left-column .panel.orders tbody,
  .left-column .panel:nth-of-type(1) tbody {
    display: block !important;
    width: 100% !important;
  }

  #ordersPanel tbody tr,
  .orders-panel tbody tr,
  .orders-table tbody tr,
  .orders tbody tr,
  .left-column .panel.orders tbody tr,
  .left-column .panel:nth-of-type(1) tbody tr {
    display: block !important;
    width: 100% !important;
    margin: 10px 0 !important;
    padding: 10px !important;
    border-radius: 12px !important;
    background: linear-gradient(180deg, rgba(255,255,255,0.015), rgba(0,0,0,0.02));
    border: 1px solid rgba(255,255,255,0.02);
    box-shadow: var(--shadow-soft);
    box-sizing: border-box !important;
  }

  /* Each TD becomes a labelled row inside the card */
  #ordersPanel tbody td,
  .orders-panel tbody td,
  .orders-table tbody td,
  .orders tbody td,
  .left-column .panel.orders tbody td,
  .left-column .panel:nth-of-type(1) tbody td {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 8px 10px !important;
    gap: 8px;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
  }

  /* Insert small labels before each value (maps columns by nth-child) */
  #ordersPanel tbody td::before,
  .orders-panel tbody td::before,
  .orders-table tbody td::before,
  .orders tbody td::before,
  .left-column .panel.orders tbody td::before,
  .left-column .panel:nth-of-type(1) tbody td::before {
    content: "";
    display: block;
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
    flex: 0 0 38%;
    max-width: 38%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Adjust these nth-child mappings if your Orders table columns are in a different order */
  /* Default mapping: 1=Symbol, 2=Qty, 3=Price, 4=OrderType, 5=Exchange, 6=Product, 7=Session, 8=DryRun */
  #ordersPanel tbody tr td:nth-child(1)::before,
  .orders-panel tbody tr td:nth-child(1)::before,
  .orders-table tbody tr td:nth-child(1)::before,
  .orders tbody tr td:nth-child(1)::before,
  .left-column .panel.orders tbody tr td:nth-child(1)::before,
  .left-column .panel:nth-of-type(1) tbody tr td:nth-child(1)::before { content: "Symbol"; }

  #ordersPanel tbody tr td:nth-child(2)::before,
  .orders-panel tbody tr td:nth-child(2)::before,
  .orders-table tbody tr td:nth-child(2)::before,
  .orders tbody tr td:nth-child(2)::before,
  .left-column .panel.orders tbody tr td:nth-child(2)::before,
  .left-column .panel:nth-of-type(1) tbody tr td:nth-child(2)::before { content: "Qty"; }

  #ordersPanel tbody tr td:nth-child(3)::before,
  .orders-panel tbody tr td:nth-child(3)::before,
  .orders-table tbody tr td:nth-child(3)::before,
  .orders tbody tr td:nth-child(3)::before,
  .left-column .panel.orders tbody tr td:nth-child(3)::before,
  .left-column .panel:nth-of-type(1) tbody tr td:nth-child(3)::before { content: "Price"; }

  #ordersPanel tbody tr td:nth-child(4)::before,
  .orders-panel tbody tr td:nth-child(4)::before,
  .orders-table tbody tr td:nth-child(4)::before,
  .orders tbody tr td:nth-child(4)::before,
  .left-column .panel.orders tbody tr td:nth-child(4)::before,
  .left-column .panel:nth-of-type(1) tbody tr td:nth-child(4)::before { content: "Order Type"; }

  #ordersPanel tbody tr td:nth-child(5)::before,
  .orders-panel tbody tr td:nth-child(5)::before,
  .orders-table tbody tr td:nth-child(5)::before,
  .orders tbody tr td:nth-child(5)::before,
  .left-column .panel.orders tbody tr td:nth-child(5)::before,
  .left-column .panel:nth-of-type(1) tbody tr td:nth-child(5)::before { content: "Exchange"; }

  #ordersPanel tbody tr td:nth-child(6)::before,
  .orders-panel tbody tr td:nth-child(6)::before,
  .orders-table tbody tr td:nth-child(6)::before,
  .orders tbody tr td:nth-child(6)::before,
  .left-column .panel.orders tbody tr td:nth-child(6)::before,
  .left-column .panel:nth-of-type(1) tbody tr td:nth-child(6)::before { content: "Product"; }

  #ordersPanel tbody tr td:nth-child(7)::before,
  .orders-panel tbody tr td:nth-child(7)::before,
  .orders-table tbody tr td:nth-child(7)::before,
  .orders tbody tr td:nth-child(7)::before,
  .left-column .panel.orders tbody tr td:nth-child(7)::before,
  .left-column .panel:nth-of-type(1) tbody tr td:nth-child(7)::before { content: "Session"; }

  #ordersPanel tbody tr td:nth-child(8)::before,
  .orders-panel tbody tr td:nth-child(8)::before,
  .orders-table tbody tr td:nth-child(8)::before,
  .orders tbody tr td:nth-child(8)::before,
  .left-column .panel.orders tbody tr td:nth-child(8)::before,
  .left-column .panel:nth-of-type(1) tbody tr td:nth-child(8)::before { content: "Dry Run"; }

  /* make inputs/selects take the remaining space and be touch-friendly */
  #ordersPanel tbody td > *,
  .orders-panel tbody td > *,
  .orders-table tbody td > *,
  .orders tbody td > *,
  .left-column .panel.orders tbody td > *,
  .left-column .panel:nth-of-type(1) tbody td > * {
    flex: 1 1 auto !important;
    margin-left: 10px !important;
    min-width: 0 !important; /* allow truncation */
  }

  /* full-width inputs/selects with slightly larger touch target */
  #ordersPanel input[type="text"],
  .orders-panel input[type="text"],
  .orders-table input[type="text"],
  #ordersPanel input,
  .orders-panel input,
  .orders-table input,
  #ordersPanel select,
  .orders-panel select,
  .orders-table select {
    width: 100% !important;
    padding: 10px 12px !important;
    font-size: 15px !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
  }

  /* ensure symbol label truncates but remains strong */
  #ordersPanel tbody td:nth-child(1) input,
  .orders-panel tbody td:nth-child(1) input,
  .orders-table tbody td:nth-child(1) input {
    font-weight: 700;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* action buttons (if present as row-actions) — stack nicely */
  #ordersPanel .row-actions,
  .orders-panel .row-actions,
  .orders-table .row-actions,
  .orders .row-actions,
  .left-column .panel.orders .row-actions,
  .left-column .panel:nth-of-type(1) .row-actions {
    display: flex !important;
    gap: 8px !important;
    margin-top: 8px !important;
    flex-wrap: wrap !important;
  }
  #ordersPanel .row-actions .btn,
  .orders-panel .row-actions .btn,
  .orders-table .row-actions .btn {
    flex: 1 1 48% !important;
    padding: 10px !important;
    font-size: 14px !important;
  }

  /* keep autocomplete suggestions fixed above keyboard for orders inputs */
  #ordersPanel .autocomplete-list,
  .orders-panel .autocomplete-list,
  .orders-table .autocomplete-list {
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    bottom: calc(env(safe-area-inset-bottom,12px) + 12px) !important;
    width: calc(100% - 16px) !important;
    max-height: 45vh !important;
    z-index: 2147483647 !important;
  }

  /* high z-index for inputs so keyboard/suggestions don't hide them */
  #ordersPanel, .orders-panel, .orders-table, .left-column .panel.orders, .left-column .panel:nth-of-type(1) {
    z-index: 10001 !important;
    position: relative !important;
  }

  /* slightly larger default text on small devices */
  #ordersPanel, .orders-panel, .orders-table { font-size: 15px !important; }

}

/* ============================
   End Orders-only mobile patch
   ============================ */

