@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
    --primary-rgb: 37, 99, 235;
    --secondary-rgb: 29, 78, 216;

    --bg-main: #0b1220;
    --bg-card: rgba(15, 23, 42, 0.92);
    --bg-card-solid: #111827;
    --border-card: rgba(148, 163, 184, 0.24);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --primary: rgb(var(--primary-rgb));
    --primary-dark: #1d4ed8;
    --primary-glow: rgba(var(--primary-rgb), 0.22);
    --secondary: rgb(var(--secondary-rgb));
    --secondary-glow: rgba(var(--secondary-rgb), 0.16);
    --success: #16a34a;
    --success-glow: rgba(22, 163, 74, 0.15);
    --danger: #dc2626;
    --danger-glow: rgba(220, 38, 38, 0.16);
    --warning: #d97706;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --transition-smooth: background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;

    /* Input Variables */
    --input-bg: rgba(15, 23, 42, 0.75);
    --input-bg-focus: rgba(15, 23, 42, 0.95);
    --input-border: rgba(148, 163, 184, 0.3);
    --input-autofill-bg: #0f172a;
    --input-autofill-bg-focus: #172036;
}

.light-theme {
    color-scheme: light;
    --primary-rgb: 29, 78, 216;
    --secondary-rgb: 30, 64, 175;
    --bg-grad-1-rgb: 241, 245, 249;
    --bg-grad-2-rgb: 248, 250, 252;
    --bg-grad-3-rgb: 241, 245, 249;
    --bg-grad-4-rgb: 248, 250, 252;
    --bg-grad-linear-1: #f1f5f9;
    --bg-grad-linear-2: #f8fafc;
    --bg-grad-linear-3: #ffffff;
    
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.94);
    --bg-card-solid: #ffffff;
    --border-card: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --primary: rgb(var(--primary-rgb));
    --primary-dark: #1e40af;
    --primary-glow: rgba(var(--primary-rgb), 0.14);
    --secondary: rgb(var(--secondary-rgb));
    --secondary-glow: rgba(var(--secondary-rgb), 0.12);
    --success: #16a34a;
    --success-glow: rgba(22, 163, 74, 0.1);
    --danger: #dc2626;
    --danger-glow: rgba(220, 38, 38, 0.1);
    --warning: #d97706;
    
    /* Input Variables */
    --input-bg: #ffffff;
    --input-bg-focus: #ffffff;
    --input-border: #cbd5e1;
    --input-autofill-bg: #f8fafc;
    --input-autofill-bg-focus: #f1f5f9;
}

html {
    color-scheme: dark;
}
html:has(.light-theme) {
    color-scheme: light;
}

/* Premium dark defaults for when light mode is not active */
body:not(.light-theme) {
    color-scheme: dark;
    --bg-main: #0a1220;
    --bg-card: rgba(15, 23, 42, 0.92);
    --bg-card-solid: #0f172a;
    --border-card: rgba(148, 163, 184, 0.2);
    --text-primary: #e5e7eb;
    --text-secondary: #94a3b8;
}

/* Disable transitions temporarily during theme changes to prevent flicker/stutter */
.disable-transitions,
.disable-transitions * {
    transition: none !important;
}

/* Temporarily suspend transitions while the browser is actively resizing */
.is-resizing,
.is-resizing * {
    transition: none !important;
}

body.is-resizing {
    background-attachment: scroll;
}

body.is-resizing *,
body.is-resizing *::before,
body.is-resizing *::after {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* ============================================================
   CHROME COMPOSITOR / RENDERING FIXES
   Chrome (Blink) differs from Safari (WebKit) in how it handles:
   - backdrop-filter on layers without explicit will-change
   - opacity transitions that stall on background-tab return
   - fadeIn animations re-firing when tabs regain focus
   ============================================================ */

/* Promote background gradient to its own GPU layer so Chrome doesn't
   repaint it on every tab-return or scroll event. */
body::before {
    will-change: opacity;
    transform: translateZ(0);
}

/* Glass cards: Chrome needs an explicit stacking context to avoid
   backdrop-filter repaints bleeding into sibling composited layers. */
.glass-card {
    transform: translateZ(0);
    isolation: isolate;
}

/* Prevent Chrome from re-running fadeIn when switching back to a tab.
   Instead of animation:forwards on the base class, we play it once via
   a short-lived class so subsequent renders just see a static opacity:1. */
.glass-card {
    animation-fill-mode: both;
    animation-play-state: running;
}

/* Remove the repeating body-level transition — Chrome applies it on
   every repaint cycle including visibility-change repaint, causing a
   momentary flash. Use the more targeted version below instead. */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dashboard content: tell Chrome to keep the composited layer alive
   between tab switches so fields don't need to rasterize from scratch. */
#dashboard-view-content {
    will-change: opacity;
    transform: translateZ(0);
    contain: layout style;
}

/* Modal overlay: Chrome drops the backdrop-filter GPU layer when
   pointer-events:none is set; force it to stay composited. */
.modal-overlay {
    transform: translateZ(0);
    will-change: opacity;
}

/* Portfolio toolbar: Chrome re-runs its fadeIn on every hash change.
   Keep it as a simple opacity:1 static layer after first paint. */
.dash-portfolio-toolbar {
    animation: none;
    opacity: 1;
}

.pro-access-banner {
    align-items: center;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 12px;
    color: var(--text-primary);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: -20px 0 20px;
    padding: 12px 14px;
}

.pro-access-banner a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
}

/* Metric cards: the ::after pseudo-element with a large radial gradient
   forces Chrome to repaint the entire card on scroll. Reduce its cost. */
.metric-card::after {
    will-change: unset;
    pointer-events: none;
    contain: strict;
}

/* Nav items: avoid Chrome running --transition-smooth (which includes
   opacity, transform, box-shadow) on every mouse-leave during scroll. */
.dash-nav-item {
    transition: color 0.25s ease, transform 0.25s ease;
}

/* Home page cards: don't re-composite on every visibility change */
.home-hero,
.home-side-card {
    transform: translateZ(0);
    isolation: isolate;
}

/* Buttons: Chrome can stutter on filter:brightness hover when the parent
   has backdrop-filter. Use opacity instead for Chrome. */
.btn-primary:hover {
    filter: none;
    opacity: 0.92;
}

/* Skeleton shimmer: use transform instead of background-position for
   Chrome GPU acceleration (background-position forces software raster). */
@keyframes skeleton-shimmer-chrome {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.skeleton-row td {
    overflow: hidden;
    position: relative;
    background: rgba(var(--primary-rgb), 0.07) !important;
}

.skeleton-row td::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(var(--primary-rgb), 0.12) 50%,
        transparent 100%
    );
    animation: skeleton-shimmer-chrome 1.4s infinite;
    will-change: transform;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans, sans-serif);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image:
        radial-gradient(ellipse at 0% 0%, rgba(var(--primary-rgb), 0.12) 0px, transparent 58%),
        radial-gradient(ellipse at 100% 0%, rgba(var(--secondary-rgb), 0.08) 0px, transparent 52%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.28) 0%, rgba(15, 23, 42, 0) 42%);
    /* Chrome: promote to its own GPU layer so it never repaints on scroll/tab-switch */
    will-change: opacity;
    transform: translateZ(0);
    pointer-events: none;
}

body.light-theme::before {
    background-image:
        radial-gradient(ellipse at 0% 0%, rgba(var(--primary-rgb), 0.06) 0%, transparent 58%),
        radial-gradient(ellipse at 100% 0%, rgba(var(--secondary-rgb), 0.04) 0%, transparent 52%),
        linear-gradient(135deg, var(--bg-grad-linear-1) 0%, var(--bg-grad-linear-2) 40%, var(--bg-grad-linear-3) 70%, var(--bg-main) 100%);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 15px var(--primary-glow); }
    50% { box-shadow: 0 0 25px rgba(var(--primary-rgb), 0.6); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Auth Pages Container */
.auth-wrapper {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--bg-card);
    /* Reduced blur radius from 16px to 8px: lowers compositor cost
       with no visible quality difference at these card sizes */
    backdrop-filter: blur(8px) saturate(130%);
    -webkit-backdrop-filter: blur(8px) saturate(130%);
    border: 1px solid var(--border-card);
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.22);
    /* animation-fill-mode:both + isolation already set above by the Chrome
       fixes block; keep opacity:1 as default so tab-return doesn't blink */
    opacity: 1;
    width: 100%;
}

/* Only animate on first appearance (inside .view-section.active the first
   time it becomes visible). Chrome won't re-run this because animation-name
   is removed once the section is already painted. */
.view-section.active .glass-card {
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-card {
    max-width: 480px;
    padding: 40px;
}

.auth-wrapper.home-mode {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
}

.auth-wrapper.home-mode .auth-card {
    border: none;
    border-radius: 0;
    box-shadow: none;
    max-width: none;
    min-height: 100vh;
    padding: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: transparent;
}

.auth-wrapper.home-mode .brand-logo-container,
.auth-wrapper.home-mode .brand-title,
.auth-wrapper.home-mode .brand-subtitle,
.auth-wrapper.home-mode #global-status {
    display: none;
}

.home-shell {
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px 32px 24px;
}

.home-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
    gap: 16px;
}

.home-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.home-brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border-card);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.home-brand-name {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.home-topbar-actions {
    display: flex;
    gap: 10px;
}

.home-topbar-actions .btn {
    width: auto;
    min-width: 110px;
    padding: 10px 16px;
    font-size: 0.86rem;
}

.home-topbar-actions .home-signin-btn {
    background: rgba(var(--primary-rgb), 0.1);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    color: var(--primary);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    box-shadow: none;
}

.home-topbar-actions .home-signin-btn:hover {
    background: rgba(var(--primary-rgb), 0.2);
    transform: none;
    box-shadow: none;
    filter: none;
}

.home-topbar-actions .home-signin-btn:active {
    background: rgba(var(--primary-rgb), 0.25);
}

.home-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(330px, 1fr);
    gap: 22px;
    align-items: start;
}

.home-main-left,
.home-main-right {
    display: grid;
    gap: 18px;
}

.home-hero {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
    border: 1px solid var(--border-card);
    border-radius: 12px;
    background: var(--bg-card);
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.22);
    backdrop-filter: blur(8px);
}

.home-badge {
    width: fit-content;
    background: rgba(var(--primary-rgb), 0.14);
    border: 1px solid rgba(var(--primary-rgb), 0.28);
    border-radius: 999px;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 6px 12px;
    text-transform: uppercase;
}

.home-title {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.home-lead {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

.home-desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.7;
    margin-top: 10px;
}

.home-refresh {
    display: grid;
    gap: 16px;
}

.home-refresh-topbar {
    margin-bottom: 0;
}

.home-refresh-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
    padding: 32px;
    border-radius: 20px;
    border: 1px solid rgba(var(--primary-rgb), 0.22);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28), 0 6px 18px rgba(var(--primary-rgb), 0.12);
}

.home-refresh-hero::before {
    content: "";
    position: absolute;
    inset: -30% auto auto -10%;
    width: 440px;
    height: 440px;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.2), rgba(var(--primary-rgb), 0));
    pointer-events: none;
}

.home-refresh-hero::after {
    content: "";
    position: absolute;
    inset: auto -10% -35% auto;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(var(--secondary-rgb), 0.2), rgba(var(--secondary-rgb), 0));
    pointer-events: none;
}

.home-refresh-hero-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
    align-content: center;
}

.home-refresh-title {
    color: var(--text-primary);
    font-size: clamp(2.2rem, 3.2vw, 3.45rem);
    line-height: 1.18;
    letter-spacing: -0.02em;
}

.home-refresh-lead {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    max-width: 58ch;
}

.home-refresh-hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.home-refresh-hero-cta .btn {
    width: auto;
    min-width: 150px;
}

.home-refresh-hero-cta .btn-primary {
    position: relative;
    overflow: hidden;
}

.home-refresh-hero-cta .btn-primary::after {
    content: "";
    position: absolute;
    top: -120%;
    left: -40%;
    width: 40%;
    height: 320%;
    transform: rotate(18deg);
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0));
    pointer-events: none;
    animation: homeCtaShine 5s ease-in-out infinite;
}

.home-refresh-conversion-points {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.home-refresh-conversion-points span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px dashed rgba(var(--primary-rgb), 0.3);
    border-radius: 999px;
    padding: 4px 10px;
    background: rgba(var(--primary-rgb), 0.08);
}

.home-refresh-proof {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.home-refresh-proof span {
    border: 1px solid var(--border-card);
    border-radius: 999px;
    padding: 5px 11px;
    background: rgba(255, 255, 255, 0.02);
}

.home-refresh-pricing-teaser {
    display: grid;
    gap: 8px;
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    border-radius: 14px;
    padding: 12px;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.12), rgba(var(--secondary-rgb), 0.08));
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-refresh-pricing-teaser:hover,
.home-refresh-pricing-teaser:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(var(--primary-rgb), 0.5);
    box-shadow: 0 14px 28px rgba(var(--primary-rgb), 0.16);
    outline: none;
}

.home-refresh-pricing-kicker {
    color: var(--text-secondary);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
}

.home-refresh-pricing-plans {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.home-refresh-plan-pill {
    border: 1px solid var(--border-card);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.76rem;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.12);
}

.home-refresh-plan-pill strong {
    color: var(--primary);
    font-weight: 700;
    margin-left: 2px;
}

.home-refresh-plan-pill-plus {
    border-color: rgba(var(--primary-rgb), 0.45);
    background: rgba(var(--primary-rgb), 0.2);
}

.home-refresh-hero-preview {
    position: relative;
    z-index: 1;
    margin-top: 0;
    align-self: stretch;
    min-height: 320px;
    animation: homeFloat 6s ease-in-out infinite;
}

.home-refresh-value-tools {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.home-refresh-all-points {
    padding: 20px;
    border-radius: 16px;
}

.home-refresh-point-list {
    margin: 12px 0 0;
    list-style: none;
    padding-left: 0;
    display: grid;
    gap: 10px;
}

.home-refresh-point-list li {
    position: relative;
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.45;
    border: 1px solid var(--border-card);
    border-radius: 10px;
    padding: 10px 12px 10px 30px;
    background: rgba(255, 255, 255, 0.02);
}

.home-refresh-point-list li::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.9);
}

.home-refresh-point-list li:nth-child(even) {
    border-color: rgba(var(--primary-rgb), 0.22);
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.06), rgba(255, 255, 255, 0.02));
}

