/* ==========================================================================
   theInvestor design system
   One stylesheet for the whole app (loaded after Bootstrap 5.3).
   Character: calm private-wealth software. Evergreen brand, cool neutral canvas,
   hairline structure instead of shadows, an editorial serif reserved for page
   titles and headline figures, Geist for everything you read and operate.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
    /* Neutrals */
    --ti-ink:        #0e1b15;   /* primary text */
    --ti-ink-2:      #44544c;   /* secondary text */
    --ti-ink-3:      #75857d;   /* muted text, icons */
    --ti-canvas:     #f3f5f4;   /* app background */
    --ti-surface:    #ffffff;   /* cards, sidebar, top bar */
    --ti-surface-2:  #f8faf9;   /* subtle fills: table hover, inputs at rest */
    --ti-line:       #e1e7e3;   /* hairlines */
    --ti-line-2:     #cdd6d0;   /* control borders */

    /* Brand */
    --ti-brand:       #1a5438;  /* evergreen */
    --ti-brand-hover: #134129;
    --ti-brand-tint:  #e8f1ec;
    --ti-brand-ring:  rgba(26, 84, 56, .18);
    --ti-deep:        #1a5438;  /* hero panel */
    --ti-brass:       #b08d4a;  /* premium accent: used sparingly */

    /* Semantic */
    --ti-gain: #1e7a4c;  --ti-gain-tint: #e5f2ea;
    --ti-loss: #c0392d;  --ti-loss-tint: #fbe9e7;
    --ti-warn: #a2650a;  --ti-warn-tint: #fbf0dc;
    --ti-info: #2455a4;  --ti-info-tint: #e8eefa;

    /* Type */
    --ti-font: "Geist", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --ti-font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    --ti-font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

    /* Shape & depth */
    --ti-radius-sm: 8px;
    --ti-radius:    10px;   /* controls */
    --ti-radius-lg: 14px;   /* cards */
    --ti-radius-xl: 20px;   /* hero panels, dialogs */
    --ti-shadow-pop: 0 16px 40px -12px rgba(14, 27, 21, .22), 0 2px 6px rgba(14, 27, 21, .06);
    --ti-ease: cubic-bezier(.2, .7, .2, 1);

    /* Shell */
    --sidebar-w: 256px;
    --sidebar-w-rail: 72px;
    --topbar-h: 64px;
    --tabbar-h: 62px;

    /* Bootstrap bridge */
    --bs-body-font-family: var(--ti-font);
    --bs-body-font-size: .9375rem;
    --bs-body-line-height: 1.55;
    --bs-body-color: var(--ti-ink);
    --bs-body-bg: var(--ti-canvas);
    --bs-secondary-color: var(--ti-ink-2);
    --bs-tertiary-color: var(--ti-ink-3);
    --bs-emphasis-color: var(--ti-ink);
    --bs-border-color: var(--ti-line);
    --bs-border-color-translucent: var(--ti-line);
    --bs-border-radius: var(--ti-radius);
    --bs-border-radius-sm: var(--ti-radius-sm);
    --bs-border-radius-lg: var(--ti-radius-lg);
    --bs-primary: var(--ti-brand);
    --bs-primary-rgb: 26, 84, 56;
    --bs-primary-text-emphasis: var(--ti-brand);
    --bs-primary-bg-subtle: var(--ti-brand-tint);
    --bs-primary-border-subtle: #bcd7c8;
    --bs-success: var(--ti-gain);
    --bs-success-rgb: 30, 122, 76;
    --bs-danger: var(--ti-loss);
    --bs-danger-rgb: 192, 57, 45;
    --bs-warning: #d38b12;
    --bs-warning-rgb: 211, 139, 18;
    --bs-info: var(--ti-info);
    --bs-info-rgb: 36, 85, 164;
    --bs-link-color: var(--ti-brand);
    --bs-link-color-rgb: 26, 84, 56;
    --bs-link-hover-color: var(--ti-brand-hover);
    --bs-link-hover-color-rgb: 19, 65, 41;
    --bs-secondary-bg: var(--ti-surface-2);
    --bs-tertiary-bg: var(--ti-surface-2);
    --bs-focus-ring-color: var(--ti-brand-ring);

    /* Legacy aliases: older views reference these names in inline styles */
    --color-primary: var(--ti-brand);
    --color-primary-light: var(--ti-brand);
    --color-accent: var(--ti-brand);
    --color-accent-bright: var(--ti-gain);
    --color-text-primary: var(--ti-ink);
    --color-text-secondary: var(--ti-ink-2);
    --color-text-muted: var(--ti-ink-3);
    --color-border: var(--ti-line);
    --color-border-light: var(--ti-line);
    --color-surface: var(--ti-surface);
    --color-surface-elevated: var(--ti-surface-2);
    --color-profit: var(--ti-gain);
    --color-loss: var(--ti-loss);
    --font-mono: var(--ti-font-mono);
    --shadow-sm: none;
    --radius-md: var(--ti-radius);
    --radius-lg: var(--ti-radius-lg);
    --hairline: var(--ti-line);

    color-scheme: light;
}

/* Dark theme: same structure, lights dimmed */
[data-bs-theme="dark"] {
    --ti-ink:        #e8eeea;
    --ti-ink-2:      #a9b7af;
    --ti-ink-3:      #7d8c84;
    --ti-canvas:     #0b1110;
    --ti-surface:    #121a17;
    --ti-surface-2:  #172220;
    --ti-line:       #22302b;
    --ti-line-2:     #31423b;

    --ti-brand:       #6bc79b;
    --ti-brand-hover: #90d5b4;
    --ti-brand-tint:  rgba(107, 199, 155, .13);
    --ti-brand-ring:  rgba(107, 199, 155, .28);
    --ti-deep:        #1a5438;

    --ti-gain: #6bc79b;  --ti-gain-tint: rgba(107, 199, 155, .13);
    --ti-loss: #f07a6e;  --ti-loss-tint: rgba(240, 122, 110, .13);
    --ti-warn: #e7b04f;  --ti-warn-tint: rgba(231, 176, 79, .14);
    --ti-info: #8ab0f0;  --ti-info-tint: rgba(138, 176, 240, .13);
    --ti-shadow-pop: 0 18px 44px -12px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .3);

    --bs-body-color: var(--ti-ink);
    --bs-body-bg: var(--ti-canvas);
    --bs-emphasis-color: var(--ti-ink);
    --bs-secondary-color: var(--ti-ink-2);
    --bs-tertiary-color: var(--ti-ink-3);
    --bs-border-color: var(--ti-line);
    --bs-border-color-translucent: var(--ti-line);
    --bs-primary: var(--ti-brand);
    --bs-primary-rgb: 107, 199, 155;
    --bs-primary-text-emphasis: var(--ti-brand);
    --bs-primary-bg-subtle: var(--ti-brand-tint);
    --bs-success-rgb: 107, 199, 155;
    --bs-danger-rgb: 240, 122, 110;
    --bs-link-color: var(--ti-brand);
    --bs-link-color-rgb: 107, 199, 155;
    --bs-link-hover-color: var(--ti-brand-hover);
    --bs-secondary-bg: var(--ti-surface-2);
    --bs-tertiary-bg: var(--ti-surface-2);
    --bs-body-bg-rgb: 11, 17, 16;
    color-scheme: dark;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
html { scroll-padding-top: calc(var(--topbar-h) + 16px); }
html, body { overflow-x: clip; }
body {
    font-family: var(--ti-font);
    font-size: var(--bs-body-font-size);
    color: var(--ti-ink);
    background: var(--ti-canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "ss01", "cv11";
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--ti-ink);
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.25;
}
h1, .h1 { font-size: 1.75rem; }
h2, .h2 { font-size: 1.375rem; }
h3, .h3 { font-size: 1.1875rem; }
h4, .h4 { font-size: 1.0625rem; }
h5, .h5 { font-size: 1rem; }
h6, .h6 { font-size: .9375rem; }
p { color: inherit; }
a { color: var(--ti-brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ti-brand-hover); }
hr { border-color: var(--ti-line); opacity: 1; }
::selection { background: var(--ti-brand-tint); color: var(--ti-ink); }
.lead { font-size: 1.0625rem; color: var(--ti-ink-2); font-weight: 400; }
.small, small { font-size: .8125rem; }
.text-muted, .text-body-secondary, .text-secondary { color: var(--ti-ink-2) !important; }
.text-primary { color: var(--ti-brand) !important; }
.text-success { color: var(--ti-gain) !important; }
.text-danger { color: var(--ti-loss) !important; }
.text-warning { color: var(--ti-warn) !important; }
.text-info { color: var(--ti-info) !important; }
.bg-light { background-color: var(--ti-surface-2) !important; }
.bg-white { background-color: var(--ti-surface) !important; }
.bg-primary { background-color: var(--ti-brand) !important; }
.border, .border-top, .border-bottom, .border-start, .border-end { border-color: var(--ti-line) !important; }
.shadow, .shadow-sm, .shadow-lg { box-shadow: none !important; }
.dropdown-menu.shadow, .modal-content.shadow { box-shadow: var(--ti-shadow-pop) !important; }
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: var(--ti-font-display);
    font-weight: 500;
    letter-spacing: -0.02em;
}
.letter-spacing-1 { letter-spacing: .02em; }
.min-w-0 { min-width: 0; }
.fw-bold, strong, b { font-weight: 600 !important; }
.fw-semibold { font-weight: 600 !important; }

