/* TradeDiary — dark trading journal UI */
:root {
  --bg: #0a0d14;
  --surface: #111520;
  --card: #161b2e;
  --card-2: #1b2137;
  --hover: #1e2540;
  --border: #242a42;
  --border-2: #2d3555;
  --text: #e8eaf6;
  --text-2: #8892b0;
  --muted: #5b6585;
  --accent: #4f8ef7;
  --accent-2: #6aa0ff;
  --accent-bg: rgba(79,142,247,.12);
  --profit: #00e5a0;
  --profit-bg: rgba(0,229,160,.1);
  --loss: #ff4d6d;
  --loss-bg: rgba(255,77,109,.1);
  --warn: #ffc107;
  --warn-bg: rgba(255,193,7,.1);
  --purple: #8b5cf6;
  --purple-bg: rgba(139,92,246,.12);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
  --sidebar: 244px;
  --mono: 'DM Mono', ui-monospace, monospace;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.55 'Space Grotesk', system-ui, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; }
p { margin: 0 0 .75em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.ic { flex-shrink: 0; vertical-align: middle; }
.mono, .num { font-family: var(--mono); font-feature-settings: 'tnum'; }
.profit { color: var(--profit) !important; }
.loss { color: var(--loss) !important; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden, [hidden] { display: none !important; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 60; transition: transform .25s ease; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: var(--text); font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--purple)); box-shadow: 0 6px 18px rgba(79,142,247,.35); }
.nav { flex: 1; overflow-y: auto; padding: 6px 10px 12px; }
.nav-label { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; margin-bottom: 1px; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--accent-bg); color: var(--accent-2); }
.nav-item.active .ic { color: var(--accent); }
.nav-item.is-soon { opacity: .45; cursor: default; }
.nav-item.is-soon:hover { background: none; color: var(--text-2); }
.nav-item em { margin-left: auto; font-style: normal; font-size: 10px; padding: 1px 6px; border-radius: 10px; background: var(--card); border: 1px solid var(--border); }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); background: var(--card); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--purple), var(--accent)); flex-shrink: 0; }
.user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-meta strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { color: var(--text-2); font-size: 11px; }
.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: rgba(10,13,20,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.page-title { font-size: 18px; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.content { padding: 24px 28px 48px; max-width: 1440px; width: 100%; }
.only-mobile { display: none !important; }
.sidebar-backdrop { display: none; }
.mkt-pill { font-size: 11.5px; font-weight: 500; padding: 3px 10px; border-radius: 20px; border: 1px solid var(--border); color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.mkt-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.mkt-pill.open { color: var(--profit); border-color: rgba(0,229,160,.3); }
.mkt-pill.open::before { background: var(--profit); box-shadow: 0 0 0 3px var(--profit-bg); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: none; box-shadow: var(--shadow); }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 55; }
  .main { margin-left: 0; }
  .only-mobile { display: inline-flex !important; }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px 16px 40px; }
  .mkt-pill { display: none; }
}