.home-refresh-point-list li:nth-child(3n) {
    border-color: rgba(var(--secondary-rgb), 0.24);
    background: linear-gradient(135deg, rgba(var(--secondary-rgb), 0.1), rgba(255, 255, 255, 0.02));
}

.home-refresh-point-list li:nth-child(3n)::before {
    background: rgba(var(--secondary-rgb), 0.95);
}

.home-refresh-point-list li strong {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.home-refresh-tools-col {
    display: grid;
    gap: 16px;
}

.home-refresh-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.home-refresh-stat-card {
    display: grid;
    gap: 6px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(var(--primary-rgb), 0.18);
    background: linear-gradient(145deg, rgba(var(--primary-rgb), 0.1), rgba(255, 255, 255, 0.02));
}

.home-refresh-stat-value {
    color: var(--text-primary);
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.home-refresh-stat-label {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.4;
}

.home-refresh-trust {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.home-refresh-trust-item {
    padding: 14px;
    border-radius: 14px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.home-refresh-trust-item:hover {
    transform: translateY(-2px);
}

.home-refresh-trust-value {
    display: block;
    color: var(--text-primary);
    font-size: 0.96rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.home-refresh-trust-copy {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
}

.home-refresh-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.home-refresh-feature-card {
    padding: 16px;
    border-radius: 16px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.home-refresh-feature-card:hover {
    transform: translateY(-2px);
}

.home-refresh-feature-card h3 {
    color: var(--text-primary);
    font-size: 0.98rem;
    margin-bottom: 6px;
}

.home-refresh-feature-card p {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

.home-refresh-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 16px;
}

.home-refresh-tool-card {
    padding: 20px;
    border-radius: 16px;
}

.home-refresh-news-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.home-refresh-news-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.home-refresh-news-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.home-refresh-news-actions .btn-action-small {
    background: rgba(var(--primary-rgb), 0.1);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
}

.home-refresh-news-actions .btn-action-small:hover {
    background: rgba(var(--primary-rgb), 0.2);
}

.home-refresh-last-updated {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-align: right;
}

.home-refresh-news-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 460px;
    overflow-y: auto;
    padding-right: 8px;
    margin-top: 14px;
}

.home-refresh-final-cta {
    border-radius: 16px;
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.home-refresh-final-cta h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.home-refresh-final-cta p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.home-refresh-final-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.home-refresh-final-cta-actions .btn {
    width: auto;
    min-width: 140px;
}

@keyframes homeFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes homeCtaShine {
    0%,
    65% {
        left: -45%;
    }
    100% {
        left: 135%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-refresh-hero-preview {
        animation: none;
    }

    .home-refresh-trust-item,
    .home-refresh-feature-card,
    .home-refresh-pricing-teaser {
        transition: none;
    }

    .home-refresh-hero-cta .btn-primary::after {
        animation: none;
    }
}

@media (max-width: 1200px) {
    .home-refresh-hero {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .home-refresh-value-tools {
        grid-template-columns: 1fr;
    }

    .home-refresh-tools {
        grid-template-columns: 1fr;
    }

    .home-refresh-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .home-refresh-title {
        font-size: clamp(1.85rem, 7vw, 2.45rem);
    }

    .home-refresh-trust,
    .home-refresh-features {
        grid-template-columns: 1fr;
    }

    .home-refresh-news-head {
        flex-direction: column;
    }

    .home-refresh-news-actions {
        align-items: flex-start;
    }

    .home-refresh-last-updated {
        text-align: left;
    }
}

.pricing-view {
    width: 100%;
}

.pricing-shell {
    max-width: 1320px;
    margin: 0 auto;
    padding: 8px 0 16px;
}

body:not(.layout-wide) .pricing-shell {
    max-width: 1240px;
}

.pricing-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.pricing-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.pricing-subtitle {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.pricing-toggle {
    display: inline-flex;
    gap: 8px;
    border: 1px solid var(--border-card);
    border-radius: 999px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 18px;
}

.pricing-toggle-btn {
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 8px 14px;
    cursor: pointer;
}

.pricing-toggle-btn.active {
    background: rgba(var(--primary-rgb), 0.18);
    color: var(--primary);
}

.pricing-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.pricing-card {
    position: relative;
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 20px;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pricing-card-current {
    border-color: rgba(var(--primary-rgb), 0.75);
    box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.16);
}

.pricing-card h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.pricing-price {
    font-size: 1.22rem;
    font-weight: 800;
    color: var(--primary);
}

.pricing-billing-note {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.pricing-savings {
    color: var(--success);
    font-size: 0.78rem;
    font-weight: 700;
}

.pricing-feature-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 16px;
    margin-bottom: 8px;
}

.pricing-feature-list li {
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.4;
}

.pricing-card .btn {
    margin-top: auto;
}

.pricing-card .btn.current-plan-btn {
    cursor: not-allowed;
    opacity: 0.75;
}

.pricing-card-highlight {
    border-color: rgba(var(--primary-rgb), 0.5);
    box-shadow: 0 14px 28px rgba(var(--primary-rgb), 0.12);
}

.pricing-pill {
    width: fit-content;
    background: rgba(var(--primary-rgb), 0.18);
    border: 1px solid rgba(var(--primary-rgb), 0.35);
    color: var(--primary);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pricing-bottom-row {
    margin-top: 14px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.pricing-footnote {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.pricing-highest-plan {
    margin-top: 14px;
    border: 1px solid rgba(var(--primary-rgb), 0.35);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-primary);
    background: rgba(var(--primary-rgb), 0.1);
    font-weight: 600;
}

.home-dashboard-preview {
    margin-top: 2px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    background: rgba(255, 255, 255, 0.02);
}

.home-dashboard-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    object-fit: contain;
    transition: opacity 0.4s ease-in-out;
}

.home-snapshot-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.home-stat-card {
    padding: 18px;
}

.home-graph-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.home-graph-card {
    padding: 20px;
}

.home-card-title {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.home-main-right .home-side-card {
    padding: 20px;
}

#home-allocation-bars {
    display: grid;
    gap: 10px;
}

.home-allocation-row {
    display: grid;
    gap: 6px;
}

.home-allocation-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.home-allocation-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.home-allocation-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.home-momentum-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    min-height: 160px;
    padding-top: 18px;
}

.home-momentum-bar {
    flex: 1;
    border-radius: 10px 10px 4px 4px;
    background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.9) 0%, rgba(var(--primary-rgb), 0.3) 100%);
    min-height: 18px;
    position: relative;
}

.home-momentum-bar span {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.home-search-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.home-inline-error {
    color: var(--danger);
    font-size: 0.82rem;
    display: none;
    margin-top: 10px;
}

.home-search-result {
    margin-top: 14px;
    border: 1px solid var(--border-card);
    border-radius: 14px;
    padding: 14px;
    background: rgba(var(--primary-rgb), 0.05);
}

.home-search-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.home-search-ticker,
.home-search-price {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.home-search-price {
    color: var(--primary);
}

.home-search-meta {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.home-search-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

.home-recent-searches {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.home-recent-chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
}

.home-news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.home-news-updated {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.home-news-feed {
    display: grid;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 6px;
}

.home-news-card {
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
}

.home-news-card-title {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.45;
    margin: 6px 0;
}

.home-news-card-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.auth-card.auth-card-wide {
    max-width: 900px;
}

body:not(.layout-wide) .auth-card.auth-card-wide {
    max-width: 820px;
}

.auth-card.auth-card-pricing {
    max-width: 1460px;
}

body:not(.layout-wide) .auth-card.auth-card-pricing {
    max-width: 1380px;
}

@media (max-width: 1440px) {
    .auth-card.auth-card-pricing {
        max-width: 1320px;
    }

    body:not(.layout-wide) .auth-card.auth-card-pricing {
        max-width: 1240px;
    }
}

/* Header & Typography */
.brand-title {
    color: var(--text-primary);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-align: center;
    margin-bottom: 8px;
}

.brand-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
    text-align: center;
    margin-bottom: 32px;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 18px;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.password-hint-list {
    display: grid;
    gap: 4px;
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}

.password-hint-item {
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.35;
    padding-left: 22px;
    position: relative;
}

.password-hint-item::before {
    color: var(--danger);
    content: "\2715";
    font-weight: 700;
    left: 0;
    position: absolute;
    text-align: center;
    top: 0;
    width: 16px;
}

.password-hint-item.met {
    color: var(--success);
}

.password-hint-item.met::before {
    color: var(--success);
    content: "\2713";
}

.password-strength {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}

.password-strength-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    height: 6px;
    overflow: hidden;
}

.password-strength-bar {
    background: var(--danger);
    border-radius: 999px;
    display: block;
    height: 100%;
    transition: width 0.2s ease, background-color 0.2s ease;
    width: 0%;
}

.password-strength-text {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.password-strength.weak .password-strength-bar {
    background: var(--danger);
}

.password-strength.medium .password-strength-bar {
    background: var(--warning);
}

.password-strength.strong .password-strength-bar {
    background: var(--success);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.input-control {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-sans, sans-serif);
    font-size: 0.92rem;
    padding: 12px 14px;
    outline: none;
    transition: var(--transition-smooth);
    width: 100%;
}

.input-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--input-bg-focus);
}

.input-control-invalid,
.input-control-invalid:focus {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18) !important;
    background: rgba(220, 38, 38, 0.08);
}

.input-inline-error {
    color: var(--danger);
    font-size: 0.82rem;
    margin-top: 8px;
}

.form-inline-status {
    border: 1px solid var(--border-card);
    border-radius: 10px;
    font-size: 0.84rem;
    line-height: 1.45;
    margin-top: 12px;
    padding: 10px 12px;
}

.form-inline-status-error {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.35);
    color: var(--danger);
}

.form-inline-status-success {
    background: rgba(22, 163, 74, 0.1);
    border-color: rgba(22, 163, 74, 0.35);
    color: var(--success);
}

/* Autofill Style Override */
.input-control:-webkit-autofill,
.input-control:-webkit-autofill:hover, 
.input-control:-webkit-autofill:focus, 
.input-control:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--input-autofill-bg) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.input-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--input-autofill-bg-focus) inset !important;
    border-color: var(--primary) !important;
}

/* Buttons */
.btn {
    align-items: center;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    font-family: var(--font-sans, sans-serif);
    font-size: 0.92rem;
    font-weight: 600;
    justify-content: center;
    padding: 12px 20px;
    transition: var(--transition-smooth);
    width: 100%;
}
 
.btn:disabled,
.btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
}

button[data-auto-disabled="true"][aria-busy="true"],
.btn[data-auto-disabled="true"][aria-busy="true"] {
    position: relative;
    padding-right: 42px;
}

button[data-auto-disabled="true"][aria-busy="true"]::after,
.btn[data-auto-disabled="true"][aria-busy="true"]::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    opacity: 0.85;
    animation: vm-btn-spin 0.75s linear infinite;
}

@keyframes vm-btn-spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-primary {
    background: var(--primary);
    border: 1px solid var(--primary-dark);
    color: white;
    box-shadow: 0 8px 18px rgba(var(--primary-rgb), 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(var(--primary-rgb), 0.3);
    filter: none;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-google {
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--input-border);
}

.btn-google:hover {
    background: var(--input-bg-focus);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-google svg {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

.google-btn-wrapper {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.btn-secondary {
    background: rgba(var(--primary-rgb), 0.06);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(var(--primary-rgb), 0.12);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(var(--primary-rgb), 0.38);
    color: var(--text-primary);
    box-shadow: none;
    transition: var(--transition-smooth);
}

.btn-outline:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: var(--secondary);
    color: var(--text-primary);
    box-shadow: 0 8px 16px rgba(var(--primary-rgb), 0.15);
    transform: translateY(-2px);
}

.btn-outline:active {
    transform: translateY(0);
}

.btn-outline:disabled,
.btn-outline[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

.btn-action-small {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid var(--border-card);
}

.btn-action-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-action-small:active {
    transform: translateY(0);
}

.btn-with-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-with-icon svg {
    flex-shrink: 0;
}

.btn-icon-label {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.watchlist-add-btn,
.watchlist-refresh-btn,
.trading-refresh-btn {
    white-space: nowrap;
}

.btn-layout-mode {
    width: auto;
    min-width: 68px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.1);
    border: 1px solid rgba(var(--primary-rgb), 0.28);
    color: var(--primary);
    font-size: 0.76rem;
    letter-spacing: 0.02em;
    font-weight: 700;
}

.btn-layout-mode:hover {
    background: rgba(var(--primary-rgb), 0.2);
    border-color: var(--primary);
}

@media (max-width: 1600px) {
    .compact-icon-btn {
        width: 40px !important;
        min-width: 40px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        justify-content: center !important;
        gap: 0 !important;
    }

    .compact-icon-btn .btn-icon-label {
        display: none !important;
    }

    .compact-icon-btn svg {
        margin: 0 !important;
    }
}

@media (max-width: 768px) {
    .compact-icon-btn {
        width: 38px !important;
        min-width: 38px !important;
        padding: 8px !important;
    }
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px var(--danger-glow);
}

/* Divider */
.divider {
    align-items: center;
    color: var(--text-secondary);
    display: flex;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 24px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-card);
}

.divider::before { margin-right: 16px; }
.divider::after { margin-left: 16px; }

/* Links */
.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.auth-link {
    color: var(--primary);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.auth-link:hover {
    color: var(--secondary);
    text-decoration: underline;
}

.info-page-view {
    width: 100%;
}

/* When info pages are rendered inside the dashboard layout (logged-in user) */
#dashboard-view-content .info-page-view {
    max-width: 980px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 36px 40px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body:not(.layout-wide) #dashboard-view-content .info-page-view {
    max-width: 820px;
}

.info-page-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.info-page-intro {
    margin-bottom: 0;
    text-align: left;
}

.info-page-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-page-section h3 {
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 600;
}

.info-page-section p,
.info-page-list {
    color: var(--text-secondary);
    font-size: 0.94rem;
    line-height: 1.7;
}

.info-page-list {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.site-links-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-card);
}

.auth-wrapper.home-mode .site-links-footer {
    max-width: 1600px;
    margin: 10px auto 24px;
    padding: 18px 32px 0;
}

.dashboard-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--border-card);
}

.dashboard-footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
}

.search-insight-title {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.search-peer-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-peer-chip {
    background: rgba(var(--primary-rgb), 0.12);
    border: 1px solid rgba(var(--primary-rgb), 0.22);
    border-radius: 999px;
    color: var(--text-primary);
    cursor: pointer;
    font-family: var(--font-sans, sans-serif);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 12px;
    transition: var(--transition-smooth);
}

.search-peer-chip:hover {
    background: rgba(var(--primary-rgb), 0.2);
    border-color: var(--primary);
    color: var(--primary);
}

.ticker-intel-actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.ticker-intel-watchlist-btn {
    width: auto;
    flex: 0 0 auto;
    min-width: 0;
    padding: 7px 12px;
    font-size: 0.78rem;
    line-height: 1.2;
    white-space: nowrap;
}

.search-recommendations-list {
    display: grid;
    gap: 10px;
}

.search-dividends-list {
    display: grid;
    gap: 10px;
}

.search-recommendation-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.search-recommendation-legend .rec-pill {
    font-size: 0.66rem;
    padding: 3px 7px;
}

.search-insight-empty {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-card);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.5;
    padding: 12px 14px;
}

.search-recommendation-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 12px 14px;
}

