/* CoreFeed product shell: shared visual language for every workspace. */
:root {
    --bg-app: #070a11;
    --bg-panel: #0e1420;
    --bg-panel-header: #121a29;
    --bg-card: #151e2e;
    --bg-card-hover: #1b2740;
    --border-color: rgba(139, 158, 190, 0.17);
    --border-glow: rgba(73, 117, 255, 0.22);
    --text-primary: #f4f7fb;
    --text-secondary: #9aa9bd;
    --text-muted: #63748b;
    --accent: #3a6ff7;
    --accent-hover: #5284ff;
    --accent-glow: rgba(58, 111, 247, 0.34);
    --border-radius-sm: 7px;
    --border-radius-md: 10px;
    --border-radius-lg: 15px;
    --surface-shadow: 0 16px 42px rgba(0, 0, 0, 0.20);
}

html { color-scheme: dark; }

body {
    background:
        radial-gradient(circle at 48% -18%, rgba(51, 91, 194, 0.13), transparent 34rem),
        radial-gradient(circle at 100% 42%, rgba(63, 53, 137, 0.06), transparent 32rem),
        var(--bg-app);
    letter-spacing: -0.01em;
}

button,
input,
select,
textarea { font-family: var(--font-ui); }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #83a5ff;
    outline-offset: 2px;
}

/* Header and primary navigation */
.dashboard-header {
    height: 64px;
    padding: 0 20px;
    border-bottom-color: rgba(144, 164, 199, 0.14);
    background: rgba(8, 12, 20, 0.88);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(18px) saturate(125%);
}

.header-left { min-width: 0; gap: 18px; }
.header-logo { flex: 0 0 auto; gap: 10px; }
.header-logo:hover { opacity: 1; }

.pulse-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border: 1px solid rgba(121, 155, 255, 0.28);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(58, 111, 247, 0.30), rgba(111, 66, 193, 0.12));
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.07), 0 8px 22px rgba(25, 65, 170, 0.17);
}

.pulse-icon::before,
.pulse-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.pulse-icon::before {
    width: 8px;
    height: 8px;
    background: #84a6ff;
    box-shadow: 0 0 13px rgba(111, 151, 255, 0.9);
}

.pulse-icon::after {
    width: 16px;
    height: 16px;
    border: 1px solid rgba(132, 166, 255, 0.36);
    background: transparent;
    animation: brandPulse 2.4s ease-out infinite;
}

@keyframes brandPulse {
    0%, 35% { opacity: 0.7; transform: translate(-50%, -50%) scale(0.7); }
    80%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.15); }
}

.header-logo h1 {
    flex: 0 0 auto;
    font-size: 17px;
    font-weight: 720;
    letter-spacing: -0.45px;
    white-space: nowrap;
    background: linear-gradient(115deg, #ffffff 35%, #bac9e2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-nav {
    min-width: 0;
    gap: 2px;
    padding: 3px;
    border: 1px solid rgba(137, 157, 190, 0.13);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.025);
}

.nav-link {
    min-height: 32px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    color: #8290a5;
    font-size: 12px;
    font-weight: 650;
}

.nav-link:hover {
    color: #dce5f4;
    background: rgba(255, 255, 255, 0.055);
}

.nav-link.active {
    color: #f7f9ff;
    background: linear-gradient(135deg, rgba(62, 112, 245, 0.94), rgba(48, 91, 218, 0.94));
    box-shadow: 0 5px 16px rgba(37, 82, 201, 0.26), inset 0 1px rgba(255, 255, 255, 0.12);
}