/* Numbers line up in columns everywhere it matters */
.financial-number, .stat-value, .kpi-value, td, .table, .badge, .price, [data-symbol],
[class*="value"], [class*="price"], [class*="amount"], [class*="total"] {
    font-variant-numeric: tabular-nums;
}
.financial-number { font-weight: 600; letter-spacing: -0.01em; color: var(--ti-ink); }
.financial-number.positive, .positive, .text-gain { color: var(--ti-gain) !important; }
.financial-number.negative, .negative, .text-loss { color: var(--ti-loss) !important; }

/* Focus: one visible ring everywhere */
:focus-visible { outline: 2px solid var(--ti-brand); outline-offset: 2px; }
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible { outline: none; }

/* --------------------------------------------------------------------------
   3. App shell
   -------------------------------------------------------------------------- */
main:focus { outline: none; }

.skip-link {
    position: fixed; left: 1rem; top: -3rem; z-index: 2000;
    padding: .55rem .9rem; border-radius: var(--ti-radius);
    background: var(--ti-brand); color: #fff; font-weight: 600; text-decoration: none;
    transition: top .15s var(--ti-ease);
}
.skip-link:focus-visible { top: .75rem; color: #fff; }

.app-main { display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }
.app-main > main { flex: 1 0 auto; }
.has-app-shell .app-main { margin-left: var(--sidebar-w); transition: margin-left .2s var(--ti-ease); }
@media (min-width: 992px) {
    .sidebar-collapsed .has-app-shell .app-main { margin-left: var(--sidebar-w-rail); }
}

/* Content column: consistent gutters and a comfortable reading width */
.app-content { padding: 32px 40px 48px; }
.app-content > .container,
.app-content > .container-fluid,
.app-content > .container-xl,
.app-content > .container-xxl,
.app-content > div > .container,
.app-content > div > .container-fluid {
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
}
.is-public .app-content { padding: 0; }
.is-public .app-content > .container,
.is-public .app-content > .container-fluid { padding: 40px 24px; max-width: 1120px; }
@media (max-width: 1199.98px) { .app-content { padding: 28px 28px 40px; } }
@media (max-width: 767.98px)  { .app-content { padding: 20px 16px 32px; } }

/* ---- Sidebar ------------------------------------------------------------- */
.app-sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 1035;
    width: var(--sidebar-w);
    display: flex; flex-direction: column;
    background: var(--ti-surface);
    border-right: 1px solid var(--ti-line);
    transition: width .2s var(--ti-ease), transform .25s var(--ti-ease);
}
.sidebar-header {
    height: var(--topbar-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px 0 20px;
    flex: 0 0 auto;
}
.sidebar-brand { display: inline-flex; align-items: center; text-decoration: none; min-width: 0; }
/* The logo artwork carries ~20% built-in padding, so it is sized up and pulled in */
.sidebar-brand-logo { height: 54px; width: auto; display: block; margin: 0 0 0 -8px; }
[data-bs-theme="dark"] .sidebar-brand-logo,
[data-bs-theme="dark"] .topbar-brand-logo,
[data-bs-theme="dark"] .public-brand .topbar-brand-logo,
[data-bs-theme="dark"] .footer-brand-logo { content: url("/content/assets/img/logo/logo-dark.svg"); }
.sidebar-brand-mark {
    display: none; width: 36px; height: 36px; border-radius: 10px;
    align-items: center; justify-content: center;
    object-fit: contain;
}
.sidebar-close {
    display: none; width: 36px; height: 36px; border: 0; border-radius: var(--ti-radius-sm);
    background: transparent; color: var(--ti-ink-2); align-items: center; justify-content: center;
}
.sidebar-close:hover { background: var(--ti-surface-2); color: var(--ti-ink); }

.sidebar-nav {
    flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain;
    padding: 8px 12px 16px;
    scrollbar-width: thin; scrollbar-color: var(--ti-line-2) transparent;
}
.sidebar-group + .sidebar-group { margin-top: 2px; }
.sidebar-group-toggle {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    margin-top: 14px; padding: 6px 8px;
    border: 0; background: transparent; border-radius: var(--ti-radius-sm);
    color: var(--ti-ink-3); font-size: .78rem; font-weight: 500; letter-spacing: 0; text-transform: none;
    cursor: pointer;
}
.sidebar-group-toggle:hover { color: var(--ti-ink); }
.sidebar-group.has-active .sidebar-group-toggle { color: var(--ti-ink-2); }
.sidebar-group-chevron { font-size: .7rem; transition: transform .15s var(--ti-ease); }
.sidebar-group-toggle[aria-expanded="false"] .sidebar-group-chevron { transform: rotate(-90deg); }
.sidebar-list { list-style: none; margin: 0; padding: 0; }
.sidebar-list.is-collapsed { display: none; }
.sidebar-section {
    padding: 10px 10px 4px; font-size: .72rem; font-weight: 500;
    color: var(--ti-ink-3); letter-spacing: 0; text-transform: none; opacity: .85;
}
.sidebar-link {
    position: relative; width: 100%;
    display: flex; align-items: center; gap: 10px;
    min-height: 36px; padding: 7px 10px;
    border: 0; border-radius: var(--ti-radius-sm);
    background: transparent; color: var(--ti-ink-2);
    font-size: .875rem; font-weight: 500; text-align: left; text-decoration: none;
    transition: background-color .12s ease, color .12s ease;
}
.sidebar-link:hover { background: var(--ti-surface-2); color: var(--ti-ink); }
.sidebar-link.active { background: var(--ti-brand-tint); color: var(--ti-brand); font-weight: 600; }
.sidebar-link.active::before {
    content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--ti-brand);
}
.sidebar-icon { flex: 0 0 18px; font-size: 1rem; line-height: 1; color: var(--ti-ink-3); text-align: center; }
.sidebar-link:hover .sidebar-icon { color: var(--ti-ink-2); }
.sidebar-link.active .sidebar-icon { color: var(--ti-brand); }
.sidebar-label { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-badge {
    flex: 0 0 auto; padding: 1px 7px; border-radius: 999px;
    background: transparent; border: 1px solid color-mix(in srgb, var(--ti-brass) 55%, transparent);
    color: var(--ti-brass); font-size: .66rem; font-weight: 600; letter-spacing: .02em;
}
.sidebar-footer { flex: 0 0 auto; padding: 10px 12px 14px; border-top: 1px solid var(--ti-line); }
.sidebar-kbd, .cmdk-shortcut, .gs-kbd, kbd {
    font-family: var(--ti-font); font-size: .7rem; font-weight: 500;
    padding: 1px 6px; border-radius: 6px;
    background: var(--ti-surface-2); color: var(--ti-ink-3);
    border: 1px solid var(--ti-line); box-shadow: none;
}
.sidebar-backdrop { display: none; }

@media (min-width: 992px) {
    .sidebar-collapsed .app-sidebar { width: var(--sidebar-w-rail); }
    .sidebar-collapsed .sidebar-header { justify-content: center; padding: 0; }
    .sidebar-collapsed .sidebar-brand-logo { display: none; }
    .sidebar-collapsed .sidebar-brand-mark { display: inline-flex; }
    .sidebar-collapsed .sidebar-group-toggle,
    .sidebar-collapsed .sidebar-section,
    .sidebar-collapsed .sidebar-badge,
    .sidebar-collapsed .sidebar-kbd { display: none; }
    .sidebar-collapsed .sidebar-list.is-collapsed { display: block; }
    .sidebar-collapsed .sidebar-group + .sidebar-group { border-top: 1px solid var(--ti-line); margin-top: 8px; padding-top: 8px; }
    .sidebar-collapsed .sidebar-link { justify-content: center; padding: 9px 0; gap: 0; }
    .sidebar-collapsed .sidebar-link.active::before { left: -12px; }
    .sidebar-collapsed .sidebar-icon { font-size: 1.1rem; }
    .sidebar-collapsed .sidebar-label {
        position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
        margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important; border: 0 !important;
    }
}
@media (max-width: 991.98px) {
    .has-app-shell .app-main { margin-left: 0; }
    .app-sidebar {
        width: min(300px, 86vw);
        transform: translateX(-100%); visibility: hidden;
        transition: transform .25s var(--ti-ease), visibility 0s linear .25s;
    }
    .sidebar-open .app-sidebar { transform: none; visibility: visible; box-shadow: var(--ti-shadow-pop); transition: transform .25s var(--ti-ease), visibility 0s; }
    .sidebar-close { display: inline-flex; }
    .sidebar-backdrop {
        display: block; position: fixed; inset: 0; z-index: 1034;
        background: rgba(7, 20, 14, .45); opacity: 0; pointer-events: none; transition: opacity .25s ease;
    }
    .sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
    html.sidebar-open, html.sidebar-open body { overflow: hidden; }
    .sidebar-footer { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}

/* ---- Top bar ------------------------------------------------------------- */
.app-topbar {
    position: sticky; top: 0; z-index: 1030;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 8px;
    padding: 0 24px 0 16px;
    background: color-mix(in srgb, var(--ti-surface) 88%, transparent);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--ti-line);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .app-topbar { background: var(--ti-surface); }
}
.topbar-spacer { flex: 1 1 auto; }
.topbar-brand { display: none; align-items: center; text-decoration: none; }
.topbar-brand-logo { height: 46px; width: auto; display: block; margin: 0 -6px; }
@media (max-width: 991.98px) { .topbar-brand { display: inline-flex; } }
.topbar-icon-btn {
    position: relative;
    width: 38px; height: 38px; flex: 0 0 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: var(--ti-radius);
    background: transparent; color: var(--ti-ink-2); font-size: 1.05rem; text-decoration: none;
    transition: background-color .12s ease, color .12s ease;
}
.topbar-icon-btn:hover { background: var(--ti-surface-2); color: var(--ti-ink); }
.topbar-icon-btn.active { background: var(--ti-brand-tint); color: var(--ti-brand); }
.theme-icon-to-light { display: none; }
[data-bs-theme="dark"] .theme-icon-to-light { display: inline; }
[data-bs-theme="dark"] .theme-icon-to-dark { display: none; }
.topbar-badge {
    position: absolute; top: 5px; right: 4px;
    min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
    background: var(--ti-loss); color: #fff; font-size: .62rem; font-weight: 700; line-height: 17px; text-align: center;
    border: 2px solid var(--ti-surface);
}
.topbar-cmdk-btn {
    height: 38px; display: inline-flex; align-items: center; gap: 8px;
    padding: 0 10px; border-radius: var(--ti-radius);
    border: 1px solid var(--ti-line); background: var(--ti-surface); color: var(--ti-ink-2);
}
.topbar-cmdk-btn:hover { color: var(--ti-ink); border-color: var(--ti-line-2); }

/* Market status */
.market-status-pill {
    display: inline-flex; align-items: center; gap: 7px;
    height: 28px; padding: 0 11px; margin-left: 4px;
    border-radius: 999px; border: 1px solid var(--ti-line);
    background: var(--ti-surface); color: var(--ti-ink-2);
    font-size: .78rem; font-weight: 500; letter-spacing: 0; text-transform: none;
    white-space: nowrap;
}
.market-status-pill .status-dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--ti-gain);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ti-gain) 22%, transparent);
}
.market-status-pill[data-state="open"] { color: var(--ti-gain); border-color: color-mix(in srgb, var(--ti-gain) 30%, transparent); background: var(--ti-gain-tint); }
.market-status-pill[data-state="extended"] { color: var(--ti-warn); border-color: color-mix(in srgb, var(--ti-warn) 30%, transparent); background: var(--ti-warn-tint); }
.market-status-pill[data-state="extended"] .status-dot { background: var(--ti-warn); box-shadow: none; }
.market-status-pill[data-state="closed"] .status-dot { background: var(--ti-ink-3); box-shadow: none; }