.search-dividend-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 12px 14px;
}

.search-dividend-card.upcoming {
    border-color: rgba(var(--success-rgb, 52, 211, 153), 0.35);
    background: rgba(var(--success-rgb, 52, 211, 153), 0.04);
}

.search-dividend-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 20px;
    vertical-align: middle;
    margin-right: 5px;
}

.search-dividend-badge.upcoming {
    background: rgba(var(--success-rgb, 52, 211, 153), 0.15);
    color: var(--success, #34d399);
    border: 1px solid rgba(var(--success-rgb, 52, 211, 153), 0.3);
}

.search-dividend-badge.past {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-dividend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.search-dividend-date {
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 700;
}

.search-dividend-amount {
    color: var(--success);
    font-size: 0.82rem;
    font-weight: 700;
}

.search-dividend-meta {
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.74rem;
    line-height: 1.4;
}

.search-data-source {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-radius: 12px;
    color: var(--warning);
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.3;
    padding: 4px 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-block;
    width: fit-content;
    align-self: flex-end;
}

.search-price-source {
    margin-top: 0;
}

.search-dividend-source {
    margin-top: 10px;
}

.search-recommendation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.search-recommendation-period {
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 700;
}

.search-recommendation-summary {
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
}

.search-recommendation-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rec-pill {
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 8px;
}

.rec-pill.strong-buy,
.rec-pill.buy {
    background: rgba(16, 185, 129, 0.14);
    color: var(--success);
}

.rec-pill.hold {
    background: rgba(245, 158, 11, 0.14);
    color: var(--warning);
}

.rec-pill.sell,
.rec-pill.strong-sell {
    background: rgba(239, 68, 68, 0.14);
    color: var(--danger);
}

.text-center {
    text-align: center;
}

.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }

.status-message {
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 12px 16px;
    margin-bottom: 24px;
    display: none;
    line-height: 1.4;
}

.status-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--success);
    color: #34d399;
    display: block;
}

.status-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger);
    color: #f87171;
    display: block;
}

/* Dashboard Layout */
.dashboard-wrapper {
    max-width: 1460px;
    margin: 0 auto;
    padding: 0 20px 32px;
}

body:not(.layout-wide) .dashboard-wrapper {
    max-width: 1320px;
    padding: 0 24px 32px;
}

/* Header */
.dash-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 900;
    background: color-mix(in srgb, var(--bg-card-solid) 90%, transparent);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    margin-bottom: 28px;
    padding: 12px 16px;
}

body:not(.light-theme) .dash-header {
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35);
}

.header-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 32px;
}

.user-profile {
    align-items: center;
    display: flex;
    gap: 12px;
    transition: transform 0.2s ease;
}
.user-profile:hover {
    transform: translateY(-1.5px);
}
.user-profile .avatar {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.user-profile:hover .avatar {
    transform: scale(1.06);
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.35);
}
.user-profile:hover span {
    color: var(--primary) !important;
}

.avatar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    height: 48px;
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-info .name {
    font-size: 1.1rem;
    font-weight: 600;
}

.user-info .account {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.btn-ticker-search-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(var(--primary-rgb), 0.10);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    color: var(--primary);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: var(--font-sans, sans-serif);
}

.btn-ticker-search-toggle:hover {
    background: rgba(var(--primary-rgb), 0.20);
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.2);
}

.btn-logout {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.95) 0%, rgba(239, 68, 68, 0.9) 100%);
    border: 1px solid rgba(254, 202, 202, 0.42);
    color: #fff7f7;
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 18px -10px rgba(239, 68, 68, 0.7);
}

.btn-logout:hover {
    background: linear-gradient(135deg, rgba(244, 63, 94, 1) 0%, rgba(220, 38, 38, 0.98) 100%);
    border-color: rgba(255, 228, 230, 0.8);
    color: #ffffff;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 14px 24px -12px rgba(239, 68, 68, 0.9);
}

.btn-logout:active {
    transform: translateY(0) scale(0.97);
    box-shadow: none;
}

.btn-logout:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.24);
}

.btn-display-mode {
    background: rgba(var(--primary-rgb), 0.12);
    border: 1px solid rgba(var(--primary-rgb), 0.32);
    color: var(--text-primary);
    font-weight: 700;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-display-mode svg,
.btn-display-mode div {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-display-mode:hover {
    background: rgba(var(--primary-rgb), 0.2);
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
    transform: translateY(-2px) scale(1.05);
}

.btn-display-mode:hover svg,
.btn-display-mode:hover div {
    transform: rotate(20deg) scale(1.1);
}

.btn-display-mode:active {
    transform: translateY(0) scale(0.95);
}

.btn-currency-select {
    background: rgba(var(--primary-rgb), 0.12);
    border: 1px solid rgba(var(--primary-rgb), 0.32);
    color: var(--text-primary);
    font-weight: 700;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-align-last: center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    outline: none;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-right: 8px;
}

.btn-currency-select:hover {
    background: rgba(var(--primary-rgb), 0.2);
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
    transform: translateY(-2px) scale(1.05);
}

.btn-currency-select:active {
    transform: translateY(0) scale(0.95);
}

.btn-currency-select option,
#profile-currency-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Mobile Safari/Chrome can render translucent select overlays on profile forms.
   Force solid backgrounds to prevent text bleed-through behind dropdowns. */
@media (max-width: 768px) {
    #view-dash-profile select.input-control,
    #view-dash-profile .input-control[type="date"] {
        background: var(--bg-card-solid) !important;
    }

    #view-dash-profile select.input-control option {
        background: var(--bg-card-solid);
        color: var(--text-primary);
    }
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.metric-card {
    padding: 18px 22px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 136px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22), 0 0 15px rgba(var(--primary-rgb), 0.12);
    border-color: rgba(var(--primary-rgb), 0.3) !important;
}

.metric-card::after {
    content: '';
    position: absolute;
    bottom: 12px;
    right: 16px;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.metric-label {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 8px;
    padding-right: 4px;
}

.metric-value {
    font-size: clamp(1.4rem, 2.2vw, 2.2rem);
    font-family: var(--font-mono);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.trading-summary-metrics .metric-label {
    font-size: clamp(0.62rem, 0.68vw, 0.78rem);
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trading-summary-metrics .metric-value {
    font-size: clamp(1rem, 1.75vw, 1.9rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#metric-assets-count {
    display: flex;
    flex-direction: column;
    font-size: clamp(1rem, 1.25vw, 1.32rem);
    font-weight: 700;
    gap: 6px;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
}

#metric-assets-count .metric-mover-row {
    display: block;
}

#metric-assets-count .metric-mover-gain {
    color: var(--success);
}


#metric-assets-count .metric-mover-loss {
    color: var(--danger);
}

.metric-subtext {
    color: var(--text-secondary);
    font-size: 0.76rem;
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

.metric-change {
    align-self: flex-start;
    align-items: center;
    display: inline-flex;
    font-family: var(--font-mono);
    font-size: clamp(0.72rem, 0.9vw, 0.9rem);
    font-weight: 600;
    gap: 4px;
    border-radius: 6px;
    padding: 2px 8px;
    position: relative;
    z-index: 1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-change.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.metric-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.metric-change.metric-contributor {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    overflow: hidden;
}

.metric-change.metric-contributor .metric-contributor-icon {
    flex-shrink: 0;
    margin-right: 6px;
}

.metric-change.metric-contributor .metric-contributor-text {
    overflow: hidden;
    white-space: nowrap;
    display: inline-block;
    max-width: 250px;
    vertical-align: middle;
}

.metric-change.metric-contributor .metric-contributor-scroll {
    display: inline-block;
    animation: contributor-marquee 16s ease-in-out infinite alternate;
}

@keyframes contributor-marquee {
    0%, 25% {
        transform: translateX(0);
    }
    75%, 100% {
        transform: translateX(min(0px, calc(250px - 100%)));
    }
}

/* Charts / Content Section */
/* Navigation Tabs */
.dash-nav {
    display: flex;
    align-items: center;
    margin-left: 0;
}

.dash-nav-links {
    display: flex;
    gap: 18px;
    align-items: center;
}

.dash-nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.dash-nav-dropdown:hover .nav-dropdown-chevron {
    transform: rotate(180deg);
}

.dash-nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 190px;
    background: #10141f;
    border: 1px solid var(--border-card);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 1002;
}

/* Bridge hover area so cursor can move into the dropdown without it collapsing. */
.dash-nav-dropdown-menu::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

.light-theme .dash-nav-dropdown-menu {
    background: #ffffff;
}

.dash-nav-dropdown:hover .dash-nav-dropdown-menu {
    display: flex;
}

.dash-nav-dropdown.force-hide .dash-nav-dropdown-menu {
    display: none !important;
}

.dash-nav-dropdown-item {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.25s ease, background 0.25s ease, transform 0.25s ease;
    position: relative;
}

.dash-nav-dropdown-item::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 10px;
    width: calc(100% - 20px);
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
    transform: scaleX(0);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.dash-nav-dropdown-item:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-0.5px);
}

.dash-nav-dropdown-item:hover::after {
    transform: scaleX(1);
}

.pro-feature-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.pro-feature-lock {
    font-size: 0.78rem;
    opacity: 0.8;
}

.pro-feature-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.36);
    color: #fbbf24;
}

.pro-feature-item.pro-feature-locked {
    color: rgba(148, 163, 184, 0.7) !important;
    cursor: pointer;
}

.pro-feature-item.pro-feature-locked:hover {
    color: rgba(148, 163, 184, 0.9) !important;
    background: rgba(245, 158, 11, 0.08) !important;
}

.plus-feature-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.plus-feature-lock {
    font-size: 0.78rem;
    opacity: 0.8;
}

.plus-feature-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: rgba(139, 92, 246, 0.18);
    border: 1px solid rgba(139, 92, 246, 0.36);
    color: #a78bfa;
}

.plus-feature-item.plus-feature-locked {
    color: rgba(148, 163, 184, 0.7) !important;
    cursor: pointer;
}

.plus-feature-item.plus-feature-locked:hover {
    color: rgba(148, 163, 184, 0.9) !important;
    background: rgba(139, 92, 246, 0.08) !important;
}

/* Portfolio Toolbar Styling */
.dash-portfolio-toolbar {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 12px 24px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: fadeIn 0.4s ease-out;
    position: relative;
    z-index: 100;
}

.portfolio-switcher-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portfolio-switcher-container select {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border: 1px solid var(--border-card);
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: var(--transition-smooth);
    width: 220px;
}

.portfolio-switcher-container select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.light-theme .portfolio-switcher-container select {
    background: rgba(var(--primary-rgb), 0.06);
    border-color: rgba(var(--primary-rgb), 0.2);
    color: var(--text-primary);
}

.light-theme .portfolio-switcher-container select option {
    background: #e2f1fc;
    color: var(--text-primary);
}

.light-theme .dash-portfolio-toolbar {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(var(--primary-rgb), 0.14);
}

.portfolio-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portfolio-actions .btn-action-small {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.portfolio-actions .btn-with-icon svg {
    margin-right: 6px;
}

.portfolio-actions .btn-with-icon .btn-icon-label {
    margin-left: 6px;
}

#view-dash-holdings .card-header-actions .btn-with-icon svg {
    margin-right: 6px;
}

#view-dash-holdings .card-header-actions .btn-with-icon .btn-icon-label {
    margin-left: 6px;
}

.portfolio-actions .btn-create {
    background: rgba(var(--primary-rgb), 0.1);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    color: var(--primary);
}

.portfolio-actions .btn-create:hover {
    background: rgba(var(--primary-rgb), 0.2);
    border-color: var(--primary);
}

.trading-sub-nav,
.profile-sub-nav {
    margin-bottom: 32px;
}

.trading-sub-nav-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.trading-tab-btn {
    width: auto;
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 999px;
}

.trading-tab-btn.btn-with-icon {
    gap: 6px;
    column-gap: 6px;
    white-space: nowrap;
}

.trading-sub-nav-tabs .trading-tab-btn.btn-with-icon {
    gap: 6px;
    column-gap: 6px;
}

.trading-sub-nav-tabs .trading-tab-btn.btn-with-icon svg {
    margin-right: 6px;
}

.trading-sub-nav-tabs .trading-tab-btn .btn-icon-label {
    margin-left: 6px;
}

.trading-refresh-btn {
    width: auto;
    padding: 8px 16px;
    font-size: 0.85rem;
    border-color: var(--primary);
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
}

@media (max-width: 1280px) {
    .trading-sub-nav-tabs .compact-tab-btn {
        width: 40px !important;
        min-width: 40px !important;
        flex: 0 0 40px !important;
        padding: 8px !important;
        gap: 0 !important;
        justify-content: center !important;
    }

    .trading-sub-nav-tabs .compact-tab-btn .btn-icon-label {
        display: none !important;
    }

    .trading-sub-nav-tabs .compact-tab-btn svg {
        margin: 0 !important;
    }
}

.watchlist-toolbar {
    gap: 12px;
    flex-wrap: wrap;
}

.watchlist-switcher select {
    min-width: 170px;
}

.watchlist-switcher .btn-action-small {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.watchlist-switcher #btn-create-watchlist {
    background: rgba(var(--primary-rgb), 0.15);
    border: 1px solid rgba(var(--primary-rgb), 0.35);
    color: var(--primary);
}

.watchlist-switcher #btn-create-watchlist:hover {
    background: rgba(var(--primary-rgb), 0.25);
}

.watchlist-switcher #btn-delete-watchlist {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #ef4444;
}

.watchlist-switcher #btn-delete-watchlist:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.45);
}


.watchlist-add-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.watchlist-add-form #watchlist-add-ticker-input {
    width: 120px;
    height: 36px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.watchlist-add-btn,
.watchlist-refresh-btn {
    width: auto;
    padding: 0 16px;
    height: 36px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 4px;
}


