* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0d1117; --surface: #161b22; --border: #30363d; --text: #e6edf3;
  --text2: #8b949e; --accent: #58a6ff; --green: #3fb950; --red: #f85149;
  --gold: #d29922; --purple: #bc8cff;
}
body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
nav { display: flex; align-items: center; gap: 1.5rem; padding: 0.75rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.nav-brand { font-weight: 700; font-size: 1.2rem; color: var(--accent); }
.nav-link { color: var(--text2); font-size: 0.9rem; }
.nav-link.active, .nav-link:hover { color: var(--text); }
.hero { text-align: center; padding: 3rem 1rem 2rem; }
.hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.disclaimer { color: var(--gold); font-size: 0.85rem; margin: 0.5rem 0; }
.ticker-form { display: flex; justify-content: center; gap: 0.5rem; max-width: 400px; margin: 1.5rem auto; }
.ticker-form input { flex: 1; padding: 0.75rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 1.1rem; text-transform: uppercase; }
.ticker-form button { padding: 0.75rem 1.5rem; background: var(--accent); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; }
.ticker-form button:hover { opacity: 0.85; }
#current-price { font-size: 1.3rem; margin-top: 0.5rem; }
.hidden { display: none !important; }
#loading-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 999; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#loading-overlay p { margin-top: 1rem; color: var(--text2); }
.expiry-selector { padding: 1rem 1.5rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.expiry-selector label { color: var(--text2); font-size: 0.9rem; }
.expiry-selector select { padding: 0.5rem; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 4px; }
.hist-vol { color: var(--text2); font-size: 0.85rem; }
.tabs { display: flex; padding: 0 1.5rem; gap: 0; }
.tab-btn { padding: 0.6rem 1.5rem; background: transparent; color: var(--text2); border: 1px solid var(--border); border-bottom: none; border-radius: 6px 6px 0 0; cursor: pointer; font-size: 0.9rem; }
.tab-btn.active { background: var(--surface); color: var(--accent); border-color: var(--accent); }
.tab-content { display: none; padding: 0 1.5rem 2rem; }
.tab-content.active { display: block; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 0; }
th, td { padding: 0.5rem 0.75rem; text-align: right; font-size: 0.85rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: var(--surface); color: var(--text2); position: sticky; top: 0; }
.greeks-col { color: var(--purple); font-variant-numeric: tabular-nums; }
.resizable-table th.resizable { position: relative; padding-right: 14px; }
.resize-handle { position: absolute; right: 0; top: 0; bottom: 0; width: 4px; cursor: col-resize; background: transparent; }
.resize-handle:hover { background: var(--accent); }
th:first-child, td:first-child { text-align: center; }
tr:hover { background: rgba(88,166,255,0.05); }
tr.itm { background: rgba(63,185,80,0.05); }
.clickable-row { cursor: pointer; }
.positive { color: var(--green); }
.negative { color: var(--red); }
/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 2rem 1rem; overflow-y: auto; }
.modal-content { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; max-width: 900px; width: 100%; position: relative; }
.modal-close { position: absolute; top: 0.75rem; right: 1rem; background: none; border: none; color: var(--text2); font-size: 1.5rem; cursor: pointer; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.detail-card { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; }
.detail-card.full-width { grid-column: 1 / -1; }
.detail-card h3 { color: var(--accent); margin-bottom: 0.5rem; font-size: 0.95rem; }
.detail-card .metric { display: flex; justify-content: space-between; padding: 0.25rem 0; border-bottom: 1px solid rgba(48,54,61,0.5); font-size: 0.85rem; }
.detail-card .metric .val { font-weight: 600; }
/* Score */
.score-bar { height: 24px; background: var(--border); border-radius: 12px; overflow: hidden; margin: 0.5rem 0; }
.score-fill { height: 100%; border-radius: 12px; transition: width 0.5s; }
.score-value { font-size: 2rem; font-weight: 700; text-align: center; }
/* Glossary */
.glossary { max-width: 800px; margin: 0 auto; padding: 2rem 1.5rem; }
.glossary h1 { text-align: center; margin-bottom: 1rem; }
.glossary-list { display: flex; flex-direction: column; gap: 1rem; }
.glossary-item { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; }
.glossary-item h3 { color: var(--accent); margin-bottom: 0.25rem; }
.glossary-item p { color: var(--text2); font-size: 0.9rem; }
footer { text-align: center; padding: 2rem 1rem; border-top: 1px solid var(--border); }
canvas { max-width: 100%; }
/* Score column */
.score-col { font-weight: 700; text-align: center; }
/* Strategy page */
.strategy-builder { padding: 0 1.5rem 2rem; }
.strat-controls { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.strat-controls label { color: var(--text2); font-size: 0.9rem; }
.strat-controls select { padding: 0.5rem; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 4px; }
.btn-primary { padding: 0.6rem 1.2rem; background: var(--accent); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; }
.btn-primary:hover { opacity: 0.85; }
.strike-inputs { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.strike-field { flex: 1; min-width: 180px; }
.strike-field label { display: block; color: var(--text2); font-size: 0.85rem; margin-bottom: 0.25rem; }
.strike-field select { width: 100%; padding: 0.5rem; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 4px; }
.strategy-info { margin-bottom: 1rem; }
.strategy-desc { color: var(--text2); font-size: 0.9rem; line-height: 1.5; }
#results-area { padding: 0 1.5rem 2rem; }
@media (max-width: 600px) {
  .detail-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.4rem; }
  .ticker-form { flex-direction: column; }
}
