/* thegraph.finance - Dark terminal aesthetic */
:root {
    --bg-0: #06060a;
    --bg-1: #0c0c14;
    --bg-2: #12121c;
    --bg-3: #1a1a28;
    --border: #1e1e2e;
    --border-h: #2a2a40;
    --t1: #eeeef4;
    --t2: #b0b6c9;
    --t3: #808a9e;
    --cyan: #00d4ff;
    --cyan-d: rgba(0, 212, 255, 0.15);
    --gold: #ffb300;
    --gold-d: rgba(255, 179, 0, 0.15);
    --mint: #4ecdc4;
    --mint-d: rgba(78, 205, 196, 0.15);
    --coral: #ff6b6b;
    --coral-d: rgba(255, 107, 107, 0.15);
    --blue: #448aff;
    --purple: #a78bfa;
    --mono: 'IBM Plex Mono', monospace;
    --sans: 'IBM Plex Sans', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--bg-0);
    color: var(--t1);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
}

/* Nav */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 60px;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    line-height: 1.2;
}
.nav-brand-name {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 16px;
    color: var(--cyan);
}
.nav-brand-ext { color: var(--t3); font-weight: 400; }
.nav-brand-sub {
    font-family: var(--sans);
    font-size: 10px;
    color: var(--t3);
    font-weight: 400;
    letter-spacing: 0.5px;
}
.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    margin-right: 240px;
}
.nav-search {
    margin-left: 20px;
    flex-shrink: 0;
}
.nav-search input {
    font-family: var(--mono);
    font-size: 13px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 6px 12px;
    color: var(--t1);
    width: 220px;
    outline: none;
    transition: border-color 0.2s;
}
.nav-search input:focus { border-color: var(--cyan); }
.nav-search input::placeholder { color: var(--t3); }

/* Header */
.header {
    padding: 20px 24px 0;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
}
.h-row {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
}
.h-name { font-size: 22px; font-weight: 700; }
.h-ticker { font-family: var(--mono); font-size: 13px; color: var(--t2); }
.h-badge {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--t3);
    background: var(--bg-3);
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid var(--border);
}
.h-price-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 8px 0 12px;
}
.h-price { font-family: var(--mono); font-size: 30px; font-weight: 700; }
.h-curr { font-size: 13px; color: var(--t3); }
.h-chg {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}
.h-chg.up { color: var(--mint); background: var(--mint-d); }
.h-chg.down { color: var(--coral); background: var(--coral-d); }
.score-badge {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 6px;
    margin-left: 12px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    padding: 0 24px;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
}
.tab {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    padding: 10px 16px;
    color: var(--t3);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    user-select: none;
}
.tab:hover { color: var(--t2); }
.tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }

/* Panels */
.panel { display: none; }
.panel.active { display: block; }

/* Main layout (valuation) */
.main {
    display: grid;
    grid-template-columns: 1fr 280px;
    height: calc(100vh - 180px);
}
@media (max-width: 960px) { .main { grid-template-columns: 1fr; height: auto; } }

.chart-area {
    padding: 20px 24px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar {
    padding: 20px;
    background: var(--bg-1);
    overflow-y: auto;
}

/* Chart box */
.chart-box {
    position: relative;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}
.chart-box::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    opacity: 0.2;
}

/* Cards */
.card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}
.card-title {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 960px) { .grid-2 { grid-template-columns: 1fr; } }

/* Toggle buttons */
.toggle-row { display: flex; gap: 4px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.toggle-btn {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--t3);
    cursor: pointer;
}
.toggle-btn:hover { border-color: var(--border-h); color: var(--t2); }
.toggle-btn.active {
    background: var(--cyan);
    color: var(--bg-0);
    border-color: var(--cyan);
}