.portfolio-actions .btn-rename {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-card);
    color: var(--text-secondary);
}

.portfolio-actions .btn-rename:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.portfolio-actions .btn-delete {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.portfolio-actions .btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
}

@media (min-width: 769px) {
    #view-dash-holdings .card-header-actions > div > button.btn-with-icon {
        padding: 8px 14px !important;
        gap: 5px !important;
    }

    #view-dash-holdings .card-header-actions > div > button.btn-action-small.btn-with-icon {
        padding: 6px 12px !important;
    }
}

.switcher-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.dash-nav-item {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    padding: 7px 0;
    transition: color 0.25s ease, transform 0.25s ease;
}

.dash-nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    transform: scaleX(0);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.dash-nav-item:hover,
.dash-nav-dropdown:hover #nav-research {
    color: var(--primary);
    transform: translateY(-1.5px);
}

.dash-nav-item:hover::after,
.dash-nav-dropdown:hover #nav-research::after {
    transform: scaleX(0.7);
}

.dash-nav-item.active {
    color: var(--primary);
}

.dash-nav-item.active::after {
    transform: scaleX(1);
}

/* Responsive Content Grid for Charts */
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

@media(min-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media(max-width: 1199px) and (min-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr 1fr;
    }
    .content-grid .chart-card:first-child {
        grid-column: span 2;
    }
}

/* Horizontal Bar Charts (Gainers / Losers) */
.bar-chart-row {
    margin-bottom: 16px;
}
.bar-chart-row:last-child {
    margin-bottom: 0;
}


.chart-card {
    padding: 24px;
}

.card-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

/* SVG Chart */
.chart-container {
    height: 250px;
    width: 100%;
    position: relative;
}

/* Donut Chart Layout */
.donut-chart-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 24px;
    width: 100%;
    min-height: 240px;
}

.donut-chart-wrapper {
    position: relative;
    width: 240px;
    height: 240px;
    flex-shrink: 0;
}

#weight-chart-svg, #sector-chart-svg {
    transform: rotate(-90deg);
    border-radius: 50%;
    flex-shrink: 0;
    width: 100%;
    height: 100%;
}

#donut-chart-center, #sector-chart-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    text-align: center;
    width: 150px;
    height: 150px;
    border-radius: 50%;
}

#donut-center-label, #sector-center-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

#donut-center-value, #sector-center-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2px;
}

#chart-legend, #sector-chart-legend {
    flex: 1 1 200px;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 8px;
    font-size: 0.85rem;
}

#chart-legend::-webkit-scrollbar, #sector-chart-legend::-webkit-scrollbar {
    width: 4px;
}
#chart-legend::-webkit-scrollbar-track, #sector-chart-legend::-webkit-scrollbar-track {
    background: transparent;
}
#chart-legend::-webkit-scrollbar-thumb, #sector-chart-legend::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb), 0.2);
    border-radius: 2px;
}
#chart-legend::-webkit-scrollbar-thumb:hover, #sector-chart-legend::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--primary-rgb), 0.4);
}

.chart-svg {
    height: 100%;
    width: 100%;
}

.chart-grid-line {
    stroke: rgba(148, 163, 184, 0.2);
    stroke-width: 1;
}

.chart-line {
    fill: none;
    stroke: url(#chart-gradient);
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
    animation: drawLine 2s ease-out forwards;
}

.chart-area {
    fill: url(#area-gradient);
}

/* Holdings Section */
.holdings-card {
    padding: 22px;
}

/* ── Light-theme table overrides ── */

/* holdings-table - base td/th */
.light-theme .holdings-table td {
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.10);
    color: var(--text-primary);
}

.light-theme .holdings-table th {
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.18);
}

/* row hover */
.light-theme .holdings-table tr:hover td {
    background: rgba(var(--primary-rgb), 0.05);
}

/* ticker group rows */
.light-theme .holdings-table tr.ticker-group-row td {
    background: rgba(var(--primary-rgb), 0.06);
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.14);
}

.light-theme .holdings-table tr.ticker-group-row:hover td {
    background: rgba(var(--primary-rgb), 0.10);
}

/* child breakdown rows */
.light-theme .holdings-table tr.ticker-child-row td {
    background: rgba(var(--primary-rgb), 0.02);
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.07);
}

.light-theme .holdings-table tr.ticker-child-row:hover td {
    background: rgba(var(--primary-rgb), 0.06);
}

.light-theme .holdings-table tr.ticker-child-row:last-child td {
    border-bottom: 2px solid rgba(var(--primary-rgb), 0.16);
}

/* option child rows */
.light-theme .holdings-table tr.option-child-row td {
    background: rgba(var(--primary-rgb), 0.02);
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.07);
}

.light-theme .holdings-table tr.option-child-row:hover td {
    background: rgba(var(--primary-rgb), 0.06);
}

/* csv-preview-table */
.light-theme .csv-preview-table th,
.light-theme .csv-preview-table td {
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.10);
    color: var(--text-primary);
}

.light-theme .csv-preview-table th {
    background: rgba(var(--primary-rgb), 0.08);
}

.light-theme .csv-preview-table tr:hover td {
    background: rgba(var(--primary-rgb), 0.04);
}

/* bar chart track (Top Gainers / Losers) */
.light-theme .bar-chart-row .bar-track {
    background: rgba(var(--primary-rgb), 0.08) !important;
}

/* ── Light-theme global element overrides ── */

/* Scrollbar thumb */
.light-theme ::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb), 0.2);
}

/* Secondary / Rename buttons */
.light-theme .btn-secondary {
    background: rgba(var(--primary-rgb), 0.06);
    border-color: rgba(var(--primary-rgb), 0.18);
    color: var(--text-primary);
}
.light-theme .btn-secondary:hover {
    background: rgba(var(--primary-rgb), 0.12);
}

.light-theme .portfolio-actions .btn-rename {
    background: rgba(var(--primary-rgb), 0.05);
    border-color: rgba(var(--primary-rgb), 0.16);
    color: var(--text-secondary);
}
.light-theme .portfolio-actions .btn-rename:hover {
    background: rgba(var(--primary-rgb), 0.10);
    color: var(--text-primary);
}

/* Allocation bar track (home page) */
.light-theme .home-allocation-track {
    background: rgba(var(--primary-rgb), 0.10);
}

/* Recent ticker chips (home page) */
.light-theme .home-recent-chip {
    background: rgba(var(--primary-rgb), 0.06);
}

/* News cards (home page) */
.light-theme .home-news-card {
    background: rgba(var(--primary-rgb), 0.04);
}

/* Search insight / recommendation / dividend cards */
.light-theme .search-insight-empty,
.light-theme .search-recommendation-card,
.light-theme .search-dividend-card {
    background: rgba(var(--primary-rgb), 0.04);
}

/* Home dashboard image placeholder */
.light-theme .home-dashboard-img-wrapper {
    background: rgba(var(--primary-rgb), 0.04);
}

#trading-subview-detail .trading-detail-card {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}


.table-responsive {
    overflow-x: auto;
    overflow-y: auto;
    width: 100%;
    max-height: 620px;
}

.table-responsive::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb), 0.3);
    border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--primary-rgb), 0.5);
}

/* Keep Options table area stable while rerendering rows */
.options-table-shell {
    min-height: 480px;
}

@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
    #btn-refresh-trading-summary-open-stocks,
    #btn-refresh-trading-summary-options,
    #btn-refresh-trading-stocks,
    #btn-refresh-trading-options {
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        padding: 8px !important;
        border-radius: 10px !important;
        font-size: 0 !important;
        line-height: 0 !important;
        justify-content: center !important;
        gap: 0 !important;
    }

    #btn-refresh-trading-summary-open-stocks .btn-icon-label,
    #btn-refresh-trading-summary-options .btn-icon-label,
    #btn-refresh-trading-stocks .btn-icon-label,
    #btn-refresh-trading-options .btn-icon-label {
        display: none !important;
    }

    #btn-refresh-trading-summary-open-stocks svg,
    #btn-refresh-trading-summary-options svg,
    #btn-refresh-trading-stocks svg,
    #btn-refresh-trading-options svg {
        margin: 0 !important;
    }
}

@media (max-width: 768px) {
    .options-table-shell {
        min-height: 360px;
    }
}

.holdings-table {
    border-collapse: collapse;
    width: 100%;
    text-align: left;
}

.holdings-table tr {
    height: auto;
}

.holdings-table th {
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.15);
    min-height: 44px;
    display: table-cell;
    vertical-align: middle;
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--bg-card-solid) 96%, transparent);
    font-variant-numeric: tabular-nums;
}

.holdings-table td {
    padding: 16px 18px;
    font-size: 0.92rem;
    font-variant-numeric: tabular-nums;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    min-height: 48px;
    display: table-cell;
    vertical-align: middle;
}

/* Compact table variant for wide multi-column tables (e.g. Options Trading) */
.holdings-table-compact th {
    padding: 10px 12px;
    font-size: 0.72rem;
    min-height: 40px;
    display: table-cell;
    vertical-align: middle;
}

.holdings-table-compact td {
    padding: 10px 12px;
    font-size: 0.85rem;
    min-height: 40px;
    display: table-cell;
    vertical-align: middle;
}

.holdings-table tr:hover td {
    background: rgba(var(--primary-rgb), 0.04);
}

body:not(.light-theme) .holdings-table tr:hover td {
    background: rgba(37, 99, 235, 0.08);
}

body:not(.light-theme) .glass-card,
body:not(.light-theme) .dash-portfolio-toolbar,
body:not(.light-theme) .holdings-card {
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.34);
}

/* Grouped ticker summary row */
.holdings-table tr.ticker-group-row {
    cursor: pointer;
}
.holdings-table tr.ticker-group-row td {
    background: rgba(var(--primary-rgb), 0.04);
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.12);
}
.holdings-table tr.ticker-group-row:hover td {
    background: rgba(var(--primary-rgb), 0.09);
}
.ticker-expand-chevron {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    transition: transform 0.22s ease;
    vertical-align: middle;
}
.ticker-expand-chevron.open {
    transform: rotate(90deg);
    color: var(--primary);
}
.ticker-multi-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(var(--primary-rgb), 0.18);
    color: var(--secondary);
    border-radius: 10px;
    padding: 2px 7px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0.3px;
}

/* Child portfolio breakdown rows */
.holdings-table tr.ticker-child-row td {
    background: rgba(var(--primary-rgb), 0.02);
    padding-top: 12px;
    padding-bottom: 12px;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.025);
}
.holdings-table tr.ticker-child-row:last-child td {
    border-bottom: 2px solid rgba(var(--primary-rgb), 0.15);
}
.holdings-table tr.ticker-child-row:hover td {
    background: rgba(var(--primary-rgb), 0.05);
}
.child-portfolio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 28px;
}
.child-portfolio-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    opacity: 0.6;
}
.child-portfolio-name {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Option sub-rows */
.holdings-table tr.option-child-row td {
    background: rgba(var(--primary-rgb), 0.03);
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.08);
    border-left: none;
}
.holdings-table tr.option-child-row:hover td {
    background: rgba(var(--primary-rgb), 0.07);
}
.holdings-table tr.option-child-row:last-child td {
    border-bottom: 2px solid rgba(var(--primary-rgb), 0.18);
}

