/* ============================================================
   DividendBull — "Financial Noir" Design System
   A dark, sophisticated, editorial aesthetic inspired by
   Bloomberg Terminal meets luxury financial magazine.
   ============================================================ */

/* === Fonts === */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* === CSS Variables === */
:root {
    /* Core palette */
    --midnight: #0b0f1a;
    --charcoal: #121826;
    --slate: #1a2035;
    --iron: #252d42;
    --steel: #384160;
    --mist: #64748b;
    --cloud: #94a3b8;
    --fog: #cbd5e1;
    --ivory: #e8ecf2;
    --snow: #f1f5f9;
    --white: #ffffff;

    /* Accent — warm amber/gold */
    --amber-50: #fff8eb;
    --amber-100: #fef0c7;
    --amber-200: #fdd889;
    --amber-300: #fcc249;
    --amber-400: #f5a623;
    --amber-500: #d4890a;
    --amber-600: #a86608;
    --amber-700: #7d4b0b;

    /* Success — teal-emerald */
    --up: #10b981;
    --up-light: #d1fae5;
    --up-muted: rgba(16, 185, 129, 0.15);
    --up-glow: rgba(16, 185, 129, 0.25);

    /* Danger — rose */
    --down: #ef4444;
    --down-light: #fee2e2;
    --down-muted: rgba(239, 68, 68, 0.15);

    /* Info — blue */
    --info: #3b82f6;
    --info-light: #dbeafe;
    --info-muted: rgba(59, 130, 246, 0.15);

    /* Warning — yellow */
    --warn: #eab308;
    --warn-light: #fef9c3;
    --warn-muted: rgba(234, 179, 8, 0.15);

    /* Premium — purple */
    --premium: #a855f7;
    --premium-light: #f3e8ff;
    --premium-muted: rgba(168, 85, 247, 0.15);

    /* Typography */
    --font-display: 'DM Sans', system-ui, -apple-system, sans-serif;
    --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;

    /* Sizing */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 8px;
    --radius-xl: 8px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.15);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.2);
    --shadow-xl: 0 8px 24px rgba(0,0,0,0.25);
    --shadow-glow: 0 0 12px rgba(245,166,35,0.1);
    --shadow-card: 0 1px 2px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.05);

    /* Grain overlay */
    --grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    background-color: var(--midnight);
}

body {
    background-color: var(--midnight);
    color: var(--fog);
    min-height: 100vh;
}

/* Global side padding — ensure visible whitespace on all pages */
.max-w-7xl,
.max-w-5xl,
.max-w-4xl,
.max-w-3xl {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
}
@media (min-width: 768px) {
    .max-w-7xl,
    .max-w-5xl,
    .max-w-4xl,
    .max-w-3xl {
        padding-left: 6rem;
        padding-right: 6rem;
    }
}
@media (min-width: 1024px) {
    .max-w-7xl,
    .max-w-5xl,
    .max-w-4xl,
    .max-w-3xl {
        padding-left: 10rem;
        padding-right: 10rem;
    }
}

/* Grain overlay — disabled */
body::before {
    display: none;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--white);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

a {
    color: var(--amber-400);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: var(--amber-300);
}

p {
    color: var(--cloud);
    line-height: 1.7;
}

strong, b { font-weight: 600; }

::selection {
    background: var(--amber-400);
    color: var(--midnight);
}

