/* =========================================================
   SharkTrade — Marketpulse-inspired design system
   Dark-first, with a light theme override.
   ========================================================= */

:root,
[data-theme="dark"] {
    --ink: #0E1116;
    --ink-2: #1A1F27;
    --panel: #161B22;
    --panel-2: #1C222B;
    --line: #262D38;
    --line-2: #323A47;
    --fg: #E8ECF1;
    --fg-dim: #9AA4B2;
    --fg-mute: #646E7D;
    --up: #22C55E;
    --up-bg: rgba(34, 197, 94, 0.10);
    --up-line: rgba(34, 197, 94, 0.28);
    --down: #F0455B;
    --down-bg: rgba(240, 69, 91, 0.10);
    --down-line: rgba(240, 69, 91, 0.28);
    --gold: #E3B23C;
    --accent: #5B8DEF;

    /* Legacy aliases used across templates */
    --bg: var(--ink);
    --bg-card: var(--panel);
    --bg-header: rgba(14, 17, 22, 0.82);
    --text: var(--fg);
    --text-muted: var(--fg-dim);
    --border: var(--line);
    --primary: var(--accent);
    --primary-dark: #4577d6;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --radius: 14px;

    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

[data-theme="light"] {
    --ink: #F4F6F9;
    --ink-2: #ECEFF4;
    --panel: #FFFFFF;
    --panel-2: #F7F9FC;
    --line: #E2E8F0;
    --line-2: #D5DCE6;
    --fg: #0E1116;
    --fg-dim: #50596A;
    --fg-mute: #8A93A3;
    --up: #16A34A;
    --up-bg: rgba(22, 163, 74, 0.10);
    --up-line: rgba(22, 163, 74, 0.24);
    --down: #DC2B45;
    --down-bg: rgba(220, 43, 69, 0.09);
    --down-line: rgba(220, 43, 69, 0.22);
    --gold: #B7860B;
    --accent: #2F6FE4;

    --bg-header: rgba(255, 255, 255, 0.85);
    --primary-dark: #1f57c0;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--ink);
    color: var(--fg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.display { font-family: var(--font-display); }

.container { width: min(1240px, 100% - 3rem); margin-inline: auto; }
@media (max-width: 560px) { .container { width: min(1240px, 100% - 2rem); } }

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 9999;
    padding: .5rem 1rem; background: var(--accent); color: #fff; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ===================== Ticker tape ===================== */
.tape {
    border-bottom: 1px solid var(--line);
    background: var(--ink-2);
    overflow: hidden; white-space: nowrap; position: relative;
}
.tape-track { display: inline-flex; gap: 0; animation: tape-scroll 56s linear infinite; will-change: transform; }
.tape:hover .tape-track { animation-play-state: paused; }
@keyframes tape-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tape-item {
    display: inline-flex; align-items: baseline; gap: 8px;
    padding: 9px 20px; font-size: 12.5px; border-right: 1px solid var(--line);
    color: var(--fg); text-decoration: none;
}
.tape-item:hover { text-decoration: none; background: rgba(255,255,255,.02); }
.tape-item .sym { color: var(--fg-dim); font-weight: 500; letter-spacing: .04em; }
.tape-item .px { color: var(--fg); font-weight: 500; }
.tape-item .ch { font-weight: 600; }
.pos { color: var(--up); }
.neg { color: var(--down); }

/* ===================== Header ===================== */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--bg-header);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex; align-items: center; gap: 1rem;
    padding: .85rem 0; flex-wrap: wrap;
}

.logo { display: flex; align-items: center; gap: .7rem; color: var(--fg); text-decoration: none; }
.logo:hover { text-decoration: none; color: var(--fg); }
.logo-mark {
    width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
    background: linear-gradient(140deg, var(--up) 0%, var(--accent) 100%);
    color: #fff; display: grid; place-items: center;
    font-family: var(--font-display); font-size: .9rem; font-weight: 700; letter-spacing: -.02em;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.18);
}
.logo-text {
    font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em;
}