/* CALL / PUT option type badge */
.option-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    border-radius: 5px;
    padding: 2px 7px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    text-transform: uppercase;
}
.option-badge.call {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.option-badge.put {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.holding-ticker {
    font-weight: 700;
    color: var(--text-primary);
}

.holding-logo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(var(--primary-rgb), 0.10);
    border: 1px solid rgba(var(--primary-rgb), 0.16);
    flex-shrink: 0;
}

.holding-logo.small {
    width: 18px;
    height: 18px;
}

.holding-logo-img,
.holding-logo-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.holding-logo-img {
    object-fit: cover;
    background: #ffffff;
}

.holding-logo-fallback {
    color: var(--text-primary);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.holding-logo.small .holding-logo-fallback {
    font-size: 0.54rem;
}

.holding-name {
    font-size: 0.76rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Slightly stronger contrast in dark mode for long sessions */
body:not(.light-theme) .metric-label,
body:not(.light-theme) .metric-subtext,
body:not(.light-theme) .holding-name,
body:not(.light-theme) .dash-nav-item {
    color: #a8b3c7;
}

.holding-price {
    font-family: var(--font-mono);
    font-weight: 500;
}

.badge-trend {
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    padding: 4px 8px;
    display: inline-block;
}

.badge-trend.up {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-trend.down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.table-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    display: inline-flex;
    transition: var(--transition-smooth);
}

.btn-icon:hover {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    border-color: rgba(var(--primary-rgb), 0.25);
}

.btn-icon-edit:hover {
    border-color: var(--secondary);
    color: var(--secondary);
}

.btn-icon-delete {
    background: rgba(239, 68, 68, 0.08) !important;
    border: 1px solid rgba(239, 68, 68, 0.18) !important;
    color: #ef4444 !important;
}

.btn-icon-delete:hover {
    background: rgba(239, 68, 68, 0.22) !important;
    border-color: #f87171 !important;
    color: #f87171 !important;
}

/* Modals */
.modal-overlay {
    background: rgba(0, 0, 0, 0.82);
    /* Chrome: skip backdrop-filter on modal overlay — it causes heavy
       re-compositing when opacity transitions. Use a solid bg tint instead. */
    display: flex;
    height: 100%;
    justify-content: center;
    left: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    top: 0;
    transition: opacity 0.22s ease;
    width: 100%;
    z-index: 1000;
    transform: translateZ(0);
    will-change: opacity;
    overflow-y: auto;
    padding: 40px 16px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    max-width: 500px;
    padding: 32px;
    transform: translateY(20px);
    transition: var(--transition-smooth);
    background: var(--bg-main) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    margin: auto;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-card .holdings-table th {
    background: var(--bg-main) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
}

.modal-actions .btn {
    width: auto;
}

/* Session Widget */
.session-widget {
    position: static;
    padding: 0;
    border-top: none;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.session-widget-card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.session-widget-inline {
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
}

.session-widget-link {
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-family: var(--font-sans, sans-serif);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0;
    text-align: left;
    width: fit-content;
}

.session-widget-link:hover {
    color: var(--secondary);
    text-decoration: underline;
}

.mobile-nav-wrapper {
    display: none !important;
}

/* Responsive */
@media(max-width: 1024px) {
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 1200px) and (min-width: 769px) {
    .dash-header {
        align-items: center;
    }

    .header-left {
        justify-content: space-between;
        width: 100%;
        gap: 12px;
        min-width: 0;
    }

    .dash-nav {
        margin-left: auto;
        min-width: 0;
    }

    .dash-nav-links {
        display: none !important;
    }

    .mobile-nav-wrapper {
        display: flex !important;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    .mobile-nav-dropdown {
        display: block !important;
    }

    .header-right {
        display: none !important;
    }

    .dash-brand-name {
        font-size: 1.15rem;
    }
}

@media(max-width: 768px) {
    .dashboard-wrapper,
    body:not(.layout-wide) .dashboard-wrapper {
        padding: 0 14px 24px;
    }

    /* Make dashboard surfaces fully solid on mobile to prevent underlying text bleed-through. */
    #dashboard-container .glass-card,
    #dashboard-container .dash-portfolio-toolbar,
    #dashboard-container .dash-header,
    #dashboard-container .mobile-menu-content {
        background: var(--bg-card-solid) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .metrics-grid .metric-card:first-child {
        grid-column: span 1;
    }
    .metric-value {
        font-size: 1.8rem;
    }
    .donut-chart-container {
        flex-direction: column !important;
        gap: 24px !important;
        align-items: center !important;
    }
    #chart-legend {
        margin-left: 0;
        max-height: 220px;
        overflow-y: auto;
        width: 100%;
        padding-right: 4px;
    }
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .dash-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 20px;
        padding: 10px 12px;
    }
    .header-left {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }
    .dash-nav {
        margin-left: auto !important;
        width: auto !important;
        display: flex !important;
        align-items: center !important;
    }
    .dash-nav-links {
        display: none !important;
    }
    .mobile-nav-dropdown {
        display: block !important;
    }
    .mobile-nav-wrapper {
        display: flex !important;
        align-items: center;
        gap: 8px;
    }
    .btn-layout-mode {
        min-width: 62px;
        font-size: 0.72rem;
        padding: 6px 8px;
    }
    .dash-portfolio-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 14px;
        margin-bottom: 20px;
    }
    .portfolio-switcher-container {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 8px;
    }
    .portfolio-switcher-container select {
        width: 100%;
    }
    .portfolio-actions {
        width: 100%;
        display: flex;
        gap: 8px;
        justify-content: space-between;
    }
    .portfolio-actions .btn-action-small {
        flex: 1;
        text-align: center;
    }
    .trading-sub-nav-tabs {
        width: 100%;
    }
    .trading-tab-btn {
        flex: 1 1 auto;
        text-align: center;
    }
    .trading-refresh-btn {
        align-self: flex-start;
    }
    #btn-refresh-trading-summary-open-stocks,
    #btn-refresh-trading-summary-options,
    #btn-refresh-trading-stocks,
    #btn-refresh-trading-options {
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        padding: 8px !important;
        border-radius: 10px !important;
        font-size: 0 !important;
        line-height: 0 !important;
        justify-content: center !important;
        gap: 0 !important;
    }
    #btn-refresh-trading-summary-open-stocks .btn-icon-label,
    #btn-refresh-trading-summary-options .btn-icon-label,
    #btn-refresh-trading-stocks .btn-icon-label,
    #btn-refresh-trading-options .btn-icon-label {
        display: none !important;
    }
    #btn-refresh-trading-summary-open-stocks svg,
    #btn-refresh-trading-summary-options svg,
    #btn-refresh-trading-stocks svg,
    #btn-refresh-trading-options svg {
        margin: 0 !important;
    }
    .watchlist-add-form {
        width: 100%;
    }
    .watchlist-add-form #watchlist-add-ticker-input {
        flex: 1;
        min-width: 0;
        width: auto;
    }
    .watchlist-add-btn {
        flex-shrink: 0;
    }
    .dash-logo {
        height: 32px;
        width: 32px;
    }
    .header-right {
        display: none !important;
    }
    .user-profile {
        min-width: 0;
        flex: 1;
    }
    .user-info {
        min-width: 0;
    }
    .user-info .name {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .user-info .account {
        font-size: 0.75rem;
    }
    .btn-logout {
        width: auto;
        white-space: nowrap;
        flex-shrink: 0;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    .auth-card {
        padding: 24px;
    }
    .auth-wrapper.home-mode .auth-card {
        padding: 0;
    }
    .home-shell {
        padding: 20px 14px;
    }
    .home-topbar {
        flex-wrap: wrap;
    }
    .home-topbar-actions {
        width: 100%;
    }
    .home-topbar-actions .btn {
        flex: 1;
    }
    .home-main-grid,
    .home-graph-grid,
    .home-snapshot-grid {
        grid-template-columns: 1fr;
    }
    .home-title {
        font-size: 1.45rem;
    }
    .pricing-title {
        font-size: 1.45rem;
    }
    .pricing-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .home-search-form {
        flex-wrap: wrap;
    }
    .home-search-form .btn {
        width: 100% !important;
    }
    .home-title {
        font-size: 1.4rem;
    }
    .site-links-footer,
    .dashboard-footer-links {
        justify-content: center;
        gap: 12px 16px;
    }
    .dashboard-footer-row {
        flex-direction: column;
        align-items: center;
    }
    .session-widget {
        width: 100%;
        justify-content: center;
    }
    .session-widget-inline {
        margin-left: 0;
        white-space: normal;
        justify-content: center;
        text-align: center;
        flex-wrap: wrap;
    }
    .info-page-section p,
    .info-page-list {
        font-size: 0.9rem;
    }

    /* Responsive Card Headers & Buttons wrapping */
    .card-header-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
        margin-bottom: 20px !important;
    }
    .card-header-actions > div {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        width: 100% !important;
    }
    #prices-last-updated {
        width: 100% !important;
        flex: 1 1 100% !important;
        margin-bottom: 4px !important;
    }
    .card-header-actions > div button,
    .card-header-actions > div select {
        flex: 1 1 calc(50% - 8px) !important;
        min-width: 120px !important;
        justify-content: center !important;
    }
    .card-header-actions > div button.compact-icon-btn {
        flex: 0 0 38px !important;
        min-width: 38px !important;
    }
    .holdings-card, .glass-card {
        padding: 14px !important;
    }
}

@media (max-width: 480px) {
    .pricing-card-grid {
        grid-template-columns: 1fr;
    }
}

/* Hidden views */
.view-section {
    display: none;
}

.view-section.active {
    display: block;
}

.market-news-feed-column {
    min-height: 180px;
}

/* ===== PAGE TRANSITION: fade-in when content is ready ===== */
#dashboard-view-content {
    /* Chrome: explicit compositing so tab-return doesn't re-rasterize */
    transform: translateZ(0);
    will-change: opacity;
    contain: layout style;
    /* Keep transition short and only on opacity — not 'all' */
    transition: opacity 0.12s ease;
}

#dashboard-view-content.page-loading {
    opacity: 1;
    pointer-events: auto;
}

/* Skeleton shimmer rows shown while data loads */
.skeleton-row td {
    background: linear-gradient(90deg,
        rgba(var(--primary-rgb), 0.06) 25%,
        rgba(var(--primary-rgb), 0.12) 50%,
        rgba(var(--primary-rgb), 0.06) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
    color: transparent !important;
    border-radius: 4px;
    user-select: none;
}

@keyframes skeleton-shimmer {
    0%   { background-position: 200% center; }
    100% { background-position: -200% center; }
}

/* ================= UNIVERSAL THEME TOGGLE STYLING ================= */
.theme-toggle-container {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.btn-theme-toggle {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    width: 48px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.2);
}

.btn-theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.btn-theme-toggle:active {
    transform: scale(0.95);
}

.theme-icon {
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.profile-accent-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 260px;
}

.profile-accent-swatch-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-accent-swatch {
    border: 2px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    height: 28px;
    outline: none;
    position: relative;
    transition: var(--transition-smooth);
    width: 28px;
}

.profile-accent-swatch::after {
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    content: "";
    inset: 4px;
    position: absolute;
}

.profile-accent-swatch.theme-default { background: linear-gradient(135deg, #0f172a, #2563eb); }
.profile-accent-swatch.theme-purple { background: linear-gradient(135deg, #ff007f, #00f0ff); }
.profile-accent-swatch.theme-emerald { background: linear-gradient(135deg, #022c22, #10b981); }
.profile-accent-swatch.theme-rose { background: linear-gradient(135deg, #4c0519, #fb923c); }

.profile-accent-swatch:hover,
.profile-accent-swatch:focus-visible {
    transform: translateY(-1px);
}

.profile-accent-swatch.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

/* ================= ACCENT COLOR THEME OVERRIDES ================= */
/* Nordic Forest Theme (Green) */
body.theme-emerald {
    --primary-rgb: 16, 185, 129;
    --secondary-rgb: 52, 211, 153;
    --bg-main: #030d0a;
    --bg-card: rgba(8, 20, 17, 0.78);
    --bg-card-solid: #081411;
    --border-card: rgba(16, 185, 129, 0.16);
    --input-autofill-bg: #081411;
    --input-autofill-bg-focus: #0c201a;
}
body.light-theme.theme-emerald {
    --primary-rgb: 5, 150, 105;
    --secondary-rgb: 16, 185, 129;
    --bg-main: #f0fdf4;
    --bg-card: rgba(255, 255, 255, 0.82);
    --bg-card-solid: #ffffff;
    --border-card: rgba(5, 150, 105, 0.16);
    --input-autofill-bg: #f0fdf4;
    --input-autofill-bg-focus: #dcfce7;
}

/* Cyberpunk Neon Theme (Purple) */
body.theme-purple {
    --primary-rgb: 255, 0, 127;
    --secondary-rgb: 0, 240, 255;
    --bg-main: #05030a;
    --bg-card: rgba(13, 10, 20, 0.78);
    --bg-card-solid: #0d0a14;
    --border-card: rgba(255, 0, 127, 0.18);
    --input-autofill-bg: #0d0a14;
    --input-autofill-bg-focus: #141020;
}
body.light-theme.theme-purple {
    --primary-rgb: 219, 39, 119;
    --secondary-rgb: 13, 148, 136;
    --bg-main: #fdf2f8;
    --bg-card: rgba(255, 255, 255, 0.82);
    --bg-card-solid: #ffffff;
    --border-card: rgba(219, 39, 119, 0.16);
    --input-autofill-bg: #faf5ff;
    --input-autofill-bg-focus: #f3e8ff;
}

/* Crimson Dusk Theme (Rose) */
body.theme-rose {
    --primary-rgb: 244, 63, 94;
    --secondary-rgb: 251, 146, 60;
    --bg-main: #0c0306;
    --bg-card: rgba(18, 10, 12, 0.78);
    --bg-card-solid: #120a0c;
    --border-card: rgba(244, 63, 94, 0.16);
    --input-autofill-bg: #120a0c;
    --input-autofill-bg-focus: #1a1012;
}
body.light-theme.theme-rose {
    --primary-rgb: 225, 29, 72;
    --secondary-rgb: 244, 63, 94;
    --bg-main: #fff1f2;
    --bg-card: rgba(255, 255, 255, 0.82);
    --bg-card-solid: #ffffff;
    --border-card: rgba(225, 29, 72, 0.16);
    --input-autofill-bg: #fff5f5;
    --input-autofill-bg-focus: #ffe4e6;
}

/* ================= BRAND LOGO STYLING ================= */
.brand-logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.brand-logo {
    height: 80px;
    width: 80px;
    border-radius: 50%;
    border: 2px solid var(--border-card);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    filter: drop-shadow(0 0 12px var(--primary-glow));
    transition: var(--transition-smooth);
    cursor: pointer;
}

.brand-logo:hover {
    transform: scale(1.08) rotate(5deg);
    border-color: var(--primary);
}

.dash-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.dash-brand:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

.dash-brand:active {
    transform: translateY(0) scale(0.98);
}

.dash-logo {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-card);
    filter: drop-shadow(0 0 6px var(--primary-glow));
}

.dash-brand-name {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: var(--font-sans, sans-serif);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Drag and Drop Upload Zone */
.upload-drag-zone {
    border: 2px dashed var(--border-card);
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-bottom: 20px;
}

.upload-drag-zone.dragover {
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
    background: rgba(255, 255, 255, 0.05);
}

.upload-drag-zone:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.04);
}

.upload-icon-container {
    margin-bottom: 12px;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    display: flex;
    justify-content: center;
}

.upload-drag-zone:hover .upload-icon-container,
.upload-drag-zone.dragover .upload-icon-container {
    color: var(--primary);
    transform: translateY(-2px);
}

.upload-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-family: var(--font-sans, sans-serif);
}

.upload-subtext {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-sans, sans-serif);
}

/* CSV Preview Table */
.csv-preview-card {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-card);
    border-radius: 8px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.2);
}

.csv-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    color: var(--text-primary);
    font-family: var(--font-sans, sans-serif);
}

.csv-preview-table th, 
.csv-preview-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.csv-preview-table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.csv-preview-table tr:last-child td {
    border-bottom: none;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Tooltip styling */
.chart-tooltip {
    position: absolute;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: var(--font-sans, sans-serif);
    pointer-events: none;
    z-index: 10000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.15s ease;
    transform: translate(-50%, -115%);
}

.light-theme .chart-tooltip {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #0f172a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.chart-tooltip .tooltip-header {
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 0.92rem;
    color: var(--primary);
}

.chart-tooltip .tooltip-body {
    font-weight: 500;
    color: #94a3b8;
}

.light-theme .chart-tooltip .tooltip-body {
    color: #475569;
}

.creation-limit-tooltip {
    position: fixed;
    left: 0;
    top: 0;
    transform: translate(-50%, calc(-100% - 10px));
    max-width: min(320px, calc(100vw - 24px));
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fff7ed;
    font-size: 0.82rem;
    line-height: 1.4;
    font-weight: 600;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
    z-index: 10020;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    text-align: center;
    display: inline-flex;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.creation-limit-tooltip-icon {
    line-height: 1.1;
    font-size: 0.9rem;
    margin-top: 1px;
}

.creation-limit-tooltip-text {
    display: inline-block;
}

.creation-limit-tooltip.below {
    transform: translate(-50%, 10px);
}



/* Mobile Navigation Dropdown */
.mobile-nav-dropdown {
    display: none;
    position: relative;
}

.btn-menu-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.mobile-menu-content {
    display: flex;
    position: absolute;
    top: 48px;
    right: 0;
    left: auto;
    background: var(--bg-card-solid, var(--bg-card));
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border-card);
    border-radius: 12px;
    width: 180px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    flex-direction: column;
    padding: 8px 0;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px) translateZ(0);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease;
    pointer-events: none;
    will-change: transform, opacity;
}

.mobile-menu-content.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) translateZ(0);
    pointer-events: auto;
}