/* === Layout Utilities === */
.container { width: 100%; max-width: 80rem; margin: 0 auto; padding: 0 1.5rem; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-7xl { max-width: 80rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* === Spacing === */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.p-12 { padding: 3rem; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.pt-1 { padding-top: 0.25rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pl-3 { padding-left: 0.75rem; }
.pl-10 { padding-left: 2.5rem; }
.pr-4 { padding-right: 1rem; }

.m-0 { margin: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mt-16 { margin-top: 4rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-4 { margin-left: 1rem; }
.ml-8 { margin-left: 2rem; }
.mr-2 { margin-right: 0.5rem; }
.my-1 { margin-top: 0.25rem; margin-bottom: 0.25rem; }

/* === Position === */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.left-0 { left: 0; }
.bottom-0 { bottom: 0; }
.inset-y-0 { top: 0; bottom: 0; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }

/* === Sizing === */
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-20 { width: 5rem; }
.w-24 { width: 6rem; }
.w-full { width: 100%; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.h-20 { height: 5rem; }
.h-24 { height: 6rem; }
.min-h-screen { min-height: 100vh; }

/* === Grid === */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.col-span-1 { grid-column: span 1 / span 1; }
.col-span-2 { grid-column: span 2 / span 2; }

/* === Background Colors (Dark Palette) === */
.bg-white { background-color: var(--white); }
.bg-gray-50, .bg-surface-light { background-color: var(--snow); }
.bg-gray-100 { background-color: var(--ivory); }
.bg-gray-200 { background-color: var(--fog); }
.bg-gray-900 { background-color: var(--midnight); }

/* Dark surface variants */
.bg-surface { background-color: var(--charcoal); }
.bg-surface-raised { background-color: var(--slate); }
.bg-surface-overlay { background-color: var(--iron); }

/* Semantic BG */
.bg-green-50 { background-color: var(--up-muted); }
.bg-green-100 { background-color: var(--up-muted); }
.bg-green-500, .bg-green-600, .bg-green-700 { background-color: var(--up); }
.bg-red-50 { background-color: var(--down-muted); }
.bg-red-600 { background-color: var(--down); }
.bg-blue-50, .bg-blue-100 { background-color: var(--info-muted); }
.bg-blue-600 { background-color: var(--info); }
.bg-yellow-50 { background-color: var(--warn-muted); }
.bg-purple-100, .bg-purple-50 { background-color: var(--premium-muted); }
.bg-orange-50 { background-color: rgba(245, 166, 35, 0.12); }
.bg-amber { background-color: var(--amber-400); }

/* === Text Colors === */
.text-white { color: var(--white); }
.text-gray-300 { color: var(--fog); }
.text-gray-400 { color: var(--cloud); }
.text-gray-500 { color: var(--mist); }
.text-gray-600 { color: var(--cloud); }
.text-gray-700 { color: var(--fog); }
.text-gray-800 { color: var(--ivory); }
.text-gray-900 { color: var(--white); }
.text-green-500, .text-green-600 { color: var(--up); }
.text-green-800, .text-green-900 { color: #059669; }
.text-red-500, .text-red-600 { color: var(--down); }
.text-red-700, .text-red-800 { color: #dc2626; }
.text-blue-600, .text-blue-700 { color: var(--info); }
.text-blue-800 { color: #2563eb; }
.text-yellow-600, .text-yellow-700, .text-yellow-800 { color: var(--warn); }
.text-purple-600, .text-purple-700 { color: var(--premium); }
.text-orange-600, .text-orange-700 { color: var(--amber-400); }
.text-amber { color: var(--amber-400); }

/* === Border Colors === */
.border { border-width: 1px; border-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-gray-100 { border-color: rgba(255,255,255,0.04); }
.border-gray-200 { border-color: rgba(255,255,255,0.06); }
.border-gray-300 { border-color: rgba(255,255,255,0.1); }
.border-gray-800 { border-color: rgba(255,255,255,0.06); }
.border-green-200, .border-green-500, .border-green-600 { border-color: var(--up); }
.border-red-200, .border-red-300 { border-color: var(--down); }
.border-yellow-200 { border-color: var(--warn); }
.border-transparent { border-color: transparent; }
.border-surface { border-color: rgba(255,255,255,0.06); }
.border-amber { border-color: var(--amber-400); }

.divide-y > * + * { border-top: 1px solid rgba(255,255,255,0.06); }
.divide-gray-200 > * + * { border-color: rgba(255,255,255,0.06); }
.divide-gray-100 > * + * { border-color: rgba(255,255,255,0.04); }

/* === Border Radius === */
.rounded { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }
.rounded-bl-lg { border-bottom-left-radius: var(--radius-lg); }
.rounded-tr-lg { border-top-right-radius: var(--radius-lg); }
.rounded-tr-xl { border-top-right-radius: var(--radius-xl); }

/* === Shadows === */
.shadow { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* === Font Weight === */
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* === Font Size === */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1.1; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.8; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wide { letter-spacing: 0.05em; }

/* === Transitions === */
.transition { transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.transition-colors { transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease; }
.transition-shadow { transition: box-shadow 0.2s ease; }
.transition-transform { transition: transform 0.2s ease; }

/* === Interactivity === */
.cursor-pointer { cursor: pointer; }
.pointer-events-none { pointer-events: none; }
.select-none { user-select: none; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.whitespace-nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* === Focus States === */
.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px var(--amber-400); }
.focus\:ring-green-500:focus { box-shadow: 0 0 0 2px var(--amber-400); }
.focus\:border-transparent:focus { border-color: transparent; }

/* === Hover States === */
.hover\:text-white:hover { color: var(--white); }
.hover\:text-green-600:hover { color: var(--amber-400); }
.hover\:text-green-800:hover { color: var(--amber-300); }
.hover\:text-red-800:hover { color: #dc2626; }
.hover\:text-yellow-800:hover { color: var(--warn); }
.hover\:bg-gray-50:hover { background-color: rgba(255,255,255,0.04); }
.hover\:bg-gray-100:hover { background-color: rgba(255,255,255,0.06); }
.hover\:bg-green-50:hover { background-color: var(--up-muted); }
.hover\:bg-green-700:hover { background-color: #059669; }
.hover\:border-green-600:hover { border-color: var(--amber-400); }
.hover\:underline:hover { text-decoration: underline; }
.hover\:shadow-lg:hover { box-shadow: var(--shadow-lg); }
.hover\:shadow-md:hover { box-shadow: var(--shadow-md); }

.ring-2 { box-shadow: 0 0 0 2px var(--amber-400); }
.ring-green-500 { box-shadow: 0 0 0 2px var(--up); }

/* ============================================================
   COMPONENT STYLES
   ============================================================ */

/* === Cards === */
.card,
.bg-white {
    background-color: var(--charcoal);
    color: var(--fog);
}

.bg-white.rounded-xl,
.card {
    background: var(--charcoal);
    border: 1px solid rgba(255,255,255,0.07);
    box-shadow: var(--shadow-card);
}

.bg-white.rounded-xl:hover,
.card:hover {
    border-color: rgba(255,255,255,0.08);
}

/* === Buttons === */
button, [type="button"], [type="submit"] {
    cursor: pointer;
    font-family: var(--font-body);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    border: none;
    letter-spacing: 0.01em;
}

.btn-primary,
.bg-green-600,
.bg-green-700 {
    background: linear-gradient(135deg, var(--amber-400) 0%, var(--amber-500) 100%);
    color: var(--midnight);
    font-weight: 600;
    border: none;
}

.btn-primary:hover,
.bg-green-600:hover,
.bg-green-700:hover,
.hover\:bg-green-700:hover {
    background: linear-gradient(135deg, var(--amber-300) 0%, var(--amber-400) 100%);
    box-shadow: var(--shadow-glow);
}

.btn-secondary,
.border.border-gray-300 {
    background: transparent;
    color: var(--fog);
    border: 1px solid rgba(255,255,255,0.12);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.2);
}

/* Primary action buttons on pages */
a.bg-green-600,
button.bg-green-600,
a[class*="bg-green-600"],
button[class*="bg-green-600"] {
    background: linear-gradient(135deg, var(--amber-400) 0%, var(--amber-500) 100%);
    color: var(--midnight);
    font-weight: 600;
}

a.bg-green-600:hover,
button.bg-green-600:hover {
    background: linear-gradient(135deg, var(--amber-300) 0%, var(--amber-400) 100%);
    box-shadow: var(--shadow-glow);
}

/* Outline buttons */
.border-green-600 {
    border-color: var(--amber-400);
    color: var(--amber-400);
}
.border-green-600:hover,
a.border-2.border-green-600:hover {
    background: rgba(245, 166, 35, 0.08);
}

/* White outlined (hero) */
a.border-2.border-white {
    border-color: rgba(255,255,255,0.3);
}
a.border-2.border-white:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

/* === Forms === */
input, textarea, select {
    font-family: var(--font-body);
    font-size: inherit;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select {
    background: var(--slate);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    color: var(--white);
    padding: 0.625rem 0.875rem;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--amber-400);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
    background: var(--iron);
}

input::placeholder,
textarea::placeholder {
    color: var(--steel);
}

input[type="checkbox"] {
    accent-color: var(--amber-400);
}

label {
    color: var(--cloud);
}

/* Select dropdown arrow */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

/* === Tables === */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.875rem 1rem;
    text-align: left;
}

th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mist);
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

td {
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--fog);
}

tbody tr {
    transition: background-color 0.15s ease;
}

tbody tr:hover,
tr.hover\:bg-gray-50:hover {
    background-color: rgba(255,255,255,0.03) !important;
}

thead tr,
thead.bg-gray-50 tr {
    background: rgba(255,255,255,0.02);
}

.bg-gray-50 th,
thead.bg-gray-50 {
    background: rgba(255,255,255,0.02);
}

/* === Charts === */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* === Price Colors === */
.price-up { color: var(--up); }
.price-down { color: var(--down); }
.price-neutral { color: var(--mist); }

/* === Badges / Tags === */
.bg-gray-100.text-gray-600,
.bg-gray-100.text-gray-700 {
    background: rgba(255,255,255,0.06);
    color: var(--cloud);
}

.bg-blue-100.text-blue-600,
.bg-blue-100.text-blue-700 {
    background: var(--info-muted);
    color: var(--info);
}

.bg-green-100.text-green-600 {
    background: var(--up-muted);
    color: var(--up);
}

.bg-purple-100.text-purple-700,
.bg-purple-100.text-purple-600 {
    background: var(--premium-muted);
    color: var(--premium);
}

.bg-orange-100.text-orange-700 {
    background: rgba(245, 166, 35, 0.12);
    color: var(--amber-400);
}

.bg-yellow-100.text-yellow-800 {
    background: var(--warn-muted);
    color: var(--warn);
}

.bg-blue-100.text-blue-800 {
    background: var(--info-muted);
    color: var(--info);
}

.bg-green-100.text-green-800 {
    background: var(--up-muted);
    color: var(--up);
}

.bg-red-100.text-red-800 {
    background: var(--down-muted);
    color: var(--down);
}

/* === Gray backgrounds → dark variants === */
.bg-gray-50 {
    background-color: rgba(255,255,255,0.03);
}

.bg-gray-100 {
    background-color: rgba(255,255,255,0.05);
}

/* Stat tiles that use bg-gray-50 */
div.bg-gray-50.rounded-lg,
div[class*="bg-gray-50"][class*="rounded-lg"] {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.04);
}

/* Green highlight tiles */
div.bg-green-50.rounded-lg,
div[class*="bg-green-50"][class*="rounded-lg"],
.p-4.bg-green-50.rounded-lg {
    background: var(--up-muted);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

/* Blue highlight tiles */
div.bg-blue-50.rounded-lg,
div[class*="bg-blue-50"][class*="rounded-lg"],
.p-4.bg-blue-50.rounded-lg {
    background: var(--info-muted);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

/* Purple highlight tiles */
div.bg-purple-50.rounded-lg,
.p-3.bg-purple-50.rounded-lg {
    background: var(--premium-muted);
    border: 1px solid rgba(168, 85, 247, 0.15);
}

/* Orange highlight tiles */
div.bg-orange-50.rounded-lg,
.p-3.bg-orange-50.rounded-lg {
    background: rgba(245, 166, 35, 0.1);
    border: 1px solid rgba(245, 166, 35, 0.15);
}

/* Yellow backgrounds for warnings */
div.bg-yellow-50,
.bg-yellow-50 {
    background: var(--warn-muted);
}

.bg-yellow-50.text-yellow-700 {
    color: var(--warn);
}

/* Green callout/tip boxes */
div.bg-green-50.rounded-xl {
    background: var(--up-muted);
    border: 1px solid rgba(16, 185, 129, 0.1);
}

.text-green-900 { color: var(--up); }
.text-green-800 { color: #34d399; }

/* === Modals / Overlays === */
.bg-black.bg-opacity-50 {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

/* Modal card override */
.bg-black.bg-opacity-50 .bg-white {
    background: var(--slate);
    border: 1px solid rgba(255,255,255,0.08);
}

/* === Hero Section BG Gradient === */
.bg-gradient-to-br {
    background: linear-gradient(135deg, var(--charcoal) 0%, var(--slate) 50%, rgba(245, 166, 35, 0.08) 100%);
}

.from-green-600 { /* override with our gradient */ }
.to-green-800 { /* override with our gradient */ }

section.bg-gradient-to-br {
    background: linear-gradient(135deg, var(--charcoal) 0%, var(--slate) 40%, rgba(245, 166, 35, 0.06) 100%);
    position: relative;
    overflow: hidden;
}

/* Decorative line pattern — disabled */
section.bg-gradient-to-br::before {
    display: none;
}

/* Hero text color overrides */
.text-green-200 { color: var(--amber-200); }
.text-green-100 { color: var(--cloud); }
.text-green-700 { color: var(--midnight); }

a.text-green-600 {
    color: var(--amber-400);
}
a.text-green-600:hover {
    color: var(--amber-300);
}

/* === Breadcrumb / Nav === */
nav.text-sm a {
    color: var(--mist);
}
nav.text-sm a:hover {
    color: var(--amber-400);
}
nav.text-sm span.text-gray-700 {
    color: var(--fog);
}

/* === Flash messages === */
.bg-green-50.border-green-200 {
    background: var(--up-muted);
    border-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.bg-red-50.border-red-200 {
    background: var(--down-muted);
    border-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.bg-yellow-50.border-yellow-200 {
    background: var(--warn-muted);
    border-color: rgba(234, 179, 8, 0.2);
    color: #fbbf24;
}

/* === Dark CTA Section (already dark) === */
section.bg-gray-900 {
    background: var(--charcoal);
    border-top: 1px solid rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

/* === Pricing Cards === */
.border-2.border-green-500 {
    border-color: var(--amber-400);
    box-shadow: var(--shadow-glow);
}

.border-2.border-green-500 .absolute.bg-green-500 {
    background: linear-gradient(135deg, var(--amber-400), var(--amber-500));
    color: var(--midnight);
}

/* Ring around current plan */
.ring-2.ring-green-500 {
    box-shadow: 0 0 0 2px var(--amber-400), var(--shadow-glow);
}

/* === Feature icons (icon circles) === */
.w-16.h-16.rounded-full,
.w-12.h-12.rounded-lg {
    border: 1px solid rgba(255,255,255,0.06);
}

.w-16.h-16.bg-green-100 {
    background: var(--up-muted);
    border-color: rgba(16, 185, 129, 0.15);
}

.w-16.h-16.bg-blue-100 {
    background: var(--info-muted);
    border-color: rgba(59, 130, 246, 0.15);
}

.w-16.h-16.bg-purple-100 {
    background: var(--premium-muted);
    border-color: rgba(168, 85, 247, 0.15);
}

.w-12.h-12.bg-green-100 {
    background: var(--up-muted);
}

.w-12.h-12.bg-blue-100 {
    background: var(--info-muted);
}

.w-12.h-12.bg-purple-100 {
    background: var(--premium-muted);
}

/* Icon colors within feature circles */
.w-8.h-8.text-green-600,
.w-6.h-6.text-green-600 { color: var(--up); }
.w-8.h-8.text-blue-600,
.w-6.h-6.text-blue-600 { color: var(--info); }
.w-8.h-8.text-purple-600,
.w-6.h-6.text-purple-600 { color: var(--premium); }
.w-8.h-8.text-yellow-600 { color: var(--amber-400); }
.w-8.h-8.text-gray-600 { color: var(--mist); }

/* Rounded ticker pills */
a.rounded-full.bg-gray-100 {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--fog);
}
a.rounded-full.bg-gray-100:hover,
a.rounded-full:hover {
    background: rgba(245, 166, 35, 0.1);
    border-color: rgba(245, 166, 35, 0.2);
    color: var(--amber-400);
}

/* === Safety Score Circle === */
.w-24.h-24.rounded-full {
    border: 2px solid rgba(255,255,255,0.06);
}

.w-24.h-24.bg-green-50 { background: var(--up-muted); border-color: rgba(16, 185, 129, 0.2); }
.w-24.h-24.bg-blue-50 { background: var(--info-muted); border-color: rgba(59, 130, 246, 0.2); }
.w-24.h-24.bg-yellow-50 { background: var(--warn-muted); border-color: rgba(234, 179, 8, 0.2); }
.w-24.h-24.bg-red-50 { background: var(--down-muted); border-color: rgba(239, 68, 68, 0.2); }

/* Success circle (subscription success page) */
.w-20.h-20.bg-green-100.rounded-full {
    background: var(--up-muted);
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.w-10.h-10.text-green-600 { color: var(--up); }

/* === Chart Period Buttons === */
button.chart-range,
button.chart-period {
    background: rgba(255,255,255,0.05);
    color: var(--mist);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.625rem;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

button.chart-range:hover,
button.chart-period:hover {
    background: rgba(245, 166, 35, 0.1);
    color: var(--amber-400);
    border-color: rgba(245, 166, 35, 0.2);
}

button.chart-range.active,
button.chart-period.active {
    background: linear-gradient(135deg, var(--amber-400), var(--amber-500));
    color: var(--midnight);
    border-color: var(--amber-400);
}

/* === Delete Account Section === */
.border-red-200 {
    border-color: rgba(239, 68, 68, 0.2);
}

.bg-red-600 {
    background: var(--down);
}
.bg-red-600:hover,
.hover\:bg-red-700:hover {
    background: #dc2626;
}

/* Red buttons for danger */
button.bg-red-600,
a.bg-red-600 {
    background: var(--down);
    color: var(--white);
}

/* Red text buttons */
.text-red-500,
.text-red-600,
button.text-red-500,
a.text-red-600 {
    color: var(--down);
}

.border-red-300.text-red-600 {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--down);
}

/* === Hover/highlight feedback === */
.hover\:bg-green-100:hover,
a:hover .hover\:bg-green-100 {
    background: rgba(245, 166, 35, 0.08);
}

/* Action link cards */
a.bg-white.rounded-xl.shadow-md {
    transition: all 0.2s ease;
}
a.bg-white.rounded-xl.shadow-md:hover {
    border-color: rgba(245, 166, 35, 0.15);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(245, 166, 35, 0.05);
}

/* Quick action tiles (dashboard) */
a.bg-gray-50.rounded-lg,
a[class*="bg-gray-50"][class*="rounded-lg"] {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.2s ease;
}
a.bg-gray-50.rounded-lg:hover,
a[class*="bg-gray-50"][class*="rounded-lg"]:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
}

/* Analysis tool sidebar links */
a.block.p-3.bg-gray-50.rounded-lg:hover {
    background: rgba(245, 166, 35, 0.06);
    border-color: rgba(245, 166, 35, 0.12);
}

/* Small stock cards in screener */
a.bg-white.rounded-lg.shadow {
    background: var(--charcoal);
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: var(--shadow-sm);
}
a.bg-white.rounded-lg.shadow:hover {
    border-color: rgba(245, 166, 35, 0.12);
    box-shadow: var(--shadow-md);
}

/* Feature comparison table */
.bg-green-50 td {
    background: rgba(245, 166, 35, 0.04);
}

th.bg-green-50 {
    background: rgba(245, 166, 35, 0.06);
}

td.bg-green-50 {
    background: rgba(245, 166, 35, 0.04);
}

/* Sensitivity table base highlight */
.bg-yellow-50 td,
td.bg-yellow-50 {
    background: rgba(245, 166, 35, 0.08);
}

/* === Scrollbar (WebKit) === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--midnight);
}
::-webkit-scrollbar-thumb {
    background: var(--steel);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--mist);
}

/* === HR === */
hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin: 0.5rem 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 640px) {
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
    .sm\:flex-row { flex-direction: row; }
}

@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:inline-flex { display: inline-flex; }
    .md\:hidden { display: none; }
    .md\:block { display: block; }
    .md\:ml-8 { margin-left: 2rem; }
    .md\:mt-0 { margin-top: 0; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:col-span-2 { grid-column: span 2 / span 2; }
    .md\:flex-row { flex-direction: row; }
    .md\:items-start { align-items: flex-start; }
    .md\:items-end { align-items: flex-end; }
    .md\:text-5xl { font-size: 3rem; line-height: 1.1; }
}

@media (min-width: 1024px) {
    .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

/* Fade in */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* Staggered entrance */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.slide-up {
    animation: slideUp 0.5s ease-out forwards;
    opacity: 0;
}
.slide-up:nth-child(1) { animation-delay: 0.05s; }
.slide-up:nth-child(2) { animation-delay: 0.1s; }
.slide-up:nth-child(3) { animation-delay: 0.15s; }
.slide-up:nth-child(4) { animation-delay: 0.2s; }
.slide-up:nth-child(5) { animation-delay: 0.25s; }
.slide-up:nth-child(6) { animation-delay: 0.3s; }

/* Pulse glow for important numbers */
@keyframes pulseGlow {
    0%, 100% { text-shadow: 0 0 10px rgba(245, 166, 35, 0.1); }
    50% { text-shadow: 0 0 20px rgba(245, 166, 35, 0.25); }
}
.glow {
    animation: none;
}

/* Loading spinner */
.spinner {
    border: 2px solid rgba(255,255,255,0.1);
    border-top: 2px solid var(--amber-400);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === Toast notifications === */
.toast {
    background: var(--slate);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--white);
    box-shadow: var(--shadow-lg);
}

.toast-success { border-left: 3px solid var(--up); }
.toast-error { border-left: 3px solid var(--down); }
.toast-warning { border-left: 3px solid var(--warn); }
.toast-info { border-left: 3px solid var(--info); }

/* === Search Dropdown === */
.search-dropdown {
    background: var(--slate);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: var(--shadow-lg);
}

.search-dropdown a:hover {
    background: rgba(255,255,255,0.04);
}

.search-dropdown .border-gray-100 {
    border-color: rgba(255,255,255,0.04);
}

/* === Auth layout body override === */
body.auth-page {
    background: linear-gradient(135deg, var(--midnight) 0%, var(--charcoal) 50%, rgba(245, 166, 35, 0.03) 100%);
}

/* === Pricing comparison table checkmarks === */
td.text-green-600 {
    color: var(--up);
}

/* === "Popular" badge on pricing === */
span.bg-green-500.text-white {
    background: linear-gradient(135deg, var(--amber-400), var(--amber-500));
    color: var(--midnight);
    font-weight: 700;
}

/* === FAQ cards === */
.bg-white.rounded-lg.shadow.p-6 {
    background: var(--charcoal);
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: var(--shadow-sm);
}

/* === Watchlist action buttons === */
.remove-btn,
.delete-calc {
    color: var(--down);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}
.remove-btn:hover,
.delete-calc:hover {
    opacity: 1;
}

/* === Disabled state === */
button:disabled,
button[disabled] {
    background: rgba(255,255,255,0.05);
    color: var(--steel);
    cursor: not-allowed;
    box-shadow: none;
    border-color: transparent;
}

/* === Dark divider line (OAuth) === */
.border-t.border-gray-200 {
    border-color: rgba(255,255,255,0.06);
}

/* Divider text bg */
span.bg-white.text-gray-500 {
    background: var(--charcoal);
    color: var(--mist);
}

/* === OAuth buttons === */
a.border.border-gray-300.rounded-lg {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.1);
    color: var(--fog);
}
a.border.border-gray-300.rounded-lg:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.15);
}

/* === Margin of safety results === */
.bg-green-50.text-green-700 {
    background: var(--up-muted);
    color: var(--up);
}
.bg-yellow-50.text-yellow-700 {
    background: var(--warn-muted);
    color: var(--warn);
}
.bg-red-50.text-red-700 {
    background: var(--down-muted);
    color: var(--down);
}
.bg-orange-50.text-orange-700 {
    background: rgba(245, 166, 35, 0.1);
    color: var(--amber-400);
}
.bg-green-100.text-green-800 {
    background: var(--up-muted);
    color: var(--up);
}

/* === Chart.js canvas styling === */
/* Note: CSS filter on canvas interferes with Chart.js ResizeObserver dimension
   calculation, causing 0-size renders. Use box-shadow on the container instead. */

/* === Misc overrides === */
.text-center.py-8.text-gray-400 {
    color: var(--steel);
}

/* SVG icon color pass-through */
svg.text-gray-300,
svg.text-gray-400 { color: var(--steel); }
svg.text-green-500 { color: var(--up); }
svg.text-green-600 { color: var(--up); }
svg.text-blue-600 { color: var(--info); }
svg.text-red-600 { color: var(--down); }
svg.w-5.h-5.text-green-500 { color: var(--up); }

/* Check marks in feature lists */
.flex.items-center svg.text-green-500 {
    color: var(--amber-400);
}

/* X marks in feature lists */
svg.w-4.h-4:not(.text-green-500) {
    color: var(--steel);
}

/* === Footer === */
.site-footer {
    background: #080c16;
    border-top: 1px solid rgba(245,166,35,0.08);
    color: #64748b;
}
.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2.5rem;
}
.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    margin-bottom: 1.25rem;
}
.footer-tagline {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #64748b;
    max-width: 360px;
}
.footer-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: #64748b;
}
.footer-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulseGlow 2s ease-in-out infinite;
}
.footer-col-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94a3b8;
    margin-bottom: 1rem;
}
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.footer-links a {
    font-size: 0.875rem;
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s;
}
.footer-links a:hover {
    color: #f5a623;
}
.footer-bottom {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}
.footer-bottom p:first-child {
    color: #475569;
}
.footer-bottom p:last-child {
    color: #334155;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    .footer-brand {
        grid-column: 1 / -1;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}
@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* === Nav override === */
nav.bg-white {
    background: rgba(11, 15, 26, 0.85);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

nav .text-green-600,
nav .text-2xl.font-bold.text-green-600 {
    color: var(--amber-400);
}

nav a.text-gray-700 {
    color: var(--cloud);
}

nav a.text-gray-700:hover,
nav a:hover {
    color: var(--amber-400);
}

nav .border-b-2.hover\:border-green-600:hover {
    border-color: var(--amber-400);
}

nav .hover\:text-green-600:hover {
    color: var(--amber-400);
}

nav .bg-green-600 {
    background: linear-gradient(135deg, var(--amber-400), var(--amber-500));
    color: var(--midnight);
}

nav .bg-green-100 {
    background: rgba(245, 166, 35, 0.12);
}
nav .text-green-600.font-semibold {
    color: var(--amber-400);
}

/* Mobile menu */
#mobile-menu {
    background: var(--charcoal);
    border-top: 1px solid rgba(255,255,255,0.06);
}

#mobile-menu a {
    color: var(--fog);
}

#mobile-menu a:hover {
    background: rgba(255,255,255,0.04);
    color: var(--amber-400);
}

/* User dropdown menu */
nav .bg-white.rounded-lg.shadow-lg {
    background: var(--slate);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: var(--shadow-lg);
}

nav .bg-white.rounded-lg.shadow-lg a {
    color: var(--fog);
}

nav .bg-white.rounded-lg.shadow-lg a:hover {
    background: rgba(255,255,255,0.04);
    color: var(--white);
}

nav .bg-white.rounded-lg.shadow-lg a.text-red-600 {
    color: var(--down);
}

/* Search bar in nav */
nav input[type="text"] {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.08);
    color: var(--white);
}

nav input[type="text"]:focus {
    background: rgba(255,255,255,0.08);
    border-color: var(--amber-400);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

nav input[type="text"]::placeholder {
    color: var(--steel);
}

/* Nav link hover */
.nav-link {
    position: relative;
    transition: color 0.2s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--amber-400);
    transition: width 0.3s ease, left 0.3s ease;
}
.nav-link:hover::after {
    width: 100%;
    left: 0;
}

/* Tier badges */
.tier-badge {
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 4px;
}
.tier-free {
    background: rgba(100, 116, 139, 0.15);
    color: var(--mist);
    border: 1px solid rgba(100, 116, 139, 0.2);
}
.tier-starter {
    background: rgba(59, 130, 246, 0.12);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.2);
}
.tier-pro {
    background: linear-gradient(135deg, rgba(245, 166, 35, 0.15), rgba(168, 85, 247, 0.1));
    color: var(--amber-400);
    border: 1px solid rgba(245, 166, 35, 0.25);
}
.tier-elite {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(139, 92, 246, 0.12));
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

/* User avatar circle */
.w-8.h-8.bg-green-100.rounded-full {
    background: rgba(245, 166, 35, 0.15);
}
.w-8.h-8.bg-green-100.rounded-full .text-green-600 {
    color: var(--amber-400);
}

/* === Watchlist button on stock page === */
button.border-green-600.text-green-600.bg-green-50 {
    border-color: var(--amber-400);
    color: var(--amber-400);
    background: rgba(245, 166, 35, 0.08);
}

/* === Auth page link overrides === */
a.text-green-600.font-medium {
    color: var(--amber-400);
}

a.text-green-600.font-medium:hover {
    color: var(--amber-300);
}

/* Terms/privacy links on register */
a.text-green-600.hover\:underline {
    color: var(--amber-400);
}

/* === Export CSV button === */
a.border-gray-300.rounded-lg.text-sm {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.1);
    color: var(--fog);
}

a.border-gray-300.rounded-lg.text-sm:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.15);
}

/* === Stripe billing button === */
a.bg-green-600.text-white.rounded-lg {
    background: linear-gradient(135deg, var(--amber-400), var(--amber-500));
    color: var(--midnight);
}

/* === Subscription cancel button === */
.border-red-300.text-red-600 {
    border-color: rgba(239, 68, 68, 0.3);
}

.border-red-300.text-red-600:hover,
.hover\:bg-red-50:hover {
    background: rgba(239, 68, 68, 0.08);
}

/* Cancelling badge */
.bg-yellow-100.text-yellow-700 {
    background: var(--warn-muted);
    color: var(--warn);
}

/* === Connected accounts === */
.bg-gray-50.rounded-lg .text-gray-700 {
    color: var(--fog);
}

/* === Mega-Menu Navigation === */

/* Desktop nav link */
.mega-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--cloud);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.mega-nav-link:hover {
    color: var(--amber-400, #f5a623);
    border-bottom-color: var(--amber-400, #f5a623);
}

/* Chevron on trigger items */
.mega-nav-chevron {
    transition: transform 0.25s ease;
    opacity: 0.6;
}
.mega-nav-trigger:hover .mega-nav-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* Trigger container */
.mega-nav-trigger {
    position: relative;
}

/* Mega-panel dropdown */
.mega-panel {
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    top: 100%;
    min-width: 200px;
    width: max-content;
    background: rgba(18, 24, 38, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(245, 166, 35, 0.1);
    border-radius: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 100;
    margin-top: 4px;
}

/* Invisible bridge to prevent hover gap */
.mega-panel::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

/* Show on hover */
.mega-nav-trigger:hover .mega-panel {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Inner grid — column count set via inline style */
.mega-panel-inner {
    display: grid;
    gap: 1.5rem;
    padding: 0.5rem 1.25rem;
}

/* Column container — groups in the same column stack vertically */
.mega-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Group */
.mega-group { }

.mega-group-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
a.mega-group-title-link {
    text-decoration: none;
    color: #fff;
    transition: color 0.2s;
}
a.mega-group-title-link:hover {
    color: var(--amber-400, #f5a623);
}
.mega-group-arrow {
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    transform: translateX(-4px);
    font-size: 1rem;
}
a.mega-group-title-link:hover .mega-group-arrow {
    opacity: 1;
    transform: translateX(0);
}

.mega-group-desc {
    font-size: 0.75rem;
    color: var(--mist, #94a3b8);
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

/* Link list */
.mega-link-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.mega-link-list li { margin: 0; }

.mega-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0;
    font-size: 0.825rem;
    color: var(--cloud, #cbd5e1);
    text-decoration: none;
    transition: color 0.15s, transform 0.15s;
}
.mega-link:hover {
    color: var(--amber-400, #f5a623);
    transform: translateX(4px);
}
.mega-link-arrow {
    color: var(--steel, #475569);
    font-size: 1rem;
    line-height: 1;
    transition: color 0.15s;
}
.mega-link:hover .mega-link-arrow {
    color: var(--amber-400, #f5a623);
}

/* Nav lock icon for tier-gated items */
.nav-lock-icon {
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
    opacity: 0.45;
    flex-shrink: 0;
}
.nav-locked-link {
    opacity: 0.65;
}
.nav-locked-link:hover {
    color: var(--cloud, #cbd5e1);
    opacity: 0.85;
}

/* === Mobile Mega-Menu Accordion === */

.mobile-mega-item { }

.mobile-mega-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--fog, #e2e8f0);
    background: none;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    text-align: left;
}
.mobile-mega-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
}

.mobile-mega-chevron {
    transition: transform 0.25s ease;
    opacity: 0.5;
}
.mobile-mega-item.open .mobile-mega-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

.mobile-mega-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 0.5rem;
}
.mobile-mega-item.open .mobile-mega-content {
    max-height: 500px;
}

.mobile-mega-group-title {
    display: block;
    padding: 0.35rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--steel, #475569);
    text-decoration: none;
}
a.mobile-mega-group-title:hover {
    color: var(--amber-400, #f5a623);
}

/* === Responsive Mega-Menu === */
@media (max-width: 767px) {
    .mega-panel {
        display: none !important;
    }
}

/* === Graph/Chart dark mode support === */
/* Chart.js will pick up colors from JS - these are cosmetic overlays */

/* ============================================================
   Dividend Calendar Grid
   ============================================================ */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.calendar-day-header {
    padding: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mist, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f8fafc;
}
.calendar-day {
    min-height: 80px;
    padding: 0.5rem;
    border: 1px solid #f1f5f9;
    position: relative;
    cursor: pointer;
    transition: background-color 0.15s;
}
.calendar-day:hover {
    background-color: #f8fafc;
}
.calendar-day-empty {
    background: #fafbfc;
    cursor: default;
}
.calendar-day-empty:hover {
    background: #fafbfc;
}
.calendar-day-today {
    background-color: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.2);
}
.calendar-day-has-events {
    background-color: rgba(245, 166, 35, 0.03);
}
.calendar-day-number {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}
.calendar-day-number-today {
    background: #10b981;
    color: white;
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}
.calendar-event-dots {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}
.calendar-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 600;
    min-width: 1.2rem;
    height: 1.2rem;
    border-radius: 0.75rem;
    padding: 0 0.25rem;
    color: white;
}
.calendar-dot-ex {
    background-color: #10b981;
}
.calendar-dot-pay {
    background-color: #3b82f6;
}

/* Calendar responsive */
@media (max-width: 640px) {
    .calendar-day {
        min-height: 50px;
        padding: 0.25rem;
    }
    .calendar-day-header {
        padding: 0.25rem;
        font-size: 0.65rem;
    }
    .calendar-day-number {
        font-size: 0.7rem;
    }
    .calendar-dot {
        font-size: 0.5rem;
        min-width: 1rem;
        height: 1rem;
    }
}

/* =============================================
   TRIAL BANNER
   ============================================= */

.trial-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    color: #fff;
    z-index: 40;
}

.trial-banner-green {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.08));
    border-bottom: 1px solid rgba(16, 185, 129, 0.25);
    color: #10b981;
}

.trial-banner-yellow {
    background: linear-gradient(90deg, rgba(245, 166, 35, 0.15), rgba(245, 166, 35, 0.08));
    border-bottom: 1px solid rgba(245, 166, 35, 0.25);
    color: #f5a623;
}

.trial-banner-red {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.08));
    border-bottom: 1px solid rgba(239, 68, 68, 0.25);
    color: #ef4444;
}

.trial-banner-btn {
    display: inline-block;
    padding: 0.25rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.trial-banner-btn:hover {
    opacity: 0.85;
}

.trial-banner-green .trial-banner-btn {
    background: #10b981;
    color: #0b0f1a;
}

.trial-banner-yellow .trial-banner-btn {
    background: #f5a623;
    color: #0b0f1a;
}

.trial-banner-red .trial-banner-btn {
    background: #ef4444;
    color: #fff;
}

@media (max-width: 640px) {
    .trial-banner {
        flex-direction: column;
        gap: 0.4rem;
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
}

/* =============================================
   NOTIFICATION BELL & DROPDOWN
   ============================================= */

#notif-dropdown {
    animation: notifSlideIn 0.15s ease-out;
}

@keyframes notifSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

#notif-list a {
    transition: background-color 0.1s;
}

#notif-badge {
    animation: notifPulse 0.3s ease-out;
}

@keyframes notifPulse {
    0% { transform: scale(0.5); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* =====================================================
   Social & Community Features
   ===================================================== */

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    transition: all 0.15s ease;
    cursor: pointer;
    text-decoration: none;
}

.share-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.share-btn-twitter:hover { color: #1da1f2; border-color: #1da1f2; background: #f0f9ff; }
.share-btn-linkedin:hover { color: #0077b5; border-color: #0077b5; background: #f0f7ff; }
.share-btn-facebook:hover { color: #1877f2; border-color: #1877f2; background: #f0f5ff; }
.share-btn-copy:hover { color: #10b981; border-color: #10b981; background: #f0fdf4; }
.share-btn-copy.copied { color: #10b981; border-color: #10b981; background: #ecfdf5; }

/* Rating Buttons */
.rating-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #6b7280;
}

.rating-btn:hover { background: #f9fafb; }

.rating-btn-bullish.active {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #16a34a;
}

.rating-btn-neutral.active {
    background: #fefce8;
    border-color: #eab308;
    color: #ca8a04;
}

.rating-btn-bearish.active {
    background: #fef2f2;
    border-color: #ef4444;
    color: #dc2626;
}

/* Rating Bar */
.rating-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: #f3f4f6;
}

.rating-bar-bullish { background: #22c55e; transition: width 0.3s ease; }
.rating-bar-neutral { background: #eab308; transition: width 0.3s ease; }
.rating-bar-bearish { background: #ef4444; transition: width 0.3s ease; }

/* Comment Items */
.comment-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.comment-item:last-child { border-bottom: none; }

.comment-reply {
    margin-left: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid #e5e7eb;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.comment-author {
    font-weight: 600;
    font-size: 0.875rem;
    color: #111827;
}

.comment-time {
    font-size: 0.75rem;
    color: #9ca3af;
}

.comment-delete-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 0.25rem;
}

.comment-delete-btn:hover { color: #ef4444; }

.comment-body {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.375rem;
}

.comment-vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.comment-vote-btn:hover { background: #f3f4f6; }
.comment-vote-btn.vote-up.active { color: #22c55e; }
.comment-vote-btn.vote-down.active { color: #ef4444; }

.comment-reply-toggle {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
}

.comment-reply-toggle:hover { background: #f3f4f6; color: #374151; }

.comment-reply-form {
    margin-top: 0.5rem;
    margin-left: 1.5rem;
}

.comment-reply-form.hidden { display: none; }

.comment-char-counter {
    position: absolute;
    bottom: 0.5rem;
    right: 0.75rem;
    font-size: 0.75rem;
    color: #9ca3af;
    pointer-events: none;
}

/* Follow Button */
.follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #374151;
}

.follow-btn:hover { background: #f9fafb; border-color: #d1d5db; }

.follow-btn.following {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #16a34a;
}

/* ============================================================
   ETF & Index Pages
   ============================================================ */

/* ETF Badge */
.etf-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f3e8ff;
    color: #7c3aed;
}

.index-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #dbeafe;
    color: #2563eb;
}

/* ETF Metrics Card */
.etf-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.etf-metric-item {
    padding: 0.75rem;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
}

.etf-metric-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.etf-metric-value {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.etf-metric-value.highlight {
    color: #7c3aed;
}

/* Performance Returns Table */
.etf-returns-table td {
    padding: 0.5rem 0.75rem;
}

.etf-return-positive { color: #059669; font-weight: 600; }
.etf-return-negative { color: #dc2626; font-weight: 600; }
.etf-return-neutral { color: #6b7280; }

/* Holdings Weight Bar */
.holding-weight-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.holding-weight-bar-track {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #f3f4f6;
    overflow: hidden;
}

.holding-weight-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
    transition: width 0.3s ease;
}

.holding-weight-pct {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    min-width: 48px;
    text-align: right;
}

/* Sector Doughnut Chart Container */
.etf-sector-chart-wrap {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.etf-sector-chart-wrap canvas {
    max-width: 220px;
    max-height: 220px;
}

.etf-sector-legend {
    flex: 1;
    min-width: 200px;
}

.etf-sector-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.875rem;
}

.etf-sector-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.etf-sector-legend-label {
    color: #374151;
    flex: 1;
}

.etf-sector-legend-pct {
    font-weight: 600;
    color: #111827;
}

/* Overlap Matrix */
.overlap-matrix {
    border-collapse: separate;
    border-spacing: 2px;
}

.overlap-matrix th,
.overlap-matrix td {
    padding: 0.5rem 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    border-radius: 4px;
}

.overlap-matrix th {
    font-weight: 600;
    color: #374151;
}

.overlap-low { background: #dcfce7; color: #166534; }
.overlap-moderate { background: #fef9c3; color: #854d0e; }
.overlap-high { background: #fee2e2; color: #991b1b; }
.overlap-self { background: #f3f4f6; color: #9ca3af; }

/* ETF Screener Filter Panel */
.etf-filter-panel {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.etf-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
}

/* ETF Preset Buttons */
.etf-preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
}

.etf-preset-btn:hover {
    background: #f3e8ff;
    border-color: #c4b5fd;
    color: #7c3aed;
}

.etf-preset-btn.active {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
}

/* Index Constituents Table */
.index-constituents-table {
    width: 100%;
}

.index-constituents-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e5e7eb;
}

.index-constituents-table td {
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    border-bottom: 1px solid #f3f4f6;
}

.index-constituents-table tr:hover td {
    background: #f9fafb;
}

/* Tier Gate Overlay (ETF holdings) */
.etf-tier-gate {
    position: relative;
}

.etf-tier-gate-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(transparent, white 70%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 1.5rem;
}

.etf-tier-gate-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.etf-tier-gate-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

/* ========================================
   Breadcrumbs
   ======================================== */
.breadcrumb-nav {
    margin-bottom: 0.25rem;
}
.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0;
    font-size: 0.8125rem;
}
.breadcrumb-list li {
    display: flex;
    align-items: center;
}
.breadcrumb-list a {
    color: var(--mist);
    text-decoration: none;
    transition: color 0.15s ease;
}
.breadcrumb-list a:hover {
    color: var(--amber-400);
}
.breadcrumb-sep {
    margin: 0 0.5rem;
    color: var(--steel);
    font-size: 0.75rem;
}
.breadcrumb-current {
    color: var(--fog);
    font-weight: 500;
}

/* ========================================
   Tooltips (Contextual Help)
   ======================================== */
.tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 15px;
    height: 15px;
    margin-left: 4px;
    border-radius: 50%;
    background: var(--steel);
    color: var(--fog);
    font-size: 9px;
    font-weight: 700;
    font-style: italic;
    cursor: help;
    vertical-align: middle;
    flex-shrink: 0;
}
.tip::before {
    content: 'i';
}
.tip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--iron);
    color: var(--fog);
    font-size: 0.75rem;
    font-weight: 400;
    font-style: normal;
    line-height: 1.5;
    white-space: normal;
    max-width: 260px;
    min-width: 160px;
    border-radius: var(--radius-md);
    border: 1px solid var(--steel);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 100;
    text-align: left;
}
.tip:hover::after,
.tip:focus::after {
    opacity: 1;
    visibility: visible;
}
.tip:focus {
    outline: 2px solid var(--amber-400);
    outline-offset: 2px;
}
.tip-bottom::after {
    bottom: auto;
    top: calc(100% + 8px);
}
.tip-glossary-link {
    font-size: 0.65rem;
    color: var(--amber-400);
    text-decoration: none;
    opacity: 0.6;
    vertical-align: super;
    margin-left: 1px;
}
.tip-glossary-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ========================================
   Empty States
   ======================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    text-align: center;
}
.empty-state-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 1rem;
    color: var(--steel);
}
.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--fog);
    margin-bottom: 0.5rem;
}
.empty-state-message {
    font-size: 0.875rem;
    color: var(--mist);
    max-width: 320px;
    line-height: 1.6;
    margin-bottom: 1rem;
}
.empty-state-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: var(--amber-400);
    color: var(--midnight);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background 0.15s ease;
}
.empty-state-cta:hover {
    background: var(--amber-500);
}

/* Skeleton Loading */
@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, var(--iron) 25%, var(--steel) 50%, var(--iron) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 4px;
}
.skeleton-text:last-child {
    width: 60%;
}
.skeleton-circle {
    border-radius: 50%;
}
.skeleton-card {
    height: 120px;
    border-radius: var(--radius-lg);
}
.skeleton-row {
    height: 44px;
    margin-bottom: 4px;
    border-radius: var(--radius-sm);
}

/* ========================================
   Keyboard Shortcut Keys
   ======================================== */
kbd.shortcut-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: var(--iron);
    border: 1px solid var(--steel);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--fog);
    line-height: 1;
}

/* Shortcuts Modal */
.shortcuts-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}
.shortcuts-modal {
    background: var(--charcoal);
    border: 1px solid var(--steel);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}
.shortcuts-modal h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ivory);
    margin-bottom: 1rem;
}
.shortcuts-modal h4 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--mist);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1rem 0 0.5rem;
}
.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0;
}
.shortcut-row span {
    color: var(--fog);
    font-size: 0.875rem;
}
.shortcut-keys {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========================================
   Theme Toggle
   ======================================== */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--mist);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease;
}
.theme-toggle:hover {
    color: var(--amber-400);
}
.theme-toggle svg {
    width: 18px;
    height: 18px;
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ========================================
   Onboarding Checklist
   ======================================== */
.onboarding-card {
    background: linear-gradient(135deg, rgba(245,166,35,0.08), rgba(245,166,35,0.02));
    border: 1px solid rgba(245,166,35,0.15);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.onboarding-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.onboarding-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ivory);
}
.onboarding-skip {
    background: none;
    border: none;
    color: var(--mist);
    font-size: 0.8125rem;
    cursor: pointer;
    text-decoration: underline;
}
.onboarding-skip:hover {
    color: var(--fog);
}
.onboarding-progress {
    width: 100%;
    height: 6px;
    background: var(--iron);
    border-radius: 3px;
    margin-bottom: 1rem;
    overflow: hidden;
}
.onboarding-progress-bar {
    height: 100%;
    background: var(--amber-400);
    border-radius: 3px;
    transition: width 0.3s ease;
}
.onboarding-steps {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}
.onboarding-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--mist);
    text-decoration: none;
    transition: background 0.15s ease;
}
.onboarding-step:hover {
    background: rgba(255,255,255,0.04);
}
.onboarding-step.completed {
    color: var(--up);
}
.onboarding-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--steel);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.onboarding-step.completed .onboarding-check {
    background: var(--up);
    border-color: var(--up);
}

