:root {
    --page: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: rgba(255, 255, 255, .72);
    --ink: #10182d;
    --muted: #5c697e;
    --faint: #94a3b8;
    --line: rgba(143, 162, 184, .17);
    --teal: #14b8a6;
    --teal-dark: #0f766e;
    --teal-soft: #e8f8f5;
    --green: #079669;
    --red: #df5361;
    --shadow: 0 20px 50px rgba(44, 66, 91, .07);
    --shadow-high: 0 26px 68px rgba(44, 66, 91, .1);
    
    --c-text-main: var(--ink);
    --glass-bg: rgba(255, 255, 255, 0.75);
}

html[data-theme="dark"] {
    --page: #0b0f19;
    --surface: #101726;
    --surface-soft: rgba(16, 23, 38, .76);
    --ink: #f1f5f9;
    --muted: #94a3b8;
    --faint: #64748b;
    --line: rgba(148, 163, 184, .14);
    --teal: #14b8a6;
    --teal-dark: #2dd4bf;
    --teal-soft: rgba(20, 184, 166, 0.08);
    --green: #10b981;
    --red: #f43f5e;
    --shadow: 0 20px 50px rgba(0, 0, 0, .3);
    --shadow-high: 0 26px 68px rgba(0, 0, 0, .45);
    
    --c-text-main: var(--ink);
    --glass-bg: rgba(16, 23, 38, 0.75);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100dvh;
    background: var(--page);
    color: var(--ink);
    font-family: Manrope, Arial, sans-serif;
}
html[dir="rtl"] body,
html[dir="rtl"] .display { font-family: "IBM Plex Sans Arabic", Arial, sans-serif; }
a { text-decoration: none; color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
.display { font-family: Sora, Manrope, Arial, sans-serif; }
.tabular { font-variant-numeric: tabular-nums; }
.grid-backdrop {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(15, 23, 42, .027) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 184, 166, .037) 1px, transparent 1px);
    background-size: 42px 42px;
}
.atmosphere {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 1% 0%, rgba(20, 184, 166, .14), transparent 28%),
        radial-gradient(circle at 100% 4%, rgba(45, 212, 191, .09), transparent 26%);
}
.site-nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 20;
    height: 5rem;
    border-bottom: 1px solid var(--line);
    background: rgba(244, 247, 251, .86);
    backdrop-filter: blur(20px);
}
.nav-inner {
    max-width: 1536px;
    height: 5rem;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.3rem;
}
.brand { display: flex; align-items: center; gap: .75rem; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: .62rem;
    background: var(--teal);
    color: #faffff;
    font-size: 1.35rem;
    font-weight: 800;
}
.brand-name { font-size: 1.1rem; letter-spacing: .17em; font-weight: 800; }
.nav-links { display: flex; gap: clamp(1.05rem, 1.9vw, 2rem); align-items: center; }
.nav-links a {
    position: relative;
    color: var(--muted);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .14em;
    white-space: nowrap;
    transition: color 180ms ease;
}
html[dir="rtl"] .nav-links a { font-family: "IBM Plex Sans Arabic", sans-serif; font-size: 13px; letter-spacing: 0; }
.nav-links a:is(:hover, .active) { color: var(--teal-dark); }
.nav-links a.active::after {
    content: "";
    position: absolute;
    inset: auto 0 -.72rem;
    height: 2px;
    border-radius: 2px;
    background: var(--teal);
}
.lang-toggle {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .62rem 1.02rem;
    background: var(--surface);
    font-weight: 700;
    color: var(--ink);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}