.mobile-nav-item {
    padding: 12px 16px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.mobile-nav-item:hover, .mobile-nav-item.active {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
}

.mobile-nav-item.pro-feature-item {
    display: flex;
    align-items: center;
    gap: 7px;
}

.mobile-nav-item.pro-feature-item .pro-feature-badge {
    margin-left: auto;
}

.mobile-nav-item.pro-feature-item.pro-feature-locked {
    color: rgba(148, 163, 184, 0.7);
}

.mobile-nav-item.pro-feature-item.pro-feature-locked:hover,
.mobile-nav-item.pro-feature-item.pro-feature-locked.active {
    color: rgba(148, 163, 184, 0.9);
    background: rgba(245, 158, 11, 0.08);
}

.mobile-nav-item.plus-feature-item {
    display: flex;
    align-items: center;
    gap: 7px;
}

.mobile-nav-item.plus-feature-item .plus-feature-badge {
    margin-left: auto;
}

.mobile-nav-item.plus-feature-item.plus-feature-locked {
    color: rgba(148, 163, 184, 0.7);
}

.mobile-nav-item.plus-feature-item.plus-feature-locked:hover,
.mobile-nav-item.plus-feature-item.plus-feature-locked.active {
    color: rgba(148, 163, 184, 0.9);
    background: rgba(139, 92, 246, 0.08);
}

/* ============================================================
   PWA / Mobile App Styles
   ============================================================ */

/* Safe area insets for notched phones (iPhone X+, Android) */
body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* When running as an installed PWA (standalone/fullscreen) */
@media (display-mode: standalone), (display-mode: fullscreen) {
    /* Extra top padding for status bar on standalone mode */
    body {
        padding-top: max(env(safe-area-inset-top), 8px);
    }

    /* Hide browser-only hint text */
    .browser-only { display: none !important; }

    /* Give installed app a slightly elevated header */
    .dash-header {
        padding-top: max(env(safe-area-inset-top), 16px);
    }
}

/* PWA install prompt banner */
#pwa-install-banner {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom) + 16px);
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    padding: 14px 20px;
    border-radius: 16px;
    font-size: 0.87rem;
    font-weight: 600;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    max-width: 92vw;
    animation: slideInUp 0.4s ease-out;
}

#pwa-install-banner .pwa-banner-text {
    flex: 1;
    line-height: 1.4;
}

#pwa-install-banner .pwa-banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

#pwa-install-banner button {
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    padding: 7px 14px;
    transition: all 0.2s;
}

#pwa-install-banner .btn-install {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

#pwa-install-banner .btn-install:hover {
    background: rgba(255,255,255,0.4);
}

#pwa-install-banner .btn-dismiss {
    background: none;
    color: rgba(255,255,255,0.65);
    padding: 7px 8px;
}

/* Update available banner */
#pwa-update-banner {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom) + 80px);
    left: 50%;
    transform: translateX(-50%);
    animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Prevent text selection and tap highlight on buttons on mobile */
@media (max-width: 768px) {
    button, .btn, .search-peer-chip, .mobile-nav-item {
        -webkit-tap-highlight-color: transparent;
        user-select: none;
    }

    /* Larger touch targets on mobile */
    .btn {
        min-height: 44px;
    }

    input, select, textarea {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }


    .market-news-shell {
        padding: 20px !important;
        min-height: unset !important;
    }

    .market-news-header {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
    }

    .market-news-controls {
        align-items: flex-end !important;
    }

    .market-news-column-card {
        min-height: unset !important;
    }

    .market-news-feed-column {
        max-height: none !important;
        overflow-y: visible !important;
    }

    /* Stack footer row on narrow screens */
    .dashboard-footer-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* Mobile-First Native Feel Optimizations */
@media (pointer: coarse) {
    html, body {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Remove tap highlight color and click delays globally for touch devices */
    a, button, input, select, textarea, [role="button"], .btn, .nav-item, .chip, .search-peer-chip, .mobile-nav-item {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Disable selection for UI elements to prevent native browser copying highlights during fast taps */
    body {
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Re-enable selection for inputs and textareas so users can copy/paste values */
    input, textarea, [contenteditable="true"] {
        -webkit-user-select: text;
        user-select: text;
    }
    
    /* Ensure scrollable blocks use native touch momentum */
    .modal-card, .scroll-container, #session-devices-list, .csv-preview-card, .home-news-feed {
        -webkit-overflow-scrolling: touch;
    }
}

/* Fix for sharing tables on mobile - ensure cells are visible */
@media(max-width: 768px) {
    #sharing-sent-list-body td,
    #sharing-received-list-body td {
        padding: 8px 10px !important;
        font-size: 0.75rem !important;
        min-height: 36px !important;
    }

    #sharing-sent-list-body tr,
    #sharing-received-list-body tr {
        height: auto;
    }
}

.calendars-card {
    padding: 24px;
}

.calendars-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.calendars-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.calendars-tab-actions {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.calendars-tab-btn {
    border: 1px solid var(--border-card);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.calendars-tab-btn.active {
    color: var(--text-primary);
    border-color: rgba(var(--primary-rgb), 0.38);
    background: rgba(var(--primary-rgb), 0.15);
}

.calendars-panel {
    display: none;
}

.calendars-panel.active {
    display: block;
}

.calendars-toolbar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 12px;
    flex-wrap: wrap;
}

.calendars-filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.calendars-toggle-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.calendars-toggle-row {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 132px;
    border: 1px solid var(--border-card);
    border-radius: 10px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
}

.calendars-switch {
    position: relative;
    display: inline-flex;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.calendars-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.calendars-switch-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.45);
    transition: all 0.2s ease;
}

.calendars-switch-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.calendars-switch input:checked + .calendars-switch-slider {
    background: rgba(var(--primary-rgb), 0.45);
    border-color: rgba(var(--primary-rgb), 0.65);
}

.calendars-switch input:checked + .calendars-switch-slider::before {
    transform: translateX(18px);
}

.calendars-switch input:focus-visible + .calendars-switch-slider {
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.35);
}

.calendars-filter-label {
    font-size: 0.84rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.calendar-range-select {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.84rem;
    font-weight: 600;
}

.calendars-refresh-theme-btn {
    background: rgba(var(--primary-rgb), 0.1) !important;
    border: 1px solid rgba(var(--primary-rgb), 0.25) !important;
    color: var(--primary) !important;
    border-radius: 999px !important;
    padding: 6px 16px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.calendars-refresh-theme-btn:hover {
    background: rgba(var(--primary-rgb), 0.2) !important;
}

.calendars-source-note {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.78;
    line-height: 1.1;
}

.calendars-source-note-inline {
    margin-left: 4px;
    align-self: center;
}

.calendars-body-grid {
    display: grid;
    grid-template-columns: minmax(260px, 360px) 1fr;
    gap: 14px;
}

.calendars-list-panel,
.calendars-detail-panel {
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    min-height: 420px;
    max-height: 560px;
    overflow-y: auto;
}

.calendars-empty-message {
    color: var(--text-secondary);
    font-size: 0.86rem;
    text-align: center;
    padding: 28px 14px;
}

.calendars-list-item {
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.01);
    color: var(--text-primary);
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: var(--transition-smooth);
}

.calendars-list-item.active,
.calendars-list-item:hover {
    border-color: rgba(var(--primary-rgb), 0.38);
    background: rgba(var(--primary-rgb), 0.12);
}

.calendars-item-title {
    font-size: 0.92rem;
    font-weight: 700;
}

.calendars-ticker-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.calendars-ticker-logo {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(var(--primary-rgb), 0.10);
    border: 1px solid rgba(var(--primary-rgb), 0.16);
}

.calendars-ticker-inline .holding-logo,
.calendars-ticker-inline .holding-logo.small {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
}

.calendars-ticker-inline .holding-logo-fallback {
    font-size: 0.56rem;
}

.calendars-item-subtitle {
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.calendars-item-date {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
}

.calendars-detail-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.calendars-detail-grid {
    display: grid;
    gap: 8px;
}

.calendars-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px dashed rgba(var(--primary-rgb), 0.2);
    padding-bottom: 8px;
}

.calendars-detail-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.calendars-detail-value {
    font-size: 0.84rem;
    font-weight: 600;
    text-align: right;
}

.calendars-event-card {
    cursor: default;
    grid-template-columns: 1fr auto;
}

.calendars-economic-metrics {
    grid-column: 1 / -1;
    margin-top: 8px;
    border-top: 1px dashed rgba(var(--primary-rgb), 0.2);
    padding-top: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    font-size: 0.76rem;
    color: var(--text-secondary);
}

@media (max-width: 980px) {
    .calendars-body-grid {
        grid-template-columns: 1fr;
    }

    .calendars-list-panel,
    .calendars-detail-panel {
        min-height: 260px;
    }
}

/* Fundamentals Drawer Styling */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: flex-end;
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.drawer-card {
    width: 100%;
    max-width: 480px;
    height: 100%;
    background: rgba(13, 20, 38, 0.75) !important;
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    padding: 30px;
    box-shadow: -10px 0 45px rgba(0,0,0,0.65);
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.drawer-overlay.active .drawer-card {
    transform: translateX(0);
}

.btn-icon-analytics {
    background: rgba(var(--primary-rgb), 0.1) !important;
    border: 1px solid rgba(var(--primary-rgb), 0.2) !important;
    color: var(--primary) !important;
}

.btn-icon-analytics:hover {
    background: rgba(var(--primary-rgb), 0.25) !important;
    color: var(--secondary) !important;
}

/* Badge colors for fundamentals */
.positive-badge {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.warning-badge {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.danger-badge {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Light Theme overrides for the fundamentals drawer */
.light-theme .drawer-card {
    background: rgba(248, 250, 252, 0.82) !important;
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    border-left: 1px solid rgba(var(--primary-rgb), 0.16);
    box-shadow: -10px 0 45px rgba(0, 0, 0, 0.12);
}

.metric-card-sub {
    padding: 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.light-theme .metric-card-sub {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.4) 100%) !important;
    border: 1px solid rgba(var(--primary-rgb), 0.18) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
}

.fundamentals-insight {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.09) 0%, rgba(var(--primary-rgb), 0.02) 100%);
    border: 1px solid rgba(var(--primary-rgb), 0.18);
    border-radius: 14px;
    padding: 18px;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--text-secondary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.light-theme .fundamentals-insight {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.06) 0%, rgba(var(--primary-rgb), 0.01) 100%) !important;
    border: 1px solid rgba(var(--primary-rgb), 0.25) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03) !important;
}

/* Dashboard Dividends Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media(min-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1.6fr 1fr;
    }
}

/* FAQ Styles */
.category-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 14px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 6px;
}