/* Period buttons */
.period-btns { display: flex; align-items: center; gap: 2px; }
.period-btn {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--t3);
    cursor: pointer;
    transition: all 0.15s;
}
.period-btn:hover { border-color: var(--border-h); color: var(--t2); }
.period-btn.active {
    background: var(--cyan-d, rgba(0,212,255,0.1));
    color: var(--cyan);
    border-color: var(--cyan);
}

/* Dropdown selects (dark theme) */
select {
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--t1);
    font-family: var(--mono);
    font-size: 11px;
    border-radius: 4px;
    padding: 4px 8px;
    outline: none;
}
select:focus { border-color: var(--cyan); }
select option { background: var(--bg-2); color: var(--t1); padding: 2px 4px; }
select option:checked { background: var(--cyan-d); color: var(--cyan); }

/* Checkbox dropdown filters */
.dd-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}
.dd-trigger {
    font-family: var(--mono);
    font-size: 11px;
    padding: 5px 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--t1);
    cursor: pointer;
    min-width: 100px;
    white-space: nowrap;
    transition: border-color 0.15s;
}
.dd-trigger:hover { border-color: var(--border-h); }
.dd-arrow { font-size: 8px; color: var(--t3); margin-left: 4px; }
.dd-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    min-width: 200px;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    padding: 4px 0;
}
.dd-menu.open { display: block; }
.dd-header {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--t3);
    padding: 6px 12px 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dd-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    cursor: pointer;
    font-family: var(--sans);
    font-size: 13px;
    color: var(--t2);
    transition: background 0.1s;
}
.dd-item:hover { background: var(--bg-3); }
.dd-item.selected { color: var(--cyan); }
.dd-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-h);
    border-radius: 4px;
    font-size: 11px;
    color: transparent;
    flex-shrink: 0;
    transition: all 0.15s;
}
.dd-check.on {
    background: var(--cyan);
    border-color: var(--cyan);
    color: var(--bg-0);
}
.filter-label {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--t3);
}

/* EPS / financial table */
.eps-tbl { width: 100%; overflow-x: auto; margin-bottom: 12px; }
.eps-tbl table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--mono);
    font-size: 11px;
    white-space: nowrap;
    table-layout: fixed;
}
.eps-tbl th {
    color: var(--t3);
    font-weight: 500;
    padding: 5px 6px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    text-overflow: ellipsis;
}
.eps-tbl th:first-child { text-align: left; width: 120px; }
.eps-tbl td { padding: 5px 6px; text-align: right; color: var(--t2); overflow: hidden; text-overflow: ellipsis; }
.eps-tbl td:first-child { text-align: left; color: var(--t3); width: 120px; }
.eps-tbl .est { color: var(--blue); }