.lang-toggle:hover { border-color: rgba(20,184,166,.38); box-shadow: 0 12px 24px rgba(20,184,166,.1); }
.pulse-page {
    width: min(1488px, calc(100% - 2.5rem));
    margin: 0 auto;
    padding: 6.4rem 0 5rem;
}
.shell, .panel {
    border: 1px solid var(--line);
    background: var(--surface-soft);
    box-shadow: var(--shadow);
}
.market-banner {
    min-height: 6.4rem;
    display: grid;
    grid-template-columns: 13rem minmax(36rem, 1fr) minmax(15rem, 18rem);
    gap: 1rem;
    align-items: stretch;
    padding: .7rem .8rem;
    border-radius: 1.55rem;
    backdrop-filter: blur(18px);
}
.exchange-signature {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding-inline: .45rem 1.15rem;
    border-inline-end: 1px solid var(--line);
}
.exchange-mark {
    width: 2.45rem;
    height: 2.45rem;
    display: block;
}
.exchange-mark svg { width: 100%; height: 100%; fill: none; stroke: var(--teal); stroke-width: 2.4; }
.exchange-mark circle { fill: var(--teal); stroke: #f5fbfa; }
.exchange-name { font-size: 1.22rem; letter-spacing: .03em; font-weight: 700; }
.caption { color: var(--muted); font-size: .72rem; margin-top: .16rem; }
.banner-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(8.25rem, 1fr));
    align-items: center;
}
.ribbon-metric {
    min-width: 0;
    padding: .3rem clamp(.75rem, 1.6vw, 1.28rem);
    border-inline-end: 1px solid var(--line);
    display: grid;
    gap: .22rem;
}
.ribbon-metric:last-child { border: 0; }
.ribbon-metric > span { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.ribbon-metric strong { font-size: 1.03rem; font-weight: 700; }
.ribbon-metric small { font-size: .7rem; color: var(--muted); }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.status-pill {
    display: inline-flex;
    justify-self: start;
    align-items: center;
    min-height: 1.25rem;
    padding: .06rem .48rem;
    border-radius: 999px;
    background: var(--teal-soft);
    color: var(--teal-dark) !important;
    font-weight: 700;
}
.company-search {
    position: relative;
    display: flex;
    align-items: center;
}
.company-search svg {
    position: absolute;
    left: .95rem;
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: var(--faint);
    stroke-width: 2;
}
html[dir="rtl"] .company-search svg { left: auto; right: .95rem; }
.company-search input {
    width: 100%;
    height: 3rem;
    padding: 0 .95rem 0 2.65rem;
    border: 1px solid var(--line);
    border-radius: .85rem;
    background: rgba(248,250,252,.72);
    color: var(--ink);
}
html[dir="rtl"] .company-search input { padding: 0 2.65rem 0 .95rem; }
.company-search input:focus {
    outline: none;
    border-color: rgba(20,184,166,.42);
    box-shadow: 0 0 0 4px rgba(20,184,166,.08);
}
.workspace {
    display: grid;
    grid-template-columns: minmax(17.5rem, 19rem) minmax(32rem, 1fr) minmax(19rem, 21.5rem);
    gap: .8rem;
    margin-top: .85rem;
    align-items: start;
}
.left-rail, .center-stage, .right-rail { display: grid; gap: .8rem; min-width: 0; }
.panel {
    border-radius: 1.28rem;
    overflow: hidden;
    background: var(--surface-soft);
    backdrop-filter: blur(16px);
}
.panel-head {
    min-height: 3.2rem;
    padding: 1rem 1.05rem .72rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
}
.panel-head h2 { margin: 0; font-size: .9rem; letter-spacing: -.025em; font-weight: 700; }
.panel-head a { color: var(--teal-dark); font-size: .72rem; font-weight: 700; }
.subtle { color: var(--muted); font-size: .7rem; }
.segmented {
    display: flex;
    gap: .14rem;
    margin: 0 .8rem .65rem;
    padding: .2rem;
    border-radius: .66rem;
    background: rgba(241,245,249,.72);
}
.segmented button {
    flex: 1;
    border: 0;
    border-radius: .49rem;
    padding: .52rem .3rem;
    background: transparent;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 700;
    transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.segmented button.active {
    background: var(--surface);
    color: var(--teal-dark);
    box-shadow: 0 5px 13px rgba(42,60,84,.06);
}
/* ── Add-stock button ── */
.add-stock-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    border: 1.5px solid rgba(20,184,166,.3);
    background: var(--teal-soft);
    color: var(--teal-dark);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.add-stock-btn svg { width: .82rem; height: .82rem; pointer-events: none; }
.add-stock-btn:hover {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 14px rgba(20,184,166,.35);
}
/* ── Premium Select Dropdown ── */
.premium-select {
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.32rem 1.6rem 0.32rem 0.55rem;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314b8a6' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.45rem center;
    background-size: 0.8rem;
    min-width: 6.8rem;
    max-width: 9.5rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
html[dir="rtl"] .premium-select {
    padding: 0.32rem 0.55rem 0.32rem 1.6rem;
    background-position: left 0.45rem center;
}
.premium-select:focus, .premium-select:hover {
    border-color: rgba(20, 184, 166, 0.42);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.08);
}
.premium-select option {
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
}
/* ── Add-stock search panel ── */
.watch-add-panel {
    padding: .6rem .8rem .5rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}
.watch-add-header {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.watch-add-search-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: .45rem;
    height: 2.2rem;
    padding: 0 .7rem;
    border: 1.5px solid rgba(20,184,166,.25);
    border-radius: .65rem;
    background: var(--page);
    transition: border-color 180ms ease, box-shadow 180ms ease;
    cursor: text;
}
.watch-add-search-label:focus-within {
    border-color: rgba(20,184,166,.55);
    box-shadow: 0 0 0 3px rgba(20,184,166,.1);
}
.watch-add-search-label svg { width: .75rem; height: .75rem; color: var(--muted); flex-shrink: 0; }
.watch-add-search-label input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--ink);
    font-size: .72rem;
    outline: none;
}
.watch-add-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    cursor: pointer;
    padding: 0;
    transition: background 150ms ease, color 150ms ease;
    flex-shrink: 0;
}
.watch-add-close svg { width: .7rem; height: .7rem; }
.watch-add-close:hover { background: var(--red); color: #fff; border-color: var(--red); }
.watch-add-results {
    max-height: 13rem;
    overflow-y: auto;
    margin-top: .45rem;
    scrollbar-width: thin;
}
.watch-add-row {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .48rem .55rem;
    border-radius: .5rem;
    cursor: pointer;
    transition: background 140ms ease;
}
.watch-add-row:hover:not(.watch-add-row--added) { background: var(--teal-soft); }
.watch-add-row--added { opacity: .42; pointer-events: none; cursor: default; }
.watch-add-row-logo {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
    background: var(--surface-soft);
}
.watch-add-row-info { flex: 1; min-width: 0; }
.watch-add-row-info strong { display: block; font-size: .74rem; font-weight: 700; color: var(--ink); }
.watch-add-row-info small { display: block; font-size: .62rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.watch-add-row-badge {
    font-size: .6rem;
    font-weight: 700;
    padding: .15rem .45rem;
    border-radius: .35rem;
    background: var(--teal-soft);
    color: var(--teal-dark);
    flex-shrink: 0;
}
.watch-add-row--added .watch-add-row-badge { background: var(--surface-soft); color: var(--muted); }
.watch-add-empty { padding: 1.5rem 1rem; text-align: center; color: var(--muted); font-size: .72rem; }
/* ── Watchlist table — FLEXBOX (definitive alignment fix) ── */
.table-labels {
    padding: .5rem 1rem;
    display: flex;
    align-items: center;
    border-block: 1px solid var(--line);
    color: var(--faint);
    font-size: .64rem;
    font-weight: 600;
}
.lbl-sym { flex: 1; min-width: 0; }
.lbl-last { width: 5.5rem; text-align: center; flex-shrink: 0; }
.lbl-chg  { width: 5.0rem; text-align: center; flex-shrink: 0; }
.watch-rows { min-height: 22.55rem; }
.watch-row {
    width: 100%;
    border: 0;
    border-bottom: 1px solid rgba(148,163,184,.12);
    padding: .62rem 1rem;
    display: flex;
    align-items: center;
    background: transparent;
    color: var(--ink);
    text-align: start;
    cursor: pointer;
    transition: background 170ms ease;
}
.watch-row:hover, .watch-row.active { background: var(--teal-soft); }
/* Stock identity column — shrinks gracefully */
.stock-ident {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .48rem;
    overflow: hidden;
}
.stock-ident-logo {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
    background: var(--surface-soft);
}
.stock-ident-text { min-width: 0; flex: 1; overflow: hidden; }
.stock-ident strong { display: block; font-size: .76rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stock-ident small  { display: block; font-size: .61rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Price columns — FIXED width, NEVER compress */
.price-cell  { width: 5.5rem; flex-shrink: 0; font-size: .73rem; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.change-cell { width: 5.0rem; flex-shrink: 0; font-size: .69rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-inline { padding: 2.8rem 1rem; color: var(--muted); font-size: .76rem; text-align: center; }
.skeleton-row {
    margin: .74rem 1rem;
    height: 2.2rem;
    border-radius: .55rem;
    background: linear-gradient(95deg, var(--surface-soft), var(--surface), var(--surface-soft));
    background-size: 220% 100%;
    animation: shimmer 1.5s linear infinite;
}
.quick-stats { padding-bottom: 1rem; }
.quick-stats dl { margin: 0; padding: .2rem 1.05rem 0; }
.quick-stats dl div {
    min-height: 2.65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(148,163,184,.1);
}
.quick-stats dt { color: var(--muted); font-size: .72rem; }
.quick-stats dd { margin: 0; font-size: .75rem; font-weight: 700; }
.breadth-bar { height: .38rem; margin: 1.1rem 1.05rem .75rem; display: flex; overflow: hidden; border-radius: 999px; background: #eef2f6; }
.breadth-bar span { display: block; background: var(--green); transition: width 500ms cubic-bezier(.16,1,.3,1); }
.breadth-bar i { display: block; background: var(--red); transition: width 500ms cubic-bezier(.16,1,.3,1); }
.market-reading { margin: 0 1.05rem; min-height: 2rem; color: var(--teal-dark); font-size: .69rem; line-height: 1.55; font-weight: 600; }
.equity-workspace { padding-bottom: .85rem; box-shadow: var(--shadow-high); }
.security-head {
    min-height: 6.4rem;
    display: grid;
    grid-template-columns: minmax(13rem, 1fr) auto auto;
    align-items: center;
    gap: 1.2rem;
    padding: 1.1rem 1.2rem .7rem;
}
.ticker-row { display: flex; align-items: center; gap: .48rem; }
.ticker-row h1 { margin: 0; font-size: 1.42rem; font-weight: 700; letter-spacing: -.05em; }
.favorite {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    border: 1.5px solid rgba(20,184,166,.28);
    color: var(--teal-dark);
    background: var(--teal-soft);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: transform 200ms cubic-bezier(.34,1.56,.64,1), background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.favorite svg { width: .78rem; height: .78rem; display: block; pointer-events: none; }
.favorite:hover { transform: scale(1.15); background: rgba(20,184,166,.18); }
.favorite.active {
    background: linear-gradient(135deg, #f59e0b, #eab308);
    border-color: #d97706;
    color: #fff;
    box-shadow: 0 3px 12px rgba(234,179,8,.4);
}
.security-name {
    max-width: 19rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: .22rem 0 0;
    color: var(--muted);
    font-size: .7rem;
}
.quote { display: flex; align-items: baseline; gap: .38rem; white-space: nowrap; }
.quote strong { font-size: 2rem; letter-spacing: -.06em; }
.quote .unit { color: var(--muted); font-size: .68rem; font-weight: 600; }
.quote small { margin-inline-start: .48rem; font-size: .76rem; font-weight: 700; }
.outline-action {
    border: 1px solid rgba(20,184,166,.24);
    border-radius: .62rem;
    padding: .68rem .95rem;
    background: var(--teal);
    color: #faffff;
    font-size: .7rem;
    font-weight: 700;
    white-space: nowrap;
    transition: transform 160ms ease, background 160ms ease;
}
.outline-action:hover { background: #10a998; transform: translateY(-1px); }
.quick-view-btn {
    border: 1px solid var(--teal);
    border-radius: .62rem;
    padding: .68rem .95rem;
    background: transparent;
    color: var(--teal-dark);
    font-size: .7rem;
    font-weight: 700;
    white-space: nowrap;
    transition: transform 160ms ease, background 160ms ease, color 160ms ease;
    cursor: pointer;
}
.quick-view-btn:hover {
    background: var(--teal);
    color: #faffff;
    transform: translateY(-1px);
}
.ohlc-metrics {
    min-height: 2.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
    padding: 0 1.2rem .72rem;
    border-bottom: 1px solid var(--line);
}
.ohlc-metrics div { display: grid; gap: .18rem; }
.ohlc-metrics span { color: var(--faint); font-size: .61rem; }
.ohlc-metrics strong { font-size: .72rem; font-weight: 700; }
.chart-controls {
    min-height: 3.2rem;
    padding: .65rem 1.15rem .45rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}
.period-controls { display: flex; gap: .28rem; }
.period-controls button {
    min-width: 2.65rem;
    border: 0;
    border-radius: .47rem;
    padding: .44rem .65rem;
    background: transparent;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 700;
}
.period-controls button.active { background: var(--teal-soft); color: var(--teal-dark); }
.price-figure { position: relative; height: clamp(19rem, 29vw, 25rem); margin: .3rem .75rem 0; }
#stockChart, #indexChart { display: block; width: 100%; height: 100%; overflow: visible; }
.gridline {
    fill: none;
    stroke: rgba(148, 163, 184, .16);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}
.axis {
    fill: var(--faint);
    font: 10px "IBM Plex Mono", ui-monospace, monospace;
}
.candle-up { fill: var(--green); stroke: var(--green); }
.candle-down { fill: var(--red); stroke: var(--red); }
.wick { stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.volume-up { fill: rgba(7, 150, 105, .33); }
.volume-down { fill: rgba(223, 83, 97, .3); }
.chart-divider { stroke: rgba(148, 163, 184, .18); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-message {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: .78rem;
}
.chart-message.hidden { display: none; }
.company-overview { padding-bottom: .7rem; }
.overview-tabs {
    display: flex;
    align-items: center;
    gap: clamp(.8rem, 2vw, 1.5rem);
    border-bottom: 1px solid var(--line);
    padding: .9rem 1.15rem 0;
    overflow-x: auto;
}
.overview-tabs span {
    position: relative;
    padding-bottom: .85rem;
    white-space: nowrap;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 600;
}
.overview-tabs span.active { color: var(--teal-dark); }
.overview-tabs span.active::after { content: ""; position: absolute; inset: auto 0 0; height: 2px; border-radius: 2px; background: var(--teal); }
.overview-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    padding: 1.35rem 1.15rem 1rem;
}
.overview-content h2 { margin: 0 0 .55rem; font-size: .92rem; letter-spacing: -.03em; }
.overview-content p { max-width: 33rem; margin: 0; color: var(--muted); font-size: .73rem; line-height: 1.72; }
.company-facts { margin: 0; display: grid; grid-template-columns: auto auto; column-gap: 1.1rem; row-gap: .46rem; align-content: start; }
.company-facts dt { color: var(--muted); font-size: .67rem; }
.company-facts dd { margin: 0; color: var(--ink); font-size: .69rem; font-weight: 600; max-width: 10rem; }
.index-overview { padding-bottom: .9rem; }
.index-quote { display: flex; align-items: baseline; justify-content: space-between; padding: .05rem 1.05rem .45rem; }
.index-quote strong { font-size: 1.04rem; letter-spacing: -.035em; }
.index-quote span { font-size: .72rem; font-weight: 700; }
.index-figure { height: 8.55rem; margin: .35rem 1rem .6rem; }
.feed-note { min-height: 1.2rem; margin: 0 1.05rem; color: var(--muted); font-size: .63rem; line-height: 1.45; }
.movers { padding-block: .82rem .48rem; }
.movers-toggle { margin-bottom: .85rem; }
.mover-rows { padding: .45rem 0; min-height: 9.9rem; }
.mover-row {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--ink);
    text-align: start;
    cursor: pointer;
    transition: background 170ms ease;
    display: grid;
    grid-template-columns: 1fr auto 4rem;
    gap: .5rem;
    padding: .48rem 1rem;
    align-items: center;
    font-size: .7rem;
}
.mover-row:hover, .mover-row.active {
    background: var(--teal-soft);
    outline: none;
}
.mover-row span:nth-child(2), .mover-row strong { text-align: end; }
.mover-row strong { font-size: .68rem; }
.news-panel { padding-bottom: .52rem; }
.news-rows { padding: .1rem .92rem; }
.news-card {
    display: grid;
    grid-template-columns: 3.55rem 1fr;
    gap: .7rem;
    align-items: center;
    padding: .72rem 0;
    border-bottom: 1px solid rgba(148,163,184,.12);
}
.news-card:last-child { border-bottom: 0; }
.news-media {
    width: 3.55rem;
    height: 3rem;
    border-radius: .48rem;
    overflow: hidden;
    background: #ffffff;
}
.news-media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.news-media span { display: grid; width: 100%; height: 100%; place-items: center; color: var(--teal-dark); font-size: .68rem; font-weight: 700; }
.news-copy h3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin: 0 0 .3rem;
    color: var(--ink);
    font-size: .68rem;
    line-height: 1.42;
    font-weight: 700;
}
.news-copy time { color: var(--muted); font-size: .61rem; }
.skeleton-news {
    height: 3.3rem;
    margin: .7rem 0;
    border-radius: .55rem;
    background: linear-gradient(95deg, var(--surface-soft), var(--surface), var(--surface-soft));
    background-size: 220% 100%;
    animation: shimmer 1.5s linear infinite;
}
.market-tape {
    position: fixed;
    z-index: 10;
    inset: auto 0 0;
    height: 3.05rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.3rem;
    padding: 0 clamp(1rem, 3vw, 2rem);
    border-top: 1px solid var(--line);
    background: rgba(248, 251, 253, .94);
    backdrop-filter: blur(20px);
    box-shadow: 0 -14px 30px rgba(40,61,87,.05);
}
.tape-label { color: var(--muted); font-size: .68rem; font-weight: 700; }
.ticker-tape {
    display: flex;
    gap: 1.45rem;
    overflow: hidden;
    white-space: nowrap;
}
.tape-entry { font-size: .7rem; font-weight: 600; }
.tape-entry strong { margin-inline-end: .5rem; }
.tape-entry span { margin-inline-start: .45rem; font-weight: 700; }
.tape-status {
    display: flex;
    align-items: center;
    gap: .45rem;
    color: var(--muted);
    font-size: .69rem;
    font-weight: 600;
}
.tape-status::before { content: ""; width: .43rem; height: .43rem; border-radius: 50%; background: var(--teal); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (max-width: 1152px) {
    .market-banner { grid-template-columns: 11.7rem 1fr; }
    .company-search { grid-column: 1 / -1; padding: .3rem .25rem; }
    .workspace { grid-template-columns: minmax(16.5rem, 18rem) 1fr; }
    .right-rail { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 846px) {
    .nav-links { display: none; }
    .nav-inner { padding-inline: 1.15rem; }
    .pulse-page { width: min(100% - 1.25rem, 1488px); padding-top: 5.8rem; }
    .market-banner { grid-template-columns: 1fr; }
    .exchange-signature { border-inline-end: 0; padding: .25rem .4rem .72rem; border-bottom: 1px solid var(--line); }
    .banner-metrics { grid-template-columns: repeat(2, 1fr); }
    .ribbon-metric:nth-child(even) { border-inline-end: 0; }
    .ribbon-metric { margin-block: .35rem; }
    .workspace { grid-template-columns: 1fr; }
    .left-rail { grid-template-columns: 1fr; }
    .watch-rows { min-height: auto; }
    .right-rail { display: grid; grid-template-columns: 1fr; }
    .security-head { grid-template-columns: 1fr auto; }
    .outline-action { grid-column: 1 / -1; }
    .overview-content { grid-template-columns: 1fr; gap: 1.1rem; }
}
@media (max-width: 558px) {
    .market-tape { display: none; }
    .pulse-page { padding-bottom: 1.2rem; }
    .banner-metrics { grid-template-columns: 1fr; }
    .ribbon-metric { border-inline-end: 0; border-bottom: 1px solid var(--line); padding-block: .55rem; }
    .security-head { display: block; }
    .quote { margin: .85rem 0; }
    .chart-controls { display: block; }
    .chart-controls .subtle { display: block; margin-top: .55rem; }
    .price-figure { height: 16rem; }
}

/* World-class interactive tooltips */
.chart-tooltip {
    position: absolute;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.72rem;
    pointer-events: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    transition: opacity 120ms ease;
    display: none;
    text-align: left;
}
.chart-tooltip strong {
    display: block;
    font-size: 0.85rem;
    margin-top: 4px;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-weight: 600;
}
.chart-tooltip span {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Dark Mode Tooltip (Default) */
html[data-theme="dark"] .chart-tooltip,
body.dark-theme .chart-tooltip,
.chart-tooltip {
    background: rgba(16, 24, 45, 0.93);
    border: 1px solid rgba(20, 184, 166, 0.45);
    color: #f8fafc;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.25);
}
html[data-theme="dark"] .chart-tooltip span,
body.dark-theme .chart-tooltip span,
.chart-tooltip span {
    color: #94a3b8;
}
html[data-theme="dark"] .chart-tooltip strong,
body.dark-theme .chart-tooltip strong,
.chart-tooltip strong {
    color: #14b8a6;
}

/* Light Mode Tooltip */
html[data-theme="light"] .chart-tooltip,
body.light-theme .chart-tooltip {
    background: rgba(255, 255, 255, 0.93);
    border: 1px solid rgba(20, 184, 166, 0.35);
    color: #0f172a;
    box-shadow: 0 16px 36px rgba(148, 163, 184, 0.18);
}
html[data-theme="light"] .chart-tooltip span,
body.light-theme .chart-tooltip span {
    color: #64748b;
}
html[data-theme="light"] .chart-tooltip strong,
body.light-theme .chart-tooltip strong {
    color: #0d9488;
}

/* Interactive SVG hover bars */
.hover-bar {
    cursor: pointer;
}
.hover-bar:hover {
    fill: rgba(20, 184, 166, 0.055) !important;
}

/* Premium view company action */
#companyAction {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

/* Premium list SVG logos */
.watch-row img, .mover-row img {
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 1px;
}

/* Dark Mode Theme specific support overrides */
html[data-theme="dark"] .grid-backdrop {
    background-image:
        linear-gradient(rgba(255, 255, 255, .012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 184, 166, .018) 1px, transparent 1px);
}
html[data-theme="dark"] .atmosphere {
    background:
        radial-gradient(circle at 1% 0%, rgba(20, 184, 166, 0.07), transparent 28%),
        radial-gradient(circle at 100% 4%, rgba(45, 212, 191, 0.05), transparent 26%);
}
html[data-theme="dark"] .site-nav {
    background: rgba(11, 15, 25, .86);
}
html[data-theme="dark"] .market-tape {
    background: rgba(11, 15, 25, .94);
}
html[data-theme="dark"] .watch-row:hover,
html[data-theme="dark"] .watch-row.active,
html[data-theme="dark"] .mover-row:hover,
html[data-theme="dark"] .mover-row.active {
    background: rgba(20, 184, 166, 0.12);
}
html[data-theme="dark"] .segmented {
    background: rgba(15, 23, 42, .45);
}
html[data-theme="dark"] .segmented button.active {
    background: #1e293b;
    color: #2dd4bf;
    box-shadow: 0 5px 13px rgba(0,0,0,0.3);
}
html[data-theme="dark"] .company-search input {
    background: rgba(15, 23, 42, .5);
}
html[data-theme="dark"] .lang-toggle {
    background: rgba(16, 23, 38, .84);
}
html[data-theme="dark"] .watch-row img,
html[data-theme="dark"] .mover-row img {
    background: var(--surface);
}
html[data-theme="dark"] .control-btn .dark-icon {
    color: #2dd4bf;
}
html[data-theme="dark"] .control-btn .light-icon {
    color: #94a3b8;
}
html[data-theme="light"] .control-btn .dark-icon {
    color: #64748b;
}
html[data-theme="light"] .control-btn .light-icon {
    color: #0d9488;
}

/* --- Slide-in Drawer Styles --- */
.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    visibility: hidden;
    transition: visibility 0.4s ease;
}
.drawer-overlay.active {
    visibility: visible;
}
.drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.drawer-overlay.active .drawer-backdrop {
    opacity: 1;
}
.drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(30rem, 90dvw);
    height: 100dvh;
    background: var(--surface);
    box-shadow: -10px 0 40px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    z-index: 101;
    border-left: 1px solid var(--line);
}
html[dir="rtl"] .drawer-panel {
    right: auto;
    left: 0;
    transform: translateX(-100%);
    box-shadow: 10px 0 40px rgba(0,0,0,0.15);
    border-left: 0;
    border-right: 1px solid var(--line);
}
.drawer-overlay.active .drawer-panel {
    transform: translateX(0);
}
.drawer-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.drawer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.drawer-logo-container {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.drawer-logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.drawer-logo-fallback {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--teal-dark);
}
#drawerTitle {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}
.drawer-close {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    padding: 0;
}
.drawer-close:hover {
    background: var(--teal-soft);
    color: var(--teal-dark);
}
.drawer-close svg {
    width: 1rem;
    height: 1rem;
}
.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.drawer-price-section {
    padding: 1rem;
    border-radius: 12px;
    background: var(--teal-soft);
    border: 1px solid rgba(20, 184, 166, 0.1);
}
.drawer-price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}
.drawer-price-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ink);
}
.drawer-change-value {
    font-size: 0.95rem;
    font-weight: 700;
    margin-left: 0.5rem;
}
html[dir="rtl"] .drawer-change-value {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* Tabs inside Drawer */
.drawer-tabs {
    display: flex;
    border-bottom: 1px solid var(--line);
    gap: 1rem;
}
.drawer-tabs button {
    background: transparent;
    border: 0;
    padding: 0.5rem 0.25rem;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 600;
    position: relative;
    cursor: pointer;
}
.drawer-tabs button.active {
    color: var(--teal-dark);
}
.drawer-tabs button.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--teal);
    border-radius: 2px;
}
.drawer-tab-pane {
    display: none;
}
.drawer-tab-pane.active {
    display: block;
}

/* Profile Tab details */
.drawer-description {
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--muted);
    margin-top: 0;
    margin-bottom: 0.75rem;
    max-height: 150px;
    overflow-y: auto;
}
.drawer-meta-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.drawer-badge {
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.2);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--teal-dark);
}
.drawer-link-btn {
    color: var(--teal-dark);
    font-size: 0.68rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 2px 10px;
    background: var(--surface);
    transition: background 0.2s, border-color 0.2s;
}
.drawer-link-btn:hover {
    background: var(--teal-soft);
    border-color: rgba(20, 184, 166, 0.3);
}
.drawer-facts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin: 0;
}
.drawer-facts-grid div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 6px;
}
.drawer-facts-grid dt {
    color: var(--muted);
    font-size: 0.65rem;
}
.drawer-facts-grid dd {
    margin: 0;
    color: var(--ink);
    font-size: 0.75rem;
    font-weight: 700;
}

/* Metrics grid */
.drawer-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
.drawer-metric-card {
    background: rgba(20, 184, 166, 0.04);
    border: 1px solid rgba(20, 184, 166, 0.08);
    padding: 10px 12px;
    border-radius: 8px;
}
.drawer-metric-card .title {
    font-size: 0.65rem;
    color: var(--muted);
    font-weight: 600;
}
.drawer-metric-card .value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    margin-top: 3px;
}