.faq-accordion {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-accordion:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(var(--primary-rgb), 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.faq-accordion[open] {
    background: rgba(var(--primary-rgb), 0.03);
    border-color: rgba(var(--primary-rgb), 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.faq-accordion summary {
    padding: 16px 20px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    outline: none;
    transition: color 0.2s ease;
    font-size: 0.95rem;
}

.faq-accordion summary:hover {
    color: var(--primary);
}

.faq-accordion[open] summary {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

.faq-answer {
    padding: 18px 20px;
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.faq-answer p {
    margin: 0 0 12px 0;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.indicator-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.indicator-dot.success { background-color: var(--success); }
.indicator-dot.danger { background-color: var(--danger); }
.indicator-dot.warning { background-color: var(--warning); }

.onboarding-dot {
    transition: background-color 0.25s ease, transform 0.25s ease;
}
.onboarding-dot.active {
    transform: scale(1.25);
}

/* ================= AI INSIGHTS DASHBOARD ================= */
.ai-insights-card {
    padding: 24px;
}

.ai-insights-subtitle {
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.ai-insights-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
    margin-bottom: 16px;
}

.ai-tab-btn {
    border: 1px solid var(--border-card);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-weight: 600;
    border-radius: 999px;
    padding: 8px 14px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.ai-tab-btn.active {
    color: var(--text-primary);
    border-color: rgba(var(--primary-rgb), 0.45);
    background: rgba(var(--primary-rgb), 0.12);
}

.ai-tab-panel {
    display: none;
}

.ai-tab-panel.active {
    display: block;
}

.ai-audit-toolbar,
.ai-stock-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 12px;
}

.ai-audit-context {
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.ai-stock-select-wrap {
    flex: 1;
    max-width: 320px;
}

.ai-loading {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.ai-content-block {
    border: 1px solid var(--border-card);
    border-radius: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.01);
}

.ai-empty-state {
    color: var(--text-secondary);
}

.ai-markdown p {
    margin-bottom: 8px;
}

.ai-markdown h4 {
    margin-top: 10px;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-size: 0.92rem;
}

.ai-markdown ul {
    margin-left: 18px;
    margin-bottom: 8px;
}

.ai-stock-header {
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-card);
    padding-bottom: 10px;
}

.ai-stock-title-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ai-stock-ticker {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ai-stock-price {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--primary);
}

.ai-stock-meta {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.ai-stock-meta-bottom {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-card);
    color: var(--text-secondary);
    font-size: 0.78rem;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.ai-stock-meta-bottom strong {
    color: var(--text-primary);
    font-weight: 600;
}

.ai-pros-cons-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.ai-pros-cons-card {
    border: 1px solid var(--border-card);
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.015);
}

.ai-pros-cons-card h5 {
    font-size: 0.8rem;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.ai-pros-cons-card.pros h5 {
    color: var(--success);
}

.ai-pros-cons-card.cons h5 {
    color: var(--danger);
}

.ai-pros-cons-card ul {
    margin-left: 16px;
}

.ai-pros-cons-card li {
    margin-bottom: 6px;
}

.ai-verdict-pill {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.ai-verdict-pill.verdict-buy {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.28);
}

.ai-verdict-pill.verdict-hold {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.28);
}

.ai-verdict-pill.verdict-sell {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.28);
}

.ai-chat-thread {
    min-height: 320px;
    max-height: 56vh;
    overflow-y: auto;
    border: 1px solid var(--border-card);
    border-radius: 14px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.01);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-chat-msg {
    max-width: 90%;
    padding: 10px 12px;
    border-radius: 10px;
    line-height: 1.45;
    font-size: 0.88rem;
}

.ai-chat-msg-user {
    align-self: flex-end;
    background: rgba(var(--primary-rgb), 0.18);
    border: 1px solid rgba(var(--primary-rgb), 0.35);
    color: var(--text-primary);
}

.ai-chat-msg-assistant {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
}

.ai-chat-input-row {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.ai-error {
    color: #f87171;
}

.ai-audit-meta {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-card);
    color: var(--text-secondary);
    font-size: 0.78rem;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.ai-audit-meta strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================================
   Dip Finder Subview Styles
   ============================================================ */
.dips-chart-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-card);
    flex-wrap: nowrap;
}

.dips-chart-row-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 0 0 540px;
    min-width: 0;
    flex-wrap: nowrap;
}

.dips-chart-row-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-width: 0;
}

.dips-chart-row-ticker {
    font-weight: 800;
    font-size: 0.88rem;
    color: var(--text-primary);
    cursor: pointer;
}

.dips-chart-row-name {
    font-size: 0.72rem;
    color: var(--text-secondary);
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dips-chart-row-prices {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.dips-chart-row-current {
    font-weight: 700;
    color: var(--text-primary);
    min-width: 60px;
}

.dips-chart-row-range {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.dips-chart-row-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
    min-width: 0;
}

.dips-chart-row-bar-bg {
    flex-grow: 1;
    height: 16px;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.dips-chart-row-bar {
    height: 8px;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.4) 0%, var(--danger) 100%);
    border-radius: 4px;
    z-index: 2;
    margin-left: 4px;
}

.dips-chart-row-label {
    width: 70px;
    flex-shrink: 0;
    text-align: right;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Mobile responsive alignment */
@media (max-width: 768px) {
    .dips-chart-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .dips-chart-row-left {
        flex-wrap: wrap;
        gap: 10px;
        flex: 1 1 auto;
    }
    
    .dips-chart-row-meta {
        width: 100%;
    }
    
    .dips-chart-row-prices {
        width: 100%;
        justify-content: flex-start;
        gap: 16px;
        border-top: 1px dashed var(--border-card);
        padding-top: 8px;
    }
    
    .dips-chart-row-right {
        width: 100%;
    }
}

@media (max-width: 1440px) and (min-width: 1201px) {
    .dashboard-wrapper {
        max-width: 1360px;
        padding: 0 20px 28px;
    }

    body:not(.layout-wide) .dashboard-wrapper {
        max-width: 1240px;
    }

    .dash-header {
        margin-bottom: 22px;
        padding: 10px 14px;
    }

    .metrics-grid {
        gap: 14px;
        margin-bottom: 22px;
    }

    .metric-card {
        padding: 16px;
    }

    .metric-value {
        font-size: 2rem;
    }

    .dash-portfolio-toolbar {
        margin-bottom: 22px;
        padding: 10px 16px;
    }

    .holdings-card {
        padding: 18px;
    }

    .holdings-table th {
        font-size: 0.72rem;
        padding: 12px 14px;
    }

    .holdings-table td {
        font-size: 0.88rem;
        padding: 13px 14px;
    }

    .content-grid {
        gap: 22px;
        margin-bottom: 28px;
    }

    .chart-card {
        padding: 18px;
    }
}

@media (max-width: 390px) {
    .dashboard-wrapper {
        padding: 0 10px 18px;
    }

    .dash-header {
        gap: 10px;
        margin-bottom: 16px;
        padding: 10px 12px;
        border-radius: 10px;
    }

    .dash-brand-name {
        font-size: 1rem;
    }

    .metrics-grid {
        gap: 10px;
        margin-bottom: 16px;
    }

    .metric-card {
        padding: 14px;
    }

    .metric-label {
        font-size: 0.72rem;
    }

    .metric-value {
        font-size: 1.52rem;
    }

    .trading-summary-metrics .metric-label {
        font-size: 0.66rem;
    }

    .trading-summary-metrics .metric-value {
        font-size: 1.18rem;
    }

    .metric-subtext,
    .metric-change {
        font-size: 0.72rem;
    }

    .dash-portfolio-toolbar {
        gap: 12px;
        padding: 12px;
        margin-bottom: 16px;
    }

    .portfolio-switcher-container select {
        font-size: 0.82rem;
        padding: 8px 10px;
    }

    .portfolio-actions {
        gap: 6px;
    }

    .portfolio-actions .btn-action-small {
        font-size: 0.74rem;
        padding: 7px 8px;
    }

    .holdings-card {
        padding: 12px;
    }

    .table-responsive {
        max-height: 520px;
    }

    .holdings-table th {
        font-size: 0.68rem;
        letter-spacing: 0.05em;
        padding: 10px 10px;
    }

    .holdings-table td {
        font-size: 0.82rem;
        padding: 10px 10px;
    }

    .holding-name {
        font-size: 0.7rem;
    }

    .holding-logo {
        width: 20px;
        height: 20px;
    }

    .chart-card {
        padding: 14px;
    }

    .card-header-actions {
        margin-bottom: 12px;
    }
}

/* Paywall Gating Styles */
/* Paywall Gating Styles */
.paywall-view-card {
    max-width: 1320px;
    margin: 0 auto;
    padding: 32px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

.paywall-view-card::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.paywall-header-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
}

.paywall-feature-icon-wrapper {
    z-index: 1;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.15), rgba(var(--secondary-rgb), 0.15));
    border: 2px solid rgba(var(--primary-rgb), 0.3);
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 8px;
    transition: transform 0.3s ease;
}

.paywall-header-row .paywall-feature-icon-wrapper {
    margin-bottom: 0;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.paywall-header-row .paywall-feature-icon-wrapper svg {
    width: 32px;
    height: 32px;
}

.paywall-view-card:hover .paywall-feature-icon-wrapper {
    transform: scale(1.08) rotate(5deg);
}

.paywall-feature-icon-svg {
    filter: drop-shadow(0 4px 8px rgba(var(--primary-rgb), 0.4));
}

.paywall-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ffffff 30%, rgba(255, 255, 255, 0.7));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    z-index: 1;
}

.paywall-reason-box {
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 16px 24px;
    margin-bottom: 4px;
}

.paywall-reason-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-top: 0;
    margin-bottom: 16px;
}

.paywall-reason-benefits {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.paywall-reason-benefits li {
    font-size: 0.95rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.benefit-bullet {
    color: var(--primary);
    font-weight: bold;
}

.paywall-warning-banner {
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 500;
}

.paywall-limits-card {
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.01);
    border: 1.5px dashed rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px 24px;
    text-align: left;
}

.paywall-limits-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 16px;
    letter-spacing: 0.02em;
}

.paywall-limits-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.paywall-limit-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
}

.paywall-limit-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.paywall-limit-value {
    color: var(--text-primary);
    font-size: 1.05rem;
}

.paywall-upgrade-header {
    z-index: 1;
    margin-top: 16px;
    text-align: center;
}

.paywall-upgrade-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.paywall-upgrade-header p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
}

.paywall-cycle-toggle-container {
    z-index: 1;
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin: 8px auto;
}

.paywall-cycle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.paywall-cycle-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.paywall-savings-pill {
    font-size: 0.72rem;
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}

.paywall-upgrade-columns {
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    margin-top: 8px;
}

.paywall-upgrade-columns.three-cols {
    grid-template-columns: repeat(3, 1fr);
}

.paywall-upgrade-columns.single-col {
    grid-template-columns: 1fr;
    max-width: 380px;
}

.paywall-upgrade-col {
    padding: 20px 24px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: all 0.3s ease;
}

.paywall-upgrade-col.recommended {
    border-color: rgba(var(--primary-rgb), 0.4);
    background: rgba(var(--primary-rgb), 0.03);
    box-shadow: 0 8px 30px rgba(var(--primary-rgb), 0.1);
}

.paywall-col-badge {
    position: absolute;
    top: -12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.paywall-upgrade-col h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 8px 0 12px 0;
}

.paywall-col-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.paywall-col-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    width: 100%;
}

.paywall-col-features li {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.paywall-upgrade-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    margin-top: auto;
    transition: all 0.25s ease;
}

.paywall-upgrade-btn.pro-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
}

.paywall-upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.4);
}

.paywall-footer-link {
    z-index: 1;
    margin-top: 8px;
}

.paywall-footer-link a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.paywall-footer-link a:hover {
    color: var(--primary);
}

@media (max-width: 900px) {
    .paywall-upgrade-columns,
    .paywall-upgrade-columns.three-cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .paywall-limits-list {
        grid-template-columns: 1fr;
    }
}

/* ── Light-theme paywall overrides ── */
body.light-theme .paywall-title {
    background: linear-gradient(135deg, #0f172a 30%, #334155);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-theme .paywall-reason-box {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .paywall-limits-card {
    background: rgba(0, 0, 0, 0.01);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .paywall-limit-row {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .paywall-cycle-toggle-container {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .paywall-upgrade-col {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .paywall-upgrade-col.recommended {
    background: rgba(var(--primary-rgb), 0.04);
    border-color: rgba(var(--primary-rgb), 0.3);
}

body.light-theme .paywall-savings-pill {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

body.light-theme .paywall-warning-banner {
    background: rgba(217, 119, 6, 0.08);
    border-color: rgba(217, 119, 6, 0.25);
    color: #b45309;
}

@media (max-width: 500px) {
    .paywall-header-row {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* ================= MODERNIZED DASHBOARD BUTTONS ================= */

/* Portfolio Actions Toolbar Override */
.portfolio-actions .btn-create {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25) !important;
    transition: all 0.25s ease !important;
}
.portfolio-actions .btn-create:hover {
    transform: translateY(-2.5px) !important;
    box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.4) !important;
}

.portfolio-actions .btn-rename {
    background: rgba(var(--primary-rgb), 0.05) !important;
    border: 1.5px solid rgba(var(--primary-rgb), 0.15) !important;
    color: var(--text-primary) !important;
    transition: all 0.25s ease !important;
}
.portfolio-actions .btn-rename:hover {
    background: rgba(var(--primary-rgb), 0.12) !important;
    border-color: var(--primary) !important;
    transform: translateY(-2.5px) !important;
}

.portfolio-actions .btn-delete {
    background: rgba(239, 68, 68, 0.08) !important;
    border: 1.5px solid rgba(239, 68, 68, 0.20) !important;
    color: #ef4444 !important;
    transition: all 0.25s ease !important;
}
body:not(.light-theme) .portfolio-actions .btn-delete {
    color: #f87171 !important;
}
.portfolio-actions .btn-delete:hover {
    background: rgba(239, 68, 68, 0.16) !important;
    border-color: #ef4444 !important;
    transform: translateY(-2.5px) !important;
}

/* Holdings Header Actions Buttons Override */
.card-header-actions .btn {
    border-radius: 12px !important;
    padding: 10px 20px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: none !important;
}

/* Connect button */
#btn-plaid-import-holdings {
    background: rgba(var(--primary-rgb), 0.05) !important;
    border: 1.5px solid rgba(var(--primary-rgb), 0.18) !important;
    color: var(--primary) !important;
}
#btn-plaid-import-holdings:hover {
    background: rgba(var(--primary-rgb), 0.12) !important;
    border-color: var(--primary) !important;
    transform: translateY(-2.5px) !important;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.15) !important;
}

/* Manage, Import CSV, Export CSV */
.card-header-actions .btn-outline {
    background: rgba(var(--primary-rgb), 0.03) !important;
    border: 1.5px solid rgba(var(--primary-rgb), 0.14) !important;
    color: var(--text-secondary) !important;
}
.card-header-actions .btn-outline:hover {
    background: rgba(var(--primary-rgb), 0.08) !important;
    border-color: rgba(var(--primary-rgb), 0.35) !important;
    color: var(--text-primary) !important;
    transform: translateY(-2.5px) !important;
}

/* Add Asset Button */
.card-header-actions .btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25) !important;
}
.card-header-actions .btn-primary:hover {
    transform: translateY(-2.5px) !important;
    box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.4) !important;
}

/* Clear All Button */
#btn-clear-all {
    background: rgba(239, 68, 68, 0.08) !important;
    border: 1.5px solid rgba(239, 68, 68, 0.20) !important;
    color: #ef4444 !important;
}
body:not(.light-theme) #btn-clear-all {
    color: #f87171 !important;
}
#btn-clear-all:hover {
    background: rgba(239, 68, 68, 0.16) !important;
    border-color: #ef4444 !important;
    transform: translateY(-2.5px) !important;
}

/* Refresh Button Override */
#btn-refresh-prices {
    background: rgba(var(--primary-rgb), 0.05) !important;
    border: 1.5px solid rgba(var(--primary-rgb), 0.16) !important;
    color: var(--primary) !important;
    padding: 8px 18px !important;
    border-radius: 12px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    transition: all 0.25s ease !important;
}
#btn-refresh-prices:hover {
    background: rgba(var(--primary-rgb), 0.12) !important;
    border-color: var(--primary) !important;
    transform: translateY(-2.5px) !important;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.15) !important;
}

/* ================= ACTIONS DROPDOWN MENUS (3-DOT) ================= */

/* Responsive visibility rules for Action Toolbar buttons */
@media (min-width: 769px) {
    .mobile-only-dropdown {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .desktop-only-btn {
        display: none !important;
    }
}

.action-dropdown-container {
    position: relative;
    display: inline-block;
}

.btn-more-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    cursor: pointer;
    background: rgba(var(--primary-rgb), 0.05);
    border: 1.5px solid rgba(var(--primary-rgb), 0.16);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.btn-more-toggle:hover {
    background: rgba(var(--primary-rgb), 0.12);
    border-color: var(--primary);
    transform: translateY(-1.5px);
}

.action-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 1000;
    min-width: 200px;
    background: var(--bg-card-solid);
    backdrop-filter: blur(12px);
    border: 1.5px solid var(--border-card);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    padding: 6px;
    flex-direction: column;
    gap: 4px;
}

.action-dropdown-menu.align-left {
    right: auto !important;
    left: 0 !important;
}

.action-dropdown-menu.show {
    display: flex !important;
    animation: fadeInDropdown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.dropdown-item svg {
    color: var(--text-secondary);
    transition: color 0.15s ease;
}

.dropdown-item:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
}

.dropdown-item:hover svg {
    color: var(--primary);
}

.dropdown-item.danger {
    color: #ef4444 !important;
}

.dropdown-item.danger svg {
    color: rgba(239, 68, 68, 0.75) !important;
}

.dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
}

.dropdown-item.danger:hover svg {
    color: #ef4444 !important;
}

/* Clickable Ticker Links and Hover effects */
/* Clickable Ticker Links and Hover effects */
.ticker-intel-link {
    text-decoration: none !important;
}
.ticker-intel-link:hover span, 
.clickable-ticker-label:hover span {
    text-decoration: underline !important;
    text-underline-offset: 3px;
    text-decoration-color: var(--primary) !important;
    color: var(--primary) !important;
}

