:root{
  --bg:#f4f6f8;
  --card:#ffffff;
  --ink:#0b2239;
  --muted:#6b7a8a;
  --teal:#0f8b8d;
  --teal2:#0b6f70;
  --line:#e5e9ef;
  --soft:#f2f7f7;
  --shadow: 0 10px 30px rgba(20,40,60,0.10);
  --radius: 14px;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:var(--bg);
  color:var(--ink);
}

.topbar{
  height:50px;
  position: sticky;
top: 0;
z-index: 100000;
  background: linear-gradient(90deg, #0c6f70, #12979a);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 16px;
}

.brand{font-weight:700; letter-spacing:0.3px;}

.top-controls{
  display:flex;
  gap:14px;
  align-items:end;
}

.control .label{
  font-size:12px;
  opacity:.9;
  margin-bottom:2px;
  text-align:center;
}


select, button{
  font:inherit;
}
.top-controls select,
.top-controls button{
  font-size:12px;
  padding:3px 8px;
  height:26px;
}

select{
  padding:8px 10px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.14);
  color:#fff;
  outline:none;
}

select option{color:#000}

.btn{
  border:0;
  padding:9px 12px;
  border-radius:10px;
  cursor:pointer;
  box-shadow: 0 6px 14px rgba(0,0,0,.12);
}

.btn-primary{
  background:#0b2e3a;
  color:#fff;
}
#loadBtn{
  display:none;
}

.btn-soft{
  background: rgba(255,255,255,0.18);
  color:#fff;
  border:1px solid rgba(255,255,255,0.25);
  box-shadow:none;
}

.btn-danger{
  background:#e74c3c;
  color:#fff;
}

.subbar{
  display: flex;
  align-items: center;
  justify-content: center;
width: 100%;
max-width: 1100px;
margin: 0 auto;
  gap: 12px;
  padding: 4px 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.left-chips,
.right-chips{
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.right-chips{
  margin-left: 0;
}

.center-chip{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  flex:0 0 auto;
  min-width:0;
  max-width:none;
}

.center-chip > div:first-of-type{
  order: 2;
  margin-left: 0;
}

.center-chip .sim-dt{
  order: 1;
  margin-right: 0;
}

.center-chip span:first-child{
  display: none;
}

#spotVal{
  display: inline-block;
  font-weight: 700;
  color: #0b2e3a;
  margin-left: 6px;
}

.chip{
  border: 1px solid var(--line);
  background: #fff;
  padding: 3px 6px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  line-height: 1.2;
}

.layout{
  display:grid;
  grid-template-columns: 2fr 3fr;
  gap:14px;
  padding:14px;
}

.panel{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:6px 12px 12px 12px;
  min-height:520px;
}

.panel-title{
  font-weight:700;
  margin-bottom:4px;
  margin-top:-4px;
}

.panel-title-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:2px;
}

.panel-meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  font-size:12px;
  color:var(--muted);
  margin-bottom:10px;
}
/* =========================
   Expiry Strip (StockMock style)
   ========================= */
.expiry-strip{
  display:flex;
  gap:10px;
  flex-wrap: nowrap;      /* IMPORTANT: no wrap */
  overflow-x:auto;        /* horizontal scroll */
  overflow-y:hidden;
  white-space:nowrap;
  padding: 6px 2px;
  flex: 1;
}

.expiry-pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
  color: #17324a;
  cursor: pointer;
  user-select: none;
}

.expiry-pill.active{
  background: #e8f7f7;
  border-color: #bfe6e7;
  color: #0b6f70;
  font-weight: 800;
}