/* Drawer news styling */
.drawer-news-rows {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.drawer-news-card {
    display: grid;
    grid-template-columns: 4.5rem 1fr;
    gap: 0.75rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.75rem;
}
.drawer-news-card:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.drawer-news-media {
    width: 4.5rem;
    height: 3.5rem;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--line);
}
.drawer-news-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.drawer-news-copy h4 {
    margin: 0 0 4px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--ink);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.drawer-news-copy time {
    font-size: 0.62rem;
    color: var(--muted);
}

/* Dark Mode Theme specific overrides */
html[data-theme="dark"] .drawer-panel {
    background: #0f172a;
    border-left: 1px solid var(--line);
}
html[data-theme="dark"] .drawer-link-btn {
    background: #1e293b;
}
html[data-theme="dark"] .drawer-backdrop {
    background: rgba(0, 0, 0, 0.65);
}
html[data-theme="dark"] .drawer-facts-grid div {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .drawer-price-section {
    background: rgba(20, 184, 166, 0.12);
}

/* Premium Revamped Company Facts Grid */
.fact-card {
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01);
}
.fact-card:hover {
    transform: translateY(-2px);
    border-color: rgba(20, 184, 166, 0.35) !important;
    background: rgba(20, 184, 166, 0.06) !important;
    box-shadow: 0 8px 24px rgba(20, 184, 166, 0.08) !important;
}
html[data-theme="dark"] .fact-card {
    background: rgba(20, 184, 166, 0.04) !important;
    border: 1px solid rgba(20, 184, 166, 0.12) !important;
}
html[data-theme="dark"] .fact-card:hover {
    background: rgba(20, 184, 166, 0.08) !important;
    border-color: rgba(20, 184, 166, 0.45) !important;
    box-shadow: 0 8px 24px rgba(20, 184, 166, 0.12) !important;
}