/* ---------- Cards & grid ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-sub { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-2-1 { grid-template-columns: minmax(0,2fr) minmax(320px,1fr); }
.stack > * + * { margin-top: 16px; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g-2-1 { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .g2, .g3 { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .g4 { grid-template-columns: 1fr 1fr; gap: 10px; } }

.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; }
.kpi-label { color: var(--text-2); font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-family: var(--mono); font-size: 22px; font-weight: 500; margin-top: 6px; letter-spacing: -.02em; }
.kpi-foot { font-size: 11.5px; color: var(--text-2); margin-top: 4px; }
.kpi::after { content: ''; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: var(--accent-bg); }
.kpi.k-profit::after { background: var(--profit-bg); }
.kpi.k-loss::after { background: var(--loss-bg); }
.kpi.k-purple::after { background: var(--purple-bg); }
@media (max-width: 480px) { .kpi { padding: 12px 14px; } .kpi-value { font-size: 18px; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: var(--radius-sm); font: 500 13.5px/1.2 inherit; font-family: inherit; border: 1px solid transparent; cursor: pointer; transition: .15s; white-space: nowrap; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }
.btn-danger { background: var(--loss-bg); color: var(--loss); border-color: rgba(255,77,109,.3); }
.btn-danger:hover { background: var(--loss); color: #fff; }
.btn-success { background: var(--profit); color: #04261b; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--radius-sm); color: var(--text-2); background: transparent; border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
@media (max-width: 600px) { .topbar-actions .btn span.lbl { display: none; } }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 14px 16px; }
.col-12 { grid-column: span 12; } .col-6 { grid-column: span 6; } .col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; } .col-8 { grid-column: span 8; }
@media (max-width: 760px) { .col-6, .col-4, .col-8 { grid-column: span 12; } .col-3 { grid-column: span 6; } }
.field label, .label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.field .error { font-size: 12px; color: var(--loss); margin-top: 4px; }
.input, select.input, textarea.input { width: 100%; padding: 10px 12px; background: var(--surface); color: var(--text); border: 1px solid var(--border-2); border-radius: var(--radius-sm); font: inherit; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.input.is-invalid { border-color: var(--loss); }
textarea.input { resize: vertical; min-height: 84px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238892b0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.input-sm { padding: 7px 10px; font-size: 13px; }
.input-group { display: flex; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .addon { padding: 0 12px; display: flex; align-items: center; background: var(--card-2); border: 1px solid var(--border-2); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-2); font-size: 12.5px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-2); font-size: 13px; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg input { display: none; }
.seg label { margin: 0; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-2); }
.seg input:checked + label { background: var(--accent); color: #fff; }
.seg.long-short input[value=long]:checked + label { background: var(--profit); color: #04261b; }
.seg.long-short input[value=short]:checked + label { background: var(--loss); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check input { display: none; }
.chip-check span { display: inline-block; padding: 4px 11px; border-radius: 20px; border: 1px solid var(--border-2); color: var(--text-2); font-size: 12.5px; cursor: pointer; user-select: none; }
.chip-check input:checked + span { background: var(--accent-bg); border-color: var(--accent); color: var(--accent-2); }
.chip-check.mistake input:checked + span { background: var(--loss-bg); border-color: var(--loss); color: var(--loss); }
.stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.stars input { display: none; }
.stars label { font-size: 20px; color: var(--border-2); cursor: pointer; margin: 0; line-height: 1; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: var(--warn); }
.form-section { font-size: 13px; font-weight: 600; color: var(--text); grid-column: span 12; padding-top: 8px; border-top: 1px solid var(--border); margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.form-section:first-child { border: 0; padding-top: 0; margin-top: 0; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

.dropzone { border: 2px dashed var(--border-2); border-radius: var(--radius); padding: 32px 20px; text-align: center; cursor: pointer; transition: .15s; background: var(--surface); }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-bg); }
.dropzone .ic { color: var(--accent); margin-bottom: 8px; }
.dropzone input { display: none; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.thumb { position: relative; width: 110px; height: 80px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.7); color: #fff; border: 0; cursor: pointer; display: grid; place-items: center; font-size: 14px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th a { color: inherit; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: rgba(30,37,64,.5); }
.table tbody tr.clickable { cursor: pointer; }
.table tfoot td { font-weight: 600; border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.sym { font-weight: 600; }
.sym small { display: block; font-weight: 400; color: var(--text-2); font-size: 11.5px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 500; background: var(--card-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge.long, .badge.win, .badge.success { background: var(--profit-bg); color: var(--profit); border-color: transparent; }
.badge.short, .badge.lossb, .badge.danger { background: var(--loss-bg); color: var(--loss); border-color: transparent; }
.badge.open, .badge.info { background: var(--accent-bg); color: var(--accent-2); border-color: transparent; }
.badge.warning { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.purple { background: var(--purple-bg); color: #a78bfa; border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---------- Alerts / banners ---------- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid; font-size: 13.5px; }
.alert span { flex: 1; }
.alert-success { background: var(--profit-bg); border-color: rgba(0,229,160,.25); color: #7af5c9; }
.alert-error { background: var(--loss-bg); border-color: rgba(255,77,109,.3); color: #ff97aa; }
.alert-warning { background: var(--warn-bg); border-color: rgba(255,193,7,.3); color: #ffd666; }
.alert-info { background: var(--accent-bg); border-color: rgba(79,142,247,.3); color: #9bbcff; }
.alert-x { background: none; border: 0; color: inherit; font-size: 18px; cursor: pointer; line-height: 1; opacity: .7; padding: 0 2px; }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 28px; font-size: 13px; border-bottom: 1px solid var(--border); }
.banner span { flex: 1; }
.banner.info { background: var(--accent-bg); color: #b7ccff; }
.banner.success { background: var(--profit-bg); color: #7af5c9; }
.banner.warning { background: var(--warn-bg); color: #ffd666; }
.banner.danger { background: var(--loss-bg); color: #ff97aa; }
@media (max-width: 960px) { .banner { padding: 10px 16px; } }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.toolbar .field { min-width: 130px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--text); border-color: var(--accent); }
.pager { display: flex; gap: 4px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 11px; border-radius: 6px; border: 1px solid var(--border); color: var(--text-2); font-size: 13px; }
.pager a:hover { background: var(--hover); color: var(--text); }
.pager .current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager .disabled { opacity: .4; }
.bulkbar { display: flex; gap: 10px; align-items: center; padding: 10px 14px; margin-bottom: 12px; background: var(--accent-bg); border-radius: var(--radius-sm); font-size: 13px; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty .ic { color: var(--muted); margin-bottom: 10px; }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 6px; }

/* ---------- Calendar heatmap ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-dow { font-size: 10.5px; color: var(--muted); text-align: center; text-transform: uppercase; letter-spacing: .05em; padding-bottom: 2px; }
.cal-day { aspect-ratio: 1 / .82; border-radius: 7px; background: var(--surface); border: 1px solid var(--border); padding: 4px 4px; display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; min-width: 0; }
.cal-day.blank { background: none; border-color: transparent; }
.cal-day .d { color: var(--muted); }
.cal-day .v { font-family: var(--mono); font-size: 10px; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.cal-day.today { border-color: var(--accent); }
.cal-day.pos { background: rgba(0,229,160,var(--a,.12)); border-color: rgba(0,229,160,.25); }
.cal-day.neg { background: rgba(255,77,109,var(--a,.12)); border-color: rgba(255,77,109,.25); }
.cal-day.pos .v { color: var(--profit); } .cal-day.neg .v { color: var(--loss); }
@media (max-width: 520px) { .cal-day .v { font-size: 8.5px; } .cal { gap: 3px; } }

/* ---------- Detail lists ---------- */
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.dl div small { display: block; color: var(--text-2); font-size: 11.5px; margin-bottom: 2px; }
.dl div strong { font-family: var(--mono); font-weight: 500; }
.notes { white-space: pre-wrap; color: var(--text-2); background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; border: 1px solid var(--border); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.gallery a { display: block; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 16/10; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.bar { height: 6px; border-radius: 3px; background: var(--surface); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.preview-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.preview-box .row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
.preview-box .row span:first-child { color: var(--text-2); }
.preview-box .row.total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; font-weight: 600; font-size: 15px; }
.sticky-side { position: sticky; top: 80px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.6); }
.modal.open { display: flex; }
.modal-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; }
.lightbox img { max-height: 85vh; border-radius: var(--radius-sm); }