/* Sidebar sections */
.sb-section { margin-bottom: 20px; }
.sb-title {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border);
}
.fact {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid var(--bg-3);
}
.fact-k { font-family: var(--mono); font-size: 12px; color: var(--t3); }
.fact-v { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.fact-v.cyan { color: var(--cyan); }
.fact-v.gold { color: var(--gold); }
.fact-v.mint { color: var(--mint); }
.fact-v.coral { color: var(--coral); }
.fact-v.blue { color: var(--blue); }
.fact-v.purple { color: var(--purple); }

/* Legend */
.gk-item { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.gk-sw { width: 12px; height: 12px; border-radius: 2px; flex-shrink: 0; }
.gk-line { width: 18px; height: 2px; flex-shrink: 0; }
.gk-label { font-family: var(--mono); font-size: 11px; color: var(--t2); }
.gk-val { font-family: var(--mono); font-size: 11px; font-weight: 600; margin-left: auto; }

/* Divider */
.dot-div { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 6px 0; }
.dot-div span { width: 3px; height: 3px; border-radius: 50%; background: var(--t3); }

/* Footer */
.footer {
    padding: 14px 24px;
    text-align: center;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--t3);
    border-top: 1px solid var(--border);
    margin-top: 20px;
}

/* Home page */
.home-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 110px);
    padding: 40px 24px;
}
.home-logo {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 42px;
    color: var(--cyan);
    margin-bottom: 12px;
}
.home-logo span { color: var(--t3); font-weight: 400; }
.home-sub {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--t3);
    margin-bottom: 32px;
}
.home-search {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}
.home-search input {
    font-family: var(--mono);
    font-size: 14px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 20px;
    color: var(--t1);
    width: 380px;
    outline: none;
    transition: border-color 0.2s;
}
.home-search input:focus { border-color: var(--cyan); }
.home-search input::placeholder { color: var(--t3); }
.home-search button {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    background: var(--cyan);
    color: var(--bg-0);
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.home-search button:hover { opacity: 0.85; }
.home-examples {
    display: flex;
    gap: 12px;
    align-items: center;
    font-family: var(--mono);
    font-size: 11px;
}
.home-examples span { color: var(--t3); }
.home-examples a {
    color: var(--t2);
    text-decoration: none;
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.2s;
}
.home-examples a:hover { color: var(--cyan); border-color: var(--cyan); }

/* Error page */
.error-code {
    font-family: var(--mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--coral);
    margin-bottom: 12px;
}
.error-link {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--cyan);
    text-decoration: none;
    margin-top: 20px;
    padding: 8px 20px;
    border: 1px solid var(--cyan);
    border-radius: 4px;
    transition: all 0.2s;
}
.error-link:hover { background: var(--cyan); color: var(--bg-0); }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 3px; }

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.chart-area, .sidebar { animation: fadeUp 0.4s ease; }
.sidebar { animation-delay: 0.1s; animation-fill-mode: both; }

/* ---- Nav links ---- */
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-link {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--t2);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}
.nav-link:hover { color: var(--cyan); background: var(--bg-3); }

/* ---- Index band ---- */
.idx-band {
    display: flex;
    justify-content: center;
    gap: 0;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}
.idx-band-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 24px;
    border-right: 1px solid var(--border);
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}
.idx-band-item:last-child { border-right: none; }
.idx-band-item:hover { background: var(--bg-2); }
.idx-band-name {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--t2);
    text-transform: uppercase;
}
.idx-band-price {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--t1);
}
.idx-band-chg {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
}
.idx-band-chg.up { color: var(--mint); background: var(--mint-d); }
.idx-band-chg.down { color: var(--coral); background: var(--coral-d); }

/* ---- Homepage sections ---- */
.home-section {
    padding: 28px 24px 12px;
    margin: 0 auto;
    animation: fadeUp 0.4s ease both;
}
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.section-title {
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.section-sub {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--t3);
}

/* ---- Blue chip grid ---- */
.chip-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.chip-grid::-webkit-scrollbar { display: none; }
.chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
}
.chip:hover { border-color: var(--cyan); background: var(--bg-3); }
.chip-ticker {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--cyan);
}
.chip-name {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--t1);
}

/* ---- Movers ---- */
.mover-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    text-decoration: none;
    border-bottom: 1px solid var(--bg-3);
    transition: background 0.15s;
}
.mover-row:hover { background: var(--bg-3); }
.mover-row:last-child { border-bottom: none; }
.mover-ticker {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--t1);
    min-width: 50px;
}
.mover-name {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--t1);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mover-price {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--t1);
}
.mover-chg {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
    min-width: 60px;
    text-align: right;
}
.mover-chg.mint { color: var(--mint); background: var(--mint-d); }
.mover-chg.coral { color: var(--coral); background: var(--coral-d); }

/* ---- Top holdings grid ---- */
.holdings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
}
.holding-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}
.holding-card:hover { border-color: var(--cyan); background: var(--bg-3); }
.holding-rank {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--t3);
    min-width: 22px;
}
.holding-info { flex: 1; overflow: hidden; }
.holding-ticker {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--cyan);
    display: block;
}
.holding-issuer {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--t3);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.holding-meta { text-align: right; }
.holding-val {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--t1);
    display: block;
}
.holding-funds {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--gold);
    display: block;
}

