        /* Smooth transition for manual toggle — suppressed on load by .no-transition */
        html { transition: background-color 0.3s ease; }

        /* ===== DARK MODE FLICKER PREVENTION ===== */
        /* Applied synchronously before paint — suppresses transitions on initial load only */
        .no-transition,
        .no-transition *,
        .no-transition *::before,
        .no-transition *::after {
            transition: none !important;
        }

        /* ===== GLOBAL STYLES WITH DARK/LIGHT MODE SUPPORT ===== */
        :root {
            --bg-primary: #F5F7FA;
            --bg-secondary: #FFFFFF;
            --bg-tertiary: #D6E9FF;
            --bg-header: #0A2463;
            --bg-footer: #1E1E24;
            --text-primary: #1E1E24;
            --text-secondary: #5A6570;
            --text-tertiary: #8C95A0;
            --text-light: #FFFFFF;
            --border-color: #E1E5EB;
            --accent-color: #3E92CC;
            --accent-hover: #2A7CB0;
            --shadow-color: rgba(0, 0, 0, 0.1);
            --trending-bg-1: #E8F0FE;
            --trending-bg-2: #E6F0FA;
            --trending-bg-3: #E8ECF1;
            --trending-bg-4: #EFF2F6;
            --trending-bg-5: #E4ECF5;
            --trending-bg-6: #E9EDF2;
            --trending-text: #2C3E50;
            --trending-hover-bg: #D0E0FF;
            --user-menu-bg: #FFFFFF;
            --user-menu-hover: #F0F7FF;
            --user-menu-border: #E1E5EB;
            --user-menu-text: #0A2463;
            --user-menu-text-secondary: #3E6B8C;
            --badge-bg: #E53E3E;
            --badge-text: #FFFFFF;
            --tech-blue: #0A2463;
            --tech-dark-blue: #061A40;
            --tech-accent: #3E92CC;
            --tech-light-blue: #D6E9FF;
            --tech-gray: #1E1E24;
            --tech-light-gray: #F5F7FA;
            --tech-border: #E1E5EB;
            --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            --font-secondary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            --font-serif: 'Charter', Georgia, 'Times New Roman', Times, serif;
        }

        html.dark-mode {
            --bg-primary: #0A0E17;
            --bg-secondary: #121826;
            --bg-tertiary: #1A2236;
            --bg-header: #0C1220;
            --bg-footer: #050811;
            --text-primary: #E6EDF3;
            --text-secondary: #9FB3C8;
            --text-tertiary: #7D8FA8;
            --text-light: #FFFFFF;
            --border-color: #2A3655;
            --accent-color: #58A6FF;
            --accent-hover: #7CB9FF;
            --shadow-color: rgba(0, 0, 0, 0.3);
            --trending-bg-1: #1E293B;
            --trending-bg-2: #1F2A3F;
            --trending-bg-3: #1C2A3A;
            --trending-bg-4: #1E2C3C;
            --trending-bg-5: #1B2838;
            --trending-bg-6: #1D2A3D;
            --trending-text: #D1DCE6;
            --trending-hover-bg: #2A3A50;
            --user-menu-bg: #1E293B;
            --user-menu-hover: #2A3A50;
            --user-menu-border: #2A3655;
            --user-menu-text: #E6EDF3;
            --user-menu-text-secondary: #9FB3C8;
            --badge-bg: #F56565;
            --badge-text: #FFFFFF;
            --tech-blue: #0C1220;
            --tech-dark-blue: #050811;
            --tech-accent: #58A6FF;
            --tech-light-blue: #1A2236;
            --tech-gray: #121826;
            --tech-light-gray: #0A0E17;
            --tech-border: #2A3655;
        }

        /* Transition on html element — only fires during manual toggle (suppressed on load) */
        html { transition: background-color 0.3s ease, color 0.3s ease; }

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

        /* Prevent images from ever overflowing their container on any screen size */
        img {
            max-width: 100%;
            height: auto;
            display: block;
        }

        body {
            font-family: var(--font-secondary);
            color: var(--text-primary);
            line-height: 1.6;
            background-color: var(--bg-primary);
        }

        h1, h2, h3, h4, h5, h6 {
            font-family: var(--font-primary);
            font-weight: 700;
            margin-bottom: 1rem;
            color: var(--text-primary);
        }

        p { margin-bottom: 1.5rem; font-size: 16px; color: var(--text-secondary); }

        a { color: var(--text-primary); text-decoration: none; transition: all 0.3s ease; }
        a:hover { color: var(--accent-color); }

        .container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

        /* ===== HEADER ===== */
        .header {
            padding: 10px 0;
            background-color: var(--bg-header);
            position: sticky;
            top: 0;
            z-index: 100;
            transition: all 0.3s ease;
            box-shadow: 0 2px 10px var(--shadow-color);
        }

        .header.scrolled { padding: 10px 0; box-shadow: 0 4px 12px var(--shadow-color); }

        .header-inner {
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all 0.3s ease;
        }

        .logo {
            display: flex;
            align-items: center;
            transition: all 0.3s ease;
        }

        /* SVG logo image — scales height like the old text used to scale font-size */
        .logo-img {
            display: block;
            height: 34px;       /* resting size ≈ old 24px text + bolt icon */
            width: auto;        /* preserves 930×166 aspect ratio              */
            transition: height 0.3s ease;
        }

        .header.scrolled .logo-img { height: 22px; }

        .nav ul { display: flex; list-style: none; transition: all 0.3s ease; align-items: center; }
        .nav ul li { margin-left: 30px; position: relative; }

        .nav ul li a:not(.user-dropdown-item) {
            font-size: 16px;
            font-weight: 500;
            color: var(--text-light);
            transition: all 0.3s ease;
        }

        .header.scrolled .nav ul li a:not(.user-dropdown-item) { font-size: 14px; }
        .nav ul li a:not(.user-dropdown-item):hover { color: var(--accent-color); }

        .btn { padding: 8px 16px; border-radius: 4px; font-weight: 500; cursor: pointer; transition: all 0.3s ease; display: inline-block; }
        .btn-primary { background-color: var(--accent-color); color: var(--text-light); border: none; }
        .btn-primary:hover { background-color: var(--accent-hover); color: var(--text-light); }

        /* User Menu */
        .user-menu-container { position: relative; margin-left: 30px; }

        .user-menu-button {
            display: flex;
            align-items: center;
            gap: 8px;
            background: transparent;
            border: 1px solid rgba(255,255,255,0.2);
            border-radius: 30px;
            padding: 5px 5px 5px 12px;
            color: var(--text-light);
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .user-menu-button:hover { background-color: rgba(62,146,204,0.2); border-color: var(--accent-color); }

        .user-avatar {
            width: 32px; height: 32px; border-radius: 50%;
            background-color: var(--accent-color);
            display: flex; align-items: center; justify-content: center;
            font-weight: 600; font-size: 14px; color: var(--text-light);
        }

        .user-name { font-size: 14px; font-weight: 500; color: var(--text-light); }
        .dropdown-arrow { font-size: 12px; margin-left: 4px; color: var(--text-light); }

        .user-dropdown {
            position: absolute;
            top: calc(100% + 15px);
            right: 0;
            width: 280px;
            background-color: var(--user-menu-bg);
            border-radius: 8px;
            box-shadow: 0 10px 30px var(--shadow-color);
            border: 1px solid var(--user-menu-border);
            opacity: 0; visibility: hidden;
            transform: translateY(-10px);
            transition: all 0.3s ease;
            z-index: 1000;
        }

        .user-dropdown.active { opacity: 1; visibility: visible; transform: translateY(0); }

        .user-dropdown-header {
            padding: 20px;
            display: flex; align-items: center; gap: 15px;
            border-bottom: 1px solid var(--user-menu-border);
        }

        .dropdown-user-avatar {
            width: 48px; height: 48px; border-radius: 50%;
            background-color: var(--accent-color);
            display: flex; align-items: center; justify-content: center;
            font-weight: 600; font-size: 18px; color: var(--text-light); flex-shrink: 0;
        }

        .dropdown-user-name { font-weight: 600; color: var(--user-menu-text); margin-bottom: 4px; font-size: 16px; }
        .dropdown-user-email { font-size: 13px; color: var(--user-menu-text-secondary); }
        .user-dropdown-menu { padding: 10px 0; }

        .user-dropdown-item {
            display: flex !important; align-items: center !important; gap: 12px !important;
            padding: 12px 20px !important; color: var(--user-menu-text) !important;
            transition: background-color 0.2s ease !important;
            text-decoration: none !important; font-size: 14px !important;
            font-weight: 400 !important; background: transparent !important;
            border: none !important; margin: 0 !important;
        }

        .user-dropdown-item:hover { background-color: var(--user-menu-hover) !important; color: var(--user-menu-text) !important; }
        .user-dropdown-item i { width: 20px; color: var(--accent-color); }

        .badge {
            background-color: var(--badge-bg); color: var(--badge-text);
            font-size: 11px; font-weight: 600; padding: 2px 6px;
            border-radius: 12px; margin-left: auto;
            display: inline-flex; align-items: center; justify-content: center;
            min-width: 20px; height: 18px;
        }

        .article-author-badge {
            background-position:center;
            flex:none;
            background-size:cover;
            border-radius:100%;
            overflow:hidden;
            width:32px;
            height:32px;
            margin-right:5px;
        }
         .article-author-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background-color: var(--bg-tertiary);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--accent-color);
        flex-shrink: 0;
        transition: background-color 0.2s, color 0.2s;
        font-size: 14px;
        }
        .article-author-link:hover .article-author-avatar {
            background-color: var(--accent-color);
            color: var(--text-light);
        }
        .article-author-name-link {
            font-weight: 600;
            font-size: 0.88rem;
            color: var(--text-primary);
            margin-right: 12px;
            text-decoration: none;
            transition: color 0.2s;
        }
        .article-author-name-link:hover { color: var(--accent-color); }
        .user-dropdown-footer { padding: 10px 0; border-top: 1px solid var(--user-menu-border); }

        /* Dark Mode Toggle */
        .dark-mode-toggle {
            background: transparent; color: var(--text-light);
            border: 2px solid var(--accent-color); border-radius: 20px;
            padding: 6px 15px; font-size: 14px; font-weight: 500;
            display: flex; align-items: center; gap: 8px;
            cursor: pointer; transition: all 0.3s ease;
            float: right;
        }

        .dark-mode-toggle:hover { background-color: rgba(62,146,204,0.2); }
        .dark-mode-toggle.active { background-color: var(--accent-color); box-shadow: 0 0 15px rgba(62,146,204,0.5); }

        /* Mobile Menu Toggle */
        .mobile-menu-toggle {
            display: none; background: none; border: none;
            font-size: 24px; cursor: pointer; color: var(--text-light);
            transition: font-size 0.3s ease;
        }

        .header.scrolled .mobile-menu-toggle { font-size: 18px; }

        /* Breaking News Bar */
        .breaking-news {
            background-color: var(--tech-dark-blue);
            color: var(--text-light); padding: 8px 0; font-size: 14px;
        }

        .breaking-news-content { display: flex; align-items: center; }

        .breaking-label {
            background-color: var(--accent-color);
            padding: 3px 8px; border-radius: 3px;
            font-weight: 700; margin-right: 15px; font-size: 12px; flex-shrink: 0;
        }

        .breaking-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .breaking-text a { color: var(--text-light); }
        .breaking-text a:hover { color: var(--accent-color); text-decoration: underline; }

        /* ===== ARTICLE CARD ===== */
        .article-card {
            background-color: var(--bg-secondary);
            border-radius: 12px; overflow: hidden;
            box-shadow: 0 4px 12px var(--shadow-color);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            display: flex; border-left: 4px solid var(--accent-color);
            position: relative; cursor: pointer; margin-bottom: 20px;
        }

        .article-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px var(--shadow-color); }

        .article-image-link {
            display: block; width: 120px; height: 90px; flex-shrink: 0;
            overflow: hidden; position: relative;
            background-color: var(--bg-tertiary); text-decoration: none;
            border-radius: 6px; margin: 15px 0 15px 15px;
        }

        .article-card.no-image .article-image-link { display: none; }
        .article-image-link img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
        .article-card:hover .article-image-link img { transform: scale(1.05); }

        /* Hero/map-preview images live inside an aspect-ratio box — must fill it fully */
        .story-hero-grid img,
        .story-hero-map-preview-grid img {
            width: 100%;
            height: 40vw;
            object-fit: cover;
            object-position: center center;
            max-height: 500px;
        }

        .article-content { padding: 18px 20px; flex: 1; display: flex; flex-direction: column; }

        .article-card.no-image { background: linear-gradient(to right, rgba(62,146,204,0.02), transparent 40px); }
        html.dark-mode .article-card.no-image { background: linear-gradient(to right, rgba(88,166,255,0.05), transparent 40px); }

        .article-category {
            font-size: 0.75rem; text-transform: uppercase;
            color: var(--accent-color); font-weight: 700;
            letter-spacing: 0.5px; margin-bottom: 8px;
        }

        .article-title { font-size: 1.1rem; margin-bottom: 8px; line-height: 1.3; font-family: var(--font-serif); }

        .article-title-link { color: var(--text-primary); text-decoration: none; transition: color 0.3s ease; }
        .article-title-link:hover { color: var(--accent-color); }

        .article-excerpt {
            font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 10px;
            display: -webkit-box;line-clamp: 2; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
        }

        .article-excerpt-link { color: var(--text-secondary); text-decoration: none; display: block; }
        .article-excerpt-link:hover { color: var(--accent-color); }

        .article-meta { display: flex; gap: 14px; font-size: 13px; margin-top: auto; opacity: .85; flex-wrap: wrap; align-items: center; }
        .article-meta span, .article-meta a { color: var(--text-tertiary); text-decoration: none; }
        .article-meta a:hover { color: var(--accent-color); }

        /* Pagination */
        .pagination { margin-top: 40px; display: flex; justify-content: center; align-items: center; gap: 10px; }

        .pagination a {
            display: flex; align-items: center; justify-content: center;
            width: 40px; height: 40px; border-radius: 4px;
            background-color: var(--bg-secondary); color: var(--text-primary);
            font-weight: 500; box-shadow: 0 2px 5px var(--shadow-color); transition: all 0.3s ease;
        }

        .pagination a:hover { background-color: var(--bg-tertiary); color: var(--accent-color); }
        .pagination a.active { background-color: var(--accent-color); color: var(--text-light); }

        /* Sidebar */
        .sidebar-widget {
            background-color: var(--bg-secondary); border-radius: 8px;
            padding: 25px; margin-bottom: 35px;
            box-shadow: 0 4px 12px var(--shadow-color);
            border-top: 3px solid var(--accent-color);
        }

        .widget-title {
            font-size: 1.2rem; margin-bottom: 20px;
            padding-bottom: 10px; border-bottom: 1px solid var(--border-color);
            position: relative; color: var(--text-primary);
        }

        .widget-title::after {
            content: ''; position: absolute; bottom: -1px; left: 0;
            width: 50px; height: 2px; background-color: var(--accent-color);
        }

        .tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }

        .tag {
            padding: 5px 12px; background-color: var(--bg-tertiary);
            border-radius: 20px; font-size: 0.8rem;
            transition: all 0.2s ease; color: var(--text-secondary); cursor: pointer;
        }

        .tag:hover { background-color: var(--accent-color); color: var(--text-light); transform: translateY(-2px); }

        .trending-topics { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; }

        .topic {
            padding: 6px 16px; border-radius: 4px; font-size: 0.9rem;
            font-weight: 500; transition: all 0.2s ease;
            color: var(--trending-text); border: none; background-color: transparent;
            letter-spacing: 0.2px; cursor: pointer;
        }

        .topic:nth-child(1) { background-color: var(--trending-bg-1); }
        .topic:nth-child(2) { background-color: var(--trending-bg-2); }
        .topic:nth-child(3) { background-color: var(--trending-bg-3); }
        .topic:nth-child(4) { background-color: var(--trending-bg-4); }
        .topic:nth-child(5) { background-color: var(--trending-bg-5); }
        .topic:nth-child(6) { background-color: var(--trending-bg-6); }

        .topic:hover { background-color: var(--trending-hover-bg) !important; transform: translateY(-2px); color: var(--trending-text); }

        /* ===== ARTICLES LAYOUT ===== */
        .articles-section { padding: 20px 0 40px; }
        .articles-container { display: flex; gap: 40px; }
        .articles-main { flex: 1; padding-bottom: 30px; }
        .articles-sidebar { width: 300px; }

        .section-title {
            font-size: 1.4rem; margin-bottom: 20px; padding-bottom: 10px;
            border-bottom: 2px solid var(--accent-color); display: inline-block; color: var(--text-primary);
        }

        .article-list { display: flex; flex-direction: column; gap: 0; }
        .article-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 25px; margin-bottom: 20px; }

        .section { margin-bottom: 50px; }
        .section:last-child { margin-bottom: 0; }

        .section.trending {
            margin-bottom: 60px; padding-bottom: 20px;
            border-bottom: 1px solid var(--border-color);
        }

        /* Hero card */
        .hero-section { margin-bottom: 40px; }
        .hero-card { display: flex; flex-direction: row; border-left-width: 6px; }

        .hero-card .article-image-link { width: 280px; height: 160px; margin: 20px 0 20px 20px; }
        .hero-card .article-content { padding: 25px; }
        .hero-card .article-title { font-size: 1.5rem; }

        /* Trending list */
        .trending-list { list-style: none; padding: 0; margin: 15px 0 0; }

        .trending-list li {
            display: flex; justify-content: space-between;
            transition: all 0.2s ease; cursor: pointer;
            border-radius: 6px; padding: 12px 15px;
            border-bottom: 1px solid rgba(0,0,0,.08);
        }

        html.dark-mode .trending-list li { border-bottom-color: rgba(255,255,255,0.08); }
        .trending-list li:hover { background-color: var(--bg-tertiary); transform: translateX(5px); }

        /* Page Header */
        .page-header {
            padding: 30px 0 20px;
            background-color: var(--bg-secondary);
            border-bottom: 1px solid var(--border-color);
            margin-bottom: 30px;
        }

        .page-title {
            margin-bottom: 10px; font-size: 1.8rem;
            display: flex; align-items: center; justify-content: space-between;
            color: var(--text-primary);
        }

        .page-subtitle { font-size: 1rem; color: var(--text-secondary); margin-bottom: 0; }

        /* ===== FOOTER ===== */
        .footer { padding: 60px 0 30px; background-color: var(--bg-footer); color: var(--text-light); }

        .footer-inner {
            display: flex; justify-content: space-between;
            flex-wrap: wrap; gap: 40px; margin-bottom: 40px;
        }

        .footer-column { flex: 1; min-width: 200px; }

        .footer-logo {
            display: block;
            margin-bottom: 20px;
        }

        .footer-logo-img {
            height: 90px;
            width: auto; /* preserves 470×393 aspect ratio */
        }
        .footer-about { margin-bottom: 20px; color: rgba(255,255,255,0.7); }
        .footer-heading { font-size: 18px; margin-bottom: 20px; color: var(--text-light); }
        .footer-links { list-style: none; }
        .footer-links li { margin-bottom: 12px; }
        .footer-links a { color: rgba(255,255,255,0.7); transition: all 0.3s ease; }
        .footer-links a:hover { color: var(--accent-color); }

        .copyright {
            text-align: center; padding-top: 30px;
            border-top: 1px solid rgba(255,255,255,0.1);
            color: rgba(255,255,255,0.5); font-size: 14px;
        }

        /* ===== RESPONSIVE ===== */
        @media (max-width: 992px) {
            .articles-container { flex-direction: column; }
            .articles-sidebar { width: 100%; }
        }

        @media (max-width: 768px) {
            .header-inner { flex-direction: column; align-items: flex-start; }

            .nav {
                width: 100%;
                max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
            }

            .nav.active { max-height: 600px; }

            .nav ul { flex-direction: column; align-items: flex-start; width: 100%; }
            .nav ul li { margin: 0 0 10px; width: 100%; }

            .user-menu-container { margin-left: 0; margin-top: 10px; width: 100%; }
            .user-menu-button { width: 100%; justify-content: space-between; }
            .user-dropdown { width: 100%; right: auto; left: 0; }

            .mobile-menu-toggle {
                display: block; position: absolute; top: 10px; right: 15px;
            }

            .article-card { flex-direction: column; }
            .article-image-link { width: calc(100% - 30px); height: 140px; margin: 15px 15px 0 15px; }
            .hero-card .article-image-link { width: calc(100% - 40px); height: 180px; margin: 20px 20px 0 20px; }
            .article-grid { grid-template-columns: 1fr; gap: 20px; }

            .page-title { font-size: 1.5rem; flex-direction: column; align-items: flex-start; gap: 15px; }
            .page-header { padding: 25px 0 15px; }
        }


        /* ===================================================
           STORY PAGE (story/Index.cshtml)
           ===================================================*/

        /* ===== ARTICLE DETAIL LAYOUT ===== */
        .story-layout {
            max-width: 1200px;
            margin: 0 auto;
            padding: 40px 15px 60px;
            display: flex;
            gap: 40px;
            align-items: flex-start;
        }
        /* min-width:0 lets the flex child shrink below content size;
           overflow:hidden stops wide children from bursting out of the column */
        .story-main { flex: 1; min-width: 0; overflow: hidden; }
        .story-sidebar { width: 300px; flex-shrink: 0; }

        /* ===== PAGE HEADER BAR ===== */
        .story-page-header {
            background-color: var(--bg-secondary);
            border-bottom: 1px solid var(--border-color);
            padding: 24px 0 20px;
            margin-bottom: 30px;
        }
        .story-page-header .container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

        .story-breadcrumb {
            display: flex; align-items: center; gap: 8px;
            font-size: 0.82rem; color: var(--text-tertiary); margin-bottom: 12px;
        }
        .story-breadcrumb a { color: var(--accent-color); text-decoration: none; }
        .story-breadcrumb a:hover { text-decoration: underline; }
        .story-breadcrumb .sep { opacity: 0.5; }

        .story-category-badge {
            display: inline-block; font-size: 0.75rem; text-transform: uppercase;
            color: var(--accent-color); font-weight: 700; letter-spacing: 0.5px;
            margin-bottom: 12px;
        }
        .story-category-badge:hover { text-decoration: underline; }

        .story-h1 {
            font-size: 2rem; line-height: 1.25; font-family: var(--font-serif);
            color: var(--text-primary); margin-bottom: 16px;
        }

        .story-meta-row {
            display: flex; align-items: center; gap: 0;
            font-size: 13px; flex-wrap: wrap; opacity: .9;
        }
        .story-author-link {
            display: flex; align-items: center; text-decoration: none; margin-right: 10px;
        }
        .story-author-avatar {
            width: 32px; height: 32px; border-radius: 50%;
            background-color: var(--bg-tertiary);
            display: flex; align-items: center; justify-content: center;
            color: var(--accent-color); flex-shrink: 0;
            transition: background-color 0.2s, color 0.2s; font-size: 14px;
        }
        .story-author-link:hover .story-author-avatar { background-color: var(--accent-color); color: var(--text-light); }
        .story-author-name {
            font-weight: 600; font-size: 0.9rem; color: var(--text-primary);
            margin-right: 14px; text-decoration: none; transition: color 0.2s;
        }
        .story-author-name:hover { color: var(--accent-color); }
        .story-date { font-size: 0.8rem; color: var(--text-tertiary); margin-right: 14px; }
        .story-stats {
            margin-left: auto; display: flex; align-items: center;
            gap: 14px; font-size: 0.8rem; color: var(--text-tertiary);
        }
        .story-stat { display: flex; align-items: center; gap: 5px; }

        /* ===== HERO IMAGE (no map) — aspect-ratio box, center-cropped ===== */
        .story-hero {
            width: 100%; border-radius: 12px; margin-bottom: 30px;
            box-shadow: 0 4px 16px var(--shadow-color);
            overflow: hidden;
        }
        .story-hero-grid {
            display: grid; width: 100%; height: 100%;
            grid-template-columns: 1fr;
        }
        .story-hero-grid img {
            grid-row: 1; grid-column: 1;
            width: 100%; height: 40vw; display: block;
            object-fit: cover; object-position: center center;
            max-height: 500px;
        }

        /* ===== HERO → MAP PREVIEW ===== */
        #mapHeroPreview { cursor: pointer; }
        #mapHeroPreview:hover .story-hero-grid img { filter: brightness(0.82); transition: filter 0.2s ease; }
        /* During fade-out the preview keeps its DOM space for 300ms, which creates
           a blank gap above the map wrapper. Collapsing it to zero height immediately
           removes the gap while the opacity transition still plays visually. */
        #mapHeroPreview.is-hiding {
            height: 0 !important;
            overflow: hidden !important;
            margin: 0 !important;
            padding: 0 !important;
        }

        /* CTA bar: same grid cell, pinned to bottom via align-self */
        .map-preview-cta {
            grid-row: 1; grid-column: 1;
            align-self: end;
            background: linear-gradient(0deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 100%);
            padding: 48px 18px 16px;
            display: flex; align-items: center; justify-content: center; gap: 10px;
            color: #fff; font-size: 0.9rem; font-weight: 600;
            letter-spacing: 0.2px; pointer-events: none;
            z-index: 2;
        }
        .map-preview-cta-icon {
            width: 32px; height: 32px; border-radius: 50%;
            background: rgba(62,146,204,0.9); display: flex;
            align-items: center; justify-content: center; flex-shrink: 0;
            box-shadow: 0 0 14px rgba(62,146,204,0.6);
        }

        /* ===== MAP LOADING SPINNER ===== */
        .map-loading-overlay {
            position: absolute; inset: 0; z-index: 10;
            background: #0d1b2a;
            display: flex; flex-direction: column;
            align-items: center; justify-content: center;
            gap: 14px; color: rgba(255,255,255,0.7);
            font-size: 0.85rem; border-radius: 8px;
            transition: opacity 0.4s ease;
        }
        .map-loading-overlay.hidden { opacity: 0; pointer-events: none; }
        .map-spinner {
            width: 36px; height: 36px; border-radius: 50%;
            border: 3px solid rgba(62,146,204,0.25);
            border-top-color: #3E92CC;
            animation: mapSpin 0.8s linear infinite;
        }
        @keyframes mapSpin { to { transform: rotate(360deg); } }

        /* ===== DARK LEAFLET POPUPS ===== */
        .dark-popup .leaflet-popup-content-wrapper {
            background: #1a1a2e; color: #fff;
            border: 1px solid rgba(62,146,204,0.4);
            box-shadow: 0 4px 20px rgba(0,0,0,0.5);
            border-radius: 6px;
        }
        .dark-popup .leaflet-popup-tip { background: #1a1a2e; }
        .dark-popup .leaflet-popup-content { margin: 10px 14px; }
        .dark-popup .leaflet-popup-close-button { color: rgba(255,255,255,0.6) !important; }
        .dark-popup .leaflet-popup-close-button:hover { color: #fff !important; }

        /* ===== MAP — inline, dark, mobile-safe ===== */
        .story-map-container {
            width: 100%; max-width: 100%; box-sizing: border-box;
            overflow: hidden; border-radius: 8px; margin-bottom: 30px;
            position: relative; background: #0d1b2a;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
            min-width: 0; isolation: isolate; z-index: 1;
        }
        #storyMap {
            width: 100%; height: 420px;
            display: block; box-sizing: border-box;
        }
        .leaflet-container {
            background: #0d1b2a !important;
            outline: none;
        }
        /* maplibre-gl-leaflet canvas fills the Leaflet pane */
        .leaflet-maplibre-gl-layer {
            position: absolute; top: 0; left: 0;
            width: 100%; height: 100%;
        }

        /* ===== MAP OVERLAY PANEL ===== */
        .map-overlay {
            position: absolute; top: 12px; left: 12px; z-index: 700;
            background: rgba(0,0,0,0.75); border-radius: 8px; padding: 12px 14px;
            color: white; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
            border: 1px solid rgba(255,255,255,0.12);
            max-width: min(240px, calc(100% - 24px));
            pointer-events: none; box-sizing: border-box;
        }
        .map-overlay-title {
            font-size: 0.88rem; font-weight: 700; color: white;
            margin-bottom: 4px; line-height: 1.3;
            display: flex; align-items: flex-start; gap: 7px; word-break: break-word;
        }
        .map-overlay-title i { color: #3E92CC; flex-shrink: 0; margin-top: 2px; }
        .map-overlay-desc {
            font-size: 0.75rem; color: rgba(255,255,255,0.82);
            margin-bottom: 8px; line-height: 1.4; word-break: break-word;
        }
        .map-legend { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
        .legend-item {
            display: flex; align-items: center; gap: 7px;
            font-size: 0.7rem; color: rgba(255,255,255,0.85); word-break: break-word;
        }
        .legend-dot {
            width: 11px; height: 11px; border-radius: 50%;
            border: 2px solid rgba(255,255,255,0.8); flex-shrink: 0;
        }

        /* ===== PULSING MARKER ANIMATION ===== */
        @keyframes mapPulse {
            0%   { box-shadow: 0 0 0 0 rgba(255,71,87,0.7); }
            70%  { box-shadow: 0 0 0 10px rgba(255,71,87,0); }
            100% { box-shadow: 0 0 0 0 rgba(255,71,87,0); }
        }

        /* ===== ARTICLE BODY ===== */
        .story-body {
            font-family: var(--font-serif); font-size: 1.05rem;
            line-height: 1.85; color: var(--text-primary); margin-bottom: 36px;
        }
        .story-body p  { margin-bottom: 1.5rem; color: var(--text-primary); }
        .story-body h3 { font-size: 1.35rem; margin: 2rem 0 1rem; color: var(--text-primary); font-family: var(--font-primary); }
        .story-body b, .story-body strong { font-weight: 700; }
        .story-body i, .story-body em { font-style: italic; }
        .story-body u { text-decoration: underline; }
        .story-body a { color: var(--accent-color); }
        .story-body a:hover { text-decoration: underline; }
        .story-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 1rem 0; }

        /* ===== CATEGORY & TAGS ===== */
        .story-tags-section {
            padding-top: 24px; border-top: 1px solid var(--border-color); margin-bottom: 28px;
        }
        .story-tags-section .section-label {
            font-size: 0.78rem; text-transform: uppercase; font-weight: 700;
            letter-spacing: 0.8px; color: var(--text-tertiary); margin-bottom: 12px;
        }

        /* ===== ARTICLE SHARING ===== */
        .article-sharing {
            margin-top: 32px; padding-top: 24px;
            border-top: 1px solid var(--border-color);
            display: flex; gap: 12px; align-items: center;
        }
        .article-sharing .section-label {
            font-size: 0.78rem; text-transform: uppercase; font-weight: 700;
            letter-spacing: 0.8px; color: var(--text-tertiary); margin-right: 4px;
        }
        .share-button {
            width: 40px; height: 40px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            background-color: var(--bg-tertiary); color: var(--text-secondary);
            transition: all 0.3s ease; text-decoration: none;
            border: none; cursor: pointer; font-size: 15px; font-family: inherit;
        }
        .share-button:hover {
            background-color: var(--tech-light-blue, #D6E9FF);
            color: var(--accent-color); transform: translateY(-2px);
        }
        .share-button.copied { background-color: #38a169; color: white; }

        /* ===== SOURCES ===== */
        .story-sources-section {
            padding-top: 20px; border-top: 1px solid var(--border-color); margin-bottom: 28px;
        }
        .story-sources-section .section-label {
            font-size: 0.78rem; text-transform: uppercase; font-weight: 700;
            letter-spacing: 0.8px; color: var(--text-tertiary); margin-bottom: 10px;
        }
        .story-sources-section > a {
            display: flex; align-items: center; gap: 6px; font-size: 0.88rem;
            color: var(--accent-color); margin-bottom: 6px;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
        .story-sources-section > a:hover { text-decoration: underline; }
        .story-sources-section > a i { flex-shrink: 0; font-size: 0.75rem; opacity: 0.7; }

        /* Numbered references list at the bottom of the article */
        .story-sources-section ol.references {
            list-style: none; counter-reset: ref-counter; padding: 0; margin: 0;
        }
        .story-sources-section ol.references li {
            counter-increment: ref-counter; position: relative; padding-left: 22px;
            font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 8px;
            line-height: 1.5;
        }
        .story-sources-section ol.references li::before {
            content: counter(ref-counter) "."; position: absolute; left: 0;
            color: var(--text-tertiary); font-weight: 700;
        }
        .story-sources-section ol.references a {
            display: inline; color: var(--accent-color); word-break: break-word;
        }
        .story-sources-section ol.references a:hover { text-decoration: underline; }

        /* Inline citation markers, e.g. [1, 2] */
        .ref-group { white-space: nowrap; }
        .ref-note {
            color: var(--accent-color); font-size: 0.78em; font-weight: 700;
            text-decoration: none; cursor: pointer;
        }
        .ref-note:hover { text-decoration: underline; }

        /* Floating citation tooltip */
        .reference-popup {
            position: absolute; z-index: 1000; max-width: 320px;
            background-color: var(--bg-secondary); border: 1px solid var(--border-color);
            border-radius: 8px; box-shadow: 0 4px 12px var(--shadow-color);
            padding: 12px 14px; font-size: 0.85rem; line-height: 1.5; color: var(--text-primary);
        }
        .reference-popup strong { display: block; color: var(--accent-color); margin-bottom: 6px; }
        .reference-popup i { display: block; font-style: italic; color: var(--text-secondary); margin-bottom: 6px; }
        .reference-popup a { color: var(--accent-color); font-size: 0.8rem; }
        .reference-popup a:hover { text-decoration: underline; }

        /* Published/Accessed meta text — used in both the tooltip and the references list */
        .ref-meta {
            display: block; font-style: italic; color: var(--text-tertiary);
            font-size: 0.78rem; margin-top: 6px;
        }
        /* In the bottom references list, keep it on the same row as the title on larger screens */
        .story-sources-section ol.references .ref-meta {
            display: inline; margin-top: 0; margin-left: 6px;
        }

        /* ===== AUTHOR CARD ===== */
        .author-widget {
            background-color: var(--bg-secondary); border-radius: 8px; padding: 20px;
            box-shadow: 0 4px 12px var(--shadow-color); border-top: 3px solid var(--accent-color);
            display: flex; align-items: center; gap: 16px; margin-bottom: 28px;
            text-decoration: none;
        }
        .author-widget-avatar {
            width: 52px; height: 52px; border-radius: 50%; background-color: var(--bg-tertiary);
            display: flex; align-items: center; justify-content: center;
            color: var(--accent-color); font-size: 20px; flex-shrink: 0;
            transition: background-color 0.2s, color 0.2s;
        }
        .author-widget:hover .author-widget-avatar { background-color: var(--accent-color); color: var(--text-light); }
        .author-widget-name { font-weight: 700; font-size: 1rem; color: var(--text-primary); margin-bottom: 4px; }
        .author-widget-link { font-size: 0.82rem; color: var(--accent-color); }
        .author-widget:hover .author-widget-link { text-decoration: underline; }

        /* ===== SIMILAR ARTICLES ===== */
        .similar-articles-section {
            padding: 50px 0 60px;
            background-color: var(--bg-primary);
            border-top: 1px solid var(--border-color);
        }
        .similar-articles-section .section-title {
            font-size: 1.4rem; margin-bottom: 24px; padding-bottom: 10px;
            border-bottom: 2px solid var(--accent-color);
            display: inline-block; color: var(--text-primary);
        }
        .similar-articles-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
        }
        .similar-articles-grid .article-card { flex-direction: column; border-left-width: 3px; }
        .similar-articles-grid .article-image-link {
            width: 100%; height: 140px; margin: 0; border-radius: 0;
        }
        .similar-articles-grid .article-content { padding: 14px 16px; }
        .similar-articles-grid .article-title   { font-size: 0.95rem; }
        .similar-articles-grid .article-excerpt { display: none; }

        /* ===== STORY PAGE RESPONSIVE ===== */
        @media (max-width: 992px) {
            /* Stack sidebar below main content */
            .story-layout { flex-direction: column; }
            .story-sidebar { width: 100%; }
            .similar-articles-grid { grid-template-columns: repeat(2, 1fr); }

            /* Hero: constrain to 90vw so it never bleeds past the viewport edge.
               The grid and img children inherit via width:100% / height:100%
               so no separate rules needed for them. */
            .story-hero,
            .story-hero-map-preview {
                width: 90vw;
                /* Center it within story-main */
                margin-left: auto;
                margin-right: auto;
            }
            /* story-main is now a column — make sure it doesn't overflow */
            .story-main { width: 100%; overflow: hidden; }

            .story-hero-grid img {
            grid-row: 1; grid-column: 1;
            width: 100%; height: 40vw; display: block;
            object-fit: cover; object-position: center center;
            }
        }
        @media (max-width: 768px) {
            .story-h1 { font-size: 1.5rem; }
            #storyMap { height: 300px; }
            .map-overlay { max-width: min(190px, calc(100% - 16px)); padding: 8px 10px; top: 8px; left: 8px; }
            .map-overlay-title { font-size: 0.78rem; }
            .map-overlay-desc  { font-size: 0.68rem; }
            .legend-item       { font-size: 0.65rem; }
            .story-sources-section ol.references .ref-meta { display: block; margin-top: 4px; margin-left: 0; }
        }
        @media (max-width: 600px) {
            .similar-articles-grid { grid-template-columns: 1fr; }
            .similar-articles-grid .article-image-link { height: 160px; }
            .similar-articles-grid .article-excerpt { display: block; }
        }
        @media (max-width: 480px) {
            #storyMap { height: 250px; }
            .map-legend { display: none; }
            .map-overlay { max-width: calc(60% - 8px); }
        }


        /* ===================================================
           HOME PAGE (home/Index.cshtml)
           ===================================================*/

        /* ===== TRENDING TAGS SCROLLABLE BAR ===== */
        .trending-tags-bar {
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border-color);
            padding: 12px 0;
            overflow: hidden;
        }
        .trending-tags-inner {
            display: flex;
            align-items: center;
            gap: 8px;
            overflow-x: auto;
            scrollbar-width: none;
            -ms-overflow-style: none;
            padding-bottom: 2px;
        }
        .trending-tags-inner::-webkit-scrollbar { display: none; }
        .trending-bar-label {
            font-size: 0.7rem;
            text-transform: uppercase;
            font-weight: 800;
            letter-spacing: 1px;
            color: var(--accent-color);
            white-space: nowrap;
            flex-shrink: 0;
            padding-right: 12px;
            border-right: 2px solid var(--border-color);
            margin-right: 4px;
        }
        .trending-tag-pill {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.78rem;
            font-weight: 600;
            white-space: nowrap;
            flex-shrink: 0;
            transition: all 0.2s;
            text-decoration: none;
            background: var(--bg-tertiary);
            color: var(--text-secondary);
        }
        .trending-tag-pill:hover {
            background: var(--accent-color);
            color: var(--text-light);
            transform: translateY(-1px);
        }
        .trending-tag-pill .t-change {
            font-size: 0.68rem;
            font-weight: 700;
            opacity: 0.8;
        }
        .t-change.up   { color: #38a169; }
        .t-change.down { color: #e53e3e; }
        .trending-tag-pill:hover .t-change.up,
        .trending-tag-pill:hover .t-change.down { color: rgba(255,255,255,0.85); }

        /* ===== HOME — ARTICLE CARD META ROW ===== */
        .article-meta {
            display: flex;
            align-items: center;
            margin-top: auto;
            gap: 0;
        }
        .article-author-link {
            display: flex;
            align-items: center;
            text-decoration: none;
            margin-right: 10px;
        }
        .article-date {
            font-size: 0.78rem;
            color: var(--text-tertiary);
            margin-right: 0;
        }
        .article-stats {
            margin-left: auto;
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 0.78rem;
            color: var(--text-tertiary);
        }
        .article-likes,
        .article-comments {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        /* ===== CATEGORY STRIP SECTION ===== */
        .category-strip { margin-bottom: 50px; }
        .category-strip-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 16px;
            padding-bottom: 10px;
            border-bottom: 2px solid var(--accent-color);
        }
        .category-strip-title {
            font-size: 1.2rem;
            font-weight: 700;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 10px;
            margin: 0;
        }
        .cat-icon {
            width: 28px; height: 28px;
            background: var(--accent-color);
            border-radius: 6px;
            display: flex; align-items: center; justify-content: center;
            font-size: 0.75rem; color: white; font-weight: 800; flex-shrink: 0;
        }
        .category-strip-more {
            font-size: 0.82rem; color: var(--accent-color); font-weight: 600; white-space: nowrap;
        }
        .category-strip-more:hover { text-decoration: underline; }
        .category-story-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 16px;
        }

        /* ===== SIDEBAR — TRENDING CATEGORIES ===== */
        .categories-sidebar-list {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 15px;
        }
        .cat-topic {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 14px;
            border-radius: 4px;
            font-size: 0.88rem;
            font-weight: 500;
            transition: all 0.2s ease;
            color: var(--trending-text);
            text-decoration: none;
            letter-spacing: 0.2px;
        }
        .cat-topic:nth-child(1) { background-color: var(--trending-bg-1); }
        .cat-topic:nth-child(2) { background-color: var(--trending-bg-2); }
        .cat-topic:nth-child(3) { background-color: var(--trending-bg-3); }
        .cat-topic:nth-child(4) { background-color: var(--trending-bg-4); }
        .cat-topic:nth-child(5) { background-color: var(--trending-bg-5); }
        .cat-topic:nth-child(6) { background-color: var(--trending-bg-6); }
        .cat-topic:nth-child(7) { background-color: var(--trending-bg-1); }
        .cat-topic:nth-child(8) { background-color: var(--trending-bg-2); }
        .cat-topic:hover {
            background-color: var(--trending-hover-bg) !important;
            transform: translateY(-1px);
            color: var(--trending-text);
        }
        .cat-topic .cat-change {
            font-size: 0.68rem;
            font-weight: 700;
            opacity: 0.75;
        }
        .cat-change.up   { color: #38a169; }
        .cat-change.down { color: #e53e3e; }

        /* ===== HOME PAGE RESPONSIVE ===== */
        @media (max-width: 600px) {
            .category-story-grid { grid-template-columns: 1fr; }
        }


/* SitePlatform v1.5: reconciled platform components */
/* Consolidated SitePlatform v1.5 components: existing global typography and palette retained. */
[hidden] { display:none !important; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.header-inner { gap:16px; }
.header .logo,.header .nav { flex:none; }
.header .user-menu-button { height:34px; padding:3px 8px; }
.header .user-avatar { width:24px; height:24px; font-size:12px; }
.header .header-signin { padding:6px 12px; line-height:22px; }
.header .nav ul { margin:0; }
.header.scrolled .instrument-search input,.header.scrolled .user-menu-button { height:30px; }
.instrument-search { position:relative; flex:1 1 260px; min-width:0; max-width:470px; margin-left:auto; }
.instrument-search > i { position:absolute; left:15px; top:50%; transform:translateY(-50%); color:#a7b9d1; pointer-events:none; }
.instrument-search input { width:100%; border:1px solid #ffffff40; border-radius:24px; height:34px; padding:6px 12px 6px 38px; background:#ffffff12; color:white; font:inherit; font-size:14px; }
.instrument-search input::placeholder { color:#d0dae8; }
.instrument-search input:focus { outline:2px solid var(--accent-color); outline-offset:2px; }
.instrument-results { position:absolute; top:calc(100% + 10px); left:0; right:0; max-height:420px; overflow:auto; border-radius:10px; background:var(--bg-secondary); color:var(--text-primary); box-shadow:0 12px 32px var(--shadow-color); border:1px solid var(--border-color); list-style:none; z-index:1100; padding:6px; }
.instrument-results li { margin:0; padding:11px 10px; display:flex; gap:10px; align-items:center; cursor:pointer; border-radius:6px; }
.instrument-results li[aria-selected="true"],.instrument-results li:hover { background:var(--bg-tertiary); }
.instrument-result-text { display:flex; flex-direction:column; min-width:0; }
.instrument-result-text strong { font-size:14px; font-weight:600; }
.instrument-result-text small { color:var(--text-secondary); font-size:12px; }
.instrument-flag { font-size:22px; flex:none; min-width:30px; line-height:1; }
.instrument-empty { cursor:default !important; font-size:14px; color:var(--text-secondary); }
.header .nav ul li { margin-left:14px; }
.user-menu-container { margin-left:0; }
.user-dropdown { width:310px; max-width:calc(100vw - 32px); }
.user-dropdown-item { width:100%; text-align:left; font-family:inherit; cursor:pointer; }
.user-dropdown-item:disabled { cursor:default; opacity:.8; }
.user-dropdown-item small { font-size:10px; margin-left:auto; color:var(--text-secondary); }
.user-name { max-width:130px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dropdown-user-email { overflow-wrap:anywhere; }
.user-dropdown-footer { border-top:1px solid var(--border-color); padding:8px 0; }
.menu-note { display:block; padding:0 20px 10px; color:var(--text-secondary); font-size:11px; }
.count-bubble { display:inline-flex; align-items:center; justify-content:center; min-width:21px; height:21px; padding:0 5px; border-radius:50%; background:#d93645; color:#fff; font-size:11px; font-weight:700; flex:none; }
.user-dropdown-item .count-bubble { margin-left:auto; }
.market-widget { padding:20px; }
.market-widget .widget-title i { margin-right:8px; }
.market-widget .chart-container { width:100%; height:320px; border-radius:8px; overflow:hidden; background:var(--bg-primary); transition:background .3s ease; margin-bottom:16px; position:relative; }
.market-current { display:flex; justify-content:space-between; align-items:center; margin-top:8px; font-size:.85rem; color:var(--text-tertiary); }
.market-current strong { color:var(--accent-color); }
.market-disclaimer { font-size:11px; line-height:1.5; margin:8px 0 16px; color:var(--text-tertiary); }
.etf-selector { margin-top:16px; border-top:1px solid var(--border-color); padding-top:12px; }
.etf-heading { font-size:.8rem; font-weight:600; color:var(--text-tertiary); margin-bottom:6px; }
.etf-list { display:flex; flex-direction:column; gap:4px; margin-top:8px; max-height:200px; overflow-y:auto; padding-right:4px; }
.etf-list::-webkit-scrollbar { width:4px; }
.etf-list::-webkit-scrollbar-thumb { background:var(--accent-color); border-radius:4px; }
.etf-item { display:flex; justify-content:space-between; align-items:center; padding:8px 12px; border-radius:6px; cursor:pointer; transition:all .2s ease; font-size:.85rem; border-left:3px solid transparent; text-decoration:none; }
.etf-item:hover,.etf-item:focus-visible,.etf-item.active { background:var(--bg-tertiary); border-left-color:var(--accent-color); }
.etf-item.active { font-weight:600; }
.etf-symbol { font-weight:600; color:var(--accent-color); margin-right:10px; }
.etf-name { color:var(--text-secondary); flex:1; }
.etf-exchange { font-size:.7rem; color:var(--text-tertiary); background:var(--bg-primary); padding:2px 8px; border-radius:12px; }
.auth-section { display:flex; justify-content:center; padding:64px 20px; min-height:65vh; }
.auth-card { padding:36px; border-radius:12px; width:100%; max-width:490px; align-self:flex-start; background:var(--bg-secondary); border:1px solid var(--border-color); box-shadow:0 8px 30px var(--shadow-color); }
.auth-card h1 { font-size:27px; margin:10px 0 12px; }
.auth-card p { font-size:14px; }
.beta-kicker { font-size:11px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--accent-color); }
.auth-form { display:flex; flex-direction:column; gap:10px; }
.auth-form label { font-size:13px; font-weight:600; }
.auth-form label span,.auth-form small { color:var(--text-secondary); font-weight:400; }
.auth-form input { background:var(--bg-primary); border:1px solid var(--border-color); color:var(--text-primary); border-radius:5px; padding:12px; font:inherit; min-width:0; }
.auth-form .btn { margin-top:8px; padding:12px; font:inherit; }
.auth-divider { display:flex; align-items:center; gap:12px; color:var(--text-tertiary); font-size:12px; margin:22px 0; }
.auth-divider::before,.auth-divider::after { content:""; height:1px; flex:1; background:var(--border-color); }
.auth-choices { margin-top:24px; }
.auth-email-choice { display:block; text-align:center; padding:12px; }
.auth-email-choice i { margin-right:8px; }
.auth-google-unavailable { width:100%; padding:12px; color:var(--text-secondary); background:var(--bg-tertiary); border:1px solid var(--border-color); cursor:default; }
.auth-back { display:inline-block; margin-top:22px; font-size:13px; color:var(--accent-color); }
.verified-email { overflow-wrap:anywhere; }
.validation-errors.validation-summary-errors { padding:12px; border:1px solid #da5665; border-radius:6px; }
.validation-errors ul { padding-left:20px; margin:0; }
.form-error { padding:12px; border:1px solid #da5665; border-radius:6px; }
.form-success { padding:12px; border:1px solid #3b9a74; border-radius:6px; }
.auth-note { font-size:12px !important; margin:8px 0; }
.android-verify { display:block; width:100%; margin:16px 0; border:1px solid var(--border-color); color:var(--text-primary); background:transparent; }
.instrument-page { padding:35px 0 50px; }
.instrument-heading { display:flex; gap:12px; align-items:center; margin-bottom:24px; }
.instrument-heading h1 { font-size:clamp(24px,3vw,34px); line-height:1.25; margin:0 0 8px; }
.instrument-heading p { margin:0; font-size:13px; }
.instrument-chart { height:400px; border:1px solid var(--border-color); border-radius:12px; overflow:hidden; background:var(--bg-secondary); }
.chart-fallback { padding:25px; font-size:14px; }
.instrument-preview { position:relative; height:1000px; overflow:hidden; margin-top:28px; border-radius:12px; border:1px solid var(--border-color); background:var(--bg-primary); isolation:isolate; }
.instrument-preview iframe { display:block; width:100%; height:1800px; border:0; pointer-events:none; filter:blur(8px); user-select:none; opacity:.62; }
.beta-gate { position:absolute; inset:0; display:flex; align-items:flex-start; justify-content:center; padding:80px 20px; background:linear-gradient(180deg,transparent, var(--bg-primary)); z-index:2; }
.beta-gate-card { max-width:475px; width:100%; text-align:center; background:var(--bg-secondary); padding:34px; border:1px solid var(--border-color); border-radius:14px; box-shadow:0 12px 40px var(--shadow-color); }
.beta-gate-card h2 { font-size:26px; line-height:1.3; margin:14px 0; }
.beta-gate-card p { font-size:15px; }
.beta-lock { display:inline-flex; width:48px; height:48px; align-items:center; justify-content:center; border-radius:50%; background:var(--bg-tertiary); color:var(--accent-color); font-size:20px; margin-bottom:12px; }
.beta-gate-card .btn { padding:12px 22px; }
@media(max-width:1000px) { .header-inner { gap:12px; } .header .nav ul li { margin-left:10px; } .header .user-name { max-width:90px; } }
@media(max-width:768px) {
    .header .header-inner { position:relative; flex-direction:row; flex-wrap:nowrap; align-items:center; gap:10px; }
    .header .logo-img { height:22px; }
    .header .instrument-search { flex:1; width:auto; margin:0; }
    .header .instrument-search input { font-size:12px; padding-left:30px; }
    .header .instrument-search > i { left:10px; }
    .header .mobile-menu-toggle { position:static; flex:none; order:3; margin:0; }
    .header .nav { position:absolute; top:calc(100% + 10px); left:0; right:0; width:auto; background:var(--bg-header); }
    .header .nav.active { overflow:visible; padding:12px; box-shadow:0 8px 16px var(--shadow-color); }
    .header .nav ul { gap:14px; }
    .header .nav ul li { margin:0; }
    .header .user-dropdown { position:static; display:none; max-width:none; width:100%; margin-top:10px; }
    .header .user-dropdown.active { display:block; }
    .header .user-menu-container { margin-top:0; }
    .header .user-name { max-width:none; }
    .instrument-results { position:fixed; top:auto; left:15px; right:15px; margin-top:8px; }
    .instrument-heading { align-items:flex-start; }
    .auth-section { padding:32px 16px; }
    .auth-card { padding:25px; }
    .instrument-chart { height:310px; }
    .beta-gate { padding:48px 14px; }
    .beta-gate-card { padding:25px; }
}
@media(max-width:400px) { .header .logo-img { height:18px; } .header .header-inner { gap:8px; } }
@media(prefers-reduced-motion:reduce) { .instrument-preview * { animation:none !important; transition:none !important; } }
.app-handoff { display:flex; align-items:center; gap:12px; padding-top:12px; padding-bottom:12px; font-size:13px; }
.app-handoff .btn { flex:none; }
.app-handoff-dismiss { margin-left:auto; padding:4px 8px; background:transparent; border:0; color:var(--text-secondary); font-size:22px; cursor:pointer; }
@media(max-width:600px) { .app-handoff { flex-wrap:wrap; } .app-handoff span { flex:1 1 70%; } }
/* Profile and activity pages use the site's existing palette and typography. */
.validation-summary-valid,.validation-errors:empty{display:none}
.community-page{max-width:860px;padding-top:32px;padding-bottom:56px}.community-page>h1{font-size:30px;margin:12px 0 24px}.community-page>.auth-back{margin-bottom:20px}
.profile-card,.community-card,.activity-list{background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:12px;overflow:hidden}
.profile-cover{height:230px;background:linear-gradient(120deg,var(--bg-tertiary),var(--accent-color))}.profile-cover img{width:100%;height:100%;object-fit:cover}.profile-body{padding:0 28px 28px}.profile-topline{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin-bottom:16px}
.profile-avatar{width:124px;height:124px;margin-top:-62px;border:5px solid var(--bg-secondary);border-radius:50%;position:relative;background:var(--bg-tertiary);display:flex;align-items:center;justify-content:center;color:var(--text-secondary);font-size:46px;overflow:hidden;flex:none}.profile-avatar img{width:100%;height:100%;object-fit:cover}
.profile-body h1{margin:8px 0 0;font-size:28px;line-height:1.3;overflow-wrap:anywhere}.profile-handle,.profile-joined,.muted{color:var(--text-secondary)}.profile-handle{margin-bottom:20px}.profile-description{white-space:pre-wrap;overflow-wrap:anywhere;margin-bottom:20px}.profile-joined{font-size:14px}.profile-joined i{margin-right:6px}
.profile-stats{display:flex;flex-wrap:wrap;gap:22px;font-size:14px;color:var(--text-secondary)}.profile-stats strong{color:var(--text-primary)}.profile-stats a{color:inherit}.community-card{padding:24px;margin-top:24px}.community-card h2{font-size:21px;margin-bottom:12px}.community-card .muted,.profile-editor .muted{font-size:13px;margin-top:12px}
.profile-upload-controls{display:flex;flex-wrap:wrap;gap:24px;margin:20px 0}.profile-upload-controls>div{flex:1 1 230px;min-width:0}.profile-upload-controls label{display:block;font-weight:600;margin-bottom:8px}.profile-upload-controls input{display:block;max-width:100%;margin-bottom:12px}.upload-status{font-size:13px;margin:8px 0}
.text-button{border:0;background:transparent;color:var(--accent-color);font:inherit;cursor:pointer;padding:6px 0}.danger{color:#ce3347}.danger-button{background:#b72c40;border-color:#b72c40}.auth-form textarea{background:var(--bg-primary);color:var(--text-primary);border:1px solid var(--border-color);border-radius:5px;padding:12px;font:inherit;resize:vertical}
.activity-item{display:flex;align-items:flex-start;gap:16px;padding:20px;color:var(--text-primary);border-bottom:1px solid var(--border-color)}.activity-item:last-child{border-bottom:0}a.activity-item:hover,.activity-item.unread{background:var(--bg-tertiary)}.activity-avatar{width:44px;height:44px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;flex:none;background:var(--bg-primary);color:var(--accent-color)}.activity-avatar img{width:100%;height:100%;object-fit:cover}
.activity-copy{flex:1;min-width:0;overflow-wrap:anywhere}.activity-title{font-weight:600;color:var(--text-primary)}.activity-copy p{margin:6px 0;font-size:14px}.activity-copy time,.message-bubble time{font-size:12px;color:var(--text-secondary)}.message-snippet{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.unread-dot{width:8px;height:8px;border-radius:50%;background:var(--accent-color);margin-top:8px;flex:none}
.community-empty{padding:48px 24px;text-align:center;color:var(--text-secondary)}.community-empty>i{font-size:32px;margin-bottom:16px}.community-empty h2{font-size:21px;margin-bottom:12px;color:var(--text-primary)}.conversation{display:flex;flex-direction:column;gap:16px;padding:20px 0}
.message-bubble{max-width:80%;padding:16px 20px;align-self:flex-start;background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:16px 16px 16px 4px}.message-bubble.own-message{align-self:flex-end;background:var(--bg-tertiary);border-radius:16px 16px 4px 16px}.message-bubble p{white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0}.message-author{font-weight:600;font-size:13px}.message-image{max-height:300px;max-width:100%;border-radius:8px;display:block;margin:10px 0}
@media(max-width:768px){
.header .nav.nav-guest{left:auto;right:0;width:190px;border-radius:8px}.header .nav.nav-guest ul{align-items:flex-end;flex-direction:column}.header .nav.nav-guest li{text-align:right;display:flex;justify-content:flex-end}
.header .nav.nav-auth{position:static;display:block;width:auto;background:transparent;flex:none;max-height:none;overflow:visible}.header .nav.nav-auth ul{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:8px}.header .nav-auth ul li{width:auto;margin:0}.header .nav-auth .account-nav{order:1;position:static}.header .nav-auth .theme-nav{order:2}.header .nav-auth .user-name{display:none}
.header .nav-auth .dark-mode-toggle{font-size:0;width:32px;height:32px;padding:6px}.header .nav-auth .dark-mode-toggle i{font-size:16px;margin:0}.header .nav-auth .user-menu-button{padding:3px 5px;gap:5px}.header .nav-auth .user-menu-container{position:static}.header .nav-auth .user-dropdown{position:absolute;top:calc(100% + 10px);right:0;left:auto;width:min(310px,calc(100vw - 30px));margin:0}.header .nav-auth .user-dropdown.active{display:block}.header .nav-auth .user-dropdown-item{white-space:normal}
.profile-cover{height:170px}.profile-body{padding:0 18px 24px}.profile-avatar{width:100px;height:100px;margin-top:-50px}.community-page{padding-top:20px}.activity-item{padding:16px;gap:12px}.message-bubble{max-width:92%}
}
.user-avatar img,.dropdown-user-avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%}

        .market-dashboard-grid {
            display: grid;
            grid-template-columns: minmax(0, 1.85fr) minmax(245px, .75fr);
            gap: 14px;
            align-items: stretch;
        }
        .market-chart-panel,
        .technicals-panel {
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            box-shadow: 0 4px 12px var(--shadow-color);
        }
        .market-chart-panel {
            min-width: 0;
            overflow: hidden;
            padding: 13px;
    	    padding-bottom: 50px;
        }
        .market-panel-head {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 14px;
            margin-bottom: 9px;
        }
        .market-title-wrap {
            min-width: 0;
        }
        .market-kicker,
        .technicals-kicker {
            display: block;
            margin-bottom: 2px;
            color: var(--accent-color);
            font-size: .67rem;
            font-weight: 800;
            letter-spacing: .65px;
            text-transform: uppercase;
        }
        .market-panel-title,
        .technicals-title {
            margin: 0;
            color: var(--text-primary);
            font-family: var(--font-primary);
            font-size: 1.05rem;
            line-height: 1.3;
        }
        .market-symbol {
            flex: 0 0 auto;
            padding: 4px 8px;
            border: 1px solid var(--border-color);
            border-radius: 5px;
            background: var(--bg-primary);
            color: var(--text-primary);
            font-size: .72rem;
            font-weight: 800;
            letter-spacing: .5px;
        }
        .tv-chart-shell {
            width: 100%;
            overflow: hidden;
            border: 1px solid var(--border-color);
            border-radius: 7px;
            background: var(--bg-secondary);
            margin-bottom: 12px;
        }
        .tv-chart {
            width: 100%;
            height: 100%;
        }
        .technicals-panel {
            padding: 14px;
            display: flex;
            flex-direction: column;
        }
        .technicals-intro {
            margin: 5px 0 11px;
            color: var(--text-secondary);
            font-size: .74rem;
            line-height: 1.45;
        }
        .technical-level {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            padding: 10px 0;
            border-bottom: 1px solid var(--border-color);
        }
        .technical-label {
            color: var(--text-secondary);
            font-size: .74rem;
            font-weight: 700;
        }
        .technical-copy {
            display: flex;
            flex-direction: column;
            gap: 4px;
            align-items: flex-start;
        }
        .technical-value-wrap {
            text-align: right;
        }
        .technical-value {
            color: var(--text-primary);
            font-size: 1.02rem;
            font-weight: 850;
            font-variant-numeric: tabular-nums;
            white-space: nowrap;
        }
        .technical-value-wrap small {
            display: block;
            color: var(--text-tertiary);
            font-size: .61rem;
            margin-top: 1px;
            white-space: nowrap;
        }
        .level-role {
            display: inline-flex;
            align-items: center;
            width: fit-content;
            padding: 2px 6px;
            border-radius: 10px;
            font-size: .58rem;
            font-weight: 850;
            letter-spacing: .35px;
            text-transform: uppercase;
        }
        .support-role {
            color: var(--support-color);
            background: color-mix(in srgb, var(--support-color) 11%, transparent);
            border: 1px solid color-mix(in srgb, var(--support-color) 34%, transparent);
        }
        .resistance-role {
            color: var(--resistance-color);
            background: color-mix(in srgb, var(--resistance-color) 10%, transparent);
            border: 1px solid color-mix(in srgb, var(--resistance-color) 32%, transparent);
        }

        .technical-map {
            margin-top: 14px;
            padding: 10px 9px 8px;
            border: 1px solid var(--border-color);
            border-radius: 7px;
            background: var(--bg-primary);
        }
        .technical-map-label {
            color: var(--text-tertiary);
            font-size: .61rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: .45px;
            margin-bottom: 10px;
        }
        .level-track {
            position: relative;
            height: 5px;
            border-radius: 4px;
            background: linear-gradient(90deg,
                color-mix(in srgb, var(--text-tertiary) 18%, transparent),
                color-mix(in srgb, var(--accent-color) 45%, transparent));
            margin: 0 3px 8px;
        }
        .level-pin {
            position: absolute;
            left: var(--level-position);
            top: 50%;
            transform: translate(-50%, -50%);
            width: 9px;
            height: 9px;
            border-radius: 50%;
            border: 2px solid var(--bg-secondary);
            box-shadow: 0 0 0 1px var(--border-color);
        }
        .close-pin { background: #000; }
        .support-pin { background: var(--support-color); }
        .resistance-pin { background: var(--resistance-color); }
        .level-scale {
            display: flex;
            justify-content: space-between;
            color: var(--text-tertiary);
            font-size: .57rem;
            font-variant-numeric: tabular-nums;
        }
        .technicals-note {
            margin-top: auto;
            padding-top: 12px;
            color: var(--text-tertiary);
            font-size: .65rem;
            line-height: 1.42;
        }

        @media (max-width: 900px) {
            .market-dashboard-grid {
                grid-template-columns: 1fr;
            }
            .technicals-note {
                margin-top: 10px;
            }
        }
        @media (max-width: 520px) {
            .market-chart-panel{
 		padding: 10px;
		padding-bottom: 50px;

	     }
            .technicals-panel {
                padding: 10px;
            }
        }

.sidebar-fv-basis { font-size:.76rem; color:var(--text-tertiary); margin:-8px 0 12px; }
.sidebar-fv-grid { display:grid; grid-template-columns:1fr; gap:9px; }
.sidebar-fv-card { padding:10px 11px; border:1px solid var(--border-color); border-radius:7px; background:var(--bg-primary); }
.sidebar-fv-card.primary { border-left:3px solid var(--accent-color); }
.sidebar-fv-label { font-size:.67rem; text-transform:uppercase; letter-spacing:.5px; color:var(--text-tertiary); font-weight:800; }
.sidebar-fv-value { margin-top:2px; font-size:1.18rem; font-weight:800; color:var(--text-primary); }
.sidebar-fv-card.primary .sidebar-fv-value {color:var(--accent-color);font-size:1.42rem;}
.articles-main{min-width:0}.market-sidebar{width:380px;flex-shrink:0}.market-widget{width:100%;box-sizing:border-box}.market-widget .etf-item{width:100%;flex-shrink:0;text-align:left;font-family:inherit;background:transparent;color:inherit;border:0;border-left:3px solid transparent}.market-widget .etf-item.active,.market-widget .etf-item:hover,.market-widget .etf-item:focus-visible{background:var(--bg-tertiary);border-left-color:var(--accent-color)}
.instrument-market-layout{display:grid;grid-template-columns:minmax(0,1.85fr) minmax(230px,.75fr) minmax(220px,.75fr);gap:14px;align-items:start}.instrument-market-layout>*{min-width:0}.instrument-market-layout .market-chart-panel{padding:13px}.instrument-market-layout .tv-chart-shell{margin:0;position:relative}.instrument-market-layout .instrument-chart{height:420px;border:0;border-radius:0}
.market-panel-actions{display:flex;justify-content:flex-end;gap:6px;flex-wrap:wrap}.market-chart-mode-toggle,.market-expand-toggle{display:inline-flex;align-items:center;gap:6px;padding:6px 9px;border:1px solid var(--border-color);border-radius:6px;background:var(--bg-primary);color:var(--text-secondary);font:inherit;font-size:.68rem;font-weight:800;cursor:pointer}.market-chart-mode-toggle:focus-visible,.market-expand-toggle:focus-visible{outline:2px solid var(--accent-color);outline-offset:2px}
.instrument-fair-values .sidebar-widget{margin:0}.concealed-value{filter:blur(5px);pointer-events:none;user-select:none;min-width:65px}.instrument-levels .level-track{filter:blur(5px);pointer-events:none}.gated-technical{height:420px;position:relative;overflow:hidden}.technical-chart-preview{position:absolute;inset:0;filter:blur(7px);opacity:.5;pointer-events:none;user-select:none}.technical-chart-preview svg{width:100%;height:100%;fill:none}.chart-grid{stroke:var(--border-color);stroke-width:2}.chart-line{stroke:var(--accent-color);stroke-width:5}.chart-levels{stroke:#d49d3c;stroke-width:3;stroke-dasharray:12 8}.technical-beta-gate{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:20px}.technical-beta-gate .beta-gate-card{padding:22px;max-width:380px}.technical-beta-gate h2{font-size:21px}.technical-beta-gate p{font-size:13px}
.market-expanded .instrument-market-layout{grid-template-columns:1fr 1fr}.market-expanded .market-chart-panel{grid-column:1/-1}.market-expanded .instrument-chart,.market-expanded .gated-technical{height:70vh;min-height:420px}
@media(max-width:1100px){.instrument-market-layout{grid-template-columns:minmax(0,1.7fr) minmax(220px,1fr)}.instrument-market-layout .market-chart-panel{grid-row:span 2}.market-expanded .market-chart-panel{grid-row:auto}}
@media(max-width:992px){.market-sidebar{width:100%}.market-widget .chart-container{height:280px}.market-widget .etf-list{max-height:180px}}
@media(max-width:768px){.instrument-market-layout,.market-expanded .instrument-market-layout{grid-template-columns:1fr}.instrument-market-layout .market-chart-panel{grid-row:auto}.instrument-market-layout .instrument-chart,.gated-technical{height:360px}.market-expanded .instrument-chart,.market-expanded .gated-technical{height:70vh}.instrument-page{padding-left:15px;padding-right:15px}}
.profile-crop-dialog{width:min(480px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;margin:auto;padding:24px;border:1px solid var(--border-color);border-radius:12px;background:var(--bg-secondary);color:var(--text-primary)}.profile-crop-dialog::backdrop{background:rgba(0,0,0,.7)}.profile-crop-dialog h2{font-size:21px;margin-bottom:12px}.profile-crop-dialog p{font-size:13px;color:var(--text-secondary)}.crop-zoom{display:flex;align-items:center;gap:12px;margin:16px 0;font-size:13px}.crop-zoom input{flex:1;min-width:0}.crop-zoom output{width:42px}.crop-stage{position:relative;width:100%;aspect-ratio:4/3;background:#20252c;overflow:hidden;border-radius:8px}.crop-stage canvas{display:block;width:100%;height:100%;touch-action:none;cursor:move}.crop-mask{position:absolute;left:25%;top:16.6667%;width:50%;height:66.6667%;border:2px solid #fff;border-radius:50%;box-shadow:0 0 0 400px #0007;pointer-events:none;box-sizing:border-box}.profile-crop-dialog[data-kind=cover] .crop-mask{left:5%;top:31.25%;width:90%;height:37.5%;border-radius:0}.crop-actions{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-top:20px}.crop-actions .btn{padding:10px 20px}.registration-avatar{width:80px;height:80px;border-radius:50%;overflow:hidden;background:var(--bg-tertiary);margin:12px 0}.registration-avatar img{width:100%;height:100%;object-fit:cover}

/* Use the freed space when the database has not enabled fair values. */
.instrument-market-layout.without-fair-values{grid-template-columns:minmax(0,1.85fr) minmax(230px,.75fr)}
.instrument-market-layout.without-fair-values .market-chart-panel{grid-row:auto}
.market-expanded .instrument-market-layout.without-fair-values{grid-template-columns:1fr}
@media(max-width:768px){.instrument-market-layout.without-fair-values{grid-template-columns:1fr}}

/* Listing dashboard and US Market directory */
.market-nav-link { color:var(--text-light)!important; font-size:14px; font-weight:700; white-space:nowrap; }
.market-nav-link:hover { color:var(--accent-color)!important; }
.instrument-breadcrumbs { display:flex; align-items:center; gap:9px; flex-wrap:wrap; margin:0 0 18px; color:var(--text-tertiary); font-size:13px; }
.instrument-breadcrumbs a { color:var(--accent-color); font-weight:700; }
.instrument-breadcrumbs strong { color:var(--text-primary); }
.instrument-market-layout.has-gex { grid-template-columns:minmax(0,1.85fr) minmax(245px,.75fr); }
.instrument-market-layout.no-gex { grid-template-columns:minmax(0,1fr); }
.instrument-market-layout.no-gex .market-chart-panel { grid-column:1/-1; }
.instrument-market-layout .instrument-gex-panel { min-width:0; }
.instrument-market-layout .instrument-chart,.instrument-market-layout .technical-chart { height:420px; }
.instrument-market-layout .technical-chart { width:100%; position:relative; overflow:hidden; background:var(--bg-secondary); }
.instrument-market-layout .technical-chart-preview { position:absolute; inset:0; filter:blur(7px); opacity:.55; pointer-events:none; }
.instrument-market-layout .technical-chart-preview svg { width:100%; height:100%; fill:none; stroke:var(--border-color); stroke-width:2; }
.instrument-market-layout .technical-chart-preview svg path:last-child { stroke:var(--accent-color); stroke-width:5; }
.instrument-market-layout .tv-chart-shell { position:relative; }
.technical-chart-controls { display:flex; gap:6px; }
.technical-view-controls[hidden] { display:none!important; }
.technical-chart-date { margin:8px 2px 0; font-size:11px; color:var(--text-tertiary); }
.chart-login-gate { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; padding:18px; background:rgba(8,14,25,.12); z-index:4; }
.chart-login-gate[hidden] { display:none!important; }
.chart-login-gate .beta-gate-card { max-width:360px; padding:22px; }
.chart-login-gate h2 { font-size:21px; margin:10px 0; }
.chart-login-gate p { font-size:13px; }
.instrument-section { margin:24px 0; padding:20px; background:var(--bg-secondary); border:1px solid var(--border-color); border-radius:12px; box-shadow:0 4px 12px var(--shadow-color); }
.instrument-section-head { display:flex; justify-content:space-between; align-items:flex-end; gap:16px; margin-bottom:14px; }
.instrument-section-head h2 { margin:3px 0 0; font-size:clamp(18px,2.3vw,24px); }
.level-reference-date { color:var(--text-tertiary); font-size:12px; white-space:nowrap; }
.instrument-gex-panel { position:relative; min-height:300px; padding:16px; overflow:hidden; }
.instrument-gex-panel .technicals-title { font-size:1.1rem; margin:5px 0 8px; }
.instrument-gex-panel .technical-level { padding:11px 0; }
.instrument-gex-panel .technical-value { color:var(--text-primary); font-size:1.05rem; font-weight:800; }
.gex-expiration-list { display:flex; flex-wrap:wrap; align-items:center; gap:7px; padding-top:12px; }
.gex-expiration-list .technical-label { flex:0 0 100%; }
.gex-expiration-list span:not(.technical-label) { padding:4px 7px; border:1px solid var(--border-color); border-radius:5px; font-size:11px; }
.member-gated-shell { position:relative; overflow:hidden; border-radius:10px; }
.member-gated-content { min-width:0; }
.member-gated-content.is-locked { filter:blur(5px); pointer-events:none; user-select:none; }
.member-gate-overlay { position:absolute; inset:0; display:flex; justify-content:center; align-items:center; padding:14px; background:rgba(5,10,18,.12); z-index:2; }
.member-gate-overlay .beta-gate-card { max-width:330px; padding:22px; }
.member-gate-overlay h3 { margin:8px 0; font-size:19px; }
.member-gate-overlay p { margin-bottom:12px; font-size:13px; }
.ai-research-section { padding:18px 20px; }
.ai-research-summary { display:flex; justify-content:space-between; align-items:center; gap:18px; }
.ai-research-summary p { margin:0; max-width:700px; font-size:14px; }
.ai-pack-download { display:inline-flex; align-items:center; gap:10px; padding:10px 15px; border-radius:7px; background:var(--accent-color); color:#fff; font-size:13px; font-weight:800; white-space:nowrap; }
.ai-pack-download:hover { background:var(--accent-hover); color:#fff; }
.ai-pack-contents { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:12px; padding-top:10px; border-top:1px solid var(--border-color); color:var(--text-tertiary); font-size:11px; }
.ai-pack-contents ul { display:flex; flex-wrap:wrap; gap:8px 22px; margin:0; padding-left:18px; color:var(--text-secondary); }
.beta-feature-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:24px 0; }
.beta-feature-shell { position:relative; min-height:290px; overflow:hidden; }
.beta-feature-shell .member-gated-content { min-height:240px; }
.beta-feature-overlay { position:absolute; inset:0; z-index:2; display:flex; align-items:center; justify-content:center; padding:18px; background:rgba(5,10,18,.12); }
.beta-feature-overlay .beta-gate-card { max-width:360px; padding:22px; }
.beta-feature-overlay h3 { margin:9px 0; font-size:19px; }
.beta-feature-overlay p { margin-bottom:12px; font-size:13px; }
.beta-feature-overlay .beta-join-button { padding:10px 18px; }
.beta-enabled-note { margin-top:12px; padding:9px 11px; border-radius:6px; background:var(--bg-tertiary); color:var(--text-secondary); font-size:12px; }
.beta-metric-placeholder { display:grid; grid-template-columns:1fr auto; gap:12px; margin:20px 0; padding:14px; background:var(--bg-primary); border:1px solid var(--border-color); border-radius:8px; }
.beta-metric-placeholder span,.beta-valuation-placeholder span { color:var(--text-secondary); font-size:12px; }
.beta-metric-placeholder strong,.beta-valuation-placeholder strong { color:var(--text-primary); font-size:15px; }
.beta-valuation-placeholder { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:20px 0; }
.beta-valuation-placeholder>div { display:flex; flex-direction:column; gap:10px; padding:12px 8px; border:1px solid var(--border-color); border-radius:7px; background:var(--bg-primary); }
.period-availability { margin-top:12px; color:var(--text-tertiary); font-size:11px; }
.beta-waitlist-status { margin:0 0 18px; font-size:13px; color:var(--text-secondary); }
.beta-feature-shell.beta-enabled .member-gated-content { filter:none; }
.us-market-page { padding:32px 0 60px; }
.us-market-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:24px; }
.us-market-heading h1 { margin:4px 0 8px; font-size:clamp(26px,3vw,36px); }
.us-market-heading p { margin:0; font-size:14px; }
.us-market-date { display:flex; flex-direction:column; gap:3px; padding:10px 14px; border:1px solid var(--border-color); border-radius:8px; background:var(--bg-secondary); }
.us-market-date span { color:var(--text-tertiary); font-size:10px; text-transform:uppercase; font-weight:800; letter-spacing:.5px; }
.us-market-date strong { font-size:14px; }
.us-market-group { margin:16px 0; overflow:hidden; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-secondary); }
.us-market-group-head { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:14px 17px; background:var(--bg-tertiary); border-bottom:1px solid var(--border-color); }
.us-market-group-head h2 { margin:0; font-size:17px; }
.us-market-group-summary { display:flex; gap:14px; align-items:center; font-size:12px; font-weight:800; font-variant-numeric:tabular-nums; }
.market-up { color:#269b68!important; }
.market-down { color:#d64c55!important; }
.market-flat { color:var(--text-tertiary); }
.us-market-company-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.us-market-company { display:flex; justify-content:space-between; align-items:center; gap:12px; min-width:0; padding:12px 17px; border-bottom:1px solid var(--border-color); }
.us-market-company:nth-child(odd) { border-right:1px solid var(--border-color); }
.us-market-company:hover { background:var(--bg-primary); }
.us-market-company-name { min-width:0; display:flex; flex-direction:column; gap:2px; font-size:13px; font-weight:700; }
.us-market-company-name small { color:var(--text-tertiary); font-size:10px; font-weight:500; }
.us-market-company-move { display:flex; align-items:center; gap:8px; flex:none; font-size:12px; font-variant-numeric:tabular-nums; }
.us-market-company-move i { font-size:14px; }
.us-market-empty { padding:30px; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-secondary); color:var(--text-secondary); text-align:center; }
@media(max-width:900px) {
    .instrument-market-layout.has-gex { grid-template-columns:minmax(0,1fr); }
    .instrument-market-layout.has-gex .instrument-gex-panel { min-height:0; }
}
@media(max-width:768px) {
    .market-nav-link { font-size:12px; }
    .instrument-section { padding:15px; }
    .instrument-section-head { align-items:flex-start; flex-direction:column; }
    .level-reference-date { white-space:normal; }
    .price-level-map { padding:10px; overflow-x:auto; }
    .price-level-map-head,.price-level-row { min-width:550px; }
    .beta-feature-grid { grid-template-columns:1fr; }
    .ai-research-summary { align-items:flex-start; flex-direction:column; }
    .us-market-heading { align-items:flex-start; flex-direction:column; }
    .us-market-company-list { grid-template-columns:1fr; }
    .us-market-company:nth-child(odd) { border-right:0; }
    .us-market-company { padding:12px; }
}
.instrument-market-layout.no-gex .market-chart-panel { grid-row:auto; }
.market-expanded .instrument-market-layout .technical-chart { height:70vh; min-height:420px; }
@media(max-width:900px) { .instrument-market-layout.has-gex .market-chart-panel { grid-row:auto; } }
.financial-period-controls { display:grid; grid-template-columns:auto minmax(100px,140px) auto minmax(100px,140px); align-items:center; gap:8px; margin:12px 0; }
.financial-period-controls label { color:var(--text-tertiary); font-size:11px; font-weight:800; }
.financial-period-controls select { min-width:0; padding:7px 9px; border:1px solid var(--border-color); border-radius:5px; background:var(--bg-primary); color:var(--text-primary); font:inherit; font-size:12px; }
.financial-metrics-output { max-height:520px; overflow:auto; }
.financial-report-block { margin:14px 0; }
.financial-report-block h3 { margin:0 0 8px; font-size:13px; }
.financial-metrics-table { width:100%; border-collapse:collapse; font-size:11px; }
.financial-metrics-table th,.financial-metrics-table td { padding:7px 8px; border-bottom:1px solid var(--border-color); text-align:left; }
.financial-metrics-table th { color:var(--text-tertiary); font-size:10px; text-transform:uppercase; }
.financial-metrics-table td:nth-child(2) { text-align:right; font-variant-numeric:tabular-nums; }
.financial-empty { margin:12px 0; font-size:12px; }
@media(max-width:600px) { .financial-period-controls { grid-template-columns:auto 1fr; } }


/* Level-map styling adapted from supplied integrated dashboard prototype */
.lm-shell{border:1px solid var(--border-color);border-radius:11px;background:var(--bg-secondary);overflow:hidden;box-shadow:0 4px 14px var(--shadow-color)}
.lm-topline{display:grid;grid-template-columns:1fr 1fr;gap:16px;padding:18px 19px 16px;background:var(--bg-secondary);border-bottom:1px solid var(--border-color)}
.lm-key-label{font-size:.65rem;letter-spacing:.75px;color:var(--text-tertiary);font-weight:800;display:block;margin-bottom:4px}
.lm-close-number{font-size:2rem;line-height:1.1;letter-spacing:-.7px;font-weight:850;color:var(--text-primary);font-variant-numeric:tabular-nums}
.lm-date{display:block;color:var(--text-tertiary);font-size:.66rem;line-height:1.5;margin-top:5px}
.lm-consensus{border-left:1px solid var(--border-color);padding-left:17px}
.lm-consensus-value{display:flex;align-items:center;gap:9px;flex-wrap:wrap;min-height:38px}
.lm-strong{color:var(--support-color);font-weight:850;font-size:1.14rem}.lm-count{font-size:.72rem;color:var(--text-secondary);border:1px solid var(--border-color);border-radius:100px;padding:3px 9px}
.lm-toolbar{padding:12px 16px;display:flex;flex-direction:column;gap:11px;border-bottom:1px solid var(--border-color)}
.lm-legend,.lm-controls{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.lm-legend span{display:inline-flex;gap:6px;align-items:center;color:var(--text-secondary);font-size:.69rem;font-weight:650}.lm-dot{width:9px;height:9px;display:inline-block;border-radius:50%}.lm-analyst{background:#9871cf}.lm-gex{background:#de9b4e}.lm-pine{background:var(--accent-color)}.lm-ref{background:var(--text-primary)}
.lm-controls{justify-content:space-between;gap:8px}.lm-segments{display:flex;gap:0;padding:3px;border:1px solid var(--border-color);background:var(--bg-primary);border-radius:7px}
.lm-segments button,.lm-details-btn{font-size:.7rem;font-weight:750;color:var(--text-secondary);border:0;background:transparent;cursor:pointer;padding:7px 10px;border-radius:5px;font-family:inherit}
.lm-segments button.lm-active{background:var(--bg-secondary);box-shadow:0 1px 4px var(--shadow-color);color:var(--text-primary)}
.lm-details-btn{border:1px solid var(--border-color);background:var(--bg-secondary)}.lm-details-btn[aria-pressed="true"]{border-color:var(--accent-color);color:var(--accent-color)}
.lm-chart-scroller{overflow-x:auto;max-width:100%}.lm-chart{padding:10px 16px 14px;min-width:560px}
.lm-grid-head,.lm-grid-foot,.lm-row{display:grid;grid-template-columns:minmax(131px,1.55fr) minmax(170px,2.4fr) minmax(72px,.78fr) minmax(96px,.96fr);gap:10px;align-items:center}
.lm-grid-head{min-height:36px;color:var(--text-tertiary);font-size:.58rem;font-weight:850;letter-spacing:.45px;border-bottom:1px solid var(--border-color)}
.lm-num-col{text-align:right}.lm-grid-foot{font-size:.62rem;color:var(--text-tertiary);margin-top:7px}.lm-rows{padding-top:7px}
.lm-row{padding:7px 0;min-height:42px;border-bottom:1px solid color-mix(in srgb,var(--border-color) 65%,transparent)}.lm-row:last-child{border-bottom:0}
.lm-row.lm-is-close{background:color-mix(in srgb,var(--accent-color) 7%, transparent);border-radius:5px;padding-left:5px;padding-right:5px}
.lm-name{font-size:.74rem;line-height:1.25;font-weight:725;color:var(--text-primary);display:block}.lm-label-small{display:block;margin-top:3px;color:var(--text-tertiary);font-size:.59rem;line-height:1.3}
.lm-tag{font-size:.52rem;display:inline-block;margin-left:4px;font-weight:800;letter-spacing:.3px;vertical-align:middle;padding:1px 4px;border-radius:3px;background:var(--bg-tertiary);color:var(--text-secondary)}
.lm-plot{height:21px;position:relative;isolation:isolate;overflow:hidden;background:linear-gradient(to bottom,transparent 48%,color-mix(in srgb,var(--border-color) 50%,transparent) 49%,color-mix(in srgb,var(--border-color) 50%,transparent) 52%,transparent 53%)}
.lm-plot::after,.lm-plot-axis::after{content:"";position:absolute;left:var(--lm-zero,28.5714%);top:0;height:100%;width:1px;background:var(--text-primary);opacity:.55;z-index:3}
.lm-plot-axis{height:34px;position:relative;min-width:0}.lm-axis-tick{position:absolute;top:2px;transform:translateX(-50%);font-size:.58rem;white-space:nowrap}.lm-axis-tick:first-child{transform:translateX(0)}.lm-axis-tick:last-child{transform:translateX(-100%)}
.lm-bar{position:absolute;height:5px;top:8px;border-radius:5px;z-index:1;opacity:.72}.lm-bar[data-group="analyst"]{background:#9871cf}.lm-bar[data-group="gex"]{background:#de9b4e}.lm-bar[data-group="pine"]{background:var(--accent-color)}
.lm-pin{width:10px;height:10px;border-radius:100px;border:2px solid var(--bg-secondary);position:absolute;top:5px;transform:translateX(-50%);z-index:4;box-shadow:0 0 0 1px var(--border-color)}.lm-pin[data-group="analyst"]{background:#9871cf}.lm-pin[data-group="gex"]{background:#de9b4e}.lm-pin[data-group="pine"]{background:var(--accent-color)}.lm-pin[data-group="reference"]{background:var(--text-primary);height:13px;width:13px;top:4px}
.lm-zone{position:absolute;top:4px;height:13px;border:1px solid var(--accent-color);background:color-mix(in srgb,var(--accent-color) 20%,transparent);border-radius:3px;z-index:2;min-width:3px}
.lm-overflow{position:absolute;top:2px;z-index:5;color:#9871cf;font-size:17px;line-height:17px;font-weight:850}.lm-overflow.left{left:1px}.lm-overflow.right{right:1px}
.lm-price,.lm-distance{text-align:right;color:var(--text-primary);font-size:.73rem;font-weight:780;font-variant-numeric:tabular-nums}.lm-distance{color:var(--text-secondary);font-size:.68rem}.lm-distance.pos{color:var(--support-color)}.lm-distance.neg{color:var(--resistance-color)}
.lm-reading{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:13px 17px;color:var(--text-secondary);font-size:.68rem;line-height:1.53;background:var(--bg-primary);border-top:1px solid var(--border-color)}.lm-reading i{margin-right:6px;color:var(--accent-color)}.lm-reading strong{color:var(--text-primary)}

/* v1.5 research dashboard overrides, limited to new components */
.research-section-tabs { display:flex;gap:3px;align-items:center;flex-wrap:wrap;margin:0 0 17px;border-bottom:1px solid var(--border-color); }
.research-section-tabs a { display:inline-block;padding:10px 16px;color:var(--text-secondary);font-weight:750;font-size:12px;border-bottom:2px solid transparent; }
.research-section-tabs a:hover,.research-section-tabs a:focus-visible { color:var(--accent-color);border-color:var(--accent-color); }
.price-map-intro { margin:0 0 16px;color:var(--text-secondary);font-size:13px;line-height:1.6;max-width:1060px; }
.research-analysis-pending {display:flex;align-items:center;gap:11px;padding:14px 16px;border:1px solid var(--border-color);border-radius:7px;background:var(--bg-primary);color:var(--text-secondary);font-size:13px;line-height:1.5;margin:10px 0;}
.research-analysis-pending i {color:var(--accent-color);}
.price-level-gate {border:1px solid var(--border-color);}
.research-levelmap {background:var(--bg-secondary);overflow:hidden;--lm-zero:50%;}
.research-levelmap .lm-topline {grid-template-columns:1fr 1fr;}
.research-levelmap .lm-roc-summary {border-left:1px solid var(--border-color);padding-left:18px;align-self:center;}
.research-levelmap .lm-roc-summary strong {display:block;font-size:1rem;font-weight:750;color:var(--text-primary);}
.research-levelmap .lm-time-tabs,.research-levelmap .lm-category-toolbar {display:flex;align-items:center;gap:7px;flex-wrap:wrap;}
.research-levelmap .lm-time-tabs button,.research-levelmap .lm-category-toolbar button {font:750 12px/1.3 var(--font-primary);padding:8px 13px;background:transparent;color:var(--text-secondary);border:1px solid transparent;border-radius:5px;cursor:pointer;}
.research-levelmap .lm-time-tabs button[aria-selected="true"],.research-levelmap .lm-category-toolbar button[aria-pressed="true"] {background:var(--bg-tertiary);color:var(--accent-color);border-color:var(--border-color);}
.research-levelmap .lm-horizon-toolbar {display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;padding:10px 16px;}
.research-levelmap .lm-category-toolbar {padding:4px 16px 11px;border-bottom:1px solid var(--border-color);}
.research-levelmap .lm-tab-count {font-size:10px;color:var(--text-tertiary);margin-left:4px;}
.research-levelmap .lm-horizon-note {font-size:11px;color:var(--text-tertiary);}
.research-levelmap .lm-filter-status {font-size:12px;color:var(--text-secondary);padding:10px 17px 0;margin:0;}
.research-levelmap .lm-empty {padding:22px;color:var(--text-secondary);font-size:12px;}
.research-levelmap .lm-empty p {margin:7px 0;font-size:12px;}
.research-levelmap .lm-empty button {border:1px solid var(--border-color);background:var(--bg-tertiary);border-radius:5px;color:var(--accent-color);padding:6px 10px;font:inherit;cursor:pointer;}
.research-levelmap .lm-name-column {min-width:0;}
.research-levelmap .lm-name {font-size:12px;line-height:1.35;font-weight:750;overflow-wrap:anywhere;}
.research-levelmap .lm-description {font-size:11px;line-height:1.4;color:var(--text-secondary);margin:4px 0 0;overflow-wrap:anywhere;}
.research-levelmap .lm-desc-toggle {font-size:11px;border:0;background:none;padding:2px 0;color:var(--accent-color);cursor:pointer;text-decoration:underline;}
.research-levelmap .lm-level-formula {display:block;font-size:10px;line-height:1.35;margin-top:3px;color:var(--text-tertiary);overflow-wrap:anywhere;}
.research-levelmap .lm-grid-head>span:nth-child(n+3) {text-align:right;}
.research-levelmap .lm-point {width:10px;height:10px;border-radius:50%;border:2px solid var(--bg-secondary);position:absolute;top:5px;transform:translateX(-50%);z-index:4;background:var(--text-primary);box-shadow:0 0 0 1px var(--border-color);}
.research-levelmap .lm-bar[data-group="ANALYST"] {background:#9871cf;}
.research-levelmap .lm-bar[data-group="GEX"] {background:#de9b4e;}
.research-levelmap .lm-bar[data-group="TECHNICAL"] {background:var(--accent-color);}
.research-levelmap .lm-reading p {font-size:11px;line-height:1.5;margin:0;}
.research-levelmap .lm-grid-foot span:nth-child(2) {grid-column:2;}
.us-market-totals {display:flex;gap:13px;align-items:center;margin-top:8px;}
.us-market-date .us-market-totals span {font-size:12px;letter-spacing:0;text-transform:none;}
.us-market-group-head h2 a {color:var(--text-primary);}
.us-market-group-head h2 a:hover {color:var(--accent-color);}
@media(max-width:768px) {
 .research-levelmap .lm-topline {grid-template-columns:1fr 1fr;padding:12px;}
 .research-levelmap .lm-roc-summary {padding-left:10px;}
 .research-levelmap .lm-close-number {font-size:1.4rem;}
 .research-levelmap .lm-chart {min-width:560px;}
 .research-levelmap .lm-reading {grid-template-columns:1fr;}
 .research-levelmap .lm-horizon-toolbar {gap:7px;}
 .research-section-tabs a {padding:9px 10px;}
}
@media(prefers-reduced-motion:reduce) {.research-section-tabs a {transition:none;}}

/* Week/day timeframe and GEX context chart; reuse existing level-track palette */
.technical-timeframe-picker {display:flex;align-items:center;gap:7px;font-size:11px;color:var(--text-secondary);font-weight:700;}
.technical-timeframe-picker select {padding:6px 8px;border-radius:5px;border:1px solid var(--border-color);background:var(--bg-secondary);color:var(--text-primary);font:inherit;}
.instrument-gex-panel .technical-map {margin-top:15px;}
.gex-delta-summary {margin:8px 0 0;color:var(--text-secondary);font-size:11px;line-height:1.5;}
