* { box-sizing: border-box; }

body {
    background-color: #ffffff;
    color: #000;
    font-family: Arial, sans-serif;
    margin: 0;
    font-size: 11px;
    overflow-x: auto; 
}

/* Greeks Panel Floating Style */
.toggle-menu-box {
    position: absolute;
    top: 45px;
    right: 10px;
    background: #fff;
    border: 1px solid #333;
    z-index: 1100;
    width: 280px;
    padding-bottom: 10px;
    box-shadow: 0px 8px 20px rgba(0,0,0,0.4);
    border-radius: 6px;
    display: none;
    overflow: hidden;
}
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; padding: 12px; gap: 10px; }

/* --- HEADER 1: STICKY TOP BAR --- */
.header-1 { 
    display: flex; 
    justify-content: space-between; 
    padding: 8px 10px; 
    background: #1a1a1a; 
    border-bottom: 2px solid #333; 
    align-items: center;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1003;
}

.box-time, .box-trend, .spot-display, .box-info { 
    background: #2d2d2d; 
    border: 1px solid #444; 
    padding: 4px 10px; 
    border-radius: 4px; 
    text-align: center; 
    font-weight: bold;
    color: #ecf0f1;
}

.box-time { color: #3498db; border-left: 3px solid #3498db; }
.spot-display { color: #f1c40f; border-left: 3px solid #f1c40f; }

#expirySelect { 
    font-size: 10px !important; 
    padding: 2px 4px !important;
    height: 26px;
    width: 115px; 
    font-weight: bold;
    border-radius: 4px;
}

/* --- HEADER 2: STICKY RESISTANCE/SUPPORT --- */
.header-2 { 
    display: flex; 
    font-size: 12px; 
    font-weight: bold; 
    text-align: center; 
    color: #fff; 
    width: 100%;
    border-bottom: 2px solid #333333; 
    position: sticky;
    top: 42px; /* Sits exactly below Header 1 */
    z-index: 1002;
}

.call-header { 
    background: #008000; 
    flex: 1; 
    height: 55px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
}
.put-header { 
    background: #ff0000; 
    flex: 1; 
    height: 55px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
}

/* --- SUB-HEADER 3: STICKY COLUMN TITLES (FIXED) --- */
.sub-header-3 {
    display: flex; 
    width: 100%;
    align-items: stretch;
    position: sticky;
    top: 97px; /* Header 1 (42px) + Header 2 (55px) = 97px */
    z-index: 1001;
}

.sub-header-3 > div { 
    font-weight: bold; 
    color: #ffffff !important; 
    min-height: 30px; 
    border-bottom: 1px solid #333333; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.sub-header-3 > div:nth-child(-n+12) { background: #008000 !important; }
.sub-header-3 > div:nth-child(n+14) { background: #ff0000 !important; }

.sub-header-3 .strike-title { 
    background: #222 !important; 
    color: #fff !important; 
    min-width: 70px !important; 
}

/* Ranks and other styles stay the same */
.rank-blue { background: linear-gradient(145deg, #0056b3, #004085) !important; color: #fff !important; font-weight: 900 !important; }
.rank-yellow { background: linear-gradient(145deg, #fbc02d, #f9a825) !important; color: #000 !important; font-weight: 900 !important; }
.rank-red { background: linear-gradient(145deg, #d32f2f, #b71c1c) !important; color: #fff !important; font-weight: 900 !important; }

.spot-line-row {
    display: flex;
    align-items: center;
    width: 100%;
    height: 35px;
    background: #ffffff;
}

.row { 
    display: flex; 
    width: 100%;
    align-items: stretch;
    border-bottom: 1px solid #eee; 
    min-height: 40px; 
}

.sub-header-3 > div, .row > div, .footer-section > div {
    flex: 1; 
    min-width: 35px; 
    text-align: center;
    padding: 4px 1px;
    display: flex;
    flex-direction: column;
    align-items: center;    
    justify-content: center;
    border-right: 1px solid #f0f0f0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 9px; 
    gap: 2px;
}

.col-oi, .col-oichg, .col-volume { flex: 1.3 !important; min-width: 60px !important; }
.itm-cell { background-color: #fff9c4 !important; } 

.strike-title, .strike-cell { 
    flex: 0 0 70px !important; 
    width: 70px !important;
    min-width: 70px !important;
    font-weight: bold;
    background: #222 !important; 
    color: #fff !important; 
}

.footer { 
    display: flex; 
    width: 100%;
    align-items: stretch;
    background: #d3d3d3; color: #000; border-top: 1px solid #bbb;
    font-weight: bold; position: sticky; bottom: 0; z-index: 10;
}
.footer-section { flex: 1; display: flex; }
/* ============================================================
   STRIKE ALIGNMENT FIX
   ------------------------------------------------------------
   Pehle har row apna flexbox alag calculate karta tha -> sub-pixel
   rounding ki wajah se STRIKE cell har row me halka left/right khisak
   jaata tha. CSS Grid se saari rows ek hi column-track share karti hain,
   isliye STRIKE (aur baaki sab columns) har row me bilkul same jagah.
   Teeno row types me 25-25 cells hain -> 25 grid tracks (12 + strike + 12).
   ============================================================ */
body .sub-header-3,
body .row,
body .spot-line-row,
body .footer {
    display: grid !important;
    /* --soc-grid-cols (col_layout.js) = sirf VISIBLE columns ke tracks.
       Default = poora 25-track (JS na chale to bilkul same). Greeks/columns
       hide hone pe hidden tracks hat jaate hain -> right blank white khatam. */
    grid-template-columns: var(--soc-grid-cols,
        1fr 1fr 1fr 1fr 1fr 1fr 1fr 1.3fr 1.3fr 1.3fr 1fr 1fr
        70px
        1fr 1fr 1.3fr 1.3fr 1.3fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr) !important;
    align-items: stretch;
}

/* Footer cells ab direct grid items hain -> body jaisa hi look */
body .footer > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #c5ccd3;
    overflow: hidden;
    white-space: nowrap;
    padding: 4px 1px;
    font-size: 9px;
    gap: 2px;
}

/* Strike cell + capsule + footer TOTAL ko pakka 70px (track ke barabar) */
body .strike-title,
body .strike-cell {
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
}
