/* Functional extensions are closed by default. Historical page styles remain authoritative. */
.legacy-tools-trigger { border:0; padding:0; background:none; color:inherit; font:inherit; cursor:pointer; text-align:inherit; }
.legacy-tools-trigger:hover { text-decoration:underline; }
.legacy-tools-body { color:var(--tp-text); background:var(--tp-surface); font-family:var(--tp-font); font-size:14px; line-height:1.5; }
.legacy-tools-body a { color:var(--tp-link); }
.legacy-tools-body .tp-menu__item { display:flex; }
.legacy-tools-body .tp-menu__item .tp-icon { display:inline-block; flex-shrink:0; }
.legacy-extension { margin:1rem 0; }
.legacy-extension > summary { cursor:pointer; color:#2563eb; font-weight:600; }
.legacy-extension > .legacy-current-content { padding:1rem 0; }
.tp-modern-content { color:var(--tp-text); background:var(--tp-canvas); font-family:var(--tp-font); font-size:var(--tp-text-body); line-height:var(--tp-leading-normal); }
.tp-modern-content :where(h1,h2,h3,h4,h5,h6) { font-weight:var(--tp-weight-semibold); line-height:var(--tp-leading-snug); }
.tp-modern-content :where(a) { color:var(--tp-link); }
.tp-modern-content :where(button,input,select,textarea),.legacy-tools-body :where(button,input,select,textarea) { font:inherit; }
.tp-modern-content :where(img,svg,video,canvas) { max-width:100%; }
.tp-modern-content .tp-page-header { background:linear-gradient(135deg,#2563eb 0%,#1e40af 50%,#1e3a8a 100%); border-radius:16px; padding:2.5rem; color:white; box-shadow:0 8px 32px rgba(37,99,235,.3); --tp-text:white; --tp-text-secondary:#e4edff; --tp-link:white; }
.tp-modern-content .tp-page-header__main { align-items:center; text-align:center; }
.tp-modern-content .tp-page-title { font-size:2.5rem; font-weight:700; }
.tp-modern-content .tp-card { box-shadow:0 4px 16px rgba(0,0,0,.05); }
.tp-dialog { font-family:var(--tp-font); font-size:14px; line-height:1.5; }
.tp-dialog :where(button,input,select,textarea) { font:inherit; }
.tp-dialog .tp-icon,.tp-btn .tp-icon { display:inline-block; }
.tp-instrument-picker { font-family:var(--tp-font); font-size:14px; line-height:1.5; }
.tp-dialog h2,.tp-dialog h3 { font-size:inherit; }
.tp-original-body .tp-consent-banner { font:14px/1.5 var(--tp-font); }

/* Preserve native closed/hidden behavior for current functional controls. */
[hidden]:not([hidden="until-found"]) { display:none!important; }
.legacy-tools-trigger { text-transform:inherit; letter-spacing:inherit; }
.ticker .tp-ticker__item { color:inherit; align-items:center; }

/* Current controls fit the unchanged historical chart panel. */
.home-chart #independent-chart-container { display:flex; flex-direction:column; height:100%; min-width:0; min-height:0; padding:8px; align-self:stretch; }
.home-chart .tp-history-chart__header { flex:0 0 auto; margin:0 0 6px; min-width:0; }
.home-chart .tp-history-chart__canvas { flex:1 1 0; height:auto; min-height:0; min-width:0; }
.home-chart .tp-history-chart__info { flex:0 0 auto; margin:6px 0 0; line-height:1.3; overflow-wrap:anywhere; }
.home-chart .chart-info { z-index:2; }
.ticker .ticker-error.tp-ticker__item { color:#f59e0b; }
.legacy-text-control { color:inherit; font:inherit; background:none; padding:0; border:0; cursor:pointer; }
.legacy-text-control:focus-visible { outline:2px solid #2563eb; outline-offset:2px; }

/* First-party canvas must not set the historical grid column’s intrinsic width. */
.home-chart .tp-history-chart__canvas canvas { position:absolute!important; inset:0!important; width:100%!important; height:100%!important; }

/* The original About hero inherited the shared header border; retain its visual and positioning rules here. */
.about-page > .about-hero { border-bottom:1px solid #e3e3e0; position:sticky; top:0; z-index:1000; box-shadow:0 2px 4px rgba(0,0,0,.05); }
html[data-theme="dark"] .about-page > .about-hero { border-bottom-color:#3e3e3a; }
@media (prefers-color-scheme:dark) { html:not([data-theme="light"]) .about-page > .about-hero { border-bottom-color:#3e3e3a; } }

/* Retain legacy tables; contain horizontal movement inside explicitly labelled regions. */
.legacy-table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.legacy-table-scroll:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; }
@media (max-width: 760px) {
    .dashboard-layout > .main-panel, .dashboard-layout > .sidebar-panel { min-width: 0; }
}

/* Current source and tool links use the historical dark chart header text. */
.trading-page .chart-meta a, .chart-page .terminal-meta a { color: inherit; }