.ticker-symbol-text {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

.portfolio-names-text {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

/* Brokerage Modal Mobile Styles */
.brokerage-header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 14px 12px;
    background: rgba(var(--primary-rgb), 0.06);
    border-bottom: 1px solid var(--border-card);
}

.brokerage-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .brokerage-header-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .brokerage-header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}


/* Weekly Breakdown Expandable Rows Styling */
.monthly-summary-row:hover {
    background: rgba(255, 255, 255, 0.02) !important;
}
.weekly-breakdown-row {
    transition: all 0.3s ease-in-out;
}
.weekly-breakdown-container {
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.15);
}

/* Sleek Custom Scrollbars globally */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
}

.light-theme ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.01);
}

::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb), 0.15);
    border-radius: 8px;
    border: 1px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--primary-rgb), 0.3);
    border: 1px solid transparent;
    background-clip: padding-box;
}

/* Premium Empty State Layouts */
.empty-state-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 20px;
    text-align: center;
    width: 100%;
}

.empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
    margin-bottom: 12px;
}

.empty-state-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.empty-state-subtitle {
    font-size: 0.76rem;
    color: var(--text-secondary);
    max-width: 320px;
    line-height: 1.45;
}

/* Satisfying Button Click Physics */
.btn:active, 
.btn-icon:active, 
.btn-action-small:active,
.btn-action:active,
.btn-create:active,
.btn-delete:active,
.btn-outline:active,
.btn-icon-delete:active,
.btn-icon-analytics:active {
    transform: scale(0.95) !important;
}

/* Smooth Table Row Entry Animations */
@keyframes row-fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.holdings-table tbody tr {
    animation: row-fade-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (max-width: 768px) {
    #trading-log-dropdown-menu {
        left: 0 !important;
        right: auto !important;
    }
}

/* Active Trading Badge styling */
.active-trading-badge {
    background: rgba(var(--primary-rgb), 0.1) !important;
    border: 1px solid rgba(var(--primary-rgb), 0.25) !important;
    color: var(--primary) !important;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-block;
    vertical-align: middle;
    margin-left: 6px;
}

/* Trading Dashboard Summary Card Hover Lift */
.compact-summary-card {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease !important;
}

.compact-summary-card:hover {
    transform: translateY(-4px) !important;
}

.compact-summary-card.card-capital-flow {
    border-top: 4px solid var(--primary) !important;
}
.compact-summary-card.card-capital-flow:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35), 0 0 20px rgba(var(--primary-rgb), 0.22) !important;
}

.compact-summary-card.card-cash-position {
    border-top: 4px solid #0ea5e9 !important;
}
.compact-summary-card.card-cash-position:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35), 0 0 20px rgba(14, 165, 233, 0.25) !important;
}

.compact-summary-card.card-trading-performance {
    border-top: 4px solid #10b981 !important;
}
.compact-summary-card.card-trading-performance:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35), 0 0 20px rgba(16, 185, 129, 0.22) !important;
}

.compact-summary-card.card-profit-withdrawals {
    border-top: 4px solid #8b5cf6 !important;
}
.compact-summary-card.card-profit-withdrawals:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35), 0 0 20px rgba(139, 92, 246, 0.22) !important;
}

/* Detail View Segmented Control */
.segmented-control {
    background: rgba(var(--primary-rgb), 0.04);
    border: 1px solid var(--border-card);
    border-radius: 999px;
    padding: 4px;
    display: inline-flex;
    gap: 4px;
}

.btn-segmented {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 20px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-segmented:hover {
    color: var(--text-primary);
}

.btn-segmented.active {
    background: var(--primary);
    color: white !important;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
}

/* Income Chart Bar Hover Interactions */
.income-bar {
    transform-origin: center bottom;
}
.income-bar:hover {
    opacity: 0.92;
    transform: scaleY(1.04) scaleX(1.02);
    filter: brightness(1.15) !important;
}

/* Modern Search Inputs & Refresh Micro-interactions */
.modern-search-input {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(var(--primary-rgb), 0.35) !important;
    padding: 6px 12px 6px 30px !important;
    border-radius: 999px !important;
    font-size: 0.8rem !important;
    color: var(--text-primary) !important;
    width: 120px !important;
    outline: none !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}
.modern-search-input:focus {
    width: 180px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.22) !important;
}
.refresh-icon {
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
button:hover .refresh-icon,
.btn-icon:hover .refresh-icon,
.btn:hover .refresh-icon {
    transform: rotate(180deg) !important;
}

/* Glassmorphic Metric Card Sparklines */
.glass-card.metric-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease !important;
}
.glass-card.metric-card:hover {
    transform: translateY(-4px) !important;
    border-color: rgba(var(--primary-rgb), 0.22) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08), 0 0 15px rgba(var(--primary-rgb), 0.06) !important;
}
.glass-card.metric-card:hover svg {
    opacity: 0.75 !important;
}

.spinning {
    animation: spin 1.2s linear infinite !important;
}

/* Specificity override helper to allow hiding rows via JS classes instead of style.display */
#view-dash-holdings table.holdings-table tr.hidden-row,
#view-dash-holdings table.holdings-table tr.ticker-group-row.hidden-row,
#view-dash-holdings table.holdings-table tr.ticker-child-row.hidden-row,
#view-dash-trading table.holdings-table tr.hidden-row,
table.holdings-table tr.hidden-row {
    display: none !important;
}

/* ================= UX IMPROVEMENTS & STYLING ENHANCEMENTS ================= */

/* Table Zebra Striping & Breathing Room */
table.holdings-table tbody tr:nth-child(even):not(.hidden-row):not(.ticker-child-row) {
    background-color: rgba(255, 255, 255, 0.015);
}
.light-theme table.holdings-table tbody tr:nth-child(even):not(.hidden-row):not(.ticker-child-row) {
    background-color: rgba(0, 0, 0, 0.01);
}
table.holdings-table td {
    padding: 12px 16px !important;
}

/* Accessible Focus Rings */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px !important;
}

/* Skeleton Loading Shimmer */
.skeleton-shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 25%,
        rgba(255, 255, 255, 0.08) 37%,
        rgba(255, 255, 255, 0.03) 63%
    );
    background-size: 400% 100%;
    animation: shimmer-anim 1.4s ease infinite;
}
.light-theme .skeleton-shimmer {
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.03) 25%,
        rgba(0, 0, 0, 0.08) 37%,
        rgba(0, 0, 0, 0.03) 63%
    );
    background-size: 400% 100%;
}
@keyframes shimmer-anim {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* Micro-interactions: spring scaling active states */
.btn, .btn-icon, .modern-search-input {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.btn:active, .btn-icon:active {
    transform: scale(0.96) !important;
}

/* --- YouTube-style Top Loading Progress Bar --- */
.top-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: 100000;
    width: 0%;
    opacity: 0;
    transition: width 0.4s cubic-bezier(0.1, 0.8, 0.3, 1), opacity 0.2s ease;
    pointer-events: none;
    box-shadow: 0 0 8px var(--primary);
}
.top-loading-bar.active {
    opacity: 1;
}

/* --- Premium Command Palette --- */
.cmd-palette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 15vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.cmd-palette-overlay.show {
    opacity: 1;
    pointer-events: auto;
}
.cmd-palette-card {
    background: rgba(20, 20, 25, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
    max-width: 600px;
    border-radius: 16px;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    transform: scale(0.97) translateY(-10px);
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
}
.light-theme .cmd-palette-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.15);
}
.cmd-palette-overlay.show .cmd-palette-card {
    transform: scale(1) translateY(0);
}
.cmd-palette-search-wrapper {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.light-theme .cmd-palette-search-wrapper {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.cmd-palette-search-icon {
    color: var(--text-secondary);
    margin-right: 12px;
    flex-shrink: 0;
}
.cmd-palette-input {
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    font-size: 1.05rem;
    color: var(--text-primary);
    font-family: inherit;
}
.cmd-palette-input::placeholder {
    color: var(--text-secondary);
}
.cmd-palette-results {
    max-height: 330px;
    overflow-y: auto;
    padding: 8px;
}
.cmd-palette-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 500;
}
.cmd-palette-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cmd-palette-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    transition: all 0.15s ease;
}
.light-theme .cmd-palette-item-icon {
    background: rgba(0, 0, 0, 0.03);
}
.cmd-palette-item.active {
    background: var(--primary);
    color: #ffffff !important;
}
.cmd-palette-item.active .cmd-palette-item-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}
.cmd-palette-item.active .cmd-palette-shortcut {
    opacity: 1;
}
.cmd-palette-shortcut {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    font-family: monospace;
}
.light-theme .cmd-palette-shortcut {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
}
.cmd-palette-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.light-theme .cmd-palette-footer {
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}
.cmd-palette-footer span {
    display: flex;
    align-items: center;
    gap: 4px;
}
.cmd-palette-footer kbd {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.light-theme .cmd-palette-footer kbd {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* --- Premium Toast Notification Overrides --- */
.toast-premium {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    min-width: 260px;
    padding: 12px 16px !important;
    border-radius: 12px !important;
}
.toast-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: left;
    animation: toast-progress 5.5s linear forwards;
}
@keyframes toast-progress {
    to { transform: scaleX(0); }
}

/* Holdings Legend */
.holdings-legend {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    margin-top: 16px;
    color: var(--text-secondary);
    align-items: center;
    justify-content: flex-start;
    padding: 0 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.holdings-legend::-webkit-scrollbar {
    display: none;
}
.holdings-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}
.holdings-legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .holdings-legend {
        font-size: 0.64rem !important;
        gap: 10px !important;
    }
    .holdings-legend-item {
        gap: 4px !important;
    }
    .holdings-legend-dot {
        width: 6px !important;
        height: 6px !important;
    }
}

/* Light Theme Mobile Table Row Background Tint Fix */
@media (max-width: 768px) {
    .light-theme .holdings-table tr.ticker-group-row td {
        background-color: rgba(37, 99, 235, 0.06) !important;
    }
    .light-theme .holdings-table tr.ticker-child-row td,
    .light-theme .holdings-table tr.option-child-row td {
        background-color: rgba(37, 99, 235, 0.02) !important;
    }
}

/* --- Premium Select & Dropdown Styling --- */
select.premium-select,
.portfolio-switcher-container select,
.watchlist-switcher select,
.calendar-range-select select,
.card-header-actions select {
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 14px !important;
    padding-right: 36px !important;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease !important;
}
.light-theme select.premium-select,
.light-theme .portfolio-switcher-container select,
.light-theme .watchlist-switcher select,
.light-theme .calendar-range-select select,
.light-theme .card-header-actions select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

/* --- Expandable Row Slide-Down Animation --- */
@keyframes row-slide-down {
    from {
        opacity: 0;
        transform: translateY(-5px) scaleY(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
}
.holdings-table tr.ticker-child-row,
.holdings-table tr.option-child-row {
    animation: row-slide-down 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

/* --- Active Refresh Button Spinner Animation --- */
@keyframes refresh-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.refresh-spinning svg {
    animation: refresh-spin 0.85s linear infinite !important;
}

/* --- Premium Empty States --- */
.empty-state-premium {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.01);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px dashed rgba(59, 130, 246, 0.15);
    border-radius: 16px;
    max-width: 440px;
    margin: 16px auto;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.light-theme .empty-state-premium {
    background: rgba(37, 99, 235, 0.02);
    border-color: rgba(37, 99, 235, 0.2);
}
.empty-state-premium:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.06);
}
.empty-state-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    margin-bottom: 14px;
    animation: pulse-shimmer 2.2s infinite ease-in-out;
}
@keyframes pulse-shimmer {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.06); opacity: 1; box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.22); }
}
.empty-state-premium h3 {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}
.empty-state-premium p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.45;
}

/* --- Dashboard Chart Skeleton Rings --- */
.chart-skeleton-ring {
    animation: skeleton-ring-spin 25s linear infinite;
    transform-origin: center;
}
@keyframes skeleton-ring-spin {
    to { transform: rotate(360deg); }
}

/* --- Premium Market Status Badge Overrides --- */
#market-status-badge {
    background: rgba(var(--primary-rgb), 0.05) !important;
    border: 1px solid rgba(var(--primary-rgb), 0.15) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}
.light-theme #market-status-badge {
    background: rgba(37, 99, 235, 0.04) !important;
    border-color: rgba(37, 99, 235, 0.12) !important;
}
#market-status-dot.pulsing {
    animation: status-pulse 1.8s infinite ease-in-out;
}
@keyframes status-pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.35); opacity: 1; box-shadow: 0 0 8px currentColor; }
}



.profile-sub-nav-tabs {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
}

.profile-tab-btn {
    border-radius: 999px !important;
    padding: 8px 16px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (max-width: 768px) {
    .profile-tab-btn {
        flex: 1 1 auto !important;
        justify-content: center !important;
    }
}

.profile-tab-btn svg {
    transition: transform 0.25s ease;
}

.profile-tab-btn:hover svg {
    transform: scale(1.1);
}

/* Animations for Tab Switching */
.profile-tab-content {
    animation: profileTabFadeIn 0.35s cubic-bezier(0.21, 1.02, 0.43, 1.01) forwards;
}

@keyframes profileTabFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 769px) {
    .profile-forms-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Consolidated Header Tooltips --- */
.custom-tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
    margin-left: 5px;
    color: var(--text-secondary);
    font-size: 0.85em;
    vertical-align: middle;
}
.custom-tooltip-wrapper:hover .custom-tooltip-text {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.custom-tooltip-text {
    position: absolute;
    top: 130%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-card);
    color: #e5e7eb;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    pointer-events: none;
    text-transform: none !important;
}
.light-theme .custom-tooltip-text {
    background: rgba(255, 255, 255, 0.98);
    color: #1e293b;
    border-color: #cbd5e1;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

.custom-tooltip-wrapper.align-right .custom-tooltip-text {
    left: auto;
    right: 0;
    transform: translateY(-4px);
}
.custom-tooltip-wrapper.align-right:hover .custom-tooltip-text {
    transform: translateY(0);
}

.custom-tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 1px solid currentColor;
    font-size: 0.58rem;
    font-family: var(--font-main), sans-serif;
    font-weight: 700;
    line-height: 1;
    font-style: normal;
    text-transform: none;
    margin-left: 3px;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}
.custom-tooltip-wrapper:hover .custom-tooltip-icon {
    opacity: 1;
}

/* Elevate hovered headers to paint tooltips on top of sticky sibling columns */
.holdings-table th:hover {
    z-index: 20 !important;
}