.nav-desktop { display: none; gap: .15rem; flex: 1; }
.nav-desktop a {
    padding: .4rem .7rem; border-radius: 8px; color: var(--fg-dim);
    font-size: .85rem; font-weight: 500; text-decoration: none; white-space: nowrap; transition: .15s;
}
.nav-desktop a:hover, .nav-desktop a.active { color: var(--fg); background: var(--ink-2); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

.search-form { position: relative; }
.search-form input {
    width: 170px; padding: .5rem .8rem; border: 1px solid var(--line-2);
    border-radius: 9px; background: var(--panel); color: var(--fg); font-size: .85rem; font-family: var(--font);
}
.search-form input::placeholder { color: var(--fg-mute); }
.search-form input:focus { outline: none; border-color: var(--accent); }
.search-suggestions {
    position: absolute; top: 100%; left: 0; right: 0; margin-top: 6px;
    background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,.4); max-height: 300px; overflow-y: auto; z-index: 50;
}
.search-suggestions a {
    display: block; padding: .55rem .8rem; color: var(--fg); text-decoration: none; font-size: .85rem;
    border-bottom: 1px solid var(--line);
}
.search-suggestions a:last-child { border-bottom: none; }
.search-suggestions a:hover { background: var(--panel-2); text-decoration: none; }

.btn-icon {
    border: 1px solid var(--line-2); background: var(--panel); color: var(--fg);
    border-radius: 9px; width: 38px; height: 38px; cursor: pointer; font-size: 1rem;
    display: inline-flex; align-items: center; justify-content: center; transition: .15s;
}
.btn-icon:hover { border-color: var(--accent); }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark, :root:not([data-theme]) .theme-icon-dark { display: none; }

.nav-toggle { display: inline-flex; }
.nav-mobile {
    display: flex; flex-direction: column; padding: .5rem 0 1rem;
    border-top: 1px solid var(--line);
}
.nav-mobile[hidden] { display: none; }
.nav-mobile a { padding: .65rem .25rem; color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--line); font-size: .9rem; }

/* Live clock pill */
.clock { display: flex; align-items: center; gap: 10px; }
.live {
    display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--fg-dim);
    padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 99px; white-space: nowrap;
}
.live.closed .dot { background: var(--fg-mute); box-shadow: none; animation: none; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); animation: pulse 2s infinite; }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
    70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.clock .t { font-family: var(--font-mono); font-size: 13px; color: var(--fg-dim); }

@media (min-width: 980px) {
    .nav-desktop { display: flex; }
    .nav-toggle { display: none; }
    .search-form input { width: 220px; }
}

/* ===================== Page intro / hero ===================== */
.page-content { padding: 28px 0 60px; }

.home-intro { padding: 26px 0 6px; }
.home-intro .eyebrow {
    font-size: 11.5px; color: var(--fg-mute); letter-spacing: .14em; text-transform: uppercase; margin: 0 0 .5rem;
}
.home-intro h1 {
    font-family: var(--font-display); font-size: clamp(1.7rem, 3.4vw, 2.3rem);
    font-weight: 600; letter-spacing: -.015em; margin: 0 0 .6rem; line-height: 1.12;
}
.home-intro .lead { color: var(--fg-dim); max-width: 640px; margin: 0; font-size: 1rem; }

.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; color: var(--fg-mute); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 1.2rem;
    border-radius: 9px; font-weight: 600; font-size: .875rem; text-decoration: none; border: 1px solid transparent; cursor: pointer;
    font-family: var(--font); transition: .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.btn-secondary { background: var(--panel); color: var(--fg); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--accent); color: var(--fg); text-decoration: none; }