/* ========================================
   Infinite Scroll Sentinel
   ======================================== */
.scroll-sentinel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.scroll-sentinel.loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid var(--steel);
    border-top-color: var(--amber-400);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Recently Viewed Widget
   ======================================== */
.recently-viewed-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.recently-viewed-item:last-child {
    border-bottom: none;
}

/* ========================================
   Light Theme Overrides
   ======================================== */
[data-theme="light"] {
    --midnight: #f8fafc;
    --charcoal: #ffffff;
    --slate: #f1f5f9;
    --iron: #e2e8f0;
    --steel: #cbd5e1;
    --mist: #64748b;
    --cloud: #475569;
    --fog: #334155;
    --ivory: #1e293b;
    --snow: #0f172a;
    --white: #0f172a;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-xl: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 12px rgba(245,166,35,0.08);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
}

[data-theme="light"] html,
[data-theme="light"] body {
    background-color: #f8fafc;
}

[data-theme="light"] nav.sticky {
    background: #ffffff;
    border-color: #e2e8f0;
}

[data-theme="light"] .bg-white {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

[data-theme="light"] .text-gray-900,
[data-theme="light"] .text-gray-800 {
    color: #1e293b;
}

[data-theme="light"] .text-gray-700 {
    color: #334155;
}

[data-theme="light"] .text-gray-600 {
    color: #475569;
}

[data-theme="light"] .text-gray-500 {
    color: #64748b;
}

[data-theme="light"] .text-gray-400 {
    color: #94a3b8;
}

[data-theme="light"] .text-gray-300 {
    color: #cbd5e1;
}

[data-theme="light"] .border-gray-200,
[data-theme="light"] .border-gray-100 {
    border-color: #e2e8f0;
}

[data-theme="light"] .bg-gray-50 {
    background: #f1f5f9;
}

[data-theme="light"] .bg-gray-100 {
    background: #e2e8f0;
}

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1e293b;
}