/* ---------- Auth ---------- */
.auth-page { background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(79,142,247,.18), transparent), var(--bg); }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-brand { margin-bottom: 20px; font-size: 20px; }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 30px; box-shadow: var(--shadow); }
.auth-card h2 { font-size: 22px; margin-bottom: 4px; }
.auth-card .sub { color: var(--text-2); margin-bottom: 22px; }
.auth-card .field { margin-bottom: 14px; }
.auth-foot { text-align: center; color: var(--text-2); margin-top: 18px; font-size: 13px; }
.pw-meter { height: 4px; border-radius: 2px; background: var(--surface); margin-top: 6px; overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; transition: .2s; }

/* ---------- Landing ---------- */
.landing { background: var(--bg); }
.lnav { position: fixed; inset: 0 0 auto; z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: 14px 5%; background: rgba(10,13,20,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.lnav .links { display: flex; gap: 22px; align-items: center; }
.lnav .links a.txt { color: var(--text-2); }
.lnav .links a.txt:hover { color: var(--text); }
@media (max-width: 700px) { .lnav .links a.txt { display: none; } }
.hero { padding: 150px 5% 80px; text-align: center; background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(79,142,247,.16), transparent 70%), radial-gradient(ellipse 50% 40% at 80% 30%, rgba(139,92,246,.1), transparent); }
.hero-badge { display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border-2); background: var(--card); color: var(--text-2); font-size: 13px; margin-bottom: 22px; }
.hero h1 { font-size: clamp(36px, 6vw, 66px); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.grad { background: linear-gradient(135deg, var(--accent), var(--purple) 60%, var(--profit)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { max-width: 620px; margin: 22px auto 30px; color: var(--text-2); font-size: 17px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-shot { max-width: 1080px; margin: 60px auto 0; border-radius: 16px; border: 1px solid var(--border-2); background: var(--surface); padding: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.5), 0 0 0 1px rgba(79,142,247,.08); }
.section { padding: 90px 5%; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(26px, 4vw, 38px); letter-spacing: -.02em; margin: 10px 0; }
.section-head p { color: var(--text-2); }
.eyebrow { color: var(--accent); font-size: 12.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; max-width: 1160px; margin: 0 auto; }
.feature { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: .2s; }
.feature:hover { border-color: var(--border-2); transform: translateY(-2px); }
.feature .fi { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent); margin-bottom: 14px; }
.feature h3 { font-size: 16px; margin-bottom: 6px; }
.feature p { color: var(--text-2); margin: 0; font-size: 13.5px; }
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; max-width: 1000px; margin: 0 auto; }
.price-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; }
.price-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 20px 50px rgba(79,142,247,.15); }
.price-card .amt { font-size: 36px; font-weight: 700; font-family: var(--mono); margin: 12px 0 2px; }
.price-card ul { list-style: none; padding: 0; margin: 18px 0 24px; flex: 1; }
.price-card li { display: flex; gap: 8px; padding: 5px 0; color: var(--text-2); font-size: 13.5px; }
.price-card li .ic { color: var(--profit); margin-top: 2px; }
.lfoot { border-top: 1px solid var(--border); padding: 30px 5%; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 13px; }
.stat-row { display: flex; justify-content: center; gap: 48px; margin-top: 48px; flex-wrap: wrap; }
.stat-row div strong { display: block; font-size: 28px; font-family: var(--mono); }
.stat-row div span { color: var(--text-2); font-size: 13px; }