/* ---- Fund cards ---- */
.fund-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}
.fund-card {
    padding: 16px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.fund-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    opacity: 0.2;
}
.fund-card:hover { border-color: var(--cyan); background: var(--bg-3); transform: translateY(-1px); }
.fund-card-name {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 700;
    color: var(--t1);
    margin-bottom: 4px;
}
.fund-card-manager {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--t3);
    margin-bottom: 10px;
}
.fund-card-val {
    font-family: var(--mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--cyan);
    margin-bottom: 6px;
}
.fund-card-tops {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--t3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Index cards ---- */
.idx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
.idx-card {
    padding: 14px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}
.idx-card:hover { border-color: var(--cyan); background: var(--bg-3); }
.idx-card-name {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 700;
    color: var(--t1);
    margin-bottom: 2px;
}
.idx-card-region {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--t3);
    margin-bottom: 8px;
}
.idx-card-price {
    font-family: var(--mono);
    font-size: 15px;
    font-weight: 700;
    color: var(--t1);
}
.idx-card-chg {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    margin-top: 4px;
}
.idx-card-chg.up { color: var(--mint); background: var(--mint-d); }
.idx-card-chg.down { color: var(--coral); background: var(--coral-d); }
.idx-spark {
    display: block;
    margin-top: 8px;
}

/* ---- Homepage hero adjustment (smaller when sections present) ---- */
.home-hero {
    min-height: 50vh;
}

/* ---- Responsive ---- */
@media (max-width: 960px) {
    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tab { white-space: nowrap; padding: 10px 12px; font-size: 9px; }
}

@media (max-width: 600px) {
    .idx-band { flex-wrap: nowrap; justify-content: flex-start; }
    .idx-band-item { padding: 6px 14px; }
    .nav-links { display: none; }
    .holdings-grid { grid-template-columns: 1fr; }
    .fund-grid { grid-template-columns: 1fr; }
    .idx-grid { grid-template-columns: repeat(2, 1fr); }
    .home-hero { min-height: 40vh; padding: 20px 16px; }
    .home-search input { width: 260px; }
    .header { padding: 14px 16px 0; }
    .h-name { font-size: 18px; }
    .h-price { font-size: 24px; }
    .chart-area { padding: 14px 16px; border-right: none; }
    .toggle-row { flex-wrap: wrap; }
    .insider-toggle span { font-size: 9px; }
    .eps-tbl table { font-size: 9px; }
    .eps-tbl th, .eps-tbl td { padding: 4px 4px; }
}