.expiry-pill .dte{
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.chain{
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}

.chain th, .chain td{
  border-top:1px solid var(--line);
  padding:8px 6px;
}

.chain thead th{
  text-align:center;
}

.chain th:nth-child(3), .chain td:nth-child(3){
  text-align:center;
  font-weight:700;
}

.chain thead tr:first-child th{
  border-top:0;
  color:var(--muted);
  background: #fafcfd;
}

.chain thead tr:last-child th{
  color:var(--muted);
  background:#fff;
}

.atm-row td{
  background:#f0fbfb !important;
}

.chain thead tr:first-child th:nth-child(1){
  text-align: center;
  position: static;
  left: auto;
}

.chain thead tr:first-child th:nth-child(2){
  text-align: center;
  position: static;
  left: auto;
}

.chain thead tr:first-child th:nth-child(3){
  text-align: center;
  position: static;
  left: auto;
}

.seg{
  display:flex;
  gap:8px;
}
.seg-btn{
  border:1px solid var(--line);
  background:#fff;
  padding:6px 10px;
  border-radius:999px;
  cursor:pointer;
}
.seg-btn.active{
  background:#e8f7f7;
  border-color:#bfe6e7;
  color:#0b6f70;
  font-weight:700;
}

.strategies{
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap:10px;
}

.strategy{
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px;
  background: linear-gradient(180deg, #f7fbfb, #fff);
  font-size:12px;
  font-weight:600;
  color:#1b2b3a;
}

.chartbox{
  width: 100%;
  height: clamp(240px, 28vh, 520px);
  border:none;
  border-radius:0;
  background:transparent;
  padding:0;
}

.positions table{
  width:100%;
  border-collapse:collapse;
  margin-top:6px;
  font-size:12px;
}

.positions th, .positions td{
  border-top:1px solid var(--line);
  padding:10px 8px;
  text-align:left;
  color:var(--muted);
}

.posbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding-top:10px;
}

.pos-left, .pos-right{
  display:flex;
  gap:10px;
  align-items:center;
  color:var(--muted);
  font-size:12px;
}

.mini{
  border:1px solid var(--line);
  background:#fff;
  border-radius:8px;
  padding:4px 8px;
  cursor:pointer;
}
.mini-pill{
  border:1px solid var(--line);
  background:#fff;
  border-radius:10px;
  padding:4px 10px;
  color:#1b2b3a;
  font-weight:700;
}

/* Datepicker */
.datepicker{
  position:absolute;
  margin-top:8px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow: var(--shadow);
  width:300px;
  padding:4px 6px;
  font-size:12px;
  line-height:1.1;
  z-index:9999;
}
/* StockMock-like Datepicker UI (safe: works with table or div grid) */
.datepicker{
  overflow: hidden;          /* rounded corners clean */
}

/* header/nav area (works if you have buttons/selects on top) */
.datepicker .dp-head,
.datepicker .head,
.datepicker .header,
.datepicker .top,
.datepicker .row:first-child{
  background: rgba(18,151,154,0.12);
  border-radius: 10px;
  padding: 6px 8px;
  margin-bottom: 8px;
}

/* general controls inside datepicker */
.datepicker button,
.datepicker select{
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 10px;
}

/* ===== TABLE-based calendar support ===== */
.datepicker table{
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.datepicker thead th{
  font-size: 12px;
  font-weight: 700;
  color: #0b2e3a;
  opacity: .75;
  padding: 4px 0;
  text-align: center;
}


.datepicker td{
  text-align: center;
  padding: 0;
}

.datepicker td button,
.datepicker td a,
.datepicker td div{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border-radius: 10px;
  margin: 2px auto;
  font-weight: 600;
}

/* hover */
.datepicker td button:hover,
.datepicker td a:hover,
.datepicker td div:hover{
  background: rgba(18,151,154,0.15);
}

/* selected day (common class names) */
.datepicker .selected,
.datepicker .active,
.datepicker .is-selected,
.datepicker td.selected button,
.datepicker td.active button{
  background: rgba(18,151,154,0.95);
  color: #fff;
}

/* disabled/outside month (common patterns) */
.datepicker .muted,
.datepicker .disabled,
.datepicker .off,
.datepicker td.disabled,
.datepicker td.off{
  opacity: .35;
  pointer-events: none;
}

/* ===== DIV-grid calendar support (if days are divs/spans) ===== */
.datepicker .grid,
.datepicker .days,
.datepicker .cal-grid{
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.datepicker .dow,
.datepicker .weekday{
  font-size: 12px;
  font-weight: 700;
  opacity: .75;
  text-align: center;
}

.datepicker .day,
.datepicker .cell{
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.datepicker .day:hover,
.datepicker .cell:hover{
  background: rgba(18,151,154,0.15);
}

.hidden{display:none}
/* =========================
   B/S Hover Bubble (Step 6)
   ========================= */
.bs-bubble{
  position: fixed;              /* we will anchor via JS using getBoundingClientRect */
  z-index: 99999;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: flex;
  gap: 6px;
}

.bs-bubble.hidden{
  display: none;
}

.bs-bubble .bs-btn{
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
}

.bs-bubble .bs-btn.buy{
  color: #0b6f70;
}

.bs-bubble .bs-btn.sell{
  color: #b42318;
}

.dp-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:6px 6px 10px 6px;
}

.dp-nav{
  display:flex;
  gap:8px;
  align-items:center;
}

.dp-nav button{
  border:1px solid var(--line);
  background:#fff;
  border-radius:10px;
  padding:6px 10px;
  cursor:pointer;
}

.dp-title{
  display:flex;
  gap:8px;
  align-items:center;
  font-weight:800;
  color:#17324a;
}

.dp-title button{
  border:1px solid var(--line);
  background:#fff;
  border-radius:10px;
  padding:6px 10px;
  cursor:pointer;
}

.dp-grid{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap:6px;
}


.dp-week{
  grid-template-columns: repeat(7, 1fr);
  color:var(--muted);
  font-size:12px;
  padding:0 4px 6px 4px;
}

.dp-days{
  grid-template-columns: repeat(7, 1fr);
}

.dp-cell{
  border:1px solid transparent;
  border-radius:10px;
  padding:8px 0;
  text-align:center;
  cursor:pointer;
}

.dp-cell:hover{
  background:#f2fbfb;
  border-color:#cfeeee;
}

.dp-cell.muted{color:#b8c2cc; cursor:default;}
.dp-cell.sel{
  background:#0f8b8d;
  color:#fff;
  font-weight:800;
}

.dp-months, .dp-years{
  grid-template-columns: repeat(4, 1fr);
}

.dp-cell.box{
  border:1px solid var(--line);
  background:#fff;
  padding:12px 0;
}
/* --- FIX: Custom datepicker (dp-*) numbers + size --- */
#datePicker {
  position: absolute;
  z-index: 9999;
  pointer-events: auto;
}

#datePicker .dp-grid{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap:8px;
}

#datePicker .dp-week {
  grid-template-columns: repeat(7, 34px);
  margin-bottom: 6px;
  color: #666;
  font-size: 12px;
}

#datePicker .dp-days {
  grid-template-columns: repeat(7, 34px);
}

#datePicker .dp-cell {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #fff;
  color: #000 !important;        /* <- numbers visible */
  font-size: 14px !important;    /* <- font size normal */
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  cursor: pointer;
}

#datePicker .dp-cell.muted {
  opacity: 0.35;                 /* <- outside month faint but visible */
  cursor: default;
}

#datePicker .dp-cell.sel {
  outline: 2px solid #000;
}

#datePicker .dp-cell.box {
  width: auto;
  height: 34px;
}
/* --- FIX: show time dropdowns in center chip --- */
.center-chip .sim-dt .time-dd{
  display: inline-block !important;
  width: auto !important;
  min-width: 44px;
  visibility: visible !important;
  opacity: 1 !important;
}
/* --- FORCE: show sim time dropdowns (override any global select css) --- */
#simHour, #simMin{
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;

  width: auto !important;
  min-width: 46px !important;