/* Global search */
#global-search-wrapper { width: 300px; }
#global-search-wrapper .gs-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--ti-ink-3); font-size: .9rem; pointer-events: none; z-index: 1;
}
#global-search-wrapper .gs-input {
    height: 38px; padding-left: 36px; padding-right: 36px;
    border-radius: var(--ti-radius); border: 1px solid var(--ti-line);
    background: var(--ti-surface-2); color: var(--ti-ink); font-size: .875rem;
}
#global-search-wrapper .gs-input::placeholder { color: var(--ti-ink-3); }
#global-search-wrapper .gs-input:focus { background: var(--ti-surface); border-color: var(--ti-brand); box-shadow: 0 0 0 3px var(--ti-brand-ring); }
#global-search-wrapper .gs-input::-webkit-search-cancel-button { display: none; }
#global-search-wrapper .gs-kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
#global-search-wrapper .gs-input:focus ~ .gs-kbd { display: none; }
.gs-dropdown {
    top: calc(100% + 6px); right: 0; left: auto; width: 380px; z-index: 2000;
    max-height: 380px; overflow-y: auto; padding: 6px;
    background: var(--ti-surface) !important; border: 1px solid var(--ti-line) !important;
    border-radius: var(--ti-radius-lg) !important; box-shadow: var(--ti-shadow-pop) !important;
}
.gs-item { border-radius: var(--ti-radius-sm); border: 0 !important; color: var(--ti-ink) !important; font-size: .875rem; }
.gs-item:hover, .gs-item.active { background: var(--ti-surface-2); }
.gs-symbol { min-width: 3.75rem; font-weight: 600; color: var(--ti-ink); }
.gs-sector { background: var(--ti-surface-2) !important; color: var(--ti-ink-2) !important; font-weight: 500 !important; border: 1px solid var(--ti-line); }

/* User menu */
.user-menu-btn {
    height: 40px; display: inline-flex; align-items: center; gap: 9px;
    padding: 0 10px 0 4px; margin-left: 4px;
    border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--ti-ink);
    font-size: .875rem; font-weight: 500;
}
.user-menu-btn:hover { background: var(--ti-surface-2); }
.avatar-initial {
    width: 32px; height: 32px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ti-deep); color: #e9dfc6;
    font-family: var(--ti-font-display); font-size: .95rem; font-weight: 600;
}
.user-menu-btn .user-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-btn.dropdown-toggle::after { color: var(--ti-ink-3); margin-left: 2px; }
.user-menu-header { white-space: normal; max-width: 260px; }

/* Public (signed-out) header */
.public-topbar { position: sticky; top: 0; z-index: 1030; background: color-mix(in srgb, var(--ti-surface) 90%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--ti-line); }
.public-topbar__inner { height: 68px; display: flex; align-items: center; justify-content: space-between; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.public-brand { display: inline-flex; align-items: center; text-decoration: none; }
.public-topbar__actions { display: flex; align-items: center; gap: 8px; }

/* Bottom tab bar (phones) */
.bottom-tabbar { display: none; }
@media (max-width: 767.98px) {
    .bottom-tabbar {
        display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1032;
        background: color-mix(in srgb, var(--ti-surface) 92%, transparent);
        -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
        border-top: 1px solid var(--ti-line);
        padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    }
    .bottom-tabbar ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); }
    .bottom-tab {
        position: relative; width: 100%; height: var(--tabbar-h);
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        padding: 0; border: 0; background: transparent; color: var(--ti-ink-3);
        font-size: .68rem; font-weight: 500; text-decoration: none; cursor: pointer;
    }
    .bottom-tab i { font-size: 1.2rem; line-height: 1; }
    .bottom-tab.active { color: var(--ti-brand); }
    body.has-app-shell { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
    .has-app-shell #copilot-fab { bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom)) !important; right: 16px !important; }
    .has-app-shell #copilot-panel { bottom: calc(var(--tabbar-h) + 80px + env(safe-area-inset-bottom)) !important; right: 3vw !important; max-height: calc(100vh - var(--topbar-h) - var(--tabbar-h) - 110px) !important; }
    .has-app-shell #ti-toast-host { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)) !important; }
}

/* --------------------------------------------------------------------------
   4. Page header (no box: a title block on the canvas)
   -------------------------------------------------------------------------- */
.page-header {
    margin: 0 0 28px; padding: 0 0 22px;
    background: none !important; border: 0; border-bottom: 1px solid var(--ti-line);
    border-radius: 0; box-shadow: none !important; color: var(--ti-ink);
    position: relative;
}
.page-header::before, .page-header::after { display: none !important; content: none !important; }
.page-header__row { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.page-header__icon { display: none !important; }
.page-header__main { flex: 1 1 360px; min-width: 0; }
.page-header__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.page-header .eyebrow, .eyebrow {
    display: block; margin: 0 0 6px;
    font-size: .8125rem; font-weight: 500; color: var(--ti-ink-3);
    letter-spacing: 0; text-transform: none;
}
.page-header h1, .page-title {
    margin: 0;
    font-family: var(--ti-font-display);
    font-size: 2rem; font-weight: 500; line-height: 1.15; letter-spacing: -0.02em;
    color: var(--ti-ink);
}
.page-subtitle, .page-header .lead, .page-header p {
    margin: 8px 0 0; max-width: 68ch;
    font-size: .975rem; line-height: 1.55; color: var(--ti-ink-2);
}
.page-header .btn-primary, .page-header .btn-light, .page-header .btn-outline-light { /* actions use standard buttons */ }
@media (max-width: 767.98px) {
    .page-header { margin-bottom: 20px; padding-bottom: 16px; }
    .page-header h1, .page-title { font-size: 1.6rem; }
}

/* Section headings inside pages */
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 14px; }
.section-header h2, .section-header h3, .section-header h4, .section-header h5 { margin: 0; font-size: 1.0625rem; font-weight: 600; }
.section-icon, .icon-wrap, .feat-icon, .kpi-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: var(--ti-radius);
    background: var(--ti-brand-tint) !important; color: var(--ti-brand) !important;
    font-size: 1rem; box-shadow: none !important;
}
.kpi-icon.is-loss { background: var(--ti-loss-tint) !important; color: var(--ti-loss) !important; }
.kpi-icon.is-info { background: var(--ti-info-tint) !important; color: var(--ti-info) !important; }
.kpi-icon.is-warn { background: var(--ti-warn-tint) !important; color: var(--ti-warn) !important; }

