/* ==========================================================================
   CSS DESIGN SYSTEM FOR KEYROF WEB SCREENER
   Theme: Premium Dark Institutional Terminal
   Locale: Arabic (RTL) / Numbers & Tickers (LTR)
   ========================================================================== */

:root {
    --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* Color Palette */
    --bg-primary: #070b12;
    --bg-secondary: #0e1524;
    --bg-glass: rgba(14, 21, 36, 0.7);
    --bg-glass-card: rgba(22, 33, 56, 0.55);
    --border-color: rgba(148, 163, 184, 0.1);
    --border-hover: rgba(148, 163, 184, 0.22);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Brand & Status Colors */
    --gold: #fbbf24;
    --gold-rgb: 251, 191, 36;
    --emerald: #10b981;
    --emerald-rgb: 16, 185, 129;
    --rose: #ef4444;
    --rose-rgb: 239, 68, 68;
    --indigo: #4f46e5;
    --indigo-rgb: 79, 70, 229;
    --teal: #06b6d4;
    --teal-rgb: 6, 182, 212;
    
    /* Layout Variables */
    --border-radius-sm: 8px;
    --border-radius-md: 14px;
    --border-radius-lg: 20px;
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Core Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-ui);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    direction: rtl;
    overflow-x: hidden;
}

/* App Container */
.app-container {
    max-width: 500px; /* Target mobile phone width */
    margin: 0 auto;
    background-color: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 16px 16px 24px 16px;
    position: relative;
}

/* Header Styles */
.app-header {
    margin-bottom: 20px;
}

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

.header-account-area {
    display: flex;
    align-items: center;
    gap: 7px;
    direction: ltr;
}

.account-control { position: relative; direction: rtl; }
.account-control [hidden] { display: none !important; }
.account-control.is-loading { min-width: 42px; min-height: 36px; opacity: .55; }
.account-guest-actions { display: flex; align-items: center; gap: 5px; }
.account-auth-link { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 5px 10px; border: 1px solid rgba(148,163,184,.16); border-radius: 10px; color: var(--text-secondary); background: rgba(15,23,42,.56); font-family: var(--font-ui); font-size: .65rem; font-weight: 800; text-decoration: none; transition: var(--transition-smooth); }
.account-auth-link--primary { color: #f8fafc; border-color: rgba(var(--gold-rgb),.32); background: rgba(var(--gold-rgb),.1); }
.account-auth-link:hover,.account-auth-link:focus-visible,.account-control-trigger:hover,.account-control-trigger:focus-visible { border-color: rgba(var(--gold-rgb),.48); background: rgba(var(--gold-rgb),.08); outline: none; }
.account-control-trigger { min-width: 70px; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 3px 9px 3px 5px; border: 1px solid rgba(148,163,184,.16); border-radius: 12px; color: var(--text-primary); background: linear-gradient(145deg,rgba(30,41,59,.72),rgba(14,21,36,.6)); box-shadow: inset 0 1px 0 rgba(255,255,255,.035); cursor: pointer; transition: var(--transition-smooth); }
.account-control-monogram { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(var(--gold-rgb),.3); border-radius: 9px; color: var(--gold); background: rgba(var(--gold-rgb),.08); font-family: var(--font-ui); font-size: .7rem; font-weight: 900; }
.account-control-plan { color: var(--text-secondary); font-family: var(--font-ui); font-size: .63rem; font-weight: 850; }
.account-menu { width: min(300px,calc(100% - 24px)); margin: 0; padding: 0; border: 0; color: var(--text-primary); background: transparent; overflow: visible; }
.account-menu::backdrop { background: rgba(2,6,15,.58); backdrop-filter: blur(3px); }
.account-menu-panel { position: relative; overflow: hidden; border: 1px solid rgba(148,163,184,.22); border-radius: 16px; background: #0d1421; box-shadow: 0 24px 64px rgba(0,0,0,.48); }
.account-menu-close { position: absolute; inset-inline-end: 8px; top: 8px; width: 36px; height: 36px; border: 0; border-radius: 10px; color: var(--text-muted); background: transparent; font-size: 1.25rem; cursor: pointer; }
.account-menu-close:hover,.account-menu-close:focus-visible { color: var(--text-primary); background: rgba(148,163,184,.08); outline: 2px solid rgba(129,140,248,.45); }
.account-menu-identity { display: grid; gap: 2px; padding: 18px 18px 14px 52px; border-bottom: 1px solid rgba(148,163,184,.1); }
.account-menu-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-ui); font-size: .82rem; }
.account-menu-identity span { overflow: hidden; color: var(--text-muted); font-family: var(--font-ui); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.account-menu-links { display: grid; padding: 7px; }
.account-menu-links a { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 10px; color: var(--text-secondary); font-family: var(--font-ui); font-size: .72rem; font-weight: 780; text-decoration: none; }
.account-menu-links a:hover,.account-menu-links a:focus-visible { color: var(--text-primary); background: rgba(99,102,241,.1); outline: none; }
.account-menu-links small { color: var(--gold); font-size: .6rem; font-weight: 850; }
.account-menu-logout { width: calc(100% - 14px); min-height: 40px; margin: 0 7px 7px; border: 0; border-top: 1px solid rgba(148,163,184,.09); border-radius: 9px; color: #cbd5e1; background: transparent; font-family: var(--font-ui); font-size: .68rem; font-weight: 750; cursor: pointer; text-align: start; }
.account-menu-logout:hover,.account-menu-logout:focus-visible { color: #fff; background: rgba(148,163,184,.07); outline: none; }
.account-menu-message { min-height: 0; padding: 0 14px; color: #fca5a5; font-family: var(--font-ui); font-size: .62rem; }
.account-menu-message:not(:empty) { padding-bottom: 12px; }

.header-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 40px;
}

.logo-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.08em;
    line-height: 1.1;
}

.app-subtitle {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0;
    margin-top: 3px;
    line-height: 1.35;
}

.app-subtitle::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 1px;
    margin-inline-end: 6px;
    vertical-align: middle;
    background: rgba(var(--gold-rgb), 0.55);
}

/* Pulse Dot Live Status */
.live-status {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: var(--emerald);
    border-radius: 50%;
    position: relative;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--emerald);
    animation: pulse 1.8s infinite ease-in-out;
}