height: 24px !important;
padding: 2px 6px !important;
font-size: 11px !important;
  border: 1px solid rgba(0,0,0,0.25) !important;
  border-radius: 8px !important;

  background: #ffffff !important;
  color: #111 !important;

  appearance: auto !important;
  -webkit-appearance: menulist !important;
  -moz-appearance: menulist !important;
}
.sim-dt #simDateLabel{
  display: none;
}
#positionsPanel{
  max-height: none !important;
  overflow: auto !important;
}
#posTable{
  width: 100%;
}
/* --- Positions Panel Fixed Height --- */
/* --- FINAL: Positions panel fixed height + internal scroll --- */
#positionsPanel.panel{
  min-height: 260px !important;
  height: auto !important;
  max-height: none !important;
  overflow: auto !important;
}
/* ✅ Sticky Positions header while scrolling inside panel */
#positionsPanel .panel-title-row{
  position: sticky;
  top: 0;
  z-index: 6;
  background: #fff;
  padding: 0;          /* ✅ gap removed */
  margin: 0;           /* safety */
}

/* optional: thoda separator line */
#positionsPanel .panel-title-row{
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

#positionsPanel #posTable{
  width: 100%;
}

/* --- Payoff metrics (StockMock style row) --- */
.payoff-metrics{
  position: absolute;
  right: 20px;
  top: -4px;
  width: calc(100% - 40px);

  display: grid;
  grid-template-columns: 1.05fr 1.05fr 1.05fr 0.75fr 1.25fr 1.1fr;
  column-gap: 22px;
  align-items: center;

  font-size: 13px;
}

.payoff-metrics > div{
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}

.payoff-metrics b{
  font-weight: 700;
  margin-right: 4px;
}

.payoff-metrics span{
  font-variant-numeric: tabular-nums;
}

#payoffMargin,
#payoffMaxProfit,
#payoffMaxLoss{
  font-size: 15px;
  font-weight: 700;
}

#payoffNet,
#payoffBEs{
  font-size: 14px;
  font-weight: 600;
}

.hidden-panel{
  display: none !important;
}

.locked-ui{
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
}

/* ✅ Option Chain internal scroll (StockMock style) */

/* ✅ Option Chain internal scroll (StockMock style) */
.option-chain-table-wrapper{
  max-height: 680px;        /* box bigger (adjust later) */
  overflow-y: auto;
  border-radius: 12px;      /* optional */
}

/* ✅ Sticky header (2 rows) while scrolling */
.option-chain-table-wrapper thead th{
  position: sticky;
  background: #fff;
}

/* Row 1: CALLS / Strike / PUTS */
.option-chain-table-wrapper thead tr:first-child th{
  top: 0;
  z-index: 7;
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

/* Row 2: Call LTP / IV / ... / Put LTP */
.option-chain-table-wrapper thead tr:nth-child(2) th{
  top: 34px;                 /* if spacing off: try 32px or 36px */
  z-index: 6;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
/* ✅ FORCE: Option chain 2-row sticky header (override everything) */
.option-chain-table-wrapper thead th {
  position: sticky !important;
  background: #fff !important;
}

/* Row 1: CALLS / Strike / PUTS */
.option-chain-table-wrapper thead tr:first-child th {
  top: 0 !important;
  z-index: 30 !important;
}

/* Row 2: Call LTP / IV / ... / Put LTP */
.option-chain-table-wrapper thead tr:nth-child(2) th {
  top: 32px !important;      /* if still off: try 32px or 36px */
  z-index: 20 !important;
  box-shadow: 0 1px 0 rgba(0,0,0,0.06) !important;
}
/* ================================
   LOCK PAGE SCROLL (only chain scroll)
   ================================ */

/* Whole page fixed in viewport */
html, body{
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;   /* allow page to scroll on small screens */
}

/* Layout takes remaining height below topbar+subbar */
.layout{
  height: calc(100vh - 84px - 52px); /* 84=topbar, 52=subbar approx */
  overflow: hidden;
}

/* Both columns full height */
.leftpanel, .mainpanel{
  height: 100%;
  overflow: hidden;
}

/* Left option-chain panel becomes flex column */
.leftpanel .panel{
  height: 100%;
  min-height: 0;            /* IMPORTANT: allow inner scrolling */
  display: flex;
  flex-direction: column;
}

/* Option chain wrapper uses remaining height and scrolls */
.option-chain-table-wrapper{
  flex: 1 1 auto;
  min-height: 0;            /* IMPORTANT */
  overflow-y: auto;
}
/* ================================
   RIGHT PANEL internal scroll
   ================================ */

.mainpanel{
  height: 100%;
  overflow: hidden;   /* page lock ke saath */
}

#rightMainPanel{
  height: 100%;
  overflow-y: auto;   /* right side scroll */
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 4px; /* optional: scrollbar space */
}

/* Right side panels: min-height override (warna huge ho jate hain) */
.mainpanel .panel{
  min-height: 0 !important;
}
/* ✅ FIX: Positions sticky header extra gap/blank space */
#positionsPanel .panel-title-row{
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  height: auto !important;
}

#positionsPanel .panel-title-row .panel-title,
#positionsPanel .panel-title-row .panel-meta{
  margin: 0 !important;          /* some browsers add default margin */
  padding: 0 !important;
  line-height: 1.2 !important;   /* tight height */
}
/* ✅ FIX: Positions table header gap (tight) */
#positionsPanel #posTable{
  border-collapse: collapse !important;
  border-spacing: 0 !important;
}

#positionsPanel #posTable thead th{
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  line-height: 1.2 !important;
}

#positionsPanel #posTable thead tr{
  height: auto !important;
}
/* ✅ FIX: Positions sticky header gap (force top:0) */
#positionsPanel{
  padding-top: 0 !important;
}

#positionsPanel #posTable thead th{
  position: sticky !important;
  top: 0 !important;              /* ✅ this removes the gap */
  z-index: 10 !important;
  background: #fff !important;
}
/* ✅ Positions: keep title row (Positions + 10 legs + P&L) visible while scrolling */
#positionsPanel .panel-title-row{
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  padding-top: 8px;
  padding-bottom: 8px;
}