/* --------------------------------------------------------------------------
   5. Cards
   -------------------------------------------------------------------------- */
.card {
    --bs-card-bg: var(--ti-surface);
    --bs-card-border-color: var(--ti-line);
    --bs-card-border-radius: var(--ti-radius-lg);
    --bs-card-inner-border-radius: calc(var(--ti-radius-lg) - 1px);
    --bs-card-cap-bg: transparent;
    --bs-card-spacer-x: 1.375rem;
    --bs-card-spacer-y: 1.25rem;
    --bs-card-cap-padding-x: 1.375rem;
    --bs-card-cap-padding-y: 1rem;
    background: var(--ti-surface);
    border: 1px solid var(--ti-line) !important;
    border-radius: var(--ti-radius-lg);
    box-shadow: none !important;
    transform: none !important;
    color: var(--ti-ink);
    transition: border-color .15s ease;
}
.card.border-0 { border: 1px solid var(--ti-line) !important; }
.row > [class*="col"] > .card:only-child, .row > [class*="col"] > .kpi-card, .row > [class*="col"] > .stats-card { height: 100%; }
a.card:hover, .card.card-hover:hover, .card[onclick]:hover { border-color: var(--ti-line-2) !important; }
.card:hover { transform: none !important; box-shadow: none !important; }
.card-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    background: transparent !important;
    border-bottom: 1px solid var(--ti-line) !important;
    font-weight: 600; font-size: .9375rem; color: var(--ti-ink);
}
.card-header h1, .card-header h2, .card-header h3, .card-header h4, .card-header h5, .card-header h6, .card-header .card-title {
    margin: 0; font-size: .9375rem; font-weight: 600; letter-spacing: -0.005em; color: var(--ti-ink);
}
.card-header .bi, .card-heading > .bi { color: var(--ti-ink-3); }
.card-header.bg-primary, .card-header.bg-success, .card-header.bg-dark, .card-header.bg-info, .card-header.bg-warning, .card-header.bg-danger {
    background: transparent !important; color: var(--ti-ink) !important;
}
.card-header.text-white, .card-header .text-white { color: var(--ti-ink) !important; }
.card-footer { background: transparent !important; border-top: 1px solid var(--ti-line) !important; }
.card-title { font-weight: 600; letter-spacing: -0.005em; }
.card-text { color: var(--ti-ink-2); }
.card.bg-primary, .card.bg-success, .card.bg-dark, .card.text-white {
    background: var(--ti-deep) !important; border-color: var(--ti-deep) !important; color: #eef4f0 !important;
}
.card-heading { display: flex; align-items: center; gap: 10px; margin: 0; font-size: .9375rem; font-weight: 600; }
.card-header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-subtle { margin: 4px 0 0; font-size: .8125rem; color: var(--ti-ink-2); }

