@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');
:root{--bg:#06101d;--text:#edf5ff;--muted:#8ea3ba;--accent:#6ee7d8;--line:rgba(255,255,255,.08);--green:#59dfa0;--red:#ff7782;--yellow:#f5c96a;--max:1240px}
*{box-sizing:border-box}html{background:var(--bg)}body{margin:0;background:radial-gradient(800px 420px at 75% -10%,rgba(110,231,216,.1),transparent 60%),radial-gradient(700px 400px at 15% 10%,rgba(115,150,255,.1),transparent 60%),var(--bg);color:var(--text);font-family:"DM Sans",sans-serif}a{color:inherit;text-decoration:none}.stocks-container,.stocks-header{width:min(var(--max),calc(100% - 40px));margin:auto}.stocks-header{height:74px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.stocks-brand{font:700 21px "Space Grotesk"}.stocks-brand span{color:var(--accent)}.stocks-nav{display:flex;gap:5px}.stocks-nav a{font-size:13px;font-weight:600;color:var(--muted);padding:9px 13px;border-radius:9px}.stocks-nav a:hover,.stocks-nav a.active{color:var(--text);background:rgba(255,255,255,.07)}.stocks-nav-toggle{display:none;background:none;border:0;color:var(--text);font-size:23px}
.stocks-hero{display:flex;justify-content:space-between;align-items:end;gap:30px;padding:64px 0 34px}.eyebrow{font-size:11px;letter-spacing:2px;font-weight:700;color:var(--accent);margin-bottom:13px}.stocks-hero h1{font:700 clamp(44px,7vw,74px)/.98 "Space Grotesk";letter-spacing:-3px;margin:0}.stocks-hero h1 span{color:var(--accent)}.stocks-hero p{color:var(--muted);margin:16px 0 0;font-size:15px}.connection-card{display:flex;align-items:center;gap:11px;border:1px solid var(--line);background:rgba(255,255,255,.035);padding:11px 14px;border-radius:12px;min-width:185px}.connection-card strong,.connection-card small{display:block}.connection-card strong{font-size:12px}.connection-card small{font-size:12px;color:var(--muted);margin-top:2px}.dot{width:8px;height:8px;border-radius:50%;background:#9aa9bb}.dot.live{background:var(--green);box-shadow:0 0 0 4px rgba(89,223,160,.1)}.dot.bad{background:var(--red);box-shadow:0 0 0 4px rgba(255,119,130,.1)}.dot.closed{background:var(--yellow);box-shadow:0 0 0 4px rgba(245,201,106,.10)}
.dashboard-card{border:1px solid var(--line);border-radius:18px;background:rgba(7,18,31,.84);overflow:hidden;box-shadow:0 30px 100px rgba(0,0,0,.25)}

/* SUBTABS */
.subtabs-nav{display:flex;gap:8px;padding:12px 16px 0;border-bottom:1px solid var(--line);background:rgba(255,255,255,.015)}
.subtab-btn{height:40px;padding:0 18px;border:1px solid transparent;border-bottom:0;border-radius:9px 9px 0 0;background:transparent;color:var(--muted);font:600 13px "DM Sans",sans-serif;cursor:pointer;display:inline-flex;align-items:center;gap:6px;transition:all .2s ease}
.subtab-btn:hover{color:var(--text);background:rgba(255,255,255,.04)}
.subtab-btn.active{color:var(--accent);background:rgba(7,18,31,.95);border-color:var(--line);border-bottom-color:#07121f;margin-bottom:-1px;font-weight:700}

.toolbar{display:flex;gap:12px;justify-content:space-between;padding:16px;border-bottom:1px solid var(--line)}.search{height:44px;display:flex;align-items:center;gap:9px;border:1px solid var(--line);background:rgba(255,255,255,.035);border-radius:10px;padding:0 12px;flex:1;max-width:590px}.search>span{font-size:22px;color:#778ca3}.search input{border:0;outline:0;background:none;color:var(--text);font:inherit;font-size:14px;width:100%}.search input::placeholder{color:#70849a}.search kbd{font-size:10px;color:#73869b;border:1px solid var(--line);padding:2px 5px;border-radius:5px}.controls{display:flex;gap:7px}.controls select,.refresh{height:44px;border:1px solid var(--line);background:#0d1b2c;color:#dbe8f6;border-radius:9px;padding:0 11px;font:600 13px "DM Sans";outline:0}.refresh{cursor:pointer;min-width:86px}.stats{display:flex;align-items:center;gap:8px;padding:12px 16px;overflow:auto}.stats>div:not(.stats-note){display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:8px;padding:7px 10px;font-size:12px;white-space:nowrap}.stats span{color:#73879d}.stats strong{font-size:12px}.up{color:var(--green)!important}.down{color:var(--red)!important}.neutral{color:var(--yellow)!important}.stats-note{margin-left:auto;color:#647a91;font-size:11px;white-space:nowrap}

/* TABLE LAYOUT */
.table-wrap{width:100%;max-width:100%;height:1200px;overflow-x:auto;overflow-y:auto;-webkit-overflow-scrolling:touch;outline:none}
.table-wrap:focus-visible{box-shadow:inset 0 0 0 2px rgba(110,231,216,.35)}
.table-wrap::-webkit-scrollbar{width:8px;height:8px}
.table-wrap::-webkit-scrollbar-thumb{background:#203349;border-radius:10px}

table{border-collapse:separate;border-spacing:0;width:100%;table-layout:auto;font-size:13px}

thead th{position:sticky;top:0;z-index:5;height:52px;background:#0d1c2e;color:#7f94aa;font-size:12px;font-weight:700;text-align:center;padding:4px 6px;border-bottom:1px solid var(--line);white-space:nowrap;line-height:1.25;vertical-align:middle}

/* TEXT-WRAPPED HEADERS (Centered, strictly 2 lines) */
thead th.wrap-header{
  white-space:normal!important;
  text-align:center!important;
  line-height:1.15;
  max-height:2.4em;
  display:table-cell;
  vertical-align:middle;
  word-break:normal;
}
thead th.wrap-header button{
  white-space:normal!important;
  text-align:center!important;
  justify-content:center!important;
}

tbody td{height:46px;padding:0 6px;text-align:center;border-bottom:1px solid rgba(255,255,255,.045);color:#c7d5e4;font-size:13px;white-space:nowrap}
tbody tr:hover td{background:rgba(110,231,216,.035)}

.sticky{position:sticky!important;left:0;z-index:4;text-align:left!important;background:#091727}
thead .sticky{z-index:9;background:#0d1c2e}

.stock strong{display:block;color:#f1f6fd;font-size:13px;line-height:1.2;white-space:nowrap}
.stock-link{color:inherit;text-decoration:none;transition:color .15s ease}
.stock-link:hover{color:var(--accent);text-decoration:underline}
.stock small{display:block;color:#627891;font-size:10px;line-height:1.35;margin-top:2px;overflow:hidden;text-overflow:ellipsis}
.price{font-weight:700;color:#f0f6ff;font-size:13px}
.valuation{display:inline-flex;align-items:center;justify-content:center;padding:3px 6px;border-radius:6px;font-size:10px;font-weight:700}
.valuation.attractive,.valuation.good{color:var(--green);background:rgba(89,223,160,.08);border:1px solid rgba(89,223,160,.16)}
.valuation.fair{color:var(--yellow);background:rgba(245,201,106,.08);border:1px solid rgba(245,201,106,.16)}
.valuation.expensive{color:var(--red);background:rgba(255,119,130,.08);border:1px solid rgba(255,119,130,.16)}
.valuation.na{color:#8294a8;background:rgba(255,255,255,.04);border:1px solid var(--line)}

.pe-good{color:var(--green)!important;font-weight:700}
.pe-fair{color:var(--yellow)!important;font-weight:700}
.pe-high{color:var(--red)!important;font-weight:700}
tbody td.down{color:var(--red)!important}

.state{height:220px!important;text-align:center!important;color:#71869d!important}.state.error{color:#ff9da5!important}
.table-footer{height:42px;padding:0 15px;border-top:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;color:#657a91;font-size:11px}

thead th.sortable button{display:inline-flex;align-items:center;justify-content:center;gap:3px;width:100%;height:100%;padding:0;border:0;background:transparent;color:inherit;font:inherit;cursor:pointer}
thead th.sortable:first-child button{justify-content:flex-start;text-align:left}
.sort-indicator{font-size:11px;color:#60758a;line-height:1}

.valuation-guide{display:grid;grid-template-columns:.45fr 1.55fr;gap:35px;border-top:1px solid var(--line);margin-top:55px;padding:42px 0 8px}.valuation-guide h2{font:600 34px/1 "Space Grotesk";letter-spacing:-1px;margin:0}.rating-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:9px}.rating-card{padding:13px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.025)}.rating-card b,.rating-card span{display:block}.rating-card b{font-size:12px}.rating-card span{font-size:11px;color:var(--muted);margin-top:6px;line-height:1.4}.attractive-card b,.good-card b{color:var(--green)}.fair-card b{color:var(--yellow)}.expensive-card b{color:var(--red)}
.notes{display:grid;grid-template-columns:.8fr 1.2fr;gap:70px;border-top:1px solid var(--line);margin-top:42px;padding:48px 0 10px}.notes h2{font:600 34px/1.05 "Space Grotesk";letter-spacing:-1px;margin:0}.notes p{color:var(--muted);font-size:15px;line-height:1.8;margin:0;max-width:650px}.site-footer{display:flex;justify-content:space-between;color:#657a91;font-size:11px;padding:28px 0 35px;margin-top:35px;border-top:1px solid var(--line)}

@media(max-width:1000px){.rating-grid{grid-template-columns:repeat(2,1fr)}.valuation-guide{grid-template-columns:1fr;gap:20px}}
@media(max-width:850px){.stocks-container,.stocks-header{width:calc(100% - 28px)}.stocks-nav-toggle{display:block}.stocks-nav{display:none;position:absolute;top:70px;left:14px;right:14px;background:#0d1b2c;border:1px solid var(--line);border-radius:12px;padding:7px;z-index:20;flex-direction:column}.stocks-nav.open{display:flex}.stocks-hero{display:block;padding-top:45px}.connection-card{margin-top:20px;width:100%}.toolbar{display:block}.search{max-width:none}.controls{margin-top:8px;overflow:auto}.controls>*{flex-shrink:0}.stats-note{display:none}.notes{grid-template-columns:1fr;gap:18px}.site-footer{display:block}.site-footer span{display:block;margin:4px 0}}

/* MOBILE OPTIMIZATIONS: Display ONLY Symbol, Price, Change %, 52W, PE, PEG & Valuation with auto-fit content sizes */
@media(max-width:700px){
  .table-wrap{height:calc(100vh - 330px);min-height:520px;max-height:900px;overflow-x:auto;overflow-y:auto}
  table{table-layout:auto;width:max-content;min-width:100%}
  
  /* Hide all columns except Symbol, Price, Change %, 52W, PE, PEG & Valuation */
  thead th:nth-child(4),thead th:nth-child(5),thead th:nth-child(6),thead th:nth-child(7),thead th:nth-child(8),thead th:nth-child(13),thead th:nth-child(14),thead th:nth-child(15),
  tbody td:nth-child(4),tbody td:nth-child(5),tbody td:nth-child(6),tbody td:nth-child(7),tbody td:nth-child(8),tbody td:nth-child(13),tbody td:nth-child(14),tbody td:nth-child(15){display:none!important}
  
  /* Auto-fit columns based on text size & prevent symbol overlap */
  thead th:nth-child(1),tbody td:nth-child(1),
  thead th:nth-child(2),tbody td:nth-child(2),
  thead th:nth-child(3),tbody td:nth-child(3),
  thead th:nth-child(9),tbody td:nth-child(9),
  thead th:nth-child(10),tbody td:nth-child(10),
  thead th:nth-child(11),tbody td:nth-child(11),
  thead th:nth-child(12),tbody td:nth-child(12){
    display:table-cell!important;
    width:auto!important;
    padding:0 8px!important;
  }
  
  .stock small{display:none}
}
@media(max-width:500px){.stocks-hero h1{font-size:49px}.refresh span{display:none}.refresh{min-width:44px}.search kbd{display:none}.rating-grid{grid-template-columns:1fr}}