/* optional: little divider so it looks clean */
#positionsPanel .panel-title-row{
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
/* ✅ Positions table header sticky (but below the title-row) */
#positionsPanel #posTable thead th{
  position: sticky !important;
  top: 25px !important;      /* force below "Positions / 8 legs / P&L" */
  z-index: 999 !important;   /* title-row se bhi upar */
  background: #fff !important;
}
/* ===== Expiry Strip (Clean Single Version) ===== */

.expiry-strip-wrap{
  display:flex;
  align-items:center;
  gap:10px;
  margin:8px 0 10px 0;
}

.exp-nav{
  flex:0 0 auto;
  width:34px;
  height:34px;
  border:1px solid var(--line);
  background:#fff;
  border-radius:10px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  
}

.expiry-strip{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  gap:10px;
  flex-wrap:nowrap;
  overflow-x:auto;
  overflow-y:hidden;
  white-space:nowrap;
  padding:6px 2px;
  scroll-behavior:smooth;
}

.expiry-pill{
  flex:0 0 auto;
  white-space:nowrap;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  font-size:12px;
  cursor:pointer;
}

.expiry-pill.active{
  background:#e8f7f7;
  border-color:#bfe6e7;
  font-weight:700;
}

.expiry-strip::-webkit-scrollbar{
  height:6px;
}

.expiry-strip::-webkit-scrollbar-thumb{
  background:rgba(0,0,0,0.2);
  border-radius:999px;
}
/* === Responsive stretch for big screens (StockMock-like) === */

/* Make the main area use full viewport height (minus header/subbar approx) */
.layout{
  height: calc(100vh - 140px);
  display: grid;
  grid-template-columns: minmax(420px, 560px) 1fr;
  gap: 18px;
  align-items: stretch;
}

/* Prevent overflow issues inside grid */
.leftpanel, .mainpanel { min-width: 0; }

/* Right side stack should stretch */
.mainpanel{
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Make top panel expand to fill available space */
#prebuiltPanel{
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* Keep positions visible, but not force huge height */
#positionsPanel{ flex: 1 1 auto; min-height: 260px; }

/* Mobile / small screens: stack panels */
@media (max-width: 1000px){
  .layout{
    grid-template-columns: 1fr;
  }
}
/* === Make Option Chain panel fill height (remove blank space) === */
.leftpanel .panel{
  height: 100%;
  display: flex;
  flex-direction: column;
}

.leftpanel .panel-title{
  flex: 0 0 auto;
}

.leftpanel .expiry-strip-wrap,
.leftpanel .expiry-strip,
.leftpanel .panel-meta{
  flex: 0 0 auto;
}

/* This is the key: table area should take remaining space */
.leftpanel .option-chain-table-wrapper{
  flex: 1 1 auto;
  min-height: 0;           /* IMPORTANT for flex scroll */
  overflow: auto;
}
/* === Full-height page so left Option Chain can stretch === */
html, body{
  height: 100%;
}

body{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Make main area take remaining height under topbar+subbar */
main.layout{
  flex: 1 1 auto;
  min-height: 0; /* critical for inner scroll */
}

/* Ensure left panel + panel can use full height */
.leftpanel{
  height: 100%;
  min-height: 0;
}
/* ===========================
   EXPIRY STRIP — FINAL OVERRIDE (single source of truth)
   Paste at END of file
   =========================== */

.expiry-strip-wrap{
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  margin:8px 0 10px 0 !important;
  overflow: visible !important;          /* stop clipping */
  padding-left: 6px !important;          /* prevent left cut */
}

.exp-nav{
  flex:0 0 auto !important;
  width:34px !important;
  height:34px !important;
  border:1px solid var(--line) !important;
  background:#fff !important;
  border-radius:10px !important;
  cursor:pointer !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  font-size:18px !important;
  line-height: 1 !important;
  color:#111 !important;
}

.expiry-strip{
  flex:1 1 auto !important;
  min-width:0 !important;
  display:flex !important;
  gap:10px !important;
  flex-wrap:nowrap !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  white-space:nowrap !important;
  padding:6px 6px !important;            /* left padding so first pill not cut */
  scroll-behavior:smooth !important;

  scrollbar-width: thin;                 /* Firefox scrollbar */
}

.expiry-pill{
  flex:0 0 auto !important;
  white-space:nowrap !important;
}

/* Make the bottom scroll line visible */
.expiry-strip::-webkit-scrollbar{
  height:8px !important;
}
.expiry-strip::-webkit-scrollbar-thumb{
  background:rgba(0,0,0,0.22) !important;
  border-radius:999px !important;
}
.expiry-strip::-webkit-scrollbar-track{
  background:transparent !important;
}
/* === STEP: Option Chain should fill full left panel height (no blank space) === */
.leftpanel .panel{
  min-height: 0 !important;         /* override old min-height:520 */
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

/* meta + expiry strip fixed height; table takes remaining */
.leftpanel .option-chain-table-wrapper{
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;       /* remove fixed max-height causing blank area */
  overflow-y: auto !important;
}
/* === STEP: Right panel should fill height like StockMock (top grows, positions stays) === */
.mainpanel{
  height: 100% !important;
  min-height: 0 !important;
}

#rightMainPanel{
  height: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Prebuilt takes all remaining space */
/* DISABLED - conflicting layout rule
#prebuiltPanel{
  flex: 1 1 auto !important;
  min-height: 0 !important;
}
*/

/* Positions stays fixed height (your existing rule will still apply) */
/* DISABLED - was preventing positions panel from growing
#positionsPanel{
  flex: 0 0 auto !important;
}
*/
/* ============================= */
/* Positions totals bar (NEW)    */
/* ============================= */

.pos-totals-bar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-top:10px;
  padding:10px 12px;
  border:1px solid rgba(0,0,0,0.08);
  border-radius:10px;
  background:#fff;
}

.pos-totals-left{
  font-weight:600;
  color:#333;
}

.pos-totals-right{
  display:flex;
  align-items:center;
  gap:10px;
}

.pos-net-pnl{
  font-weight:700;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(0,0,0,0.04);
  color:#444;
}

.mini.danger{
  border:1px solid rgba(220,38,38,0.35);
  background:rgba(220,38,38,0.08);
  color:#b91c1c;
}
/* --- FORCE right column layout (single source of truth) --- */
#rightMainPanel{
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
  height: calc(100vh - 230px) !important;
}

/* Make chartbox the positioning parent for the absolute canvas */
#prebuiltChartBox{
  position: relative !important;
  height: 100% !important;
  overflow: hidden !important;
}