/* Stat / KPI tiles (works with several existing markups) */
.stats-card, .stat-card, .kpi-card, .metric-card {
    background: var(--ti-surface); border: 1px solid var(--ti-line) !important; border-radius: var(--ti-radius-lg);
    box-shadow: none !important;
}
.stat-label, .kpi-label, .metric-label {
    font-size: .8125rem; font-weight: 500; color: var(--ti-ink-2); letter-spacing: 0; text-transform: none;
}
.stat-value, .kpi-value, .metric-value, .kpi-card .financial-number {
    font-size: 1.625rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; color: var(--ti-ink); margin: 0;
}
.kpi-card .card-body { padding: 18px 20px !important; }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.kpi-foot { margin: 8px 0 0; font-size: .8125rem; color: var(--ti-ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi-delta { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.kpi-delta.is-up { background: var(--ti-gain-tint); color: var(--ti-gain); }
.kpi-delta.is-down { background: var(--ti-loss-tint); color: var(--ti-loss); }
.kpi-card .kpi-icon { width: 32px; height: 32px; font-size: .95rem; }

/* Hero panel: the one dark, confident surface (dashboard portfolio value) */
.ti-hero {
    position: relative; overflow: hidden;
    border-radius: var(--ti-radius-xl);
    background: var(--ti-deep);
    color: #e9f0ec;
    padding: 28px 32px;
    isolation: isolate;
}
.ti-hero::after {
    content: ""; position: absolute; left: 32px; right: 32px; top: 0; height: 1px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ti-brass) 80%, transparent), transparent);
}
.ti-hero__label { font-size: .875rem; color: rgba(233, 240, 236, .72); font-weight: 500; }
.ti-hero__value {
    margin: 6px 0 4px;
    font-family: var(--ti-font-display);
    font-size: clamp(2.4rem, 4.4vw, 3.5rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.02;
    color: #fbfcfb; font-variant-numeric: tabular-nums lining-nums;
}
.ti-hero__value .ti-cur { font-size: .5em; vertical-align: .62em; margin-right: .08em; color: rgba(233, 240, 236, .7); letter-spacing: 0; }
.ti-hero__delta { display: inline-flex; align-items: center; gap: 6px; font-size: .9375rem; font-weight: 500; }
.ti-hero__delta.is-up { color: #7fd8aa; }
.ti-hero__delta.is-down { color: #f2a59c; }
.ti-hero__meta { color: rgba(233, 240, 236, .62); font-size: .8125rem; }
.ti-hero__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .09); }
.ti-hero__stat-label { font-size: .78rem; color: rgba(233, 240, 236, .6); }
.ti-hero__stat-value { font-size: 1.125rem; font-weight: 600; color: #fbfcfb; font-variant-numeric: tabular-nums; margin-top: 2px; }
.ti-hero__chart { position: absolute; inset: auto 0 0 auto; width: 58%; height: 70%; opacity: .9; z-index: -1; pointer-events: none; }
.ti-hero .btn-hero {
    background: rgba(255, 255, 255, .08); color: #fbfcfb; border: 1px solid rgba(255, 255, 255, .14);
}
.ti-hero .btn-hero:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.ti-hero .btn-hero-primary { background: #f3efe3; color: var(--ti-deep); border: 1px solid #f3efe3; }
.ti-hero .btn-hero-primary:hover { background: #fff; color: var(--ti-deep); }
@media (max-width: 767.98px) { .ti-hero { padding: 22px 20px; } .ti-hero__chart { width: 100%; height: 45%; opacity: .5; } }
.ti-hero .positive, .ti-hero .text-success { color: #8fe0b5 !important; }
.ti-hero .negative, .ti-hero .text-danger { color: #f2a59c !important; }
.ti-hero__link { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(233, 240, 236, .25); }
.ti-hero__link:hover { color: #fff; border-bottom-color: rgba(233, 240, 236, .6); }
.ti-hero dl > div { min-width: 0; }
@media (min-width: 576px) and (max-width: 991.98px) { .ti-hero__stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Dashboard */
.dash-header { border-bottom: 0; padding-bottom: 0; margin-bottom: 20px; }
.dash-hero { padding: 30px 32px 28px; }
.dash-chart { position: relative; min-height: 240px; }
.dash-chart canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.dash-hero-empty { display: flex; flex-direction: column; justify-content: center; padding: 24px; border: 1px dashed rgba(255, 255, 255, .16); border-radius: var(--ti-radius-lg); color: rgba(233, 240, 236, .78); max-width: 52ch; }
.ti-range .btn, .ti-range .btn.btn-primary, .ti-range .btn.btn-outline-secondary {
    --bs-btn-color: rgba(233, 240, 236, .7); --bs-btn-bg: transparent; --bs-btn-border-color: rgba(255, 255, 255, .12);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: rgba(255, 255, 255, .08); --bs-btn-hover-border-color: rgba(255, 255, 255, .2);
    --bs-btn-active-color: var(--ti-deep); --bs-btn-active-bg: #f3efe3; --bs-btn-active-border-color: #f3efe3;
    min-height: 30px; padding: 0 12px; font-size: .78rem; font-weight: 550;
}
.ti-range .btn.active, .ti-range .btn.btn-primary { color: var(--ti-deep); background-color: #f3efe3; border-color: #f3efe3; }
.dash-portfolio-link { color: var(--ti-ink); font-weight: 600; }
.dash-portfolio-link:hover { color: var(--ti-brand); }
[data-bs-theme="dark"] .ti-hero { background: #1a5438; }

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn {
    --bs-btn-padding-x: 1rem;
    --bs-btn-padding-y: .5rem;
    --bs-btn-font-size: .875rem;
    --bs-btn-font-weight: 550;
    --bs-btn-border-radius: var(--ti-radius);
    --bs-btn-focus-box-shadow: 0 0 0 3px var(--ti-brand-ring);
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    min-height: 38px; line-height: 1.2; letter-spacing: -0.005em;
    box-shadow: none !important; transform: none !important;
    background-image: none !important;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.btn {
    color: var(--bs-btn-color); background-color: var(--bs-btn-bg); border: 1px solid var(--bs-btn-border-color);
    padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x); font-size: var(--bs-btn-font-size);
    font-weight: var(--bs-btn-font-weight); border-radius: var(--bs-btn-border-radius);
}
.btn:hover { color: var(--bs-btn-hover-color); background-color: var(--bs-btn-hover-bg); border-color: var(--bs-btn-hover-border-color); }
.btn:active, .btn.active, .btn.show { color: var(--bs-btn-active-color); background-color: var(--bs-btn-active-bg); border-color: var(--bs-btn-active-border-color); }
.btn:disabled, .btn.disabled { color: var(--bs-btn-disabled-color); background-color: var(--bs-btn-disabled-bg); border-color: var(--bs-btn-disabled-border-color); opacity: .6; }
.btn:focus-visible { box-shadow: var(--bs-btn-focus-box-shadow) !important; }
.btn .bi { font-size: 1em; }
.btn.me-1 > .bi, .btn > .bi.me-1, .btn > .bi.me-2 { margin-right: 0 !important; }
.btn-sm { --bs-btn-padding-x: .75rem; --bs-btn-padding-y: .35rem; --bs-btn-font-size: .8125rem; --bs-btn-border-radius: var(--ti-radius-sm); min-height: 32px; }
.btn-lg { --bs-btn-padding-x: 1.25rem; --bs-btn-padding-y: .7rem; --bs-btn-font-size: .9375rem; min-height: 46px; }
.btn-primary, .btn-success, .btn-dark {
    --bs-btn-color: #fff; --bs-btn-bg: var(--ti-brand); --bs-btn-border-color: var(--ti-brand);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--ti-brand-hover); --bs-btn-hover-border-color: var(--ti-brand-hover);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--ti-brand-hover); --bs-btn-active-border-color: var(--ti-brand-hover);
    --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--ti-brand); --bs-btn-disabled-border-color: var(--ti-brand);
}
/* Dark mode: solid buttons keep the exact logo green, with white text */
[data-bs-theme="dark"] .btn-primary, [data-bs-theme="dark"] .btn-success, [data-bs-theme="dark"] .btn-dark {
    --bs-btn-color: #fff; --bs-btn-bg: #1a5438; --bs-btn-border-color: #24704b;
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #1f6143; --bs-btn-hover-border-color: #2b8058;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #1f6143; --bs-btn-active-border-color: #2b8058;
    --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: #1a5438; --bs-btn-disabled-border-color: #1a5438;
}
.btn-secondary, .btn-light, .btn-outline-secondary, .btn-outline-primary, .btn-outline-dark, .btn-outline-success, .btn-outline-info {
    --bs-btn-color: var(--ti-ink); --bs-btn-bg: var(--ti-surface); --bs-btn-border-color: var(--ti-line-2);
    --bs-btn-hover-color: var(--ti-ink); --bs-btn-hover-bg: var(--ti-surface-2); --bs-btn-hover-border-color: var(--ti-line-2);
    --bs-btn-active-color: var(--ti-ink); --bs-btn-active-bg: var(--ti-surface-2); --bs-btn-active-border-color: var(--ti-ink-3);
    --bs-btn-disabled-color: var(--ti-ink-3); --bs-btn-disabled-bg: var(--ti-surface); --bs-btn-disabled-border-color: var(--ti-line);
}
.btn-outline-primary { --bs-btn-color: var(--ti-brand); --bs-btn-hover-color: var(--ti-brand); --bs-btn-active-color: var(--ti-brand); }
.btn-outline-danger, .btn-danger {
    --bs-btn-color: var(--ti-loss); --bs-btn-bg: var(--ti-surface); --bs-btn-border-color: color-mix(in srgb, var(--ti-loss) 35%, var(--ti-line-2));
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--ti-loss); --bs-btn-hover-border-color: var(--ti-loss);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--ti-loss); --bs-btn-active-border-color: var(--ti-loss);
}
.btn-danger { --bs-btn-color: #fff; --bs-btn-bg: var(--ti-loss); --bs-btn-border-color: var(--ti-loss); --bs-btn-hover-bg: #a52f24; --bs-btn-hover-border-color: #a52f24; }
.btn-warning, .btn-outline-warning {
    --bs-btn-color: var(--ti-ink); --bs-btn-bg: var(--ti-warn-tint); --bs-btn-border-color: color-mix(in srgb, var(--ti-warn) 35%, transparent);
    --bs-btn-hover-color: var(--ti-ink); --bs-btn-hover-bg: color-mix(in srgb, var(--ti-warn) 22%, var(--ti-surface)); --bs-btn-hover-border-color: var(--ti-warn);
}
.btn-info, .btn-outline-info { --bs-btn-color: var(--ti-info); --bs-btn-bg: var(--ti-surface); --bs-btn-border-color: var(--ti-line-2); }
.btn-link { --bs-btn-color: var(--ti-brand); --bs-btn-hover-color: var(--ti-brand-hover); text-decoration: none; min-height: auto; padding-left: 0; padding-right: 0; }
.btn-outline-light { --bs-btn-color: var(--ti-ink); --bs-btn-border-color: var(--ti-line-2); --bs-btn-hover-bg: var(--ti-surface-2); --bs-btn-hover-color: var(--ti-ink); }
.btn-group > .btn { min-height: 34px; }
.btn-group .btn-check:checked + .btn, .btn-group > .btn.active {
    background: var(--ti-brand-tint); color: var(--ti-brand); border-color: color-mix(in srgb, var(--ti-brand) 35%, var(--ti-line-2));
}
.btn-close { box-shadow: none !important; opacity: .55; }
.btn-close:hover { opacity: .9; }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* --------------------------------------------------------------------------
   7. Forms
   -------------------------------------------------------------------------- */
.form-label, label.form-label, .col-form-label {
    margin-bottom: 6px;
    font-size: .8125rem; font-weight: 550; color: var(--ti-ink);
    letter-spacing: 0 !important; text-transform: none !important;
}
.form-control, .form-select {
    min-height: 40px; padding: .5rem .8rem;
    font-size: .9rem; color: var(--ti-ink);
    background-color: var(--ti-surface);
    border: 1px solid var(--ti-line-2);
    border-radius: var(--ti-radius);
    box-shadow: none;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.form-control::placeholder { color: var(--ti-ink-3); opacity: 1; }
.form-control:hover, .form-select:hover { border-color: var(--ti-ink-3); }
.form-control:focus, .form-select:focus {
    color: var(--ti-ink); background-color: var(--ti-surface);
    border-color: var(--ti-brand); box-shadow: 0 0 0 3px var(--ti-brand-ring);
}
.form-control:disabled, .form-control[readonly], .form-select:disabled { background-color: var(--ti-surface-2); color: var(--ti-ink-2); }
.form-control-sm, .form-select-sm { min-height: 34px; font-size: .8125rem; border-radius: var(--ti-radius-sm); padding: .35rem .65rem; }
.form-control-lg, .form-select-lg { min-height: 46px; font-size: .95rem; padding: .65rem .95rem; }
textarea.form-control { min-height: 96px; line-height: 1.5; }
.form-select { padding-right: 2.25rem; background-position: right .75rem center; }
[data-bs-theme="dark"] .form-select { --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23a9b7af' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
.form-text { font-size: .8rem; color: var(--ti-ink-3); margin-top: 6px; }
.input-group-text { background: var(--ti-surface-2); border: 1px solid var(--ti-line-2); color: var(--ti-ink-2); font-size: .875rem; border-radius: var(--ti-radius); }
.input-group > .form-control:focus, .input-group > .form-select:focus { z-index: 5; }
.form-check-input { width: 1.05em; height: 1.05em; border: 1.5px solid var(--ti-line-2); background-color: var(--ti-surface); box-shadow: none !important; }
.form-check-input:checked { background-color: var(--ti-brand); border-color: var(--ti-brand); }
.form-check-input:focus { border-color: var(--ti-brand); box-shadow: 0 0 0 3px var(--ti-brand-ring) !important; }
.form-switch .form-check-input { width: 2.1em; height: 1.2em; }
.form-check-label { color: var(--ti-ink); font-size: .9rem; }
.form-range::-webkit-slider-thumb { background: var(--ti-brand); }
.form-range::-moz-range-thumb { background: var(--ti-brand); }
.was-validated .form-control:invalid, .form-control.is-invalid, .input-validation-error { border-color: var(--ti-loss) !important; }
.field-validation-error, .text-danger.small { font-size: .8rem; }
.validation-summary-errors ul { margin: 0; padding-left: 1rem; }

/* --------------------------------------------------------------------------
   8. Tables
   -------------------------------------------------------------------------- */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ti-ink);
    --bs-table-border-color: var(--ti-line);
    --bs-table-hover-bg: var(--ti-surface-2);
    --bs-table-hover-color: var(--ti-ink);
    --bs-table-striped-bg: var(--ti-surface-2);
    --bs-table-active-bg: var(--ti-brand-tint);
    margin-bottom: 0;
    font-size: .875rem;
    color: var(--ti-ink);
}
.table > :not(caption) > * > * { padding: .85rem 1rem; border-bottom-color: var(--ti-line); vertical-align: middle; box-shadow: none; }
.table > thead > tr > th, .table thead th, .table-light th, .table > thead.table-light > tr > th, thead.table-dark th {
    padding-top: .65rem; padding-bottom: .65rem;
    background: var(--ti-surface-2) !important; color: var(--ti-ink-2) !important;
    font-size: .78rem; font-weight: 550; letter-spacing: 0 !important; text-transform: none !important;
    border-bottom: 1px solid var(--ti-line) !important; white-space: nowrap;
}
.table thead.table-light, .table-light { --bs-table-bg: var(--ti-surface-2); --bs-table-color: var(--ti-ink-2); }
.table > tbody > tr:last-child > * { border-bottom: 0; }
.table-hover > tbody > tr { transition: background-color .1s ease; }
.table-hover > tbody > tr:hover { transform: none !important; }
.table-sm > :not(caption) > * > * { padding: .55rem .75rem; }
.card > .table-responsive, .card > .table, .card-body > .table-responsive:only-child { margin: 0; }
.card > .table-responsive:last-child .table > tbody > tr:last-child > *,
.card > .table:last-child > tbody > tr:last-child > * { border-bottom: 0; }
.card-body.p-0 .table > :not(caption) > * > *:first-child, .card > .table-responsive .table > :not(caption) > * > *:first-child { padding-left: 1.375rem; }
.card-body.p-0 .table > :not(caption) > * > *:last-child, .card > .table-responsive .table > :not(caption) > * > *:last-child { padding-right: 1.375rem; }
.table td.text-end, .table th.text-end { font-variant-numeric: tabular-nums; }
.table a { font-weight: 550; text-decoration: none; }
.table a:hover { text-decoration: underline; }
.table-responsive { -webkit-overflow-scrolling: touch; }

/* --------------------------------------------------------------------------
   9. Badges, alerts, chips, progress
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: .28em .62em; border-radius: 999px;
    font-size: .72rem; font-weight: 550; letter-spacing: 0; text-transform: none; line-height: 1.3;
}
.badge.bg-primary, .badge.text-bg-primary { background: var(--ti-brand-tint) !important; color: var(--ti-brand) !important; }
.badge.bg-success, .badge.text-bg-success { background: var(--ti-gain-tint) !important; color: var(--ti-gain) !important; }
.badge.bg-danger, .badge.text-bg-danger { background: var(--ti-loss-tint) !important; color: var(--ti-loss) !important; }
.badge.bg-warning, .badge.text-bg-warning { background: var(--ti-warn-tint) !important; color: var(--ti-warn) !important; }
.badge.bg-info, .badge.text-bg-info { background: var(--ti-info-tint) !important; color: var(--ti-info) !important; }
.badge.bg-secondary, .badge.text-bg-secondary, .badge.bg-light, .badge.text-bg-light, .badge.bg-dark {
    background: var(--ti-surface-2) !important; color: var(--ti-ink-2) !important; border: 1px solid var(--ti-line);
}
.badge.rounded-pill { border-radius: 999px; }
#alert-badge.badge { background: var(--ti-loss) !important; color: #fff !important; }

.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: .85rem 1rem; border-radius: var(--ti-radius-lg);
    border: 1px solid var(--ti-line); background: var(--ti-surface); color: var(--ti-ink);
    font-size: .9rem; box-shadow: none !important;
}
.alert > .bi:first-child { margin-top: 2px; }
.alert-dismissible { padding-right: 3rem; }
.alert-success { background: var(--ti-gain-tint); border-color: color-mix(in srgb, var(--ti-gain) 25%, transparent); color: var(--ti-ink); }
.alert-success .bi { color: var(--ti-gain); }
.alert-danger { background: var(--ti-loss-tint); border-color: color-mix(in srgb, var(--ti-loss) 25%, transparent); color: var(--ti-ink); }
.alert-danger .bi { color: var(--ti-loss); }
.alert-warning { background: var(--ti-warn-tint); border-color: color-mix(in srgb, var(--ti-warn) 25%, transparent); color: var(--ti-ink); }
.alert-warning .bi { color: var(--ti-warn); }
.alert-info, .alert-primary, .alert-secondary, .alert-light { background: var(--ti-info-tint); border-color: color-mix(in srgb, var(--ti-info) 22%, transparent); color: var(--ti-ink); }
.alert-info .bi, .alert-primary .bi { color: var(--ti-info); }
.alert-link { color: inherit; font-weight: 600; }
.alert.d-flex { display: flex; }
.alert:not(.d-flex):not(.alert-dismissible) { display: block; }

.progress { height: 6px; border-radius: 999px; background: var(--ti-surface-2); box-shadow: inset 0 0 0 1px var(--ti-line); overflow: hidden; }
.progress-bar { background: var(--ti-brand); border-radius: 999px; }
.progress-bar.bg-success { background: var(--ti-gain) !important; }
.progress-bar.bg-danger { background: var(--ti-loss) !important; }
.progress-bar.bg-warning { background: #d38b12 !important; }

.benefit-tag, .info-meta-tag, .cat-pill, .unlock-chip, .chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 999px;
    background: var(--ti-surface-2); border: 1px solid var(--ti-line); color: var(--ti-ink-2);
    font-size: .75rem; font-weight: 500; text-transform: none; letter-spacing: 0;
}

/* --------------------------------------------------------------------------
   10. Navigation inside pages: tabs, pills, list groups, breadcrumbs, pagination
   -------------------------------------------------------------------------- */
.nav-tabs { border-bottom: 1px solid var(--ti-line); gap: 4px; }
.nav-tabs .nav-link {
    border: 0; border-bottom: 2px solid transparent; border-radius: 0;
    padding: .7rem .25rem; margin-right: 1.25rem; margin-bottom: -1px;
    color: var(--ti-ink-2); font-size: .875rem; font-weight: 500; background: transparent;
}
.nav-tabs .nav-link:hover { color: var(--ti-ink); border-bottom-color: var(--ti-line-2); }
.nav-tabs .nav-link.active { color: var(--ti-ink); background: transparent; border-bottom-color: var(--ti-brand); font-weight: 600; }
.nav-pills { gap: 4px; }
.nav-pills .nav-link { border-radius: var(--ti-radius-sm); color: var(--ti-ink-2); font-size: .875rem; font-weight: 500; padding: .45rem .8rem; }
.nav-pills .nav-link:hover { background: var(--ti-surface-2); color: var(--ti-ink); }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { background: var(--ti-brand-tint); color: var(--ti-brand); }
.nav-link { color: var(--ti-ink-2); }
.nav-link:hover { color: var(--ti-ink); }

.list-group { --bs-list-group-bg: transparent; --bs-list-group-border-color: var(--ti-line); --bs-list-group-color: var(--ti-ink); border-radius: var(--ti-radius-lg); }
.list-group-item { padding: .85rem 1.1rem; font-size: .9rem; }
.list-group-flush > .list-group-item { padding-left: 1.375rem; padding-right: 1.375rem; }
.list-group-item-action:hover, .list-group-item-action:focus { background: var(--ti-surface-2); color: var(--ti-ink); }
.list-group-item.active { background: var(--ti-brand-tint); border-color: var(--ti-line); color: var(--ti-brand); font-weight: 600; }

.breadcrumb { font-size: .8125rem; margin-bottom: .75rem; }
.breadcrumb-item a { color: var(--ti-ink-2); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--ti-ink); }
.breadcrumb-item.active { color: var(--ti-ink-3); }

.pagination { --bs-pagination-color: var(--ti-ink-2); --bs-pagination-bg: var(--ti-surface); --bs-pagination-border-color: var(--ti-line); --bs-pagination-hover-bg: var(--ti-surface-2); --bs-pagination-hover-color: var(--ti-ink); --bs-pagination-active-bg: var(--ti-brand); --bs-pagination-active-border-color: var(--ti-brand); --bs-pagination-disabled-bg: var(--ti-surface); --bs-pagination-focus-box-shadow: 0 0 0 3px var(--ti-brand-ring); gap: 4px; }
.page-link { border-radius: var(--ti-radius-sm) !important; font-size: .8125rem; }

.accordion { --bs-accordion-bg: var(--ti-surface); --bs-accordion-border-color: var(--ti-line); --bs-accordion-border-radius: var(--ti-radius-lg); --bs-accordion-inner-border-radius: calc(var(--ti-radius-lg) - 1px); --bs-accordion-btn-focus-box-shadow: 0 0 0 3px var(--ti-brand-ring); --bs-accordion-active-bg: var(--ti-surface-2); --bs-accordion-active-color: var(--ti-ink); --bs-accordion-color: var(--ti-ink); --bs-accordion-btn-color: var(--ti-ink); }
.accordion-button { font-weight: 550; font-size: .9375rem; }
[data-bs-theme="dark"] .accordion-button::after { filter: invert(1); }

/* --------------------------------------------------------------------------
   11. Overlays: dropdowns, modals, toasts, tooltips, popovers
   -------------------------------------------------------------------------- */
.dropdown-menu {
    --bs-dropdown-bg: var(--ti-surface); --bs-dropdown-border-color: var(--ti-line); --bs-dropdown-link-color: var(--ti-ink);
    --bs-dropdown-link-hover-bg: var(--ti-surface-2); --bs-dropdown-link-hover-color: var(--ti-ink);
    --bs-dropdown-link-active-bg: var(--ti-brand-tint); --bs-dropdown-link-active-color: var(--ti-brand);
    --bs-dropdown-divider-bg: var(--ti-line); --bs-dropdown-header-color: var(--ti-ink-3);
    padding: 6px; border-radius: var(--ti-radius-lg); box-shadow: var(--ti-shadow-pop); font-size: .875rem;
}
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: .5rem .65rem; border-radius: var(--ti-radius-sm); font-weight: 500; }
.dropdown-item > .bi { color: var(--ti-ink-3); width: 16px; text-align: center; }
.dropdown-item.text-danger > .bi { color: var(--ti-loss); }
.dropdown-header { font-size: .75rem; font-weight: 500; text-transform: none; letter-spacing: 0; padding: .4rem .65rem; }
.dropdown-divider { margin: 6px 0; }

.modal { --bs-modal-bg: var(--ti-surface); --bs-modal-border-color: var(--ti-line); --bs-modal-border-radius: var(--ti-radius-xl); --bs-modal-inner-border-radius: calc(var(--ti-radius-xl) - 1px); --bs-modal-header-border-color: var(--ti-line); --bs-modal-footer-border-color: var(--ti-line); --bs-modal-padding: 1.5rem; }
.modal-content { box-shadow: var(--ti-shadow-pop); }
.modal-header { padding: 1.15rem 1.5rem; }
.modal-title { font-size: 1.0625rem; font-weight: 600; }
.modal-footer { padding: .9rem 1.5rem; gap: 8px; }
.modal-footer > * { margin: 0; }
.modal-backdrop { --bs-backdrop-bg: #07140e; --bs-backdrop-opacity: .45; }

.tooltip { --bs-tooltip-bg: var(--ti-ink); --bs-tooltip-color: var(--ti-surface); --bs-tooltip-font-size: .78rem; --bs-tooltip-border-radius: var(--ti-radius-sm); }
.popover { --bs-popover-border-color: var(--ti-line); --bs-popover-border-radius: var(--ti-radius-lg); --bs-popover-box-shadow: var(--ti-shadow-pop); --bs-popover-bg: var(--ti-surface); --bs-popover-header-bg: var(--ti-surface-2); }

/* Toasts (site.js showToast) */
.toast-container { z-index: 2100; }
.ti-toast {
    min-width: 300px; max-width: 400px;
    background: var(--ti-surface) !important; color: var(--ti-ink);
    border: 1px solid var(--ti-line) !important; border-radius: var(--ti-radius-lg);
    box-shadow: var(--ti-shadow-pop) !important;
}
.ti-toast .toast-body { font-size: .875rem; color: var(--ti-ink); padding: .8rem .9rem; }
.ti-toast-icon { font-size: 1.05rem; margin-top: 1px; }
.ti-toast-success .ti-toast-icon { color: var(--ti-gain); }
.ti-toast-danger .ti-toast-icon { color: var(--ti-loss); }
.ti-toast-warning .ti-toast-icon { color: var(--ti-warn); }
.ti-toast-info .ti-toast-icon { color: var(--ti-info); }

/* Confirmation dialog (site.js confirmDialog) */
.ti-confirm { border: 1px solid var(--ti-line); border-radius: var(--ti-radius-xl); box-shadow: var(--ti-shadow-pop); }
.ti-confirm .modal-title { font-size: 1.0625rem; font-weight: 600; }
.ti-confirm-icon { flex: 0 0 40px; height: 40px; border-radius: var(--ti-radius); display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.ti-confirm-icon.is-danger { background: var(--ti-loss-tint); color: var(--ti-loss); }
.ti-confirm-icon.is-info { background: var(--ti-brand-tint); color: var(--ti-brand); }

/* Command palette */
.cmdk-dialog { max-width: 640px; margin-top: 12vh; }
.cmdk-content { border: 1px solid var(--ti-line); border-radius: var(--ti-radius-xl); overflow: hidden; box-shadow: var(--ti-shadow-pop); background: var(--ti-surface); }
.cmdk-search { display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--ti-line); }
.cmdk-search-icon { color: var(--ti-ink-3); font-size: 1.05rem; }
.cmdk-input { flex: 1 1 auto; height: 56px; border: 0; background: transparent; color: var(--ti-ink); font-size: 1rem; outline: none; }
.cmdk-input::placeholder { color: var(--ti-ink-3); }
.cmdk-close { border: 0; background: transparent; padding: 0; }
.cmdk-esc { font-size: .7rem; }
.cmdk-results { max-height: min(60vh, 460px); overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.cmdk-list { list-style: none; margin: 0; padding: 0; }
.cmdk-group { padding: 10px 12px 4px; font-size: .75rem; font-weight: 500; color: var(--ti-ink-3); letter-spacing: 0; text-transform: none; }
.cmdk-group.cmdk-note { font-size: .8125rem; }
.cmdk-option { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--ti-radius); cursor: pointer; color: var(--ti-ink); }
.cmdk-option.active { background: var(--ti-surface-2); box-shadow: inset 0 0 0 1px var(--ti-line); }
.cmdk-option-icon { width: 32px; height: 32px; flex: 0 0 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--ti-radius-sm); background: var(--ti-surface-2); color: var(--ti-ink-2); border: 1px solid var(--ti-line); }
.cmdk-option-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.cmdk-option-title { font-weight: 550; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-option-meta { font-size: .75rem; color: var(--ti-ink-3); }
.cmdk-option-hint { color: var(--ti-ink-3); opacity: 0; }
.cmdk-option.active .cmdk-option-hint { opacity: 1; }
.cmdk-empty { padding: 2rem 1rem; text-align: center; color: var(--ti-ink-2); }
.cmdk-footer { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--ti-line); color: var(--ti-ink-3); font-size: .75rem; background: var(--ti-surface-2); }
@media (max-width: 575.98px) { .cmdk-dialog { margin: 0; max-width: none; height: 100%; } .cmdk-content { height: 100%; border-radius: 0; } .cmdk-results { max-height: none; flex: 1; } }

/* --------------------------------------------------------------------------
   12. Empty states, skeletons, checklists, lists used by the dashboard
   -------------------------------------------------------------------------- */
.empty-state {
    padding: 48px 24px; text-align: center;
    border: 1px dashed var(--ti-line-2); border-radius: var(--ti-radius-lg);
    background: var(--ti-surface);
}
.empty-state__icon {
    width: 52px; height: 52px; margin: 0 auto 16px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 14px; background: var(--ti-brand-tint); color: var(--ti-brand); font-size: 1.4rem;
}
.empty-state .empty-state__title, .empty-state h3, .empty-state h4, .empty-state h5 { margin: 0 0 6px; font-size: 1.0625rem; font-weight: 600; color: var(--ti-ink); }
.empty-state .empty-state__message, .empty-state p { max-width: 460px; margin: 0 auto 18px; color: var(--ti-ink-2); font-size: .9rem; }
.empty-state__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; align-items: center; }
.empty-state__secondary { font-weight: 550; color: var(--ti-brand); text-decoration: none; }
.empty-state--compact { padding: 28px 16px; border: 0; background: transparent; }
.empty-state--compact .empty-state__icon { width: 44px; height: 44px; font-size: 1.2rem; border-radius: 12px; margin-bottom: 12px; }
.empty-state--compact .empty-state__title { font-size: .975rem; }

.skeleton, .skeleton-text, .skeleton-card:empty {
    background: linear-gradient(90deg, var(--ti-surface-2) 25%, color-mix(in srgb, var(--ti-line) 70%, var(--ti-surface-2)) 37%, var(--ti-surface-2) 63%);
    background-size: 400% 100%; animation: ti-shimmer 1.4s ease infinite; border-radius: var(--ti-radius-sm);
}
.skeleton-text { display: block; height: .9em; margin: .45em 0; }
.skeleton-text.lg { height: 1.3em; } .skeleton-text.sm { height: .65em; }
.skeleton-text:last-child:not(:only-child) { width: 60%; }
.skeleton-card { background-color: var(--ti-surface); }
.skeleton-card:empty { min-height: 120px; border-color: transparent; }
@keyframes ti-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist-item + .checklist-item { border-top: 1px solid var(--ti-line); }
.checklist-link { display: flex; align-items: center; gap: 14px; padding: 14px 1.375rem; color: var(--ti-ink); text-decoration: none; }
.checklist-link:hover { background: var(--ti-surface-2); color: var(--ti-ink); }
.checklist-step {
    width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--ti-line-2); color: var(--ti-ink-2); font-size: .8125rem; font-weight: 600; background: var(--ti-surface);
}
.checklist-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.checklist-title { font-weight: 550; font-size: .9rem; }
.checklist-desc { font-size: .8125rem; color: var(--ti-ink-2); }
.checklist-go { color: var(--ti-ink-3); }
.checklist-link:hover .checklist-go { color: var(--ti-brand); }

.rec-list { list-style: none; margin: 0; padding: 0; }
.rec-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ti-line); }
.rec-item:last-child { border-bottom: 0; }
.rec-symbol { font-weight: 600; min-width: 56px; }
.rec-reason { color: var(--ti-ink-2); font-size: .8125rem; }

.news-card, .insight-card, .portfolio-card, .feat-card, .info-section, .info-grid-item {
    background: var(--ti-surface); border: 1px solid var(--ti-line) !important; border-radius: var(--ti-radius-lg);
    box-shadow: none !important; transform: none !important;
}
.news-card:hover, .insight-card:hover, .portfolio-card:hover, .feat-card:hover { border-color: var(--ti-line-2) !important; }
.news-img { border-radius: var(--ti-radius); object-fit: cover; }
.news-img-placeholder { background: var(--ti-surface-2); color: var(--ti-ink-3); border-radius: var(--ti-radius); }
.check-list { list-style: none; padding-left: 0; }
.check-list li { position: relative; padding-left: 1.5rem; margin-bottom: .45rem; color: var(--ti-ink-2); }
.check-list li::before { content: "\F26E"; font-family: "bootstrap-icons"; position: absolute; left: 0; top: 0; color: var(--ti-gain); }

/* Code blocks (developer docs) */
.code-block, pre {
    background: #0c1612; color: #d9e6df; border-radius: var(--ti-radius); padding: 14px 16px;
    font-family: var(--ti-font-mono); font-size: .8125rem; line-height: 1.6; border: 1px solid #1c2a24; overflow-x: auto;
}
code { font-family: var(--ti-font-mono); font-size: .85em; color: var(--ti-brand); }
pre code, .code-block code { color: inherit; }
.code-block .kw { color: #8fd6b0; } .code-block .string { color: #e8c98a; }

/* --------------------------------------------------------------------------
   13. Footer: compact on app pages, fuller on public pages
   -------------------------------------------------------------------------- */
.premium-footer {
    margin-top: 0 !important;
    background: transparent; color: var(--ti-ink-2);
    border-top: 1px solid var(--ti-line);
    font-size: .8125rem;
}
.premium-footer .footer-content { padding: 24px 40px 28px; max-width: 1400px; margin: 0 auto; }
.premium-footer .footer-content > .container-fluid { padding: 0; }
.footer-title { font-size: .8125rem; font-weight: 600; color: var(--ti-ink); margin-bottom: .6rem; letter-spacing: 0; text-transform: none; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .35rem; }
.footer-links a, .premium-footer a { color: var(--ti-ink-2); text-decoration: none; }
.footer-links a:hover, .premium-footer a:hover { color: var(--ti-ink); }
.footer-description { color: var(--ti-ink-2); max-width: 42ch; }
.brand-eyebrow { font-size: .8125rem; color: var(--ti-ink-3); letter-spacing: 0; text-transform: none; }
.footer-brand-logo { height: 52px !important; width: auto; margin-left: -8px; }
.social-links { display: flex; gap: 8px; }
.social-link { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--ti-radius-sm); border: 1px solid var(--ti-line); color: var(--ti-ink-2) !important; }
.social-link:hover { color: var(--ti-ink) !important; border-color: var(--ti-line-2); }
.footer-bottom { border-top: 1px solid var(--ti-line); color: var(--ti-ink-3); }
.footer-copyright, .footer-badges { color: var(--ti-ink-3); font-size: .8rem !important; }
.footer-badges i { color: var(--ti-ink-3) !important; }
.footer-disclaimer { margin-top: 12px; font-size: .75rem; line-height: 1.6; color: var(--ti-ink-3); max-width: 110ch; }
.footer-disclaimer a { color: var(--ti-ink-2); text-decoration: underline; }
/* On signed-in app pages the footer is a quiet strip: hide the marketing columns */
.has-app-shell .premium-footer .footer-content > .container-fluid > .row.g-4 { display: none; }
.has-app-shell .premium-footer .footer-bottom { border-top: 0; margin-top: 0 !important; padding-top: 0 !important; }

/* --------------------------------------------------------------------------
   14. Sign-in & registration
   -------------------------------------------------------------------------- */
.auth-page { min-height: 100vh; background: var(--ti-canvas); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-hero {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
    padding: 48px 56px;
    background: var(--ti-deep); color: #e9f0ec;
}
.auth-hero::before {
    content: ""; position: absolute; inset: auto -20% -35% -20%; height: 70%;
    background: radial-gradient(60% 60% at 50% 100%, rgba(176, 141, 74, .22), transparent 70%);
    pointer-events: none;
}
.auth-hero > * { position: relative; }
.auth-hero { justify-content: flex-start; gap: 0; }
.auth-hero h1 { margin-top: auto !important; }
.auth-hero .feature-list { margin-top: 32px; }
.auth-hero .trust-badges { margin-top: auto; padding-top: 40px; }
.auth-hero .brand-lockup { display: inline-flex; }
.auth-brand-logo { height: 72px !important; width: auto; margin-left: -10px; } /* artwork has built-in padding */
.auth-hero .brand-eyebrow, .brand-eyebrow--muted { color: rgba(233, 240, 236, .6); }
.auth-hero h1 {
    margin: 0; max-width: 16ch;
    font-family: var(--ti-font-display); font-weight: 500;
    font-size: clamp(2.2rem, 3.6vw, 3.25rem); line-height: 1.06; letter-spacing: -0.025em;
    color: #fbfcfb;
}
.auth-hero h1 .accent { color: inherit; font-style: normal; }
.auth-hero .lead { color: rgba(233, 240, 236, .74); max-width: 46ch; font-size: 1.0625rem; margin-top: 18px; }
.feature-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.feature-list li { display: flex; align-items: flex-start; gap: 12px; color: rgba(233, 240, 236, .86); font-size: .95rem; }
.feature-list li i { width: 28px; height: 28px; flex: 0 0 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(255, 255, 255, .07); color: #d8c79f; font-size: .9rem; }
.trust-badges { display: flex; flex-wrap: wrap; gap: 8px 18px; color: rgba(233, 240, 236, .6); font-size: .8125rem; }
.trust-badges span { display: inline-flex; align-items: center; gap: 6px; }
.auth-card { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 96px); background: var(--ti-surface); }
.auth-card > * { width: 100%; max-width: 420px; margin-left: auto; margin-right: auto; }
.auth-card h2, .auth-card h1 { font-family: var(--ti-font-display); font-weight: 500; font-size: 2rem; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-sub { color: var(--ti-ink-2); margin-bottom: 28px; }
.auth-card .btn-primary, .auth-card button[type="submit"] { width: 100%; }
.auth-foot { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--ti-line); color: var(--ti-ink-2); font-size: .875rem; text-align: center; }
@media (max-width: 991.98px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-hero { padding: 32px 24px; gap: 24px; }
    .auth-hero .feature-list, .auth-hero .trust-badges { display: none; }
    .auth-card { padding: 32px 20px 48px; }
}

/* --------------------------------------------------------------------------
   15. Legacy compatibility (classes older pages still use)
   -------------------------------------------------------------------------- */
.brand-lockup { display: inline-flex; align-items: center; text-decoration: none; }
.brand-logo { height: 40px; width: auto; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--ti-gain-tint); color: var(--ti-gain); font-size: .75rem; font-weight: 550; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ti-gain); display: inline-block; }
.icon { color: var(--ti-ink-3); }
.is-up { color: var(--ti-gain); } .is-down { color: var(--ti-loss); }
.rounded-3 { border-radius: var(--ti-radius-lg) !important; }
.fs-1, .fs-2 { letter-spacing: -0.02em; }
.text-white-50 { color: var(--ti-ink-3) !important; }
.bg-gradient { background-image: none !important; }
.has-active { }
.collapsed { }

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Print: clean statements */
@media print {
    .app-sidebar, .app-topbar, .bottom-tabbar, .premium-footer, #copilot-fab, #copilot-panel, .page-header__actions { display: none !important; }
    .has-app-shell .app-main { margin: 0 !important; }
    .app-content { padding: 0 !important; }
    .card { break-inside: avoid; }
}