.market-tickers { gap: 8px; }
.ticker-card {
    min-height: 34px;
    padding: 0 11px;
    border-color: rgba(139, 158, 190, 0.14);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.024);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.02);
    font-size: 11.5px;
}
.ticker-name { color: #718198; font-size: 10.5px; letter-spacing: 0.2px; }
.header-status { gap: 11px; }
.time-display { color: #697a91; font-size: 12px; }
.connection-status {
    min-height: 30px;
    padding: 0 9px;
    gap: 7px;
    border-color: rgba(139, 158, 190, 0.14);
    background: rgba(255, 255, 255, 0.025);
    font-size: 11px;
}
.status-dot { width: 7px; height: 7px; }
.lang-switch {
    gap: 1px;
    padding: 2px;
    border: 1px solid rgba(139, 158, 190, 0.13);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    font-size: 11px;
}
.lang-switch .lang-opt { padding: 4px 7px; border-radius: 6px; }
.lang-switch .lang-opt.active { background: rgba(116, 145, 197, 0.14); }

/* Shared surfaces and controls */
.panel,
.multi-workspace,
.index-card-lg {
    border-color: var(--border-color);
    border-radius: var(--border-radius-lg);
    background: linear-gradient(145deg, rgba(16, 23, 36, 0.98), rgba(12, 18, 29, 0.98));
    box-shadow: var(--surface-shadow), inset 0 1px rgba(255, 255, 255, 0.025);
}

.panel-header,
.multi-workspace-toolbar {
    border-bottom-color: rgba(139, 158, 190, 0.14);
    background: linear-gradient(180deg, rgba(21, 30, 46, 0.96), rgba(17, 25, 39, 0.96));
}

.panel-title-area h2,
.multi-workspace-toolbar h2 { letter-spacing: -0.25px; }
.panel-title-area .icon { color: #6f96ff; }

.stock-search {
    min-height: 48px;
    border-bottom-color: rgba(139, 158, 190, 0.13);
    background: rgba(8, 13, 22, 0.36);
}

.stock-search:focus-within {
    background: rgba(34, 57, 105, 0.12);
    box-shadow: inset 0 0 0 1px rgba(92, 132, 244, 0.25);
}

.search-results {
    border-color: rgba(131, 160, 220, 0.24);
    border-radius: 12px;
    background: rgba(16, 23, 36, 0.98);
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(18px);
}

.stock-table tbody tr { transition: background 120ms ease, box-shadow 120ms ease; }
.stock-table tbody tr:hover { background: rgba(73, 111, 206, 0.07); }
.stock-table tbody tr.selected,
.stock-table tbody tr.active { box-shadow: inset 3px 0 var(--accent); }

.btn-report,
.btn-discovery,
.profile-toggle-button,
.layout-button,
.workspace-fullscreen-button,
.timeframe-badge,
.nf-chip,
.btn-chart-settings,
.mobile-chart-more,
.mobile-stock-toggle,
.mobile-summary-toggle {
    border-radius: 8px;
    transition: color 140ms ease, border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.btn-report:hover,
.btn-discovery:hover,
.workspace-fullscreen-button:hover,
.btn-chart-settings:hover { transform: translateY(-1px); }

/* Main page identity: small enough to preserve data density. */
.product-page-head {
    min-height: 82px;
    padding: 8px 4px 2px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.product-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #7f9ee8;
    font-size: 9.5px;
    font-weight: 750;
    letter-spacing: 1.5px;
}
.product-eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #42c6b7;
    box-shadow: 0 0 0 4px rgba(66, 198, 183, 0.09);
}
.product-page-head h1 { margin-top: 5px; font-size: 24px; line-height: 1.15; letter-spacing: -0.7px; }
.product-page-head p { margin-top: 5px; color: var(--text-muted); font-size: 12px; }
.product-page-meta {
    min-height: 32px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    border: 1px solid rgba(93, 139, 255, 0.18);
    border-radius: 999px;
    color: #91a5c2;
    background: rgba(41, 98, 255, 0.06);
    font-size: 10.5px;
    font-weight: 600;
}
.product-page-meta::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--up-color);
    box-shadow: 0 0 0 4px rgba(38, 166, 154, 0.09);
}

/* Contact page */
.contact-wrap { max-width: 820px !important; padding-top: 44px !important; }
.contact-wrap > h1 { font-size: 28px !important; letter-spacing: -0.8px; }
.contact-sub { max-width: 620px; margin-bottom: 28px !important; font-size: 13px !important; line-height: 1.65; }
.notice-box {
    padding: 18px 20px !important;
    border: 1px solid rgba(107, 139, 205, 0.20) !important;
    border-left: 1px solid rgba(107, 139, 205, 0.20) !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, rgba(41, 98, 255, 0.09), rgba(16, 23, 36, 0.72)) !important;
    box-shadow: inset 3px 0 #4678f4;
}
.cform {
    padding: 22px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(16, 23, 36, 0.96), rgba(12, 18, 29, 0.96));
    box-shadow: var(--surface-shadow), inset 0 1px rgba(255, 255, 255, 0.025);
}
.cfield input,
.cfield select,
.cfield textarea {
    border-color: rgba(139, 158, 190, 0.17) !important;
    border-radius: 10px !important;
    background: rgba(20, 29, 45, 0.90) !important;
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.cfield input:hover,
.cfield select:hover,
.cfield textarea:hover { border-color: rgba(139, 166, 221, 0.30) !important; }
.cfield input:focus,
.cfield select:focus,
.cfield textarea:focus {
    border-color: #5f88f6 !important;
    background: rgba(23, 34, 54, 0.96) !important;
    box-shadow: 0 0 0 3px rgba(58, 111, 247, 0.12);
}
.csubmit {
    min-width: 124px;
    border-radius: 10px !important;
    background: linear-gradient(135deg, #477af8, #315fd8) !important;
    box-shadow: 0 10px 24px rgba(35, 79, 190, 0.22);
}

/* Quiet, consistent scrollbars */
* { scrollbar-color: rgba(129, 148, 180, 0.28) transparent; scrollbar-width: thin; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: rgba(129, 148, 180, 0.26); background-clip: padding-box; }

@media (max-width: 1180px) {
    .dashboard-header { padding-inline: 14px; }
    .nav-link { padding-inline: 9px; }
}

@media (max-width: 768px) {
    :root { --border-radius-lg: 13px; }
    body {
        background:
            radial-gradient(circle at 50% -8%, rgba(51, 91, 194, 0.15), transparent 22rem),
            var(--bg-app);
    }
    .dashboard-header {
        height: var(--mobile-header-height);
        min-height: var(--mobile-header-height);
        padding: 0 12px;
        background: rgba(8, 12, 20, 0.94);
        /* A filtered ancestor becomes the containing block for position:fixed,
           which would pin the mobile nav inside this 56px header. */
        backdrop-filter: none;
    }
    .header-logo { gap: 8px; }
    .pulse-icon { width: 28px; height: 28px; flex-basis: 28px; border-radius: 9px; }
    .header-logo h1 { font-size: 16px; }
    .main-nav {
        height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
        padding: 5px 7px max(5px, env(safe-area-inset-bottom));
        gap: 3px;
        border: 0;
        border-top: 1px solid rgba(139, 158, 190, 0.15);
        border-radius: 0;
        background: rgba(8, 12, 20, 0.94);
        box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.34);
        backdrop-filter: blur(18px) saturate(125%);
    }
    .nav-link {
        min-height: 52px;
        padding: 4px 2px;
        border-radius: 11px;
        color: #687990;
        font-size: 10px;
    }
    .nav-link.active {
        color: #9db8ff;
        background: linear-gradient(180deg, rgba(58, 111, 247, 0.18), rgba(58, 111, 247, 0.09));
        box-shadow: inset 0 0 0 1px rgba(89, 132, 247, 0.14);
    }
    .lang-switch { border: 0; background: transparent; }
    .panel,
    .multi-workspace,
    .index-card-lg { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16), inset 0 1px rgba(255, 255, 255, 0.02); }
    .product-page-head {
        min-height: 68px;
        padding: 8px 3px 2px;
        align-items: center;
    }
    .product-page-head h1 { font-size: 20px; }
    .product-page-head p { display: none; }
    .product-page-meta { min-height: 30px; font-size: 9.5px; }
    .contact-wrap { padding: 28px 12px 44px !important; }
    .contact-wrap > h1 { font-size: 23px !important; }
    .notice-box { padding: 15px 16px !important; }
    .cform { padding: 15px; gap: 14px !important; border-radius: 14px; }
    .csubmit { width: 100%; min-height: 48px !important; }
}

@media (prefers-reduced-motion: reduce) {
    .pulse-icon::after { animation: none; }
}