/* Positions panel: sits BELOW, takes remaining space */
#positionsPanel{
  flex: 1 1 auto !important;
  min-height: 260px !important;
  overflow: auto !important;
}
/* ==== FINAL LAYOUT OVERRIDE (must be LAST in file) ==== */

/* Right side should be a true vertical stack */
#rightMainPanel{
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: 100% !important;
}

/* Keep chart panel fixed height so Positions can grow */
#prebuiltPanel{
  flex: 0 0 360px !important;
  height: 360px !important;
  min-height: 360px !important;
  max-height: 360px !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
}

/* Chartbox must stay inside prebuiltPanel */
#prebuiltChartBox{
  flex: 1 1 auto !important;
  min-height: 0 !important;
  position: relative !important;
  overflow: hidden !important;
  padding-top: 28px !important;
}

/* Positions takes ALL remaining space */
#positionsPanel{
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}
/* ==== ABSOLUTE LAST OVERRIDE (DO NOT MOVE ABOVE) ==== */
html, body{
  height: 100% !important;
}

body{
  overflow: hidden !important; /* page scroll lock */
}

/* main grid must have a real height, warna flex children can't "fill remaining" */
main.layout{
  height: calc(100vh - 84px - 52px) !important; /* topbar 84 + subbar 52 */
  min-height: 0 !important;
  overflow: hidden !important;
  align-items: stretch !important;
}

/* both columns must also have real height */
.leftpanel, .mainpanel{
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

/* right stack must fill the column */
#rightMainPanel{
  height: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

/* chart fixed, positions gets remaining */
#prebuiltPanel{
  flex: 0 0 clamp(280px, 52vh, 620px) !important;
  height: clamp(280px, 52vh, 620px) !important;
  min-height: 280px !important;
  max-height: 620px !important;
  overflow: hidden !important;
}

#positionsPanel{
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}
/* Select date button (center) - make bigger + colored like top controls */
#dateBtn.chip{
  font-size: 13px !important;
  font-weight: 700 !important;
  padding: 7px 12px !important;
  margin-bottom:6px;
  background: #bfe9ea !important;
  color: #0c6f70 !important;
  border: 1px solid rgba(255,255,255,0.25) !important;
}

#dateBtn.chip:hover{
  filter: brightness(1.05);
}

.user-badge{
  margin-left:10px;
  padding:6px 12px;
  background:rgba(255,255,255,0.18);
  color:#fff;
  border-radius:16px;
  font-size:13px;
  font-weight:500;
}

.user-menu{
  position:relative;
  margin-left:10px;
}

.user-btn{
  display:flex;
  align-items:center;
  gap:6px;
  background:rgba(255,255,255,0.15);
  border:none;
  color:#fff;
  padding:5px 10px;
  border-radius:16px;
  cursor:pointer;
}

.user-avatar{
  width:20px;
  height:20px;
  border-radius:50%;
  background:#fff;
  color:#0f8b8d;
  font-size:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:600;
}

.user-dd{
  position:absolute;
  right:0;
  top:calc(100% + 2px);
  background:#fff;
  border-radius:8px;
  box-shadow:0 6px 18px rgba(0,0,0,0.15);
  display:none;
  flex-direction:column;
  min-width:120px;
  z-index:9999;
}

.user-dd-item{
  padding:8px 12px;
  border:none;
  background:none;
  text-align:left;
  cursor:pointer;
}

.user-dd-item:hover{
  background:#f2f2f2;
}

.user-menu:hover .user-dd{
  display:flex;
}
.user-dd{
  display:none;
}
.user-menu.open .user-dd{
  display:flex;
}

/* User menu polish */
.user-btn{
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12);
  color:#fff;
  border-radius:10px;
  padding:6px 10px;
  cursor:pointer;
}
.user-btn:focus{
  outline:none;
}
.user-dd{
  margin-top:0;
  right:0;
  min-width:160px;
}
.user-dd a{
  text-decoration:none;
  color:#0b2239;
}
.user-dd a:hover{
  background:#f2fbfb;
}

.strategy-buttons .mini.active-strategy {
  background: #e8f6f2;
  border-color: #86cbb8;
  color: #0f7f5f;
  font-weight: 700;
}

/* Prebuilt strategy layout */
.strategy-toolbar {
  display: block;
  margin-bottom: 10px;
}

.strategy-category-bar{
  display:flex;
  justify-content:center;
  gap:6px;
  margin: -22px 0 4px 0;   /* ↑ thoda aur upar */
}

.strategy-cat-btn{
  border:1px solid #d7dde5;
  background:#fff;
  color:#475569;
  border-radius:6px;
  padding:2px 8px;       /* ↓ size small */
  font-size:11px;        /* ↓ text small */
  font-weight:600;
  line-height:1.1;
  cursor:pointer;
  min-height:24px;       /* ↓ height small */
}

.strategy-cat-btn.active{
  background:#eef7ff;
  border-color:#93c5fd;
  color:#1d4ed8;
}

.sim-chart-tab-btn{
  border:1px solid #d7dde5;
  background:#fff;
  color:#475569;
  border-radius:6px;
  padding:2px 8px;
  font-size:11px;
  font-weight:600;
  line-height:1.1;
  cursor:pointer;
  min-height:24px;
}