[data-theme="light"] input::placeholder {
    color: #94a3b8;
}

[data-theme="light"] .search-dropdown {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

[data-theme="light"] .search-dropdown a {
    border-color: #f1f5f9;
}

[data-theme="light"] .search-dropdown a:hover {
    background: #f1f5f9;
}

[data-theme="light"] .mega-panel {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .mega-group-title {
    color: #1e293b;
}
[data-theme="light"] .mega-link {
    color: #334155;
}
[data-theme="light"] .mega-link:hover {
    color: #f5a623;
}
[data-theme="light"] .mega-link-arrow {
    color: #94a3b8;
}
[data-theme="light"] .mega-link:hover .mega-link-arrow {
    color: #f5a623;
}
[data-theme="light"] .nav-locked-link {
    opacity: 0.55;
}
[data-theme="light"] .nav-locked-link:hover {
    color: #475569;
}
[data-theme="light"] .mobile-mega-toggle {
    color: #1e293b;
}
[data-theme="light"] .mobile-mega-toggle:hover {
    background: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .mobile-mega-group-title {
    color: #64748b;
}

[data-theme="light"] .toast {
    border-color: #e2e8f0;
}

[data-theme="light"] .toast-info {
    background: #eff6ff;
    color: #1e40af;
}

[data-theme="light"] .toast-success {
    background: #f0fdf4;
    color: #166534;
}

[data-theme="light"] .toast-error {
    background: #fef2f2;
    color: #991b1b;
}

[data-theme="light"] .toast-warning {
    background: #fffbeb;
    color: #92400e;
}

[data-theme="light"] .tip::after {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="light"] .skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

[data-theme="light"] .shortcuts-modal {
    background: #ffffff;
    border-color: #e2e8f0;
}

[data-theme="light"] kbd.shortcut-key {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

[data-theme="light"] .site-footer {
    background: #ffffff;
    border-top-color: #e2e8f0;
}
[data-theme="light"] .footer-tagline,
[data-theme="light"] .footer-status,
[data-theme="light"] .footer-links a {
    color: #64748b;
}
[data-theme="light"] .footer-links a:hover {
    color: #f5a623;
}
[data-theme="light"] .footer-col-title {
    color: #475569;
}
[data-theme="light"] .footer-bottom {
    border-top-color: #e2e8f0;
}
[data-theme="light"] .footer-bottom p:first-child {
    color: #64748b;
}
[data-theme="light"] .footer-bottom p:last-child {
    color: #94a3b8;
}

[data-theme="light"] .onboarding-card {
    background: linear-gradient(135deg, rgba(245,166,35,0.06), rgba(245,166,35,0.02));
    border-color: rgba(245,166,35,0.2);
}

[data-theme="light"] #notif-dropdown {
    background: #ffffff;
    border-color: #e2e8f0;
}

/* ========================================
   Financial Data Expansion (Enhancement #9)
   ======================================== */

/* Analyst rating bar */
.analyst-rating-bar {
    display: flex;
    border-radius: 9999px;
    overflow: hidden;
    height: 1.25rem;
}

/* News feed items */
.news-feed-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: background-color 0.15s;
    border: 1px solid var(--border, #e2e8f0);
}
.news-feed-item:hover {
    background-color: var(--bg-hover, #f9fafb);
}
.news-feed-item .news-thumb {
    flex-shrink: 0;
    width: 4rem;
    height: 4rem;
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--bg-muted, #f3f4f6);
}
.news-feed-item .news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* line-clamp utility (for news titles) */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Sector cards */
.sector-card {
    transition: transform 0.15s, box-shadow 0.15s;
}
.sector-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

/* Economic calendar */
.econ-cal-day {
    transition: background-color 0.15s;
    cursor: pointer;
}
.econ-cal-day:hover {
    background-color: #f0fdf4;
}

/* Dark mode adjustments for new sections */
[data-theme="dark"] .news-feed-item {
    border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .news-feed-item:hover {
    background-color: rgba(255,255,255,0.05);
}
[data-theme="dark"] .econ-cal-day:hover {
    background-color: rgba(16,185,129,0.1);
}

/* === Impersonation Banner === */
.impersonation-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #f5a623;
    color: #1a1a2e;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.impersonation-banner ~ * {
    margin-top: 40px;
}

/* ===== Cookie Consent Banner ===== */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(15, 15, 35, 0.97);
    border-top: 1px solid rgba(245, 166, 35, 0.2);
    padding: 1rem 1.5rem;
    backdrop-filter: blur(12px);
}
.cookie-consent-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.cookie-consent-text {
    color: #cbd5e1;
    font-size: 0.875rem;
    line-height: 1.5;
    flex: 1;
    min-width: 280px;
}
.cookie-consent-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}
.cookie-consent-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
}
.cookie-consent-btn:hover { transform: translateY(-1px); }
.cookie-consent-btn-essential {
    background: rgba(255,255,255,0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255,255,255,0.15);
}
.cookie-consent-btn-essential:hover {
    background: rgba(255,255,255,0.15);
}
.cookie-consent-btn-accept {
    background: #f5a623;
    color: #1a1a2e;
}
.cookie-consent-btn-accept:hover {
    background: #e09500;
}

/* ==========================================================================
   14.3 WCAG Accessibility
   ========================================================================== */

/* Skip-to-content link */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 10000;
}
.skip-to-content:focus {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    padding: 12px 24px;
    background: var(--amber-400, #f5a623);
    color: var(--charcoal, #1a1a2e);
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 10000;
    text-decoration: none;
}

/* Focus-visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--amber-400, #f5a623);
    outline-offset: 2px;
}
*:focus:not(:focus-visible) {
    outline: none;
}

/* Improved touch targets for mobile */
@media (max-width: 768px) {
    input, select, textarea, button, .btn {
        min-height: 44px;
    }
}

/* ==========================================================================
   14.2 Mobile-Optimized Calculators
   ========================================================================== */

/* Calculator tab bar (mobile) */
.calculator-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding: 0 4px 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.calculator-tabs::-webkit-scrollbar { display: none; }
.calc-tab {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    background: var(--slate, #1e293b);
    color: var(--fog, #94a3b8);
    border: 1px solid var(--fog-border, rgba(255,255,255,0.08));
    transition: background 0.2s, color 0.2s;
}
.calc-tab:hover, .calc-tab:focus {
    background: rgba(245,166,35,0.1);
    color: var(--amber-400, #f5a623);
}
.calc-tab.active {
    background: var(--amber-400, #f5a623);
    color: var(--charcoal, #1a1a2e);
    border-color: var(--amber-400, #f5a623);
}

@media (max-width: 640px) {
    /* Mobile calculator improvements */
    .calculator-form input,
    .calculator-form select {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 12px 16px;
        min-height: 48px;
    }
    .calculator-form label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    .calculator-form button[type="submit"],
    .calculator-form .calc-submit-btn {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
        min-height: 52px;
    }
    /* Bottom-sheet style results on mobile */
    .calculator-results {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--slate, #1e293b);
        border-top: 2px solid var(--amber-400, #f5a623);
        border-radius: 16px 16px 0 0;
        padding: 20px;
        max-height: 60vh;
        overflow-y: auto;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        z-index: 100;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    }
    .calculator-results.visible {
        transform: translateY(0);
    }
    .calculator-results .close-results {
        display: block;
    }
    /* Swipe indicator handle */
    .calculator-results::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: var(--fog, #94a3b8);
        border-radius: 2px;
        margin: 0 auto 12px;
    }
}
@media (min-width: 641px) {
    .calculator-results .close-results {
        display: none;
    }
}

/* ==========================================================================
   14.4 Swipeable Stock Cards (Mobile)
   ========================================================================== */

.stock-card {
    background: var(--slate, #1e293b);
    border: 1px solid var(--fog-border, rgba(255,255,255,0.08));
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
    touch-action: pan-y;
}
.stock-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.stock-card-symbol {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--amber-400, #f5a623);
}
.stock-card-name {
    font-size: 0.8rem;
    color: var(--fog, #94a3b8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}
.stock-card-price {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ghost, #e2e8f0);
}
.stock-card-change {
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 8px;
}
.stock-card-change.positive { color: #22c55e; }
.stock-card-change.negative { color: #ef4444; }
.stock-card-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
    font-size: 0.8rem;
}
.stock-card-metric-label {
    color: var(--fog, #94a3b8);
}
.stock-card-metric-value {
    font-weight: 600;
    color: var(--ghost, #e2e8f0);
}
/* Swipe actions */
.stock-card.swiping {
    transition: none;
}
.stock-card .swipe-action {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}
.stock-card .swipe-action-right {
    right: 0;
    background: #ef4444;
    color: white;
    border-radius: 0 12px 12px 0;
}
.stock-cards-container {
    display: none;
}
@media (max-width: 767px) {
    .stock-cards-container { display: block; }
    .stock-table-desktop { display: none !important; }
}
@media (min-width: 768px) {
    .stock-cards-container { display: none !important; }
    .stock-table-desktop { display: block; }
}

/* ==========================================================================
   14.1 PWA Install Button
   ========================================================================== */
.pwa-install-btn {
    display: none;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--amber-400, #f5a623);
    color: var(--charcoal, #1a1a2e);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.pwa-install-btn:hover { background: #e09500; }
@media (min-width: 768px) {
    .pwa-install-btn { display: none !important; }
}

/* ============================================================
   Gamification & Engagement Styles
   ============================================================ */

/* Badge Cards */
.badge-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e2e8f0;
}
.badge-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.badge-earned {
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.badge-locked {
    opacity: 0.6;
}
.badge-locked:hover {
    opacity: 0.85;
}
.badge-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
}
.badge-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}
.badge-desc {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
}
.badge-date {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 0.5rem;
}
.badge-progress-bar {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}
.badge-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}
.badge-progress-text {
    font-size: 0.65rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

/* Course Cards */
.course-card {
    text-decoration: none;
    color: inherit;
    display: block;
}
.course-card:hover {
    text-decoration: none;
    color: inherit;
}

/* Lesson Content */
.lesson-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 1.5rem 0 0.75rem;
}
.lesson-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #334155;
    margin: 1.25rem 0 0.5rem;
}
.lesson-content p {
    line-height: 1.7;
    color: #475569;
    margin-bottom: 0.75rem;
}
.lesson-content ul, .lesson-content ol {
    margin: 0.5rem 0 1rem 1.5rem;
    color: #475569;
}
.lesson-content li {
    margin-bottom: 0.375rem;
    line-height: 1.6;
}
.lesson-content code {
    background: #f1f5f9;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #0f172a;
}
.lesson-content strong {
    color: #1e293b;
}

/* Leaderboard Podium */
@media (max-width: 640px) {
    .badge-card { padding: 0.75rem; }
    .badge-icon-wrap { width: 40px; height: 40px; }
    .badge-icon-wrap svg { width: 20px; height: 20px; }
    .badge-name { font-size: 0.75rem; }
    .badge-desc { font-size: 0.65rem; }
}

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
    .badge-card { background: #1e293b; border-color: #334155; }
    .badge-name { color: #e2e8f0; }
    .badge-desc { color: #94a3b8; }
    .badge-progress-bar { background: #334155; }
    .lesson-content h2 { color: #e2e8f0; }
    .lesson-content h3 { color: #cbd5e1; }
    .lesson-content p, .lesson-content li { color: #94a3b8; }
    .lesson-content code { background: #334155; color: #e2e8f0; }
    .lesson-content strong { color: #e2e8f0; }
}

/* ===== Data Export & Reporting ===== */

/* Export buttons */
.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: background-color 0.15s;
    cursor: pointer;
}
.export-btn-csv { color: #059669; border-color: #a7f3d0; }
.export-btn-csv:hover { background-color: #ecfdf5; }
.export-btn-pdf { color: #b91c1c; border-color: #fca5a5; }
.export-btn-pdf:hover { background-color: #fef2f2; }

/* Tax Report */
.tax-disclaimer {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: #92400e;
    margin-bottom: 1.5rem;
}
.tax-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.tax-summary-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
}
.tax-summary-card .label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.tax-summary-card .value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-top: 0.25rem;
}

/* Custom Report Builder */
.report-builder-filters {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}
.report-filter-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.report-filter-row select,
.report-filter-row input {
    padding: 0.4rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.85rem;
}
.column-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.column-selector label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #374151;
}

/* Scheduled Reports */
.schedule-form {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 2rem;
}
.schedule-form .form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    align-items: end;
}
.schedule-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.schedule-form label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
}
.schedule-form select,
.schedule-form input {
    padding: 0.4rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.85rem;
}

/* Custom report cards */
.custom-report-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: box-shadow 0.15s;
}
.custom-report-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .tax-summary-cards { grid-template-columns: repeat(2, 1fr); }
    .report-filter-row { flex-direction: column; align-items: stretch; }
    .schedule-form .form-row { flex-direction: column; }
}

/* Dark mode overrides */
[data-theme="dark"] .tax-disclaimer { background: #422006; border-color: #854d0e; color: #fde68a; }
[data-theme="dark"] .tax-summary-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .tax-summary-card .label { color: #94a3b8; }
[data-theme="dark"] .tax-summary-card .value { color: #e2e8f0; }
[data-theme="dark"] .report-builder-filters { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .custom-report-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .schedule-form { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .export-btn { border-color: #475569; }

/* === Live Price Flash Animation === */
@keyframes priceFlash {
    0% { background-color: rgba(16, 185, 129, 0.25); }
    100% { background-color: transparent; }
}
.price-flash {
    animation: priceFlash 1.5s ease-out;
    border-radius: 4px;
}
[data-theme="dark"] .price-flash {
    animation-name: priceFlashDark;
}
@keyframes priceFlashDark {
    0% { background-color: rgba(16, 185, 129, 0.15); }
    100% { background-color: transparent; }
}

/* === Stock Page Tabs === */
.stock-page-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    padding: 4px;
    margin-bottom: 1.5rem;
}

.stock-page-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: var(--font-display);
    letter-spacing: 0.01em;
    color: var(--mist) !important;
    background: transparent;
    border: 1px solid transparent !important;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}

.stock-page-tab svg {
    width: 15px;
    height: 15px;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.stock-page-tab:hover:not(.active) {
    color: var(--cloud) !important;
    background: rgba(255, 255, 255, 0.05);
}

.stock-page-tab:hover:not(.active) svg {
    opacity: 0.85;
}

.stock-page-tab.active {
    color: var(--midnight) !important;
    background: linear-gradient(135deg, var(--amber-400), var(--amber-500)) !important;
    border-color: transparent !important;
    box-shadow: 0 2px 8px rgba(245, 166, 35, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.stock-page-tab.active svg {
    opacity: 1;
}

/* === Financial Sub-Tabs === */
.fin-sub-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.fin-sub-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px !important;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: var(--font-display);
    color: var(--mist) !important;
    background: transparent;
    border: none !important;
    border-bottom: none !important;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.fin-sub-tab svg {
    width: 14px;
    height: 14px;
    opacity: 0.5;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.fin-sub-tab:hover:not(.active) {
    color: var(--cloud) !important;
    background: rgba(255, 255, 255, 0.04);
}

.fin-sub-tab:hover:not(.active) svg {
    opacity: 0.75;
}

.fin-sub-tab.active {
    color: var(--amber-400) !important;
    background: rgba(245, 166, 35, 0.08) !important;
    border: none !important;
    font-weight: 600;
}

.fin-sub-tab.active svg {
    opacity: 1;
    color: var(--amber-400);
}

/* Active indicator dot */
.fin-sub-tab.active::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 2px;
    background: var(--amber-400);
    border-radius: 1px;
}

/* ========================================
   Dividend Tabs
   ======================================== */
.div-tabs {
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--iron);
    flex-shrink: 0;
}
.div-tab {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--cloud);
    background: transparent;
    border-left: 1px solid var(--iron);
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    text-decoration: none;
}
.div-tab:first-child { border-left: none; }
.div-tab:hover:not(.div-tab--active) {
    background: var(--slate);
    color: var(--ivory);
}
.div-tab--active {
    background: var(--amber-400);
    color: var(--midnight);
    font-weight: 600;
}
[data-theme="light"] .div-tabs { border-color: #e2e8f0; }
[data-theme="light"] .div-tab { color: #475569; border-left-color: #e2e8f0; }
[data-theme="light"] .div-tab:hover:not(.div-tab--active) { background: #f1f5f9; color: #1e293b; }
[data-theme="light"] .div-tab--active { background: #16a34a; color: #ffffff; }

/* ========================================
   Dividend Timeline
   ======================================== */
.div-timeline-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.div-timeline-stat {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem 0.75rem;
    border-radius: var(--radius-lg);
    background: var(--charcoal);
    border: 1px solid var(--iron);
}
.div-timeline-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}
.div-timeline-stat-label {
    font-size: 0.75rem;
    color: var(--cloud);
}
[data-theme="light"] .div-timeline-stat {
    background: #ffffff;
    border-color: #e2e8f0;
}

/* Timeline year groups */
.div-tl-year { margin-bottom: 1.25rem; }
.div-tl-year:last-child { margin-bottom: 0; }
.div-tl-year-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--iron);
    margin-bottom: 0.75rem;
}
.div-tl-year-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ivory);
}
.div-tl-year-total {
    font-size: 0.75rem;
    color: var(--mist);
}
[data-theme="light"] .div-tl-year-header { border-bottom-color: #e2e8f0; }
[data-theme="light"] .div-tl-year-label { color: #1e293b; }

/* Individual payments */
.div-tl-payments { padding-left: 0.5rem; }
.div-tl-payment {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0;
    transition: background 0.15s;
    border-radius: var(--radius-sm);
    padding-left: 0.25rem;
    padding-right: 0.5rem;
}
.div-tl-payment:hover { background: var(--slate); }
[data-theme="light"] .div-tl-payment:hover { background: #f1f5f9; }

.div-tl-payment-line {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
}
.div-tl-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.div-tl-dot--increase { background: var(--up); box-shadow: 0 0 6px var(--up-glow); }
.div-tl-dot--freeze { background: var(--steel); }
.div-tl-dot--cut { background: var(--down); box-shadow: 0 0 6px var(--down-muted); }
.div-tl-dot--first { background: var(--info); box-shadow: 0 0 6px var(--info-muted); }

.div-tl-payment-content { flex: 1; min-width: 0; }
.div-tl-payment-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.div-tl-payment-date {
    font-size: 0.8125rem;
    color: var(--cloud);
    width: 65px;
    flex-shrink: 0;
}
.div-tl-payment-amount {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ivory);
}
[data-theme="light"] .div-tl-payment-date { color: #64748b; }
[data-theme="light"] .div-tl-payment-amount { color: #1e293b; }