.status-text {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--emerald);
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.6); opacity: 0; }
}

/* Shared semantic colours used by detail sheets and signal indicators. */
.text-emerald { color: var(--emerald) !important; }
.text-rose { color: var(--rose) !important; }
.text-gold { color: var(--gold) !important; }
.text-teal { color: var(--teal) !important; }
.text-indigo { color: var(--indigo) !important; }

/* Controls Section (Search & Filter) */
.controls-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-wrapper {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

#search-input {
    width: 100%;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 10px 38px 10px 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-ui);
    transition: var(--transition-smooth);
}

#search-input:focus {
    outline: none;
    border-color: var(--indigo);
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.15);
}

.clear-btn {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 2px;
}

.filters-toggle {
    width: 100%;
    min-height: 30px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: var(--border-radius-sm);
    background: rgba(7, 11, 18, 0.34);
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.filters-toggle:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.filters-toggle i {
    font-size: 0.62rem;
    transition: transform 0.2s ease;
}

.filters-toggle[aria-expanded="false"] i {
    transform: rotate(180deg);
}

/* Filters container */
.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 2px;
    overflow: hidden;
    max-height: 180px;
    opacity: 1;
    transition: max-height 0.25s ease, opacity 0.18s ease, padding 0.25s ease;
}

.filters-container.is-collapsed {
    max-height: 0;
    opacity: 0;
    padding-bottom: 0;
    pointer-events: none;
}

.filters-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

.filter-tab {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 5px 10px;
    border-radius: 30px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-tab:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.filter-tab.active {
    background-color: var(--indigo);
    border-color: var(--indigo);
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.filter-count {
    font-size: 0.58rem;
    font-family: var(--font-ui);
    font-weight: 800;
    padding: 1px 5.5px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.07);
    color: rgba(148, 163, 184, 0.5) !important;
    margin-inline-start: 4px;
    transition: var(--transition-smooth);
}

.filter-tab.active .filter-count {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff !important;
}

/* Highlight badge when count is greater than 0 */
.filter-count.has-signals {
    background-color: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #34d399 !important;
}

.filter-tab.active .filter-count.has-signals {
    background-color: var(--emerald);
    border-color: var(--emerald);
    color: #fff !important;
}


/* Pre-Market filter tab special styling */
.filter-tab[data-filter="pre-market"].active {
    background: linear-gradient(135deg, #065f6c 0%, #06b6d4 100%);
    border-color: #06b6d4;
    color: #fff;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
}

.filter-tab[data-filter="pre-market"].active .filter-count {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff !important;
}

.filter-tab[data-filter="pre-market"].active .filter-count.has-signals {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff !important;
}


/* Main Feed */
.main-feed {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
}

.feed-title {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-inline-start: 2px solid rgba(var(--gold-rgb), 0.72);
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(var(--gold-rgb), 0.055), rgba(15, 23, 42, 0.34));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.last-sync {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-ui);
}

/* Loading/Empty States */
.feed-loader, .feed-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    border-radius: var(--border-radius-md);
    background-color: var(--bg-glass);
    border: 1px solid var(--border-color);
    flex-grow: 1;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top-color: var(--indigo);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin-bottom: 12px;
}

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