.sim-chart-tab-btn.active{
  background:#ecfdf5;
  border-color:#86efac;
  color:#047857;
}

#prebuiltPanel.sim-underlying-chart-active #strategyCards{
  display:none;
}

#prebuiltPanel.sim-underlying-chart-active #prebuiltChartBox{
  display:block !important;
}

#prebuiltPanel.sim-underlying-chart-active #payoffTestPanel{
  display:none !important;
}

.sim-underlying-chart-view{
  display:none;
  position:absolute;
  inset:8px;
  z-index:5;
  min-height:0;
  overflow:hidden;
  flex-direction:column;
  background:#fff;
}

#prebuiltPanel.sim-underlying-chart-active .sim-underlying-chart-view{
  display:flex;
}

.sim-underlying-chart-toolbar{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:28px;
  margin-bottom:6px;
}

.sim-underlying-chart-title{
  color:#334155;
  font-size:12px;
  font-weight:700;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.sim-underlying-chart-modes{
  display:flex;
  align-items:center;
  gap:4px;
  flex:0 0 auto;
}

.sim-underlying-mode-btn{
  border:1px solid #d7dde5;
  background:#fff;
  color:#475569;
  border-radius:6px;
  padding:3px 8px;
  font-size:11px;
  font-weight:600;
  line-height:1.1;
  cursor:pointer;
  min-height:24px;
}

.sim-underlying-mode-btn.active{
  background:#eef7ff;
  border-color:#93c5fd;
  color:#1d4ed8;
}

.sim-underlying-chart-surface{
  flex:1 1 auto;
  min-height:0;
  width:100%;
  overflow:hidden;
  border:1px solid #e2e8f0;
  border-radius:6px;
  background:#ffffff;
}

.sim-underlying-chart-message{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%, -50%);
  max-width:min(320px, calc(100% - 32px));
  padding:8px 10px;
  border-radius:6px;
  background:rgba(255,255,255,0.92);
  border:1px solid #dbe3ec;
  color:#475569;
  font-size:12px;
  font-weight:600;
  text-align:center;
  box-shadow:0 4px 12px rgba(15,23,42,0.08);
  display:none;
  pointer-events:none;
}

.sim-underlying-chart-message.visible{
  display:block;
}

.sim-underlying-chart-svg{
  display:block;
  width:100%;
  height:100%;
}

.strategy-buttons {
  display: none;
}

.strategy-buttons .mini {
  white-space: nowrap;
}

.strategy-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
  align-items: start;
  justify-items: center;
}

.strategy-cards.hidden {
  display: none;
}

.strategy-card{
  border: 1px solid #d9e0e8;
  border-radius: 8px;
  padding: 6px 4px 8px 4px;
  background: #fff;
  cursor: pointer;
  transition: all .15s ease;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;

  width: 110px;
}

.strategy-card:hover{
  border-color: #c7d2de;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  transform: translateY(-1px);
}

.strategy-card-title{
  font-size: 11px;
  font-weight: 500;
  color: #475569;
  line-height: 1.15;
  margin-bottom: 4px;
  text-align: center;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;

  min-height: 26px;
}

.strategy-card-mini{
  display: block;
  width: 64px;
  height: 64px;
  margin: 4px auto 0 auto;
  border-radius: 2px;
  background: #fff;
  border: 1px solid #cfd6de;
}

.strategy-card.active-strategy {
  border-color: #6ea88c;
  box-shadow: 0 0 0 2px rgba(110, 168, 140, 0.14);
  background: #f4fbf7;
}

.payoff-metrics {
  display: grid !important;
  grid-template-columns: 1.05fr 1.05fr 1.05fr 0.70fr 1.55fr 0.85fr !important;
  gap: 8px 14px;
  align-items: center;
  margin-bottom: 12px;
}

.payoff-metrics > div {
  white-space: nowrap;
  min-width: 0;
}

.payoff-metrics > div:nth-child(5){
  justify-self: start;
}

.payoff-metrics > div:nth-child(6){
  justify-self: end;
}

.bs-marker{
  margin-left:6px;
  font-size:10px;
  font-weight:700;
  padding:2px 5px;
  border-radius:4px;
}

.bs-marker.buy{
  background:#d1fae5;
  color:#047857;
}

.bs-marker.sell{
  background:#fee2e2;
  color:#b91c1c;
}

.bs-marker{
  font-size:11px;
  padding:2px 6px;
  border-radius:6px;
  font-weight:600;
}

.bs-marker.buy{
  background:#2563eb;
  color:white;
}

.bs-marker.sell{
  background:#ef4444;
  color:white;
}

.bs-marker{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:14px;
  min-width:14px;
  height:14px;
  font-size:9px;
  font-weight:700;
  line-height:14px;
  border-radius:4px;
  margin:0;
  margin-left:0;
  margin-right:0;
  padding:0;
  flex:0 0 14px;
}

.bs-marker.buy{
  background:#16a34a;
  color:#fff;
}

.bs-marker.sell{
  background:#dc2626;
  color:#fff;
}

/* OPTION CHAIN COLUMN WIDTH STABILIZER */
.chain th,
.chain td {
  white-space: nowrap;
}

.chain th:nth-child(1),
.chain td:nth-child(1) {
  width: 78px;
  text-align: right;
}

.chain th:nth-child(2),
.chain td:nth-child(2) {
  width: 54px;
  text-align: right;
}

.chain th:nth-child(3),
.chain td:nth-child(3) {
  width: 70px;
  text-align: center;
}

.chain th:nth-child(4),
.chain td:nth-child(4) {
  width: 54px;
  text-align: left;
}

.chain th:nth-child(5),
.chain td:nth-child(5) {
  width: 86px;
  text-align: left;
  padding-left: 10px;
}