/* AI review markdown */
.md { font-size: 13.5px; color: var(--text-2); }
.md h2, .md h3, .md h4 { color: var(--text); font-size: 14.5px; margin: 16px 0 6px; }
.md h2:first-child, .md h3:first-child { margin-top: 0; }
.md ul, .md ol { padding-left: 18px; margin: 0 0 8px; }
.md li { margin-bottom: 4px; }
.md strong { color: var(--text); }
.md code { font-family: var(--mono); background: var(--surface); padding: 1px 5px; border-radius: 4px; }

/* ---------- Live market ---------- */
.skel { border-radius: var(--radius); background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 50%, var(--card) 100%); background-size: 200% 100%; animation: skel 1.4s infinite; }
@keyframes skel { to { background-position: -200% 0; } }
.idx-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.idx-card { display: block; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 10px; color: var(--text); transition: border-color .15s; }
.idx-card:hover { border-color: var(--accent); color: var(--text); }
.idx-name { font-size: 12px; color: var(--text-2); font-weight: 500; }
.idx-ltp { font-size: 20px; margin: 4px 0 1px; }
.spark { width: 100%; height: 34px; margin-top: 6px; display: block; }
.table.mini td { padding: 7px 6px; font-size: 13px; }
.table.mini tr { cursor: pointer; }
.breadth-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface); }
.breadth-bar i { display: block; height: 100%; }
.sec-row { display: grid; grid-template-columns: 130px 1fr 64px; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; cursor: pointer; }
.sec-row:hover span:first-child { color: var(--accent-2); }
.sec-bar { position: relative; height: 8px; background: var(--surface); border-radius: 4px; }
.sec-bar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.sec-bar i.pos { left: 50%; background: var(--profit); }
.sec-bar i.neg { right: 50%; background: var(--loss); }
.sec-row .mono { text-align: right; }
.treemap { position: relative; width: 100%; border-radius: var(--radius-sm); overflow: hidden; }
.tm-cell { position: absolute; box-sizing: border-box; border: 1px solid var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; cursor: pointer; overflow: hidden; text-align: center; transition: filter .1s; }
.tm-cell:hover { filter: brightness(1.2); z-index: 1; }
.tm-cell strong { font-size: 12.5px; font-weight: 600; max-width: 100%; padding: 0 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .tm-cell span { font-size: 11.5px; font-family: var(--mono); opacity: .9; }
.heat-legend { display: flex; border-radius: 6px; overflow: hidden; font-size: 10.5px; font-family: var(--mono); }
.heat-legend span { padding: 3px 7px; color: #fff; }
.sector-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.sector-cell { border-radius: 8px; padding: 12px; color: #fff; cursor: pointer; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.chart-card { padding: 16px; }
.chart-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.sym-search { position: relative; flex: 1; min-width: 200px; max-width: 340px; display: flex; align-items: center; }
.sym-search .ic { position: absolute; left: 10px; color: var(--muted); }
.sym-search .input { padding-left: 32px; text-transform: uppercase; }
.sym-results { position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; z-index: 30; background: var(--card); border: 1px solid var(--border-2); border-radius: var(--radius-sm); box-shadow: var(--shadow); max-height: 340px; overflow-y: auto; }
.sym-results button { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; padding: 9px 12px; background: none; border: 0; color: var(--text); cursor: pointer; font: inherit; font-size: 13px; border-bottom: 1px solid var(--border); }
.sym-results button:hover { background: var(--hover); }
.sym-results button .muted { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sym-results em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.ind-menu { position: relative; }
.ind-menu summary { list-style: none; }
.ind-menu summary::-webkit-details-marker { display: none; }
.ind-pop { position: absolute; right: 0; top: 100%; margin-top: 6px; z-index: 30; width: 220px; padding: 12px 14px; box-shadow: var(--shadow); }
.quote-head { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: baseline; margin-bottom: 10px; }
.qh-sym { font-weight: 700; font-size: 17px; }
.qh-px { font-size: 22px; }
.qh-ohlc { flex-basis: 100%; }
.chart-pane { width: 100%; position: relative; }
.chart-pane.sub { border-top: 1px solid var(--border); margin-top: 4px; }
.oc-table th, .oc-table td { padding: 6px 8px; font-size: 12.5px; white-space: nowrap; }
.oc-table .center { text-align: center; }
.oc-table td.strike { background: var(--surface); font-weight: 600; }
.oc-table td.itm { background: rgba(246,196,83,.06); }
.oc-table tr.atm td { border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); }
.oi-cell { position: relative; }
.oi-cell span { position: relative; }
.oi-bar { position: absolute; top: 20%; bottom: 20%; opacity: .22; border-radius: 2px; }
.oi-bar.ce { right: 0; background: var(--loss); }
.oi-bar.pe { left: 0; background: var(--profit); }
.oc-table .table-wrap, #ocTable { max-height: 640px; }
.flash-up { animation: fu 1s; } .flash-dn { animation: fd 1s; }
@keyframes fu { from { background: rgba(0,229,160,.25); } } @keyframes fd { from { background: rgba(255,77,109,.25); } }
.ticker-strip { display: flex; gap: 10px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 2px; }
.ticker-strip a { flex: 1 0 150px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; color: var(--text); font-size: 12px; }
.ticker-strip a strong { display: block; font-family: var(--mono); font-size: 15px; font-weight: 500; }
.bell { position: relative; }
.bell .dotc { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--loss); color: #fff; font-size: 10px; font-weight: 600; display: grid; place-items: center; }
.notif-pop { position: absolute; right: 0; top: 100%; margin-top: 6px; width: 320px; max-height: 420px; overflow-y: auto; z-index: 60; padding: 0; box-shadow: var(--shadow); }
.notif-pop a, .notif-pop .empty-n { display: block; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 13px; }
.notif-pop a:hover { background: var(--hover); }
.notif-pop small { color: var(--text-2); display: block; }
@media (max-width: 600px) { .notif-pop { position: fixed; left: 12px; right: 12px; top: 56px; width: auto; } .sec-row { grid-template-columns: 90px 1fr 60px; } }
@media (max-width: 600px) { #chartMain { height: 340px !important; } .ind-pop { right: auto; left: 0; } .qh-px { font-size: 19px; } }