.feed-loader p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.feed-empty .empty-icon {
    font-size: 2.2rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.feed-empty h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.feed-empty p {
    font-size: 0.78rem;
    color: var(--text-muted);
    max-width: 280px;
}

/* Signals Container & Cards */
.signals-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.signal-card {
    background-color: var(--bg-glass-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 14px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.signal-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Card Header */
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.symbol-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.symbol-name {
    font-family: var(--font-ui);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.country-tag {
    font-size: 0.55rem;
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 1px 4px;
    border-radius: 3px;
    font-family: var(--font-ui);
}

/* Uses the former country-tag footprint, but renders the ISO country as a flag. */
.country-flag {
    width: 1.45em;
    min-width: 1.45em;
    height: 1.1em;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-size: 0.68rem;
    line-height: 1;
    letter-spacing: 0;
}

.status-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Status colors */
.badge-gold { background-color: var(--gold-bg); color: var(--gold); border: 1px solid rgba(251, 191, 36, 0.2); }
.badge-emerald { background-color: var(--emerald-bg); color: var(--emerald); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-rose { background-color: var(--rose-bg); color: var(--rose); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-teal { background-color: rgba(6, 182, 212, 0.08); color: var(--teal); border: 1px solid rgba(6, 182, 212, 0.2); }
.badge-indigo { background-color: var(--indigo-bg); color: var(--indigo); border: 1px solid rgba(79, 70, 229, 0.2); }

/* Price and Change Section */
.price-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.live-price-wrapper {
    display: flex;
    flex-direction: column;
}

.live-price-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 2px;
}

.live-price-val {
    font-family: var(--font-ui);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
}

.gain-badge {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    direction: ltr; /* Always show percentages LTR */
}

.gain-positive {
    background-color: var(--emerald-bg);
    color: var(--emerald);
}

.gain-negative {
    background-color: var(--rose-bg);
    color: var(--rose);
}

/* Accordion Details Section */
.card-details {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
}

.detail-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.detail-val {
    font-family: var(--font-ui);
    font-weight: 700;
    color: var(--text-primary);
    direction: ltr; /* Prices display LTR */
}

/* Specific styling for detail highlights */
.val-sl { color: var(--rose); }
.val-target { color: var(--emerald); }
.val-entry { color: var(--gold); }

/* Card Footer Info */
.card-footer-row {
    border-top: 1px dashed rgba(255, 255, 255, 0.04);
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.time-added {
    display: flex;
    align-items: center;
    gap: 4px;
}

.news-badge {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 4px;
    padding: 1px 5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Full news details popover */
.news-details-trigger { appearance: none; -webkit-appearance: none; font-family: inherit; font-size: 0.58rem; line-height: 1; cursor: pointer; transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease; }
.news-details-trigger:active { transform: scale(0.96); }
.news-details-trigger:focus-visible { outline: 2px solid rgba(255,255,255,0.25); outline-offset: 2px; }
.news-details-trigger.news-details-material { background: rgba(134,239,172,0.16); border-color: rgba(134,239,172,0.48); color: #86efac; }
.news-details-trigger.news-details-strong { background: rgba(5,150,105,0.2); border-color: rgba(5,150,105,0.42); color: #34d399; }
.news-details-trigger.news-details-neutral { background: rgba(148,163,184,0.1); border-color: rgba(148,163,184,0.24); color: #94a3b8; }
.news-full-backdrop { position: fixed; inset: 0; z-index: 1390; background: rgba(3,7,18,0.66); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.news-full-popover { position: fixed; top: 50%; left: 50%; z-index: 1400; width: min(440px,calc(100vw - 24px)); max-height: calc(100vh - 28px); padding: 15px; overflow-y: auto; border: 1px solid rgba(148,163,184,0.2); border-radius: 16px; background: linear-gradient(155deg,rgba(20,30,50,0.995),rgba(9,15,27,0.995)); box-shadow: 0 24px 60px rgba(0,0,0,0.56),0 0 0 1px rgba(255,255,255,0.025) inset; direction: rtl; text-align: right; opacity: 0; transform: translate(-50%,-48%) scale(0.985); transition: opacity 0.18s ease,transform 0.18s ease; scrollbar-width: thin; scrollbar-color: rgba(148,163,184,0.2) transparent; }
.news-full-popover.is-open { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.news-full-topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.news-full-heading { display:inline-flex; align-items:center; gap:7px; color:var(--text-primary); font-size:0.88rem; font-weight:900; }
.news-full-heading i { color:var(--gold); font-size:0.8rem; }
.news-full-close { width:27px; height:27px; display:inline-grid; place-items:center; flex:0 0 auto; border:1px solid rgba(148,163,184,0.15); border-radius:8px; background:rgba(255,255,255,0.035); color:var(--text-secondary); cursor:pointer; }
.news-full-meta { display:flex; align-items:center; gap:6px; margin-top:11px; padding:7px 9px; border:1px solid rgba(148,163,184,0.1); border-radius:9px; background:rgba(255,255,255,0.025); font-size:0.65rem; font-weight:800; }
.news-full-category { color:var(--text-primary); } .news-full-separator { color:var(--text-muted); } .news-full-power { font-weight:900; }
.news-full-power.news-power-material { color:#86efac; } .news-full-power.news-power-strong { color:#34d399; }
.news-full-power.news-power-medium,.news-full-power.news-power-weak { color:#94a3b8; }
.news-full-time { margin-right:auto; display:inline-flex; align-items:center; gap:4px; direction:ltr; color:var(--text-muted); font-family:'Outfit',sans-serif; font-size:0.61rem; letter-spacing:0.035em; }
.news-full-body { display:grid; gap:9px; margin-top:10px; }
.news-full-block { padding:9px 10px; border:1px solid rgba(148,163,184,0.09); border-radius:10px; background:rgba(255,255,255,0.022); }
.news-full-label { margin-bottom:4px; color:var(--text-muted); font-size:0.53rem; font-weight:800; }
.news-full-value { color:var(--text-secondary); font-size:0.68rem; font-weight:500; line-height:1.68; }
.news-full-title .news-full-value { direction:ltr; text-align:left; color:#e2e8f0; font-family:'Outfit',sans-serif; font-size:0.7rem; line-height:1.5; }
.news-full-summary .news-full-value { color:var(--text-primary); } .news-full-reason .news-full-value { color:#cbd5e1; }
.news-full-disclaimer { margin-top:10px; padding-top:8px; border-top:1px solid rgba(148,163,184,0.1); color:rgba(148,163,184,0.66); font-size:0.5rem; font-weight:500; line-height:1.55; }
@media (max-height:650px) { .news-full-popover { padding:12px; } .news-full-body { gap:6px; margin-top:7px; } .news-full-block { padding:7px 9px; } .news-full-value { line-height:1.5; } }
/* Footer & Warnings */
.app-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.app-footer p {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
}

.app-footer .footer-brand {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 7px;
    direction: ltr;
}

.footer-brand span {
    color: var(--text-primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.footer-brand small {
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 0.58rem;
    font-weight: 700;
}

.trading-warning {
    margin-top: 8px;
    padding: 5px 10px;
    border-top: 1px solid rgba(var(--gold-rgb), 0.22);
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    background: rgba(var(--gold-rgb), 0.025);
    font-size: 0.58rem !important;
    line-height: 1.4;
    color: rgba(203, 213, 225, 0.58) !important;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}


.sheet-disclaimer {
    padding: 5px 10px !important;
    border-top: 1px solid rgba(var(--gold-rgb), 0.22) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    background: rgba(var(--gold-rgb), 0.025);
    color: rgba(203, 213, 225, 0.58) !important;
}

.sheet-disclaimer strong {
    color: rgba(var(--gold-rgb), 0.78);
    font-weight: 700;
}
.trading-warning strong {
    color: rgba(var(--gold-rgb), 0.78);
    font-weight: 700;
}

/* ==========================================================================
   COMPACT SLEEK ROWS & DETAILS BOTTOM SHEET
   ========================================================================== */

/* Compact Row overrides */
.signal-card.compact-row {
    padding: 5px 12px 2px 12px;
    gap: 8px;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-glass-card);
    transition: var(--transition-smooth);
}

.signal-card.compact-row:active {
    background-color: rgba(22, 33, 56, 0.85);
    transform: scale(0.985);
}

.row-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.row-symbol-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex-shrink: 0;
    min-width: 75px;
}

.row-symbol-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.row-symbol-name {
    font-family: var(--font-ui);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.row-price-section {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

.price-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.col-label {
    font-family: var(--font-ui);
    font-size: 0.50rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
    line-height: 1;
    margin-bottom: 2px;
    letter-spacing: 0.1px;
}

.row-price-val {
    font-family: var(--font-ui);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
}

.row-gain-badge {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    direction: ltr;
    display: flex;
    align-items: center;
    gap: 3px;
}

.row-label-status {
    font-family: var(--font-ui);
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-align: center;
    display: inline-block;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-label-status.badge-gold { background-color: rgba(251, 191, 36, 0.08); color: var(--gold); border: 1px solid rgba(251, 191, 36, 0.15); }
.row-label-status.badge-emerald { background-color: rgba(16, 185, 129, 0.08); color: var(--emerald); border: 1px solid rgba(16, 185, 129, 0.15); }
.row-label-status.badge-rose { background-color: rgba(239, 68, 68, 0.08); color: var(--rose); border: 1px solid rgba(239, 68, 68, 0.15); }
.row-label-status.badge-teal { background-color: rgba(6, 182, 212, 0.08); color: var(--teal); border: 1px solid rgba(6, 182, 212, 0.15); }
.row-label-status.badge-indigo { background-color: rgba(79, 70, 229, 0.08); color: var(--indigo); border: 1px solid rgba(79, 70, 229, 0.15); }

/* Details Drawer Styles */
.sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(3, 7, 18, 0.85);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sheet-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.details-sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 100%);
    width: 100%;
    max-width: 500px;
    background: linear-gradient(180deg, #0e1524 0%, #060a12 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px 24px 0 0;
    z-index: 1001;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 24px 20px 30px 20px;
    max-height: 100dvh;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.details-sheet.active {
    transform: translate(-50%, 0);
}

.sheet-handle-bar {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.18);
    border-radius: 2px;
}

/* Native-feeling sheet dismissal without stealing vertical scroll from content. */
.details-sheet.is-dragging {
    transition: none;
    cursor: grabbing;
}

.sheet-backdrop.is-dragging {
    transition: none;
}

.sheet-handle-bar,
.sheet-header-row {
    touch-action: pan-x;
    -webkit-user-select: none;
    user-select: none;
}

.sheet-handle-bar {
    cursor: grab;
}

.sheet-targets-scroll-list {
    touch-action: pan-y !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.sheet-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
    margin-top: 4px;
}

.sheet-header-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sheet-header-symbol {
    direction: ltr;
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.25px;
}

/* Keep the sheet controls reachable when a signal has long detail content. */
#sheet-body-content {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.sheet-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.sheet-close-btn:hover {
    color: var(--text-primary);
}

/* Sheet Body info & Grid */
.sheet-body-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sheet-symbol-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: calc(1.45rem + 0.62rem + 2px);
}

.sheet-market-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    max-width: 42%;
    line-height: 1;
}

.sheet-market-meta-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sheet-market-meta-label {
    color: var(--text-secondary);
    font-size: 0.55rem;
    font-weight: 600;
}

.sheet-price-summary {
    display: flex;
    align-items: baseline;
    gap: 7px;
    flex-shrink: 0;
    white-space: nowrap;
}

.sheet-live-price {
    font-family: var(--font-ui);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
}

.sheet-change-val {
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
}
.sheet-symbol-name-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sheet-symbol-name {
    font-family: var(--font-ui);
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.sheet-status-badge {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sheet-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.02);
    padding: 14px 18px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sheet-price-val {
    font-family: var(--font-ui);
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
}

.sheet-gain-badge {
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 8px;
    direction: ltr;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sheet-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.sheet-detail-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(14, 21, 36, 0.4);
    padding: 12px 14px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.sheet-detail-label-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sheet-detail-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 700;
}

.sheet-detail-title {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 700;
}

.sheet-detail-val {
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    direction: ltr;
    text-align: left;
}

.sheet-footer-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-secondary);
    border-top: 1px dashed rgba(255, 255, 255, 0.05);
    padding-top: 14px;
    margin-top: 8px;
}

/* Color Utilities */
.text-emerald { color: var(--emerald) !important; }
.text-gold { color: var(--gold) !important; }
.text-rose { color: var(--rose) !important; }
.text-indigo { color: var(--indigo) !important; }

/* Signal Setup & Live Movement Badges */
/* Price column in row header — gain on top, price below */
.price-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.row-scores-section {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    margin-right: 12px;
}

.score-badge {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.setup-badge {
    background-color: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(79, 70, 229, 0.22);
    color: #c7d2fe !important;
}

.setup-badge i {
    color: #818cf8;
}

.movement-badge {
    transition: var(--transition-smooth);
}

.movement-low {
    background-color: rgba(148, 163, 184, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--text-secondary) !important;
}

.movement-low i {
    color: var(--text-muted);
}

.movement-medium {
    background-color: rgba(251, 191, 36, 0.06);
    border: 1px solid rgba(251, 191, 36, 0.22);
    color: #fef08a !important;
}

.movement-medium i {
    color: var(--gold);
}

.movement-high {
    background-color: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.22);
    color: #a7f3d0 !important;
}

.movement-high i {
    color: var(--emerald);
}

.movement-explosive {
    position: relative;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fecaca !important;
}

.movement-explosive::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border: 1px solid rgba(239, 68, 68, 0.7);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.35);
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    animation: flash-border-opacity 1.5s infinite alternate;
}

.movement-explosive i {
    color: var(--rose);
}

@keyframes flash-border-opacity {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* =============================================
   NEW CARD ELEMENTS — v2 Redesign
   ============================================= */

/* News badge — tiny icon only, above symbol name */
.news-badge-mini {
    font-size: 0.5rem;
    color: var(--gold);
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 3px;
    padding: 1px 3px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    position: relative;
    top: -1px;
}

.news-badge-row-top {
    font-size: 0.55rem;
    color: var(--gold);
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.22);
    border-radius: 4px;
    padding: 1.5px 5.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 3.5px;
    line-height: 1;
    margin-bottom: 2px;
}
.news-badge-row-top.news-trigger {
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.news-badge-row-top.news-trigger:hover,
.news-badge-row-top.news-trigger:focus-visible {
    background: rgba(251, 191, 36, 0.16);
    border-color: rgba(251, 191, 36, 0.5);
    outline: none;
}

.news-badge-row-top.news-trigger:active { transform: scale(0.96); }

.news-popover {
    position: fixed;
    z-index: 1200;
    width: min(330px, calc(100vw - 24px));
    padding: 12px 13px 10px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    background: rgba(14, 21, 36, 0.98);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.025) inset;
    direction: rtl;
    text-align: right;
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.news-popover.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.news-popover-header {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 0.69rem;
    font-weight: 800;
    line-height: 1.25;
}

.news-popover-category { color: var(--text-primary); }
.news-popover-separator { color: var(--text-muted); font-weight: 500; }
.news-popover-power { font-weight: 900; }
.news-popover-power.news-power-material { color: var(--rose); }
.news-popover-power.news-power-strong { color: var(--emerald); }
.news-popover-power.news-power-medium { color: var(--gold); }
.news-popover-power.news-power-weak { color: var(--text-secondary); }

.news-popover-summary {
    display: -webkit-box;
    margin: 8px 0 7px;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 500;
    line-height: 1.72;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.news-popover-footer {
    min-height: 15px;
    color: var(--text-muted);
    direction: ltr;
    font-family: var(--font-ui);
    font-size: 0.61rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: left;
}

.news-popover-disclaimer {
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    color: rgba(148, 163, 184, 0.72);
    font-size: 0.51rem;
    font-weight: 500;
    line-height: 1.6;
}

/* Meta stack: scores + status stacked vertically for premium symmetry and mobile layout */
.row-meta-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 4px;
    flex-shrink: 1;
    min-width: 0;
}

/* Compact score pills — smaller than old score-badge */
.score-pill {
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.setup-pill {
    background-color: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(79, 70, 229, 0.22);
    color: #c7d2fe !important;
}
.setup-pill i { color: #818cf8; font-size: 0.5rem; }

.movement-pill {
    transition: var(--transition-smooth);
}
.movement-pill.movement-low {
    background-color: rgba(148, 163, 184, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--text-secondary) !important;
}
.movement-pill.movement-medium {
    background-color: rgba(251, 191, 36, 0.06);
    border: 1px solid rgba(251, 191, 36, 0.22);
    color: #fef08a !important;
}
.movement-pill.movement-medium i { color: var(--gold); }
.movement-pill.movement-high {
    background-color: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.22);
    color: #a7f3d0 !important;
}
.movement-pill.movement-high i { color: var(--emerald); }
.movement-pill.movement-explosive {
    position: relative;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fecaca !important;
}
.movement-pill.movement-explosive::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border: 1px solid rgba(239, 68, 68, 0.7);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.35);
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    animation: flash-border-opacity 1.5s infinite alternate;
}
.movement-pill.movement-explosive i { color: var(--rose); }
.movement-pill i { font-size: 0.5rem; }

/* Premium Alerts Panel Styles */
.sheet-alerts-section {
    margin-top: 18px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    padding-top: 15px;
    direction: rtl;
    text-align: right;
}

.sheet-alerts-title-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 12px;
}

.alerts-title-main {
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--amber);
    display: flex;
    align-items: center;
    gap: 6px;
}

.alerts-title-sub {
    font-family: var(--font-ui);
    font-size: 0.65rem;
    color: var(--text-muted);
}

.alerts-connection-banner {
    background: rgba(255, 255, 255, 0.02);
    border: 1.5px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

.connection-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
}


.connection-input-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.tg-id-input-field {
    flex: 1;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 6px 10px;
    color: #fff;
    font-family: inherit;
    font-size: 0.7rem;
    outline: none;
}

.tg-id-input-field:focus {
    border-color: var(--amber);
}

.tg-id-save-btn {
    background: var(--amber);
    color: #000;
    border: none;
    border-radius: 4px;
    padding: 6px 14px;
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
}

.alerts-options-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: opacity 0.3s ease;
}

.disabled-grid {
    opacity: 0.45;
    pointer-events: none;
}

.alert-toggle-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-toggle-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.alert-toggle-label {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 600;
    color: #e2e8f0;
}

.alert-toggle-desc {
    font-family: var(--font-ui);
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* Premium Switch Toggle */
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
}

.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 18px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .switch-slider {
    background-color: var(--emerald);
}

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

/* Card Bell Button styling */
.card-bell-btn {
    background: none;
    border: none;
    color: rgba(251, 191, 36, 0.45);
    font-size: 0.72rem;
    padding: 2px 5px;
    margin-right: 6px;
    cursor: pointer;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.card-bell-btn:hover {
    color: var(--amber);
    background: rgba(251, 191, 36, 0.15);
    transform: scale(1.1);
}

/* ==========================================================================
    Sleek 2x2 Indicator Capsules Grid revamping
   ========================================================================== */
.capsules-grid {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    margin: 0 4px;
}

.capsules-row {
    display: flex;
    gap: 4px;
    justify-content: center;
    width: 100%;
}

.indicator-capsule {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.52rem; /* Extremely small but readable */
    font-family: var(--font-ui);
    font-weight: 800;
    padding: 1.5px 5px;
    border-radius: 3px;
    white-space: nowrap;
    line-height: 1;
    border: 1px solid transparent;
    transition: var(--transition-smooth);
}

.indicator-capsule.cap-green {
    background-color: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.22);
    color: var(--emerald);
    text-shadow: 0 0 4px rgba(16, 185, 129, 0.2);
}

.indicator-capsule.cap-red {
    background-color: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.22);
    color: var(--rose);
    text-shadow: 0 0 4px rgba(239, 68, 68, 0.2);
}

.indicator-capsule.cap-orange {
    background-color: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.22);
    color: var(--gold);
    text-shadow: 0 0 4px rgba(251, 191, 36, 0.2);
}

.indicator-capsule.cap-neutral {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

/* E Zone capsule — off state (price outside entry zone) */
.indicator-capsule.cap-zone-off {
    background-color: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.06);
    color: rgba(148, 163, 184, 0.4);
}

/* Compact chart menus: timeframe, indicators and analysis. */
.chart-timeframe-selector.chart-controls {
    position: absolute;
    top: 6px;
    left: 8px;
    z-index: 20;
    display: flex;
    align-items: flex-start;
    gap: 3px;
    font-family: var(--font-ui);
}

.chart-control { position: relative; }

.chart-control-trigger {
    min-width: 0;
    height: 21px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: rgba(148, 163, 184, 0.82);
    background: rgba(10, 15, 30, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
    font: 800 0.49rem/1 var(--font-ui);
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent;
    transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.chart-control-trigger.has-active,
.chart-control.open .chart-control-trigger {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.76);
}

.chart-control.open .chart-control-trigger { background: rgba(31, 41, 55, 0.96); }

.chart-history-trigger {
    color: rgba(125, 211, 252, 0.9);
    border-color: rgba(56, 189, 248, 0.42);
}

.chart-history-trigger:hover:not(:disabled) {
    color: #e0f2fe;
    border-color: rgba(125, 211, 252, 0.82);
    background: rgba(14, 116, 144, 0.22);
}

.chart-history-trigger.history-loaded,
.chart-history-trigger:disabled {
    color: rgba(148, 163, 184, 0.48);
    border-color: rgba(148, 163, 184, 0.2);
    cursor: default;
}

.chart-control-chevron {
    width: 4px;
    height: 4px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    transition: transform 160ms ease;
}

.chart-control.open .chart-control-chevron { transform: rotate(225deg) translate(-1px, -1px); }

.chart-control-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: auto;
    z-index: 24;
    min-width: 88px;
    padding: 3px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px) scale(0.98);
    transform-origin: top left;
    color: #fff;
    background: rgba(10, 15, 30, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.42);
    transition: opacity 140ms ease, transform 140ms ease, visibility 0s linear 140ms;
}

.chart-control.open .chart-control-menu {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition-delay: 0s;
}

.chart-control-menu--compact { min-width: 76px; }
.chart-control-menu--analysis { min-width: 112px; }

/* Keep the wider analysis menu inside the chart's rounded, clipped edge. */
.chart-control[data-chart-control="analysis"] .chart-control-menu--analysis {
    left: 10px;
    right: auto;
}

.chart-control-title {
    padding: 3px 5px 4px;
    color: rgba(148, 163, 184, 0.78);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    font-size: 0.46rem;
    font-weight: 800;
    line-height: 1;
    text-align: right;
}

.chart-control-option {
    width: 100%;
    min-height: 21px;
    padding: 2px 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    color: rgba(148, 163, 184, 0.72);
    background: transparent;
    border: 0;
    border-radius: 3px;
    font: 800 0.49rem/1 var(--font-ui);
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent;
    transition: color 120ms ease, background-color 120ms ease;
}

.chart-control-option:hover,
.chart-control-option:focus-visible {
    color: #fff;
    background: rgba(148, 163, 184, 0.12);
    outline: none;
}

.chart-control-option.active { color: #fff; }

.chart-control-check {
    width: 9px;
    color: transparent;
    font-size: 0.5rem;
    text-align: center;
}

.chart-control-option.active .chart-control-check { color: #fff; }

@media (prefers-reduced-motion: reduce) {
    .chart-control-trigger,
    .chart-control-chevron,
    .chart-control-menu,
    .chart-control-option { transition-duration: 0.01ms; }
}
/* Force prevent browser viewport scroll or sheet scroll when interacting with the chart on mobile */
#sheet-chart-wrapper,
#sheet-chart-container,
#sheet-chart-container * {
    touch-action: none !important;
    -webkit-user-select: none;
    user-select: none;
}

.chart-resync-loader {
    position: absolute;
    inset: 0;
    z-index: 11;
    display: grid;
    place-items: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    background: rgba(8, 13, 25, 0.14);
    transition: opacity 90ms linear, visibility 0s linear 90ms;
}

.chart-resync-loader.active {
    visibility: visible;
    opacity: 1;
    pointer-events: none;
    transition-delay: 0s;
}

.chart-resync-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(226, 232, 240, 0.2);
    border-top-color: rgba(226, 232, 240, 0.92);
    border-radius: 50%;
    animation: chart-resync-spin 700ms linear infinite;
    box-shadow: 0 0 12px rgba(15, 23, 42, 0.45);
}

@keyframes chart-resync-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .chart-resync-spinner { animation-duration: 1400ms; }
}

/* Symbol badge occupying the isolated price/time-axis corner in expanded mode. */
.chart-symbol-corner {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 14;
    width: 60px;
    height: 26px;
    padding: 0 5px;
    display: none;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
    direction: ltr;
    color: rgba(248, 250, 252, 0.92);
    background: linear-gradient(180deg, rgba(22, 30, 45, 0.98), rgba(12, 18, 30, 0.98));
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    border-left: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.025), -2px -2px 8px rgba(0, 0, 0, 0.12);
    pointer-events: none;
    user-select: none;
}

.details-sheet.chart-expanded .chart-symbol-corner {
    display: flex;
}

.chart-symbol-corner-text {
    display: inline-block;
    flex: 0 0 auto;
    color: inherit;
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
    letter-spacing: 0.035em;
    white-space: nowrap;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    transform-origin: center center;
}
/* Institutional chart size control, placed in the empty time/price scale corner. */
.chart-expand-btn {
    position: absolute;
    right: 3px;
    bottom: 3px;
    z-index: 12;
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(226, 232, 240, 0.86);
    background: rgba(14, 21, 36, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent;
}

.chart-expand-icon {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: square;
    stroke-linejoin: miter;
    pointer-events: none;
}

.chart-expand-icon--in {
    display: none;
}

.details-sheet.chart-expanded {
    --chart-expanded-viewport-height: var(--tg-viewport-height, 100dvh);
    --chart-expanded-bottom-inset: max(var(--tg-content-safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    width: 100%;
    max-width: none;
    bottom: var(--chart-expanded-bottom-inset);
    height: calc(var(--chart-expanded-viewport-height) - var(--chart-expanded-bottom-inset));
    max-height: calc(var(--chart-expanded-viewport-height) - var(--chart-expanded-bottom-inset));
    padding: 0;
    gap: 0;
    border-radius: 0;
}

.details-sheet.chart-expanded .sheet-handle-bar,
.details-sheet.chart-expanded .sheet-header-row {
    display: none;
}

.details-sheet.chart-expanded #sheet-body-content,
.details-sheet.chart-expanded .sheet-body-info {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.details-sheet.chart-expanded .sheet-body-info {
    gap: 0;
}

.details-sheet.chart-expanded .sheet-body-info > :not(#sheet-chart-wrapper) {
    display: none !important;
}

.details-sheet.chart-expanded #sheet-chart-wrapper {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    flex: 1 1 auto;
}

.details-sheet.chart-expanded .chart-expand-btn {
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    right: calc(env(safe-area-inset-right, 0px) + 8px);
    bottom: auto;
    z-index: 30;
    width: 32px;
    height: 32px;
}

.details-sheet.chart-expanded .chart-expand-icon--out {
    display: none;
}

.details-sheet.chart-expanded .chart-expand-icon--in {
    display: block;
}

/* Optimization: Stop infinite animations and transitions on cards that are currently off-screen */
.signal-card:not(.is-visible)::before,
.signal-card:not(.is-visible) *,
.signal-card:not(.is-visible) *::before,
.signal-card:not(.is-visible) *::after {
    animation: none !important;
    transition: none !important;
}

/* Daily change percentage — below live price on card */
.row-change-val {
    font-family: var(--font-ui);
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transition: color 0.2s ease;
    min-width: 42px;
    text-align: center;
}


/* Restored card metadata ledger: same bottom positions and former 82px card height. */
.signal-card.compact-row {
    min-height: 82px;
    justify-content: space-between;
}

.row-gauge-ledger {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 5px;
    padding: 0 4px;
    direction: ltr;
}

.ledger-item {
    font-family: var(--font-ui);
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    direction: rtl;
    display: inline-block;
    white-space: nowrap;
}

.ledger-sl, .ledger-zone, .ledger-peak { color: #ffffff; }
.ledger-separator { color: rgba(255,255,255,0.15); font-size: 0.55rem; margin: 0 2px; pointer-events: none; user-select: none; }

/* Institutional append-only sparkline: a real SVG gradient area sits below
   the causal smoothed curve and remains compatible with iOS WebView. */
.sparkline-host { width: clamp(76px, 23vw, 124px); max-width: 124px; height: 42px; flex: 0 1 124px; min-width: 76px; margin: 0 4px; overflow: hidden; pointer-events: none; }
.sparkline-svg { width: 100%; height: 100%; display: block; overflow: hidden; color: #63d7b3; }
.sparkline-svg.sparkline-negative { color: #fb7185; }
.sparkline-area, .sparkline-shadow, .sparkline-line { pointer-events: none; }
.sparkline-area-segment { stroke: none; }
.sparkline-svg.sparkline-positive .sparkline-gradient-start { stop-color: #63d7b3; stop-opacity: .30; }
.sparkline-svg.sparkline-positive .sparkline-gradient-middle { stop-color: #63d7b3; stop-opacity: .10; }
.sparkline-svg.sparkline-negative .sparkline-gradient-start { stop-color: #fb7185; stop-opacity: .27; }
.sparkline-svg.sparkline-negative .sparkline-gradient-middle { stop-color: #fb7185; stop-opacity: .09; }
.sparkline-gradient-end { stop-opacity: 0; }
.sparkline-shadow-segment, .sparkline-line-segment { stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sparkline-shadow { opacity: .58; transform: translateY(1.5px); filter: blur(1.25px); }
.sparkline-last-dot { fill: currentColor; filter: drop-shadow(0 1px 2px currentColor); }

/* Focused navigation and filter refinements. */
.controls-section { margin-bottom:18px; }
.filters-toggle { width:34px; height:34px; flex:0 0 34px; padding:0; display:inline-flex; align-items:center; justify-content:center; border:1px solid rgba(99,102,241,.32); border-radius:10px; background:linear-gradient(135deg,rgba(79,70,229,.16),rgba(15,23,42,.72)); color:var(--text-secondary); cursor:pointer; transition:var(--transition-smooth); }
.filters-toggle:hover { color:var(--text-primary); border-color:var(--border-hover); }
.filters-toggle i { font-size:.76rem; }
.filters-toggle[aria-expanded="true"] { color:#e0e7ff; border-color:rgba(129,140,248,.72); background:rgba(79,70,229,.3); box-shadow:0 5px 14px rgba(79,70,229,.2); }
.filters-container { margin:-3px 4px 14px; }
.feed-header { gap:6px; flex-wrap:nowrap; }
.feed-navigation { min-width:0; flex:1; display:grid; grid-template-columns:1.06fr 1.12fr .94fr; gap:6px; }
.feed-header-actions { display:flex; align-items:center; gap:6px; flex:0 0 auto; }
.feed-header-actions .radar-alerts-trigger { width:34px; min-height:34px; flex:0 0 34px; }
.feed-tab { min-width:0; min-height:34px; display:inline-flex; align-items:center; justify-content:center; gap:5px; padding:6px 7px; border:1px solid rgba(148,163,184,.14); border-radius:10px; color:var(--text-muted); background:rgba(15,23,42,.36); font-family:var(--font-ui); font-size:.65rem; font-weight:800; cursor:pointer; white-space:nowrap; transition:var(--transition-smooth); }
.feed-tab:hover,.feed-tab:focus-visible { color:var(--text-primary); border-color:var(--border-hover); outline:none; }
.feed-tab.active { color:#fff; border-color:rgba(251,191,36,.46); background:linear-gradient(110deg,rgba(var(--gold-rgb),.16),rgba(30,41,59,.68)); box-shadow:inset 0 1px 0 rgba(255,255,255,.055),0 5px 14px rgba(0,0,0,.12); }
.feed-tab i { color:#a5b4fc; font-size:.68rem; }
.feed-empty.is-session-closed { border-color:rgba(251,191,36,.2); background:linear-gradient(145deg,rgba(251,191,36,.045),rgba(15,23,42,.58)); }
.feed-empty.is-session-closed .empty-icon { color:rgba(251,191,36,.8); }
.app-footer .last-sync { display:inline-flex; align-items:center; justify-content:center; min-height:22px; margin-top:10px; padding:3px 9px; border:1px solid rgba(148,163,184,.11); border-radius:20px; background:rgba(15,23,42,.28); color:rgba(148,163,184,.72); font-size:.57rem; direction:ltr; }
.live-signal-count { padding-inline-start:6px; border-inline-start:1px solid rgba(16,185,129,.24); color:rgba(167,243,208,.84); font-family:var(--font-ui); font-size:.6rem; font-weight:800; direction:rtl; }
@media (max-width:370px) { .feed-navigation { gap:4px; } .feed-tab { padding-inline:5px; font-size:.6rem; } }
@media (max-width:430px) {
    .live-signal-count { display:none; }
    .header-account-area { gap:5px; }
    .live-status { padding-inline:8px; }
    .account-guest-actions .account-auth-link:not(.account-auth-link--primary) { display:none; }
    .account-menu { width:100%; max-width:none; inset:auto 0 0 0 !important; }
    .account-menu-panel { padding-bottom:max(6px,env(safe-area-inset-bottom)); border-radius:18px 18px 0 0; }
}
@media (max-width:640px) {
    .feed-header { padding-inline:0; }
    .feed-navigation { flex:1 1 auto; gap:4px; }
    .feed-header-actions { width:auto; justify-content:flex-end; gap:4px; }
    .feed-tab { padding-inline:5px; font-size:.6rem; }
}
.feed-empty.is-session-closed { padding:42px 22px 38px; }
.feed-empty.is-session-closed h3 { margin-bottom:12px; font-size:1rem; }
.feed-empty.is-session-closed p { max-width:330px; white-space:pre-line; line-height:2; text-wrap:balance; }