/* ===== STEP 2: Option Chain size rebalance ===== */
.layout{
  grid-template-columns: minmax(500px, 620px) 1fr !important;
}

.leftpanel .panel{
  padding: 6px 10px 10px 10px !important;
}

.chain{
  font-size: 11px !important;
}

.chain th,
.chain td{
  padding: 7px 5px !important;
}

.panel-meta{
  font-size: 11px !important;
}

.expiry-pill{
  font-size: 11px !important;
  padding: 5px 9px !important;
}

.panel-title{
  font-size: 16px !important;
}

.bs-bubble .bs-btn{
  padding: 5px 8px !important;
  font-size: 11px !important;
}

/* ===== STEP 3C: wider left panel + clean sticky header cover ===== */

/* left option chain box thoda aur wide */
.layout{
  grid-template-columns: minmax(520px, 650px) 1fr !important;
}

/* numbers / values same compact hi rahein */
.chain{
  font-size: 11px !important;
}

.chain th,
.chain td{
  padding: 7px 5px !important;
}

/* scroll wrapper */
.option-chain-table-wrapper{
  position: relative !important;
}

/* sticky header rows */
.option-chain-table-wrapper thead th{
  position: sticky !important;
  background: #fff !important;
}

/* row 1: CALLS / Strike / PUTS */
.option-chain-table-wrapper thead tr:first-child th{
  top: 0 !important;
  z-index: 50 !important;
  background: #fff !important;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08) !important;
}

/* row 2: Call LTP / Vol / IV ... */
.option-chain-table-wrapper thead tr:nth-child(2) th{
  top: 31px !important;
  z-index: 45 !important;
  background: #fff !important;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08) !important;
}

/* extra white cover so body text never shows through behind sticky header */
.option-chain-table-wrapper thead{
  position: relative !important;
  z-index: 60 !important;
}

.option-chain-table-wrapper thead::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 62px;
  background: #fff;
  z-index: -1;
}

/* ===== OPTION CHAIN CLEAN FINAL FIX ===== */

/* left panel thoda wider */
.layout{
  grid-template-columns: minmax(520px, 650px) 1fr !important;
}

/* compact readable table */
.chain{
  font-size: 11px !important;
}

.chain th,
.chain td{
  padding: 7px 5px !important;
}

/* option chain scroll area */
.option-chain-table-wrapper{
  position: relative !important;
}

/* make all header cells solid white */
.option-chain-table-wrapper thead th{
  position: sticky !important;
  background: #fff !important;
  background-image: none !important;
}

/* FIRST sticky row: CALLS / Strike / PUTS */
.option-chain-table-wrapper thead tr:first-child th{
  top: 0 !important;
  z-index: 40 !important;
  height: 40px !important;
  line-height: 40px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,0.08) !important;
}

/* SECOND sticky row: Call LTP / Vol / IV ... */
.option-chain-table-wrapper thead tr:nth-child(2) th{
  top: 40px !important;
  z-index: 35 !important;
  height: 36px !important;
  line-height: 36px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,0.08) !important;
}

/* reserve exact header space so rows never peek through */
.option-chain-table-wrapper thead{
  position: relative !important;
}

.option-chain-table-wrapper tbody::before{
  content: "";
  display: block;
  height: 0 !important;
}

/* ===== BIG SCREEN: top bleed mask for option chain ===== */
@media (min-width: 1400px){
  .option-chain-table-wrapper{
    position: relative !important;
  }

  .option-chain-table-wrapper::before{
    content: "";
    position: sticky;
    top: 0;
    display: block;
    height: 78px;              /* covers both sticky header rows area */
    background: #fff;
    z-index: 32;               /* above body rows, below top header cells */
    pointer-events: none;
    margin-bottom: -78px;
  }

  .option-chain-table-wrapper thead tr:first-child th{
    z-index: 40 !important;
  }

  .option-chain-table-wrapper thead tr:nth-child(2) th{
    z-index: 41 !important;
  }
}

/* ===== OPTION CHAIN NATURAL ALIGNMENT FIX ===== */
/* width force mat karo */

.option-chain-table-wrapper .chain{
  table-layout: auto !important;
  width: 100% !important;
}

.option-chain-table-wrapper .chain th,
.option-chain-table-wrapper .chain td{
  white-space: nowrap !important;
  vertical-align: middle !important;
}

/* alignment only */
.option-chain-table-wrapper .chain th:nth-child(1),
.option-chain-table-wrapper .chain td:nth-child(1){
  text-align: right !important;
  padding-right: 10px !important;
}

.option-chain-table-wrapper .chain th:nth-child(2),
.option-chain-table-wrapper .chain td:nth-child(2){
  text-align: right !important;
  padding-right: 14px !important;
}

.option-chain-table-wrapper .chain th:nth-child(3),
.option-chain-table-wrapper .chain td:nth-child(3){
  text-align: center !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
}

.option-chain-table-wrapper .chain th:nth-child(4),
.option-chain-table-wrapper .chain td:nth-child(4){
  text-align: center !important;
  padding-left: 18px !important;
  padding-right: 18px !important;
}

.option-chain-table-wrapper .chain th:nth-child(5),
.option-chain-table-wrapper .chain td:nth-child(5){
  text-align: center !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
}

.option-chain-table-wrapper .chain th:nth-child(6),
.option-chain-table-wrapper .chain td:nth-child(6){
  text-align: right !important;
  padding-right: 53px !important;
}

.option-chain-table-wrapper .chain thead tr:nth-child(2) th:nth-child(6){
  padding-left: 22px !important;
}

.option-chain-table-wrapper .chain th:nth-child(7),
.option-chain-table-wrapper .chain td:nth-child(7){
  text-align: left !important;
  padding-left: 14px !important;
  padding-right: 8px !important;
}

/* ===== FORCE CURRENT COLGROUP TO ACTUALLY APPLY ===== */
/* 5-column option chain = balanced spacing */