/* ===================== Index rail ===================== */
.indices {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
    background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
    margin-bottom: 28px;
}
.idx { background: var(--panel); padding: 16px 18px; }
.idx .name { font-size: 11.5px; color: var(--fg-mute); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idx .val { font-family: var(--font-display); font-size: 25px; font-weight: 600; margin: 7px 0 4px; letter-spacing: -.01em; }
.idx .chg { font-family: var(--font-mono); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.idx .spark { margin-top: 11px; height: 30px; width: 100%; display: block; }
.caret { font-style: normal; }

/* ===================== Section headers ===================== */
.pulse-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
    margin: 6px 0 16px; flex-wrap: wrap;
}
.pulse-head .lead { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.pulse-head h2 { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.breadth { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--fg-dim); }
.breadth-bar { width: 160px; height: 8px; border-radius: 99px; overflow: hidden; display: flex; background: var(--down); }
.breadth-bar i { display: block; height: 100%; background: var(--up); }

.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg button {
    font-family: var(--font); font-size: 12.5px; font-weight: 500; color: var(--fg-dim);
    background: transparent; border: none; cursor: pointer; padding: 6px 13px; border-radius: 6px; transition: .15s;
}
.seg button.on { background: var(--ink-2); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.seg button:hover:not(.on) { color: var(--fg); }

/* ===================== Movers boards ===================== */
.movers { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.board { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; }
.board-head { display: flex; align-items: center; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.board-head .ic {
    width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.board.up .board-head .ic { background: var(--up-bg); color: var(--up); }
.board.down .board-head .ic { background: var(--down-bg); color: var(--down); }
.board-head .ttl { font-family: var(--font-display); font-size: 15px; font-weight: 600; flex: 1; }
.board-head .meta { font-size: 11.5px; color: var(--fg-mute); font-family: var(--font-mono); }

.row {
    display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 13px;
    padding: 13px 20px; border-top: 1px solid var(--line); cursor: pointer; transition: background .14s; position: relative;
    color: var(--fg); text-decoration: none;
}
.row:hover { background: var(--panel-2); text-decoration: none; color: var(--fg); }
.rank {
    font-family: var(--font-mono); font-size: 13px; color: var(--fg-mute);
    width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
    background: var(--ink-2); border: 1px solid var(--line);
}
.r-main { min-width: 0; }
.r-main .sym { font-family: var(--font-display); font-size: 14.5px; font-weight: 600; letter-spacing: .01em; }
.r-main .nm { font-size: 11.5px; color: var(--fg-mute); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.r-fig { text-align: right; }
.r-fig .px { font-family: var(--font-mono); font-size: 14px; font-weight: 500; }
.r-fig .ch { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; margin-top: 2px; display: inline-flex; align-items: center; gap: 4px; }
.chip-bar { margin-top: 6px; height: 4px; border-radius: 99px; overflow: hidden; width: 100%; }
.board.up .chip-bar { background: var(--up-bg); }
.board.down .chip-bar { background: var(--down-bg); }
.chip-bar i { display: block; height: 100%; }
.board.up .chip-bar i { background: var(--up); }
.board.down .chip-bar i { background: var(--down); }

/* ===================== Panel + data tables ===================== */
.panel { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; margin-bottom: 30px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { font-family: var(--font-display); font-size: 15px; font-weight: 600; margin: 0; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: right; font-size: 11px; font-weight: 600; color: var(--fg-mute); letter-spacing: .08em; text-transform: uppercase;
    padding: 11px 20px; border-bottom: 1px solid var(--line);
}
.data-table th:first-child { text-align: left; }
.data-table td { padding: 13px 20px; font-size: 13.5px; text-align: right; border-top: 1px solid var(--line); }
.data-table td:first-child { text-align: left; }
.data-table tbody tr { cursor: pointer; transition: background .14s; }
.data-table tbody tr:hover { background: var(--panel-2); }
.td-sym { font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.td-sym a { color: var(--fg); }
.td-sym a:hover { color: var(--fg); text-decoration: none; }
.td-nm { font-size: 11.5px; color: var(--fg-mute); font-weight: 400; margin-top: 1px; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 7px; font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.pill.pos { background: var(--up-bg); color: var(--up); }
.pill.neg { background: var(--down-bg); color: var(--down); }
.vol-cell { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.vol-bar { width: 54px; height: 6px; border-radius: 99px; background: var(--ink-2); overflow: hidden; flex-shrink: 0; }
.vol-bar i { display: block; height: 100%; background: var(--accent); }

/* ===================== Cards / sections ===================== */
.section-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    margin: 30px 0 16px;
}
.section-head h2 { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.link-arrow { font-size: .85rem; font-weight: 500; white-space: nowrap; color: var(--accent); }

.card-section {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: 16px; padding: 18px 20px; margin-bottom: 22px;
}
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; gap: 1rem; flex-wrap: wrap; }
.section-header h2 { margin: 0; font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; }

.grid-2 { display: grid; gap: 20px; }
@media (min-width: 980px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ===================== Generic stock table (other pages) ===================== */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.stock-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.stock-table thead th {
    background: var(--ink-2); color: var(--fg-dim); text-align: left; white-space: nowrap; cursor: pointer;
    padding: .7rem .85rem; font-weight: 600; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
    border-bottom: 1px solid var(--line); position: sticky; top: 60px; z-index: 10;
}
.stock-table thead th:hover { color: var(--fg); }
.stock-table td { padding: .7rem .85rem; border-top: 1px solid var(--line); }
.stock-table tbody tr { transition: background .14s; }
.stock-table tbody tr:hover { background: var(--panel-2); }
.stock-table .num, .stock-table td[data-value] { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.symbol-link { color: var(--fg); font-family: var(--font-display); font-weight: 600; }
.symbol-link:hover { color: var(--accent); }
.text-up { color: var(--up); font-weight: 600; }
.text-down { color: var(--down); font-weight: 600; }
.empty-state, .empty-state-box { text-align: center; color: var(--fg-mute); padding: 2.5rem 1rem; }

.hide-mobile, .hide-sm { display: none; }
@media (min-width: 768px) { .hide-mobile, .hide-sm { display: table-cell; } }

.watchlist-btn { background: none; border: none; cursor: pointer; font-size: 1.05rem; color: var(--fg-mute); }
.watchlist-btn:hover { color: var(--gold); }
.watchlist-btn.active { color: var(--gold); }
.watchlist-btn-lg { border: 1px solid var(--line-2); padding: .45rem .8rem; border-radius: 9px; font-size: .85rem; background: var(--panel); color: var(--fg); }

/* ===================== Page header (interior pages) ===================== */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { margin: 0 0 .5rem; font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; letter-spacing: -.01em; }
.page-intro { color: var(--fg-dim); margin: 0; }
.notice { font-size: .85rem; color: var(--fg-dim); background: var(--panel); padding: .75rem 1rem; border-radius: 10px; border: 1px solid var(--line); margin-top: .75rem; }

/* ===================== Filters ===================== */
.filters-bar { margin-bottom: 1.5rem; }
.filters-form { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .85rem; }
.filters-form label { display: flex; flex-direction: column; gap: .3rem; font-size: .72rem; color: var(--fg-mute); text-transform: uppercase; letter-spacing: .06em; }
.filters-form select {
    padding: .5rem .8rem; border: 1px solid var(--line-2); border-radius: 9px;
    background: var(--panel); color: var(--fg); font-size: .85rem; font-family: var(--font);
}

.category-chips, .chip-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
    display: inline-flex; align-items: center; padding: .4rem .8rem; border-radius: 99px;
    background: var(--panel); border: 1px solid var(--line-2); color: var(--fg-dim);
    font-size: .8rem; font-weight: 500; text-decoration: none; transition: .15s;
}
.chip:hover { border-color: var(--accent); color: var(--fg); text-decoration: none; }
.chip-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip-active:hover { color: #fff; }

/* ===================== Breadcrumbs ===================== */
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .25rem; list-style: none; padding: 0; margin: 0 0 1.25rem; font-size: .8rem; }
.breadcrumbs li:not(:last-child)::after { content: '/'; margin-left: .35rem; color: var(--fg-mute); }
.breadcrumbs a { color: var(--fg-dim); }

/* ===================== Featured / sectors / news ===================== */
.featured-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.featured-card {
    display: flex; flex-direction: column; gap: 2px; padding: 16px; border: 1px solid var(--line);
    border-radius: 14px; text-decoration: none; color: var(--fg); background: var(--panel); transition: .15s;
}
.featured-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.featured-code { font-family: var(--font-display); font-weight: 600; font-size: .9rem; }
.featured-name { font-size: .72rem; color: var(--fg-mute); margin: 2px 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.featured-price { font-family: var(--font-mono); font-weight: 600; }
.featured-card .text-up, .featured-card .text-down { font-family: var(--font-mono); font-size: .8rem; }

.sector-grid, .guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.sector-card, .guide-card {
    padding: 1.25rem; background: var(--panel); border: 1px solid var(--line);
    border-radius: 14px; text-decoration: none; color: var(--fg); display: block; transition: .15s;
}
.sector-card:hover, .guide-card:hover { border-color: var(--accent); text-decoration: none; }
.guide-card h2 { font-family: var(--font-display); font-size: 1rem; margin: 0 0 .5rem; color: var(--fg); }
.guide-card p { font-size: .875rem; color: var(--fg-dim); margin: 0 0 .75rem; }

.news-grid { display: grid; gap: 1rem; }
@media (min-width: 768px) { .news-grid { grid-template-columns: repeat(3, 1fr); } }
.news-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; }
.news-card h3 { font-size: .9375rem; margin: 0 0 .35rem; line-height: 1.35; }
.news-card h3 a { color: var(--fg); }
.news-card h3 a:hover { color: var(--accent); }
.news-card time { font-size: .75rem; color: var(--fg-mute); font-family: var(--font-mono); }
.news-list-page .news-row { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.news-list-page h2 { font-family: var(--font-display); font-size: 1.125rem; margin: 0 0 .25rem; }
.news-hero-img { width: 100%; height: auto; border-radius: 14px; margin-bottom: 1.5rem; }

/* ===================== Stock detail page ===================== */
.stock-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; align-items: flex-start; }
.stock-header h1 { margin: 0; font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; letter-spacing: -.01em; }
.stock-code { color: var(--fg-mute); margin: .25rem 0 0; font-family: var(--font-mono); }
.stock-lp { display: block; font-family: var(--font-display); font-size: 2rem; font-weight: 600; }
.stock-change { display: block; font-family: var(--font-mono); font-size: 1.05rem; font-weight: 600; }
.chart-wrap { position: relative; height: 280px; }

.stats-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; margin: 0; }
.stats-dl div { padding: .85rem 1rem; background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; }
.stats-dl dt { font-size: .72rem; color: var(--fg-mute); margin: 0; text-transform: uppercase; letter-spacing: .05em; }
.stats-dl dd { margin: .3rem 0 0; font-family: var(--font-mono); font-weight: 600; }

.performance-bars { display: flex; flex-direction: column; gap: .75rem; }
.perf-row { display: grid; grid-template-columns: 80px 1fr 70px; align-items: center; gap: .5rem; font-size: .875rem; }
.perf-bar { height: 8px; background: var(--ink-2); border-radius: 4px; overflow: hidden; }
.perf-fill.up { background: var(--up); height: 100%; }
.perf-fill.down { background: var(--down); height: 100%; }

.content-section { margin: 2.5rem 0; }
.content-section h2 { font-family: var(--font-display); font-size: 1.25rem; margin: 1.5rem 0 .75rem; font-weight: 600; }
.content-section p { color: var(--fg-dim); }
.guide-article section { margin-bottom: 1.5rem; }
.guide-article .lead { font-size: 1.0625rem; color: var(--fg-dim); }

/* ===================== FAQ ===================== */
.faq-section { margin: 2.5rem 0; }
.faq-section h2 { font-family: var(--font-display); font-weight: 600; }
.faq-item { border: 1px solid var(--line); border-radius: 12px; margin-bottom: .6rem; padding: .25rem 1rem; background: var(--panel); }
.faq-item summary { cursor: pointer; font-weight: 600; padding: .65rem 0; }
.faq-item p { margin: 0 0 .75rem; color: var(--fg-dim); font-size: .9375rem; }

/* ===================== Related links ===================== */
.related-links { margin: 2.5rem 0; }
.related-links h2 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin: 0 0 1rem; }

/* ===================== Pagination ===================== */
.pagination { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: center; margin-top: 1.75rem; }
.page-link {
    padding: .45rem .8rem; border: 1px solid var(--line-2); border-radius: 8px;
    color: var(--fg); text-decoration: none; font-size: .85rem; font-family: var(--font-mono); background: var(--panel);
}
.page-link:hover { border-color: var(--accent); text-decoration: none; }
.page-link.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-link.disabled { opacity: .4; pointer-events: none; }

/* ===================== Footer ===================== */
.site-footer { background: var(--ink-2); border-top: 1px solid var(--line); padding: 3rem 0 1.5rem; margin-top: 3rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 2rem; }
.footer-grid strong { font-family: var(--font-display); font-size: 1.05rem; }
.footer-grid p { color: var(--fg-dim); font-size: .875rem; margin: .5rem 0 0; }
.footer-grid h3 { font-size: .75rem; margin: 0 0 .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-mute); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: .45rem; }
.footer-grid a { color: var(--fg-dim); font-size: .875rem; text-decoration: none; }
.footer-grid a:hover { color: var(--fg); }
.footer-bottom { text-align: center; font-size: .8rem; color: var(--fg-mute); border-top: 1px solid var(--line); padding-top: 1.5rem; }

/* ===================== Search page ===================== */
.search-page-form { display: flex; gap: .75rem; margin-bottom: 2rem; }
.search-page-form input {
    flex: 1; padding: .8rem 1rem; border: 1px solid var(--line-2); border-radius: 10px;
    background: var(--panel); color: var(--fg); font-size: 1rem; font-family: var(--font);
}
.results-count { color: var(--fg-dim); font-size: .875rem; margin-bottom: 1rem; }

/* ===================== Holiday calendar pages ===================== */
.holiday-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .75rem;
    margin-bottom: 2rem;
}
.holiday-stat-card {
    display: flex; flex-direction: column; gap: .25rem;
    padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: 14px;
    background: var(--panel); text-decoration: none; color: var(--fg);
    transition: border-color .14s, transform .14s;
}
.holiday-stat-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.holiday-stat-card.is-current { border-color: var(--accent); background: var(--panel-2); }
.holiday-stat-year { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.holiday-stat-label { font-size: .8rem; color: var(--fg-dim); }

.holiday-year-nav, .holiday-seg-nav {
    display: flex; flex-wrap: wrap; gap: .5rem;
    margin-bottom: 1.25rem;
}
.holiday-summary-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem;
    padding: .85rem 1.1rem; margin-bottom: 1.25rem;
    border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
    font-size: .875rem; color: var(--fg-dim);
}
.holiday-summary-bar strong { color: var(--fg); }
.holiday-summary-bar a { margin-left: auto; font-size: .85rem; }

.holiday-table tbody tr.is-today { background: rgba(var(--accent-rgb, 99, 102, 241), .08); }
.holiday-table tbody tr.is-today td { font-weight: 600; }
.holiday-table tbody tr.is-past { opacity: .55; }
.holiday-table tbody tr { cursor: default; }
.holiday-table tbody tr:hover { background: var(--panel-2); }

.holiday-segment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .75rem;
    margin-top: 1rem;
}
.holiday-segment-card {
    display: flex; flex-direction: column; gap: .35rem;
    padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 12px;
    background: var(--panel); text-decoration: none; color: var(--fg);
    transition: border-color .14s;
}
.holiday-segment-card:hover { border-color: var(--accent); text-decoration: none; }
.holiday-segment-name { font-size: .875rem; color: var(--fg-dim); }
.holiday-segment-count { font-size: 1rem; font-weight: 600; }

.market-status-card {
    padding: 1.25rem 1.5rem; margin-bottom: 1.5rem;
    border: 1px solid var(--line); border-radius: 16px; background: var(--panel);
}
.market-status-card.is-open { border-color: var(--up); background: var(--up-bg); }
.market-status-card.is-closed { border-color: var(--line-2); }
.market-status-indicator { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; font-size: 1.1rem; }
.market-status-card.is-open .dot { background: var(--up); box-shadow: 0 0 8px var(--up); }
.market-status-card.is-closed .dot { background: var(--fg-mute); animation: none; }
.market-status-card p { margin: 0; color: var(--fg-dim); font-size: .9375rem; }
.market-status-holiday { margin-top: .5rem !important; }

.holiday-hours-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .75rem;
    margin-bottom: 2rem;
}
.holiday-hours-card {
    padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
}
.holiday-hours-card.is-primary { border-color: var(--accent); background: var(--panel-2); }
.holiday-hours-label { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-mute); margin-bottom: .35rem; }
.holiday-hours-time { font-size: .9375rem; font-weight: 600; }

.holiday-upcoming-section { margin-bottom: 2rem; }

/* ===================== Responsive ===================== */
@media (max-width: 880px) {
    .indices { grid-template-columns: 1fr 1fr; }
    .movers { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .indices { grid-template-columns: 1fr 1fr; }
    .idx .val { font-size: 21px; }
    .clock .t { display: none; }
    .r-main .nm { max-width: 120px; }
}

@media (prefers-reduced-motion: reduce) {
    .tape-track { animation: none; }
    .dot { animation: none; }
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