/* ---- Technical Analysis Tab ---- */
.tech-top {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.tech-gauge {
    flex-shrink: 0;
}
.tech-signal-bar {
    flex: 1;
    min-width: 200px;
}
.sig-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sig-count {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.sig-count.mint { color: var(--mint); }
.sig-count.coral { color: var(--coral); }
.sig-bar-track {
    flex: 1;
    height: 10px;
    background: var(--bg-2);
    border-radius: 5px;
    display: flex;
    overflow: hidden;
}
.sig-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}
.sig-bar-fill.mint { background: var(--mint); }
.sig-bar-fill.gold { background: var(--gold); }
.sig-bar-fill.coral { background: var(--coral); }
.sig-neutral-label {
    text-align: center;
    font-family: var(--mono);
    font-size: 10px;
    color: var(--t3);
    margin-top: 4px;
}
.tech-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.tech-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    text-align: center;
}
.tech-card-label {
    font-family: var(--sans);
    font-size: 11px;
    color: var(--t3);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tech-card-val {
    font-family: var(--mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--t1);
}
.tech-controls {
    margin-bottom: 10px;
}
.tech-overlays {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.tech-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}
.tech-badge.mint { background: rgba(78,205,196,0.15); color: var(--mint); }
.tech-badge.coral { background: rgba(255,107,107,0.15); color: var(--coral); }
.tech-badge.gold { background: rgba(255,179,0,0.15); color: var(--gold); }
.tech-badge.cyan { background: rgba(0,212,255,0.15); color: var(--cyan); }
.tech-badge.neutral { background: rgba(153,153,176,0.1); color: var(--t3); }

/* Technical stacked chart panels */
.tech-stack {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 12px;
}
.tech-stack-panel {
    position: relative;
}
.tech-stack-panel + .tech-stack-panel {
    margin-top: 12px;
}
.tech-stack .chart-box {
    border: none;
    border-radius: 0;
    padding: 4px 12px 0;
    margin-bottom: 0;
}
.tech-stack .chart-box::before {
    display: none;
}
.tech-stack-first { border-radius: 8px 8px 0 0; }
.tech-stack-last { border-radius: 0 0 8px 8px; }

/* ---- Market Breadth (Index page) ---- */
.breadth-section {
    margin-top: 24px;
}
.breadth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

@media (max-width: 768px) {
    .tech-cards { grid-template-columns: repeat(2, 1fr); }
    .tech-top { flex-direction: column; align-items: stretch; }
    .breadth-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .tech-cards { grid-template-columns: 1fr; }
}

/* ---- Mover period buttons ---- */
.mover-periods { display: flex; gap: 2px; }
.mover-period-btn {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 3px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--t3);
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.mover-period-btn:hover { border-color: var(--cyan); color: var(--t2); }
.mover-period-btn.active { background: var(--cyan); color: var(--bg-0); border-color: var(--cyan); }

/* ---- Nav dropdown ---- */
.nav-dd {
    position: relative;
    display: flex;
    align-items: center;
}
.nav-dd-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 0;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    margin-top: 4px;
}
.nav-dd:hover .nav-dd-menu { display: block; }
.nav-dd-item {
    display: block;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--t2);
    padding: 6px 14px;
    text-decoration: none;
    transition: background 0.1s, color 0.1s;
    white-space: nowrap;
}
.nav-dd-item:hover { background: var(--bg-3); color: var(--cyan); }

/* ---- Soon tag ---- */
.nav-soon { cursor: default; opacity: 0.4; }
.soon-tag {
    font-family: var(--mono);
    font-size: 7px;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: super;
}

/* ---- Sector bars ---- */
.sector-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(30,30,46,0.3);
    transition: background 0.15s;
}
.sector-bar-row:hover { background: var(--bg-2); }
.sector-bar-row:last-child { border-bottom: none; }
.sector-bar-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--t1);
    min-width: 200px;
}
.sector-bar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.sector-bar-etf {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--t3);
    min-width: 40px;
}
.sector-bar-price {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--t2);
    min-width: 70px;
    text-align: right;
}
.sector-bar-track {
    flex: 1;
    height: 6px;
    background: var(--bg-3);
    border-radius: 3px;
    overflow: hidden;
    min-width: 100px;
}
.sector-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}
.sector-bar-fill.mint { background: var(--mint); }
.sector-bar-fill.coral { background: var(--coral); }
.sector-bar-chg {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    min-width: 70px;
    text-align: right;
}
.sector-bar-chg.mint { color: var(--mint); }
.sector-bar-chg.coral { color: var(--coral); }
.sector-bar-weight {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--t2);
    min-width: 55px;
    text-align: right;
}

.sector-bar-clickable { cursor: pointer; }
.sector-bar-clickable:hover { background: var(--bg-3); }
.sector-bar-link {
    color: var(--t1);
    text-decoration: none;
    transition: color 0.15s;
}
.sector-bar-link:hover { color: var(--cyan); }

/* ETF summary on sector detail */
.etf-summary {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

@media (max-width: 768px) {
    .sector-bar-name { min-width: 120px; font-size: 10px; }
    .sector-bar-etf { display: none; }
    .sector-bar-price { display: none; }
}