.option-chain-table-wrapper .chain{
  table-layout: fixed !important;
  width: 100% !important;
}

.option-chain-table-wrapper .chain th,
.option-chain-table-wrapper .chain td{
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: clip !important;
  vertical-align: middle !important;
}

/* col 1 = Call LTP */
.option-chain-table-wrapper .chain th:nth-child(1),
.option-chain-table-wrapper .chain td:nth-child(1){
  text-align: left !important;
  padding-left: 18px !important;
  padding-right: 10px !important;
}

/* col 2 = Call Vol */
.option-chain-table-wrapper .chain th:nth-child(2),
.option-chain-table-wrapper .chain td:nth-child(2){
  text-align: center !important;
  padding-left: 10px !important;
  padding-right: 10px !important;
}

/* col 3 = Strike */
.option-chain-table-wrapper .chain th:nth-child(3),
.option-chain-table-wrapper .chain td:nth-child(3){
  text-align: center !important;
  padding-left: 10px !important;
  padding-right: 10px !important;
}

/* col 4 = Put Vol */
.option-chain-table-wrapper .chain th:nth-child(4),
.option-chain-table-wrapper .chain td:nth-child(4){
  text-align: center !important;
  padding-left: 10px !important;
  padding-right: 10px !important;
}

/* col 5 = Put LTP */
.option-chain-table-wrapper .chain th:nth-child(5),
.option-chain-table-wrapper .chain td:nth-child(5){
  text-align: right !important;
  padding-left: 10px !important;
  padding-right: 18px !important;
}

/* ===== HEADER ALIGNMENT FIX (top labels only) ===== */

/* ===== HEADER ALIGNMENT FIX (5-column layout) ===== */

/* top group headers: CALLS / Strike / PUTS */
.option-chain-table-wrapper .chain thead tr:first-child th.call-head{
  text-align: center !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.option-chain-table-wrapper .chain thead tr:first-child th.strike-head{
  text-align: center !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.option-chain-table-wrapper .chain thead tr:first-child th.put-head{
  text-align: center !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* second header row: Call LTP / Vol / blank / Vol / Put LTP */
.option-chain-table-wrapper .chain thead tr:nth-child(2) th:nth-child(1){
  text-align: left !important;
  padding-left: 18px !important;
  padding-right: 8px !important;
}

.option-chain-table-wrapper .chain thead tr:nth-child(2) th:nth-child(2){
  text-align: center !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.option-chain-table-wrapper .chain thead tr:nth-child(2) th:nth-child(3){
  text-align: center !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.option-chain-table-wrapper .chain thead tr:nth-child(2) th:nth-child(4){
  text-align: center !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.option-chain-table-wrapper .chain thead tr:nth-child(2) th:nth-child(5){
  text-align: right !important;
  padding-left: 8px !important;
  padding-right: 18px !important;
}
/* ===== Row hover highlight (Option Chain only) ===== */
#chainBody tr:hover td{
  background-color: #eef4ff !important;
  transition: background-color 0.12s ease;
}

/* keep ATM row slightly stronger even on hover */
#chainBody tr.atm-row:hover td{
  background-color: #e3f3f3 !important;
}

/* keep option-chain row highlighted while B/S bubble is active */
#chainBody tr.bs-active td{
  background-color: #eef4ff !important;
  transition: background-color 0.12s ease;
}

#chainBody tr.atm-row.bs-active td{
  background-color: #e3f3f3 !important;
}

/* ===== Positions Step 1: Qty input polish ===== */
#positionsPanel input[data-act="qty"]{
  width: 64px !important;
  height: 28px !important;
  padding: 4px 8px !important;
  border: 1px solid #d6dbe3 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #1f2937 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-align: center !important;
  outline: none !important;
  box-shadow: none !important;
}

#positionsPanel input[data-act="qty"]:focus{
  border-color: #9ecfd0 !important;
  box-shadow: 0 0 0 2px rgba(15,139,141,0.12) !important;
}

#positionsPanel input[data-act="qty"]:hover{
  border-color: #c5ccd6 !important;
}

/* ===== Positions Step 2 (refined): Compact buttons ===== */

#positionsPanel .mini{
  height: 26px !important;
  padding: 0 8px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border: 1px solid #e1e5ea !important;
  background: #fff !important;
  color: #374151 !important;
  transition: all 0.12s ease !important;
}

#positionsPanel .mini:hover{
  background: #f6f8fa !important;
}

/* Exit All / danger */
#positionsPanel .mini.danger{
  border: 1px solid #f1caca !important;
  background: #fff5f5 !important;
  color: #dc2626 !important;
}

/* X button (very compact) */
#positionsPanel td:last-child .mini{
  width: 22px !important;
  min-width: 22px !important;
  height: 22px !important;
  font-size: 11px !important;
  padding: 0 !important;
  border-radius: 6px !important;
}

/* Move Exit button towards X (without touching X column) */
#positionsPanel td:nth-last-child(2){
  text-align: right !important;
  padding-right: 1px !important;
}
/* Move top header "Exit" towards right (near X) */
#positionsPanel th:nth-last-child(2){
  text-align: right !important;
  padding-right: 10px !important;
}

/* Center align specific columns (header + values) */
#positionsPanel th:nth-child(4),
#positionsPanel td:nth-child(4),   /* Qty */

#positionsPanel th:nth-child(5),
#positionsPanel td:nth-child(5),   /* Entry */

#positionsPanel th:nth-child(6),
#positionsPanel td:nth-child(6),   /* Entry Price */

#positionsPanel th:nth-child(7),
#positionsPanel td:nth-child(7) {  /* LTP/Exit */

  text-align: center !important;
}

/* Move Strike column slightly LEFT */
#positionsPanel th:nth-child(3),
#positionsPanel td:nth-child(3){
  padding-right: 35px !important;
}

/* ===== Next polish step: smoother option-chain scrolling ===== */
.option-chain-table-wrapper{
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

