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

/* Theme Variables */
:root.neon-green {
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1423;
    --bg-tertiary: #1a2332;
    --text-primary: #b8c8e0;
    --text-secondary: #6b7d95;
    --text-bright: #e8f0fe;
    --accent-primary: #00ff44;
    --accent-secondary: #00cc33;
    --accent-tertiary: #00ff00;
    --blue-primary: #4a90e2;
    --blue-secondary: #5ba3f5;
    --blue-tertiary: #357abd;
    /* Chart uses same colors as UI for dark themes */
    --chart-bg: #0f1423;
    --chart-text: #6b7d95;
    --chart-text-bright: #b8c8e0;
}


:root.light-blue {
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1423;
    --bg-tertiary: #1a2332;
    --text-primary: #b8c8e0;
    --text-secondary: #6b7d95;
    --text-bright: #e8f0fe;
    --accent-primary: #6bb6ff;
    --accent-secondary: #6bb6ff;
    --accent-tertiary: #add8e6;
    --blue-primary: #4a90e2;
    --blue-secondary: #5ba3f5;
    --blue-tertiary: #357abd;
    /* Chart uses same colors as UI for dark themes */
    --chart-bg: #0f1423;
    --chart-text: #6b7d95;
    --chart-text-bright: #b8c8e0;
}

:root.neon-orange {
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1423;
    --bg-tertiary: #1a2332;
    --text-primary: #b8c8e0;
    --text-secondary: #6b7d95;
    --text-bright: #e8f0fe;
    --accent-primary: #ff6600;
    --accent-secondary: #ff4400;
    --accent-tertiary: #ff8800;
    --blue-primary: #4a90e2;
    --blue-secondary: #5ba3f5;
    --blue-tertiary: #357abd;
    /* Chart uses same colors as UI for dark themes */
    --chart-bg: #0f1423;
    --chart-text: #6b7d95;
    --chart-text-bright: #b8c8e0;
}

:root.white-on-black {
    /* Keep UI colors dark */
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1423;
    --bg-tertiary: #1a2332;
    --text-primary: #b8c8e0;
    --text-secondary: #6b7d95;
    --text-bright: #e8f0fe;
    --blue-primary: #4a90e2;
    --blue-secondary: #5ba3f5;
    --blue-tertiary: #357abd;
    /* Chart-specific colors for white on black */
    --chart-bg: #000000;
    --chart-text: #cccccc;
    --chart-text-bright: #ffffff;
    --accent-primary: #ffffff;
    --accent-secondary: #eeeeee;
    --accent-tertiary: #ffffff;
}

:root.terminal-green {
    /* Keep UI colors dark */
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1423;
    --bg-tertiary: #1a2332;
    --text-primary: #b8c8e0;
    --text-secondary: #6b7d95;
    --text-bright: #e8f0fe;
    --blue-primary: #4a90e2;
    --blue-secondary: #5ba3f5;
    --blue-tertiary: #357abd;
    /* Terminal Green theme - classic black background with bright green */
    --chart-bg: #000000;
    --chart-text: #00ff00;
    --chart-text-bright: #00ff00;
    --accent-primary: #00ff00;
    --accent-secondary: #00dd00;
    --accent-tertiary: #00ff00;
}

:root.midnight-oled {
    /* Keep UI colors dark */
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1423;
    --bg-tertiary: #1a2332;
    --text-primary: #b8c8e0;
    --text-secondary: #6b7d95;
    --text-bright: #e8f0fe;
    --blue-primary: #4a90e2;
    --blue-secondary: #5ba3f5;
    --blue-tertiary: #357abd;
    /* Midnight OLED theme - pure black for OLED screens with subtle neon accents */
    --chart-bg: #000000;
    --chart-text: #808080;
    --chart-text-bright: #b0b0b0;
    --accent-primary: #00e5ff;
    --accent-secondary: #00d4ee;
    --accent-tertiary: #00e5ff;
}

:root.neon-dreams {
    /* Keep UI colors dark */
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1423;
    --bg-tertiary: #1a2332;
    --text-primary: #b8c8e0;
    --text-secondary: #6b7d95;
    --text-bright: #e8f0fe;
    --blue-primary: #4a90e2;
    --blue-secondary: #5ba3f5;
    --blue-tertiary: #357abd;
    /* Neon Dreams theme - vibrant neon colors on dark background */
    --chart-bg: #0d0221;
    --chart-text: #a855f7;
    --chart-text-bright: #c084fc;
    --accent-primary: #00ffff;
    --accent-secondary: #ff00ff;
    --accent-tertiary: #00ff00;
}

/* Magenta Rising theme - uses Integrity panel's magenta-tinted background with green candles, gradient darkening to the right */
:root.magenta-rising {
    /* Keep UI colors dark and consistent */
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1423;
    --bg-tertiary: #1a2332;
    --text-primary: #b8c8e0;
    --text-secondary: #6b7d95;
    --text-bright: #e8f0fe;
    --blue-primary: #4a90e2;
    --blue-secondary: #5ba3f5;
    --blue-tertiary: #357abd;

    /* Chart: magenta-tinted gradient like the Integrity panel; darker on the right */
    --chart-bg: #0c1018;
    /* base/dark edge color for overlays and fallbacks */
    --chart-bg-left: #3a0f24;
    /* magenta-tinted deep tone */
    --chart-bg-right: #0c1018;
    /* far-right darker tone */
    /* subtle magenta-tinted grid */
    --chart-text: #c7b4c9;
    /* soft light text */
    --chart-text-bright: #efe5f2;

    /* Accents: green candles */
    --accent-primary: #00ff44;
    /* up/primary */
    --accent-secondary: #00cc33;
    /* down/secondary for HL-only still green */
    --accent-tertiary: #00ff00;
    /* crosshair/price label */
}

:root.cyberpunk {
    /* Keep UI colors dark */
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1423;
    --bg-tertiary: #1a2332;
    --text-primary: #b8c8e0;
    --text-secondary: #6b7d95;
    --text-bright: #e8f0fe;
    --blue-primary: #4a90e2;
    --blue-secondary: #5ba3f5;
    --blue-tertiary: #357abd;
    /* Cyberpunk theme - purple and teal with geometric patterns */
    --chart-bg: #0a0e27;
    --chart-text: #00d4aa;
    --chart-text-bright: #00ffcc;
    --accent-primary: #bd00ff;
    --accent-secondary: #9d00dd;
    --accent-tertiary: #00d4aa;
}

:root.donuts-coffee {
    /* Keep UI colors dark */
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1423;
    --bg-tertiary: #1a2332;
    --text-primary: #b8c8e0;
    --text-secondary: #6b7d95;
    --text-bright: #e8f0fe;
    --blue-primary: #4a90e2;
    --blue-secondary: #5ba3f5;
    --blue-tertiary: #357abd;
    /* Donuts & Coffee theme - dark chocolate bg, white candles, magenta accents */
    --chart-bg: #1f1410;
    --chart-text: #f5f5f0;
    --chart-text-bright: #ffffff;
    --accent-primary: #ffffff;
    --accent-secondary: #f5f5f0;
    --accent-tertiary: #ffffff;
}

:root.glofish {
    /* Keep UI colors dark */
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1423;
    --bg-tertiary: #1a2332;
    --text-primary: #b8c8e0;
    --text-secondary: #6b7d95;
    --text-bright: #e8f0fe;
    --blue-primary: #4a90e2;
    --blue-secondary: #5ba3f5;
    --blue-tertiary: #357abd;
    /* Glofish theme - neon blue, orange, and green on cold black background */
    --chart-bg: #000000;
    --chart-text: #00d4ff;
    --chart-text-bright: #00ffff;
    --accent-primary: #00d4ff;
    --accent-secondary: #ff6600;
    --accent-tertiary: #00ff44;
}

:root.your-ball-sport {
    /* Keep UI colors dark */
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1423;
    --bg-tertiary: #1a2332;
    --text-primary: #b8c8e0;
    --text-secondary: #6b7d95;
    --text-bright: #e8f0fe;
    --blue-primary: #4a90e2;
    --blue-secondary: #5ba3f5;
    --blue-tertiary: #357abd;
    /* Your Ball Sport - vibrant orange on deep navy and black */
    --chart-bg: #000000;
    --chart-text: #ff6600;
    --chart-text-bright: #ff7f00;
    --accent-primary: #ff6600;
    --accent-secondary: #4a6fa5;
    --accent-tertiary: #1a2332;
    --trendline-color: #7a9fcc;
}

:root.my-octopus-teacher {
    /* Keep UI colors dark */
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1423;
    --bg-tertiary: #1a2332;
    --text-primary: #b8c8e0;
    --text-secondary: #6b7d95;
    --text-bright: #e8f0fe;
    --blue-primary: #4a90e2;
    --blue-secondary: #5ba3f5;
    --blue-tertiary: #357abd;
    /* My Octopus Teacher - deep navy with ocean blues and cream accents */
    --chart-bg: #021526;
    --chart-text: #87ceeb;
    --chart-text-bright: #f5f5dc;
    --accent-primary: #87ceeb;
    --accent-secondary: #1e5a8e;
    --accent-tertiary: #f5f5dc;
}

:root.the-bright-afterglow {
    /* Keep UI colors dark */
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1423;
    --bg-tertiary: #1a2332;
    --text-primary: #b8c8e0;
    --text-secondary: #6b7d95;
    --text-bright: #e8f0fe;
    --blue-primary: #4a90e2;
    --blue-secondary: #5ba3f5;
    --blue-tertiary: #357abd;
    /* The Bright AfterGlow - dark theme with ethereal glowing accents */
    --chart-bg: #0a0a0a;
    --chart-text: #ffd700;
    --chart-text-bright: #fff8dc;
    --accent-primary: #ffd700;
    --accent-secondary: #ffa500;
    --accent-tertiary: #ff69b4;
    --trendline-color: #ffd700;
}

:root.violet-fog {
    /* Keep UI colors dark */
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1423;
    --bg-tertiary: #1a2332;
    --text-primary: #b8c8e0;
    --text-secondary: #6b7d95;
    --text-bright: #e8f0fe;
    --blue-primary: #4a90e2;
    --blue-secondary: #5ba3f5;
    --blue-tertiary: #357abd;
    /* Violet Fog - deep navy with purple, pink, and peach */
    --chart-bg: #000033;
    --chart-text: #e89ac7;
    --chart-text-bright: #ffccaa;
    --accent-primary: #66326b;
    --accent-secondary: #e89ac7;
    --accent-tertiary: #ffccaa;
}

:root.golf {
    --bg-primary: #006a4e;
    --bg-secondary: #00563c;
    --bg-tertiary: #00412b;
    --text-primary: #f8f1e4;
    --text-secondary: #d4cbb9;
    --text-bright: #fffbed;
    --accent-primary: #fff3da;
    --accent-secondary: #f2d4b0;
    --accent-tertiary: #ffb347;
    --blue-primary: #ffb347;
    --blue-secondary: #ffc98f;
    --blue-tertiary: #ff9f43;
    --chart-bg: #005a3f;
    --chart-text: #f6e9d5;
    --chart-text-bright: #fff7eb;
}


/* Default theme */
:root {
    --chart-bottom-gutter: 110px;
    /* space reserved for info/status overlays so x-axis labels stay visible */
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1423;
    --bg-tertiary: #1a2332;
    --text-primary: #b8c8e0;
    --text-secondary: #6b7d95;
    --text-bright: #e8f0fe;
    --accent-primary: #00ff44;
    --accent-secondary: #00cc33;
    --accent-tertiary: #00ff00;
    --blue-primary: #4a90e2;
    --blue-secondary: #5ba3f5;
    --blue-tertiary: #357abd;
    /* Chart uses same colors as UI for dark themes */
    --chart-bg: #0f1423;
    --chart-text: #6b7d95;
    --chart-text-bright: #b8c8e0;

    /* Border/UI defaults */
    --chrome-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --chrome-body-bg: #0a0e1a;
    --chrome-header-bg: #0f1423;
    --chrome-header-border: #1a2332;
    --chrome-header-text: #b8c8e0;
    --chrome-surface-bg: #0a0e1a;
    --chrome-panel-bg: #0f1423;
    --chrome-panel-border: #1f2b3d;
    --chrome-card-bg: #0f1423;
    --chrome-card-border: #1a2332;
    --chrome-button-bg: #1a2332;
    --chrome-button-border: #2a3441;
    --chrome-button-text: #b8c8e0;
    --chrome-button-hover-bg: #2a3441;
    --chrome-button-hover-border: #4a90e2;
    --chrome-button-hover-text: #e8f0fe;
    --chrome-dropdown-bg: #0f1423;
    --chrome-dropdown-border: #2a3441;
    --chrome-dropdown-hover-bg: #1a2332;
    --chrome-dropdown-text: #b8c8e0;
    --chrome-input-bg: #141f30;
    --chrome-input-border: #1f2b3d;
    --chrome-input-text: #e8f0fe;
    --chrome-helper-text: #6b7d95;
    --chrome-accent: #4a90e2;
    --chrome-accent-strong: #357abd;
    --chrome-backdrop: rgba(15, 20, 35, 0.92);
}

:root.border-theme-navy-blue {
    --chrome-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --chrome-body-bg: #0a0e1a;
    --chrome-header-bg: #0f1423;
    --chrome-header-border: #1a2332;
    --chrome-header-text: #b8c8e0;
    --chrome-surface-bg: #0a0e1a;
    --chrome-panel-bg: #0f1423;
    --chrome-panel-border: #1f2b3d;
    --chrome-card-bg: #0f1423;
    --chrome-card-border: #1a2332;
    --chrome-button-bg: #1a2332;
    --chrome-button-border: #2a3441;
    --chrome-button-text: #b8c8e0;
    --chrome-button-hover-bg: #2a3441;
    --chrome-button-hover-border: #4a90e2;
    --chrome-button-hover-text: #e8f0fe;
    --chrome-dropdown-bg: #0f1423;
    --chrome-dropdown-border: #2a3441;
    --chrome-dropdown-hover-bg: #1a2332;
    --chrome-dropdown-text: #b8c8e0;
    --chrome-input-bg: #141f30;
    --chrome-input-border: #1f2b3d;
    --chrome-input-text: #e8f0fe;
    --chrome-helper-text: #6b7d95;
    --chrome-accent: #4a90e2;
    --chrome-accent-strong: #357abd;
    --chrome-backdrop: rgba(15, 20, 35, 0.92);
}

:root.border-theme-black-white-gray {
    --chrome-font-family: 'Orbitron', 'Oxanium', 'Segoe UI', sans-serif;
    --chrome-body-bg: #050505;
    --chrome-header-bg: #060606;
    --chrome-header-border: #1f1f1f;
    --chrome-header-text: #f0f0f0;
    --chrome-surface-bg: #080808;
    --chrome-panel-bg: #0b0b0b;
    --chrome-panel-border: #1c1c1c;
    --chrome-card-bg: #070707;
    --chrome-card-border: #3a3a3a;
    --chrome-button-bg: #121212;
    --chrome-button-border: #3a3a3a;
    --chrome-button-text: #f5f5f5;
    --chrome-button-hover-bg: #1e1e1e;
    --chrome-button-hover-border: #6a6a6a;
    --chrome-button-hover-text: #ffffff;
    --chrome-dropdown-bg: #080808;
    --chrome-dropdown-border: #3a3a3a;
    --chrome-dropdown-hover-bg: linear-gradient(135deg, #1c1c1c, #2a2a2a);
    --chrome-dropdown-text: #f0f0f0;
    --chrome-input-bg: #111111;
    --chrome-input-border: #2d2d2d;
    --chrome-input-text: #f0f0f0;
    --chrome-helper-text: #8c8c8c;
    --chrome-accent: #c0c0c0;
    --chrome-accent-strong: #3d3d3d;
    --chrome-backdrop: rgba(0, 0, 0, 0.9);
}

/* Ensure the top header bar reflects the selected border theme */
:root.border-theme-navy-blue .control-bar {
    background: #0f1423;
    color: #b8c8e0;
    border-bottom-color: #1a2332;
}

:root.border-theme-black-white-gray .control-bar {
    background: #060606 !important;
    color: #f0f0f0;
    border-bottom-color: #1f1f1f;
}

:root.border-theme-teal .control-bar {
    background: #0b1f20;
    color: #cfeeee;
    border-bottom-color: #134347;
}

body {
    font-family: var(--chrome-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    background: var(--chrome-body-bg, var(--bg-primary));
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.main-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.control-bar {
    position: relative;
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    padding: 4px 20px 4px 20px;
    background: var(--chrome-header-bg, #0f1423);
    color: var(--chrome-header-text, #b8c8e0);
    border-bottom: 1px solid var(--chrome-header-border, rgba(36, 46, 64, 0.7));
    box-shadow: 0 24px 48px rgba(5, 8, 18, 0.6);
    z-index: 15;
    justify-content: flex-start;
    min-height: auto;
}

.control-bar__section {
    width: 100%;
    max-width: min(1180px, calc(100vw - 80px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
    padding: 0 32px;
}

.control-bar__section--spacer {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    padding: 0;
    margin: 0;
    gap: 0;
}

.control-bar__section--left-menus {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    justify-content: flex-end;
    padding: 0;
    width: auto;
    max-width: none;
    margin: 0;
    min-width: auto;
}

.left-menu-buttons {
    display: flex;
    align-items: center;
    gap: 2px;
    justify-content: flex-start;
    flex-wrap: nowrap;
    min-width: 0;
    position: relative;
}

.control-bar__section--right-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    justify-content: flex-end;
    padding: 0;
    width: auto;
    max-width: none;
    margin: 0;
}

.control-bar__section--left {
    justify-content: center;
    position: relative;
    min-height: 50px;
}

.control-bar__section--menus {
    justify-content: center;
    flex-wrap: wrap;
}

.control-bar__section--right {
    justify-content: flex-end;
}

.control-bar__menus {
    width: 100%;
}

.logo {
    position: relative;
    left: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    flex-grow: 0;
    padding-right: 12px;
    order: -1;
}

.logo-image {
    height: 60px;
    width: auto;
}

.created-date {
    font-size: 10px;
    font-weight: normal;
    color: #6b7d95;
    background: none;
}

.tagline {
    font-size: 0.7em;
    color: yellow !important;
    background: none !important;
    -webkit-text-fill-color: yellow !important;
}

.market-toggle-btn {
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid rgba(84, 110, 155, 0.55);
    background: linear-gradient(180deg, rgba(33, 44, 67, 0.85) 0%, rgba(21, 27, 43, 0.95) 100%);
    color: #f2f6ff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.18s ease;
    box-shadow: 0 10px 24px rgba(6, 12, 28, 0.45);
}

.market-toggle-btn:hover,
.market-toggle-btn:focus {
    border-color: rgba(95, 140, 220, 0.8);
    box-shadow: 0 16px 28px rgba(10, 18, 38, 0.65);
    outline: none;
    transform: translateY(-1px);
}

.market-toggle-btn[aria-expanded="true"] {
    border-color: rgba(95, 140, 220, 0.9);
    box-shadow: 0 18px 34px rgba(10, 18, 38, 0.75);
    transform: translateY(-1px);
}

.symbol-area {
    position: fixed;
    top: 70px;
    right: 0;
    left: auto;
    width: min(380px, 92vw);
    height: calc(50vh - 35px - 1.0in);
    /* lengthened by +0.5in */
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 26px 28px;
    padding-bottom: calc(26px + 0.25in);
    /* retain extra bottom room */
    border-radius: 0;
    background: #000000;
    border: 1px solid #4a4a4a;
    /* perimeter highlight */
    box-shadow: -28px 0 52px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
    transform: translateX(110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.3s ease;
    z-index: 1360;
}

.symbol-area.symbol-area--left {
    right: auto;
    left: 0;
    border-left: 1px solid #4a4a4a;
    border-right: 1px solid #4a4a4a;
    box-shadow: 28px 0 52px rgba(0, 0, 0, 0.6);
    transform: translateX(-110%);
}

.symbol-area::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, rgba(59, 83, 122, 0.3), rgba(59, 83, 122, 0));
    filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    display: none;
}

.symbol-area-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1350;
}

.symbol-area-backdrop--visible {
    opacity: 1;
    pointer-events: auto;
}

.symbol-area.symbol-area--open {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.symbol-area:focus {
    outline: none;
}

.symbol-area__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #4a4a4a;
}

.symbol-area__header h3 {
    font-size: 1.1rem;
    color: var(--text-bright);
    margin: 0;
    flex: 1;
}

.symbol-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.symbol-and-timeframe {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.market-controls,
.ticker-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.aggregation-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid #4a4a4a;
    background: #000000;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(6px);
}

.market-controls select,
.ticker-controls select {
    width: 100%;
    min-width: 0;
}

.ticker-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.ticker-input-group .ticker-input {
    flex: 1 1 auto;
}

.ticker-submit-btn {
    padding: 6px 12px;
    font-size: 13px;
}

.symbol {
    font-size: 20px;
    font-weight: 600;
    color: #e8f0fe;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.partial-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: inherit;
    cursor: pointer;
    user-select: none;
}

.partial-toggle input {
    accent-color: var(--accent-primary, #4a90e2);
    cursor: pointer;
}

.partial-toggle.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.partial-toggle.disabled input {
    cursor: not-allowed;
}

.aggregation-badge {
    display: inline-flex;
    align-items: center;
    flex-direction: column;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    letter-spacing: 0.02em;
    border: 1px solid rgba(0, 255, 204, 0.4);
    background: rgba(0, 255, 204, 0.12);
    color: #9ef8ff;
    width: auto;
    text-transform: none;
    line-height: 1;
    gap: 2px;
}

.aggregation-badge.deterministic {
    border-color: rgba(0, 255, 204, 0.4);
    background: rgba(0, 255, 204, 0.12);
    color: #9ef8ff;
}

.aggregation-badge.live {
    border-color: rgba(255, 196, 0, 0.5);
    background: rgba(255, 196, 0, 0.15);
    color: #ffe8a3;
}

.aggregation-badge.hidden {
    display: none;
}

.aggregation-badge__details {
    display: block;
    margin-top: 0;
    font-size: 10px;
    color: inherit;
    opacity: 0.85;
}

.ticker-input {
    padding: 6px 8px;
    border: 1px solid var(--chrome-input-border, #1f2b3d);
    background: var(--chrome-input-bg, #141f30);
    color: var(--chrome-input-text, #e8f0fe);
    border-radius: 4px;
    font-size: 13px;
    width: 100%;
    min-width: 0;
}

.ticker-input::placeholder {
    color: var(--chrome-helper-text, #6b7d95);
}

.market-frame .market-controls select,
.market-frame .ticker-controls select {
    background: #0b0b0b;
    color: #ffffff;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    outline: none;
}

/* Make the custom ticker input and Enter button match the panel look */
.market-frame .ticker-input {
    background: #0b0b0b;
    color: #ffffff;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
}

.market-frame .ticker-input::placeholder {
    color: #c0c0c0;
}

.market-frame .ticker-submit-btn {
    background: #0b0b0b;
    color: #ffffff;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
}

.market-frame .ticker-submit-btn:hover {
    background: #141414;
    border-color: #8a8a8a;
}

.price {
    font-size: 18px;
    color: #8abaff;
    font-weight: 600;
}

.price.positive {
    color: #6bb6ff;
}

.price.negative {
    color: #4285f4;
}

.timeframe {
    color: #ffffff;
    font-size: 14px;
    font-weight: 400;
}

.symbol-and-timeframe .timeframe {
    background: #0b0b0b;
    color: #ffffff;
    border: 1px solid #3a3a3a;
    font-size: 13px;
    opacity: 0.95;
    padding: 2px 6px;
    border-radius: 6px;
}

.market-frame {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 16px 18px;
    padding-bottom: calc(16px + 0.25in);
    /* retain extra bottom room */
    border-radius: 12px;
    border: 1px solid #3a3a3a;
    background: #0b0b0b;
    box-shadow: inset 0 1px 0 rgba(150, 190, 255, 0.05);
    backdrop-filter: blur(6px);
}

.market-frame .market-controls {
    padding: 0 0 12px 0;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(72, 92, 132, 0.35);
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    margin-bottom: 0;
}

.market-frame .ticker-controls {
    padding: 12px 0 0 0;
    border-radius: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    margin: 0;
}

.market-frame .market-controls,
.market-frame .ticker-controls {
    gap: 10px;
}

:root.border-theme-black-white-gray .market-controls select,
:root.border-theme-black-white-gray .ticker-controls select {
    background: #050505;
    color: #ffffff;
    border-color: #3a3a3a;
}

:root.border-theme-black-white-gray .timeframe {
    background: #050505;
    color: #ffffff;
    border: 1px solid #3a3a3a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* Force B/W styling for panel selects regardless of border theme */
:root.border-theme-navy-blue .market-controls select,
:root.border-theme-navy-blue .ticker-controls select {
    background: #0b0b0b;
    color: #ffffff;
    border-color: #3a3a3a;
}

:root.border-theme-navy-blue .timeframe {
    background: #0b0b0b;
    color: #ffffff;
    border: 1px solid #3a3a3a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.controls {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    align-items: center;
    justify-content: center;
    flex: 1;
    margin-top: 0;
}

.controls>.dropdown,
.controls>.controls-cluster {
    margin: 0;
    width: auto;
    flex: 0 1 auto;
}

.controls-cluster {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.controls-cluster--actions {
    gap: 4px;
}

.controls-cluster--session {
    gap: 6px;
}

.controls-cluster--actions .btn,
.controls-cluster--session .btn {
    margin: 0;
    white-space: nowrap;
}

.controls-cluster--actions .btn {
    min-width: 34px;
}

.tool-guide {
    position: fixed;
    width: 240px;
    max-width: 260px;
    padding: 12px 16px;
    background: var(--chrome-backdrop, rgba(15, 20, 35, 0.92));
    border: 1px solid color-mix(in srgb, var(--chrome-accent, #4a90e2) 40%, transparent);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    color: var(--text-primary);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 1200;
    backdrop-filter: blur(6px);
    display: none;
}

.tool-guide.tool-guide-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: block;
}

.tool-guide-heading {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.tool-guide-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 6px;
}

.tool-guide-description {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-primary);
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

/* ============================
= = =  DC Integrity Core  = = =
============================= */
:root {
    --ic-pink: #ff2d9b;
    --ic-green: #00c853;
    --ic-ink: #0b0f1a;
    --ic-card: rgba(12, 16, 24, 0.92);
    --ic-border: rgba(0, 200, 83, 0.35);
    --ic-pink-border: rgba(255, 45, 155, 0.45);
}

.integrity-panel {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    width: clamp(294px, 29vw, 476px);
    height: 100vh;
    padding: 28px 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #000000;
    border-left: 1px solid #4a4a4a;
    box-shadow: -28px 0 52px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
    transform: translateX(110%);
    opacity: 0;
    transition: transform .45s cubic-bezier(0.23, 1, 0.32, 1), opacity .3s ease;
    z-index: 1435;
    pointer-events: none;
}

.integrity-panel.integrity-panel--left {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid #4a4a4a;
    box-shadow: 28px 0 52px rgba(0, 0, 0, 0.6);
    transform: translateX(-110%);
}

.integrity-panel.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.integrity-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.integrity-panel__title-block h3 {
    color: var(--text-bright, #f2f6ff);
    font-size: 1.2rem;
    margin: 0 0 2px;
}

.integrity-panel__subtitle {
    font-size: .75rem;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: .04em;
}

.integrity-panel__header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.integrity-panel__side-toggle {
    background: rgba(74, 74, 74, 0.3);
    border: 1px solid #4a4a4a;
    color: var(--text-bright);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.integrity-panel__side-toggle:hover {
    background: rgba(74, 74, 74, 0.5);
    transform: translateY(-1px);
}

.integrity-panel__section {
    background: rgba(26, 35, 50, 0.4);
    border: 1px solid rgba(74, 74, 74, 0.5);
    border-radius: 14px;
    padding: 14px;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.3);
}

.integrity-panel__section--audit {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.integrity-section-title {
    font-size: .82rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(158, 198, 240, 0.85);
    margin-bottom: 10px;
}

.integrity-summary {
    display: grid;
    gap: 12px;
}

.integrity-kv {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.integrity-kv label {
    display: block;
    font-size: .72rem;
    color: rgba(158, 198, 240, 0.75);
    letter-spacing: .06em;
}

.integrity-kv strong {
    font-size: .95rem;
    color: var(--text-bright, #f2f6ff);
}

.integrity-hash {
    display: flex;
    align-items: center;
    gap: 8px;
}

.integrity-hash code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: .82rem;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 45, 155, 0.08);
    border: 1px solid var(--ic-pink-border);
    color: #ffd6ec;
}

.integrity-hash-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.bucket-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 10px;
    gap: 2px;
    width: 100%;
    height: 86px;
    padding: 6px;
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.bucket-cell {
    width: 10px;
    height: 100%;
    border-radius: 2px;
    position: relative;
    background: rgba(0, 200, 83, 0.18);
    border: 1px solid rgba(0, 200, 83, 0.36);
    box-shadow: 0 0 8px rgba(0, 200, 83, 0.25) inset;
}

.bucket-cell.warn {
    background: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.55);
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.35) inset;
}

.bucket-cell.bad {
    background: rgba(255, 82, 82, 0.22);
    border-color: rgba(255, 82, 82, 0.6);
    box-shadow: 0 0 8px rgba(255, 82, 82, 0.35) inset;
}

.bucket-cell:hover::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: 110%;
    transform: translateX(-50%);
    background: #0f1423;
    color: #e8f0fe;
    font-size: .72rem;
    padding: 6px 8px;
    border-radius: 6px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 2;
}

.bucket-legend {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.b-legend {
    font-size: .78rem;
    color: rgba(255, 255, 255, 0.8);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.b-legend i {
    width: 14px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}

.b-legend.ok i {
    background: rgba(0, 200, 83, 0.6);
    border: 1px solid rgba(0, 200, 83, 0.9);
}

.b-legend.warn i {
    background: rgba(255, 193, 7, 0.6);
    border: 1px solid rgba(255, 193, 7, 0.9);
}

.b-legend.bad i {
    background: rgba(255, 82, 82, 0.6);
    border: 1px solid rgba(255, 82, 82, 0.9);
}

.bucket-legend-help {
    margin-top: 10px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    font-size: .76rem;
    color: rgba(158, 198, 240, 0.85);
    line-height: 1.5;
}

.bucket-legend-help>div {
    margin: 4px 0;
}

.bucket-legend-help strong {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

.integrity-panel__footer {
    font-size: .74rem;
    color: rgba(158, 198, 240, 0.72);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.integrity-panel__timestamp {
    color: rgba(200, 220, 255, 0.78);
}

.signal-integrity-audit-log {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.signal-integrity-audit-log .entry {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.signal-integrity-audit-log .entry:last-child {
    border-bottom: none;
}

.signal-integrity-audit-log .entry.success .entry-header {
    color: #00c853;
    /* Green */
}

.signal-integrity-audit-log .entry.failure .entry-header {
    color: #ff5252;
    /* Red */
}

.signal-integrity-audit-log .entry-header {
    font-weight: bold;
    margin-bottom: 5px;
}

.data-range-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 0;
}

.radio-option input[type="radio"] {
    cursor: pointer;
}

.radio-option span {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
}


.integrity-panel-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
    z-index: 1400;
}

.integrity-panel-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 900px) {
    .integrity-panel {
        width: min(100vw, 360px);
        padding: 20px 18px;
    }

    .integrity-kv {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.dropdown-btn {
    background: linear-gradient(135deg, var(--chrome-accent, #4a90e2), var(--chrome-accent-strong, #357abd));
    border-color: var(--chrome-accent, #4a90e2);
    color: var(--chrome-button-hover-text, #ffffff);
}

.dropdown-btn:hover {
    background: linear-gradient(135deg, color-mix(in srgb, var(--chrome-accent, #4a90e2) 80%, white 20%), var(--chrome-accent, #4a90e2));
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--chrome-dropdown-bg, #0f1423);
    min-width: 200px;
    border: 1px solid var(--chrome-dropdown-border, #2a3441);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    padding: 8px 0;
    margin-top: 2px;
    white-space: nowrap;
}

.dropdown-content.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: var(--chrome-dropdown-text, #b8c8e0);
    cursor: pointer;
    transition: background 0.2s ease;
    gap: 8px;
    font-size: 14px;
    margin: 0;
}

.dropdown-item:hover {
    background: var(--chrome-dropdown-hover-bg, #1a2332);
}

.dropdown-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    background: var(--chrome-button-bg, #1a2332);
    border: 1px solid var(--chrome-button-border, #2a3441);
    border-radius: 2px;
    cursor: pointer;
    margin: 0;
    appearance: none;
    position: relative;
}

.dropdown-item input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--chrome-accent, #4a90e2), var(--chrome-accent-strong, #357abd));
}

.dropdown-item input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 1px;
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.dropdown-item input[type="radio"] {
    width: 14px;
    height: 14px;
    background: var(--chrome-button-bg, #1a2332);
    border: 1px solid var(--chrome-button-border, #2a3441);
    border-radius: 50%;
    cursor: pointer;
    margin: 0;
    appearance: none;
    position: relative;
}

.dropdown-item input[type="radio"]:checked {
    background: linear-gradient(135deg, var(--chrome-accent, #4a90e2), var(--chrome-accent-strong, #357abd));
}

.dropdown-item input[type="radio"]:checked::after {
    content: '●';
    position: absolute;
    top: -3px;
    left: 2px;
    color: white;
    font-size: 8px;
}

.dropdown-item span {
    user-select: none;
}

.shift-controls {
    margin-left: auto;
    display: flex;
    gap: 4px;
}

.shift-btn {
    background: var(--chrome-button-bg, #1a2332);
    border: 1px solid var(--chrome-button-border, #2a3441);
    color: var(--chrome-dropdown-text, #b8c8e0);
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
}

.shift-btn:hover {
    background: var(--chrome-button-hover-bg, #2a3441);
    border-color: var(--chrome-accent, #4a90e2);
}

.shift-btn:active {
    background: var(--chrome-accent, #4a90e2);
}

.dropdown-section-label {
    padding: 6px 16px 4px;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--chrome-helper-text, #6b7d95);
    opacity: 0.85;
    pointer-events: none;
    user-select: none;
}

.dropdown-section-label--border {
    margin-top: 4px;
}

.dropdown-helper-text {
    margin: 0 16px 6px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--chrome-helper-text, #6b7d95);
    pointer-events: none;
    user-select: none;
}

.dropdown-separator {
    height: 1px;
    background: var(--chrome-panel-border, var(--bg-tertiary));
    margin: 4px 0;
}

.spacing-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.spacing-item span {
    flex: 1;
}

.spacing-item .alignment-controls {
    margin-left: 0;
}

.spacing-item {
    gap: 8px;
}

.spacing-item-inline {
    justify-content: flex-start !important;
}

.spacing-item-inline .alignment-controls {
    margin-left: 8px;
}

.agent-area-controls {
    gap: 6px;
}

.agent-area-dismiss-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ff4f9a;
    background: rgba(17, 24, 39, 0.85);
    color: #ff4f9a;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, opacity 0.2s ease;
    z-index: 6;
}

.agent-area-dismiss-btn:hover {
    transform: translateY(-1px);
    background: rgba(33, 42, 64, 0.95);
}

.alignment-controls {
    display: inline-flex;
    gap: 2px;
    margin-left: 8px;
}

.align-btn {
    background: var(--chrome-button-bg, #2a3441);
    border: 1px solid var(--chrome-accent, #4a90e2);
    color: var(--chrome-button-text, #b8c8e0);
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    font-weight: bold;
    transition: all 0.2s ease;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.align-btn:hover {
    background: linear-gradient(135deg, var(--chrome-accent, #4a90e2), var(--chrome-accent-strong, #357abd));
    color: var(--chrome-button-hover-text, #ffffff);
    transform: translateY(-1px);
}

.tool-btn {
    background: var(--chrome-button-bg, #2a3441);
    border: 1px solid var(--chrome-button-border, #4a90e2);
    color: var(--chrome-button-text, #b8c8e0);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.spacing-item .tool-btn {
    width: auto;
}

.agent-area-controls .tool-btn {
    width: 100% !important;
}

.tool-btn.tool-btn-compact {
    padding: 6px 10px;
    min-width: 90px;
}

.tool-btn:hover {
    background: linear-gradient(135deg, var(--chrome-accent, #4a90e2), var(--chrome-accent-strong, #357abd));
    border-color: var(--chrome-accent, #4a90e2);
    color: var(--chrome-button-hover-text, #ffffff);
}

.tool-btn.active {
    background: linear-gradient(135deg, var(--chrome-accent, #4a90e2), var(--chrome-accent-strong, #357abd));
    color: var(--chrome-button-hover-text, #ffffff);
    border-color: color-mix(in srgb, var(--chrome-accent, #4a90e2) 85%, white 15%);
}

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

.btn {
    background: var(--chrome-button-bg, #1a2332);
    border: 1px solid var(--chrome-button-border, #2a3441);
    color: var(--chrome-button-text, #b8c8e0);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn:hover {
    background: var(--chrome-button-hover-bg, #2a3441);
    border-color: var(--chrome-button-hover-border, #4a90e2);
    color: var(--chrome-button-hover-text, #e8f0fe);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--chrome-accent, #4a90e2), var(--chrome-accent-strong, #357abd));
    border-color: var(--chrome-accent, #4a90e2);
    color: var(--chrome-button-hover-text, #ffffff);
}

.btn-primary:hover {
    background: linear-gradient(135deg, color-mix(in srgb, var(--chrome-accent, #4a90e2) 80%, white 20%), var(--chrome-accent, #4a90e2));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--chrome-accent, #4a90e2) 35%, transparent);
}

.btn-secondary {
    background: rgba(15, 20, 35, 0.6);
    border: 1px dashed rgba(91, 163, 245, 0.5);
}

.btn-secondary:hover {
    background: rgba(15, 20, 35, 0.8);
    border-color: rgba(91, 163, 245, 0.9);
}

.btn.refresh-btn {
    font-size: 1.5em;
    line-height: 1;
    padding: 8px 12px;
}

.main-content {
    flex: 1 1 auto;
    display: flex;
    min-height: 0;
    width: 100%;
}

.chart-container {
    flex: 1;
    padding: 20px;
    background: var(--chrome-surface-bg, #0a0e1a);
}

.chart-wrapper {
    position: relative;
    height: 100%;
    background: var(--chrome-card-bg, #0f1423);
    border-radius: 12px;
    padding: 20px;
    overflow: hidden;
    border: 1px solid var(--chrome-card-border, #1a2332);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.chart-canvas {
    width: 100%;
    height: calc(100% - var(--chart-bottom-gutter, 110px));
    background: var(--chart-bg, #0f1423);
    border-radius: 8px;
}

.jump-to-current {
    position: absolute;
    bottom: 86px;
    right: 32px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary, rgba(255, 255, 255, 0.7));
    background: transparent;
    color: var(--accent-primary, #ffffff);
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s ease, border-color 0.2s ease, color 0.2s ease;
    z-index: 15;
    backdrop-filter: none;
}

.jump-to-current:hover,
.jump-to-current:focus {
    border-color: var(--accent-primary, #ffffff);
    color: var(--accent-primary, #ffffff);
    outline: none;
    filter: brightness(1.2);
}

.jump-to-current:active {
    transform: translateY(1px);
}

/* ========================================
   DO NOT MODIFY: Signal line positioning
   Fixed at bottom: 36px per user requirement
   ======================================== */
.info-line {
    position: absolute;
    bottom: 36px;
    /* LOCKED: Do not change this value */
    /* Trim 1px so the left border aligns exactly with the grid start */
    left: 21px;
    right: 80px;
    height: 18px;
    font-size: 10px;
    color: var(--accent-primary, #c55f1f);
    display: flex;
    align-items: center;
    /* Make the signal bar blend with the background */
    background: transparent;
    border-radius: 4px;
    backdrop-filter: blur(3px);
    z-index: 9;
    overflow: hidden;
}

.info-line-item {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 5px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    color: inherit;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.info-line-dm {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.08);
    border-radius: 2px;
    border: 1px solid rgba(255, 107, 107, 0.6);
    /* Reduced glow - keep light inside borders */
    box-shadow: inset 0 0 6px rgba(255, 107, 107, 0.4);
}


.info-line-double-hit {
    color: #ffd93d;
    background: rgba(255, 217, 61, 0.08);
    border-radius: 2px;
    border: 1px solid rgba(255, 217, 61, 0.6);
    /* Reduced glow - keep light inside borders */
    box-shadow: inset 0 0 6px rgba(255, 217, 61, 0.4);
}

.info-line-cross-count {
    color: #ffff00;
    background: rgba(255, 255, 0, 0.08);
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 0, 0.6);
    /* Reduced glow - keep light inside borders */
    box-shadow: inset 0 0 6px rgba(255, 255, 0, 0.4);
}

/* Theme-specific info line colors */
:root.neon-green .info-line-dm {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.15);
}

:root.neon-orange .info-line-dm {
    color: #ff3838;
    background: rgba(255, 56, 56, 0.2);
    border: 1px solid rgba(255, 56, 56, 0.3);
}

:root.white-on-black .info-line-dm {
    color: #fca5a5;
    background: rgba(252, 165, 165, 0.15);
}

/* ========================================
   DO NOT MODIFY: Status bar positioning
   Fixed at bottom: 0px per user requirement
   ======================================== */
.status-bar {
    position: absolute;
    bottom: 0px;
    /* LOCKED: Do not change this value */
    left: 20px;
    right: 20px;
    font-size: 12px;
    color: #6b7d95;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    /* Use the theme's border color as the background (no border) */
    background: var(--chrome-panel-border, var(--chrome-card-border, var(--chrome-header-border, var(--bg-tertiary))));
    border: none;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    z-index: 10;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.separator {
    color: #3a4551;
}

.status-indicator {
    color: #5ba3f5;
    font-weight: 500;
}

.status-indicator.snapshot-active {
    color: #82ffa7;
}

:root.border-theme-black-white-gray .info-line {
    /* Blend the signal bar with the background for this theme too */
    background: transparent;
    color: #f0f0f0;
}

:root.border-theme-black-white-gray .status-bar {
    /* Blend the status bar with surrounding border/card area so only text stands out */
    background: var(--chrome-card-bg, var(--chrome-surface-bg, var(--chrome-body-bg, var(--bg-primary))));
    border: none;
    color: #e0e0e0;
    backdrop-filter: none;
}

:root.border-theme-black-white-gray .separator {
    color: #6a6a6a;
}

:root.border-theme-black-white-gray .status-indicator {
    color: #f5f5f5;
}

.crosshair {
    position: absolute;
    pointer-events: none;
    z-index: 5;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.crosshair-h {
    position: absolute;
    width: 100%;
    height: 1px;
    background: none;
    border-top: 1px dotted var(--accent-tertiary, #00ff00);
    opacity: 0.7;
    top: 0;
    left: 0;
}

.crosshair-v {
    position: absolute;
    width: 1px;
    height: 100%;
    background: none;
    border-left: 1px dotted var(--accent-tertiary, #00ff00);
    opacity: 0.7;
    top: 0;
    left: 0;
}

.crosshair-center {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 2px solid var(--accent-tertiary, #00ff00);
    border-radius: 50%;
    background: transparent;
    transform: translate(-50%, -50%);
    opacity: 0.8;
    pointer-events: none;
}

.price-label {
    position: absolute;
    background: linear-gradient(135deg, var(--accent-tertiary, #00ff00), var(--accent-primary, #00ff44));
    color: var(--text-primary, #000000);
    border: 1px solid var(--accent-tertiary, #00ff00);
    padding: 6px 12px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(0, 255, 0, 0.3);
    white-space: pre-line;
    text-align: center;
    transform: translate(-50%, -100%);
    margin-top: -80px;
    z-index: 10;
}

/* Darker text for bright theme backgrounds */
:root.neon-green .price-label,
:root.light-blue .price-label {
    color: #000000;
    text-shadow: none;
}

:root.neon-orange .price-label {
    color: var(--chart-bg, #0f1423);
    text-shadow: none;
}

:root.white-on-black .price-label {
    color: #111111;
    text-shadow: none;
}

:root.terminal-green .price-label {
    color: #000000;
    text-shadow: none;
}

:root.midnight-oled .price-label {
    color: #000000;
    text-shadow: none;
}

:root.neon-dreams .price-label {
    color: #0d0221;
    text-shadow: none;
}

:root.cyberpunk .price-label {
    color: #0a0e27;
    text-shadow: none;
}

:root.magenta-rising .price-label {
    color: #0c1018;
    text-shadow: none;
}

/* Donuts & Coffee theme - magenta info cursor with white text */
:root.donuts-coffee .price-label {
    background: #DD0A73;
    color: #ffffff;
    border: 1px solid #DD0A73;
    box-shadow: 0 3px 8px rgba(221, 10, 115, 0.5);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

/* Donuts & Coffee theme - orange crosshairs */
:root.donuts-coffee .crosshair-h {
    border-top: 1px dotted #FF6600;
    opacity: 0.85;
}

:root.donuts-coffee .crosshair-v {
    border-left: 1px dotted #FF6600;
    opacity: 0.85;
}

:root.donuts-coffee .crosshair-center {
    border: 2px solid #FF6600;
    opacity: 0.9;
}

/* Glofish theme - yellow info cursor with black text */
:root.glofish .price-label {
    background: #ffff00;
    color: #000000;
    border: 1px solid #ffff00;
    box-shadow: 0 3px 8px rgba(255, 255, 0, 0.5);
    text-shadow: none;
    font-weight: 700;
}

/* Your Ball Sport theme - orange info cursor with black text */
:root.your-ball-sport .price-label {
    background: #ff6600;
    color: #000000;
    border: 1px solid #ff6600;
    box-shadow: 0 3px 8px rgba(255, 102, 0, 0.5);
    text-shadow: none;
    font-weight: 700;
}

/* My Octopus Teacher theme - light blue info cursor with dark navy text */
:root.my-octopus-teacher .price-label {
    background: #87ceeb;
    color: #021526;
    border: 1px solid #87ceeb;
    box-shadow: 0 3px 8px rgba(135, 206, 235, 0.4);
    text-shadow: none;
    font-weight: 700;
}

/* Violet Fog theme - cursor text matches bg color */
:root.violet-fog .price-label {
    color: #000033;
    text-shadow: none;
}

:root.golf .price-label {
    color: #2b1900;
    text-shadow: none;
}

/* Glofish theme - yellow crosshairs */
:root.glofish .crosshair-h {
    border-top: 1px dotted #ffff00;
    opacity: 0.85;
}

:root.glofish .crosshair-v {
    border-left: 1px dotted #ffff00;
    opacity: 0.85;
}

:root.glofish .crosshair-center {
    border: 2px solid #ffff00;
    opacity: 0.9;
}

/* Your Ball Sport theme - gray crosshairs */
:root.your-ball-sport .crosshair-h {
    border-top: 1px dotted #4a6fa5;
    opacity: 0.85;
}

:root.your-ball-sport .crosshair-v {
    border-left: 1px dotted #4a6fa5;
    opacity: 0.85;
}

:root.your-ball-sport .crosshair-center {
    border: 2px solid #4a6fa5;
    opacity: 0.9;
}

/* The Bright AfterGlow theme - golden glowing cursor */
:root.the-bright-afterglow .price-label {
    background: #ffd700;
    color: #000000;
    border: 1px solid #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.4);
    text-shadow: none;
    font-weight: 700;
}

/* The Bright AfterGlow theme - golden glowing crosshairs */
:root.the-bright-afterglow .crosshair-h {
    border-top: 1px dotted #ffd700;
    opacity: 0.9;
    filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.6));
}

:root.the-bright-afterglow .crosshair-v {
    border-left: 1px dotted #ffd700;
    opacity: 0.9;
    filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.6));
}

:root.the-bright-afterglow .crosshair-center {
    border: 2px solid #ffd700;
    opacity: 0.95;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}


.note-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 12;
}

.note-item {
    position: absolute;
    display: flex;
    flex-direction: column;
    padding: 10px;
    background: color-mix(in srgb, var(--chart-bg, #0f1423) 88%, var(--accent-primary, #00ff44) 12%);
    border: 1px solid var(--accent-primary, #00ff44);
    border-radius: 10px;
    background-clip: padding-box;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
    color: var(--text-primary, #b8c8e0);
    backdrop-filter: blur(3px);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
    cursor: grab;
}

.note-item:focus-within,
.note-item.note-selected {
    border-color: var(--accent-primary, #00ff44);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary, #00ff44) 45%, transparent),
        0 12px 24px rgba(0, 0, 0, 0.45);
}

.note-item:active {
    cursor: grabbing;
}

.note-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary, #6b7d95);
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.note-delete-btn:hover {
    background: color-mix(in srgb, var(--accent-primary, #00ff44) 18%, transparent);
    color: var(--accent-primary, #00ff44);
    transform: scale(1.08);
}

.note-delete-btn:active {
    transform: scale(0.95);
}

.note-delete-btn:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent-primary, #00ff44) 65%, transparent);
    outline-offset: 2px;
}

.note-add-anchor-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary, #6b7d95);
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.note-add-anchor-btn:hover {
    background: color-mix(in srgb, var(--accent-primary, #00ff44) 18%, transparent);
    color: var(--accent-primary, #00ff44);
    transform: scale(1.08);
}

.note-add-anchor-btn:active {
    transform: scale(0.95);
}

.note-add-anchor-btn:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent-primary, #00ff44) 65%, transparent);
    outline-offset: 2px;
}

.note-editor {
    width: auto;
    min-width: 96px;
    max-width: 360px;
    min-height: 32px;
    padding: 10px 12px;
    font-size: 0.85rem;
    line-height: 1.4;
    font-family: inherit;
    background: color-mix(in srgb, var(--chart-bg, #0f1423) 94%, transparent 6%);
    color: var(--text-primary, #b8c8e0);
    border: none;
    outline: none;
    resize: none;
    box-sizing: border-box;
    border-radius: 8px;
    overflow: hidden;
}

.note-editor::placeholder {
    color: color-mix(in srgb, var(--text-secondary, #6b7d95) 80%, transparent);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 26, 0.9);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}

/* Cadence check modal - no blur so user can see chart */
#cadenceCheckModal {
    background: rgba(10, 14, 26, 0.7);
    backdrop-filter: none;
}

/* Make cadence check modal draggable */
#cadenceCheckModal .modal-content {
    position: relative;
    cursor: move;
}

#cadenceCheckModal .modal-header {
    cursor: move;
    user-select: none;
}

#cadenceCheckModal .modal-body,
#cadenceCheckModal .modal-footer {
    cursor: default;
}

.modal-content {
    background: var(--chrome-card-bg, #0f1423);
    border-radius: 12px;
    width: 400px;
    max-width: 90vw;
    border: 1px solid var(--chrome-card-border, #1a2332);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.modal-content.education-modal {
    width: min(600px, 90vw);
    height: clamp(360px, 75vh, 640px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* Image mode - auto-size to fit the image */
.modal-content.education-modal.education-modal--image {
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 90vh;
}

.modal-content.education-modal.education-modal--image .modal-body {
    padding: 12px;
    max-height: none;
    overflow: visible;
}

.modal-content.education-modal.education-modal--image .education-content {
    overflow: visible;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--chrome-header-border, #1a2332);
    background: var(--chrome-header-bg, #0f1423);
    color: var(--chrome-header-text, #b8c8e0);
    flex: 0 0 auto;
}

.modal-header h3 {
    color: var(--chrome-header-text, #e8f0fe);
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: #6b7d95;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #2a3441;
    color: #b8c8e0;
}

.modal-body {
    padding: 20px;
}

.education-modal .modal-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: calc(75vh - 160px);
}

.education-content {
    color: #b8c8e0;
    line-height: 1.6;
    white-space: normal;
    overflow-wrap: anywhere;
}

.education-modal .education-content {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 12px;
    box-sizing: border-box;
}

.education-content h1,
.education-content h2,
.education-content h3,
.education-content h4,
.education-content h5,
.education-content h6 {
    margin: 0 0 12px;
    font-weight: 600;
    color: #e8f0fe;
}

.education-content ul {
    margin: 0 0 12px 18px;
    padding: 0 0 0 12px;
    list-style: disc;
}

.education-content li {
    margin-bottom: 6px;
}

.education-content a {
    color: #6bb6ff;
    text-decoration: underline;
}

.education-content a:hover {
    color: #9cd1ff;
}

.education-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 16px 0;
    display: block;
}

.education-content code {
    font-family: 'Courier New', monospace;
    background: rgba(74, 144, 226, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    color: #e8f0fe;
}

.modal-body p {
    margin-bottom: 15px;
    color: #b8c8e0;
    line-height: 1.5;
}

.modal-body input {
    width: 100%;
    padding: 12px;
    background: #1a2332;
    border: 1px solid #2a3441;
    border-radius: 6px;
    color: #e8f0fe;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    transition: all 0.2s ease;
}

.modal-body input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.modal-body input::placeholder {
    color: #6b7d95;
}

.api-info {
    font-size: 12px;
    color: #6b7d95;
    margin-top: 10px;
}

.api-info a {
    color: #5ba3f5;
    text-decoration: none;
    font-weight: 500;
}

.api-info a:hover {
    text-decoration: underline;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #1a2332;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: rgba(15, 20, 35, 0.5);
    flex: 0 0 auto;
}

.modal-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    cursor: pointer;
}

.modal-option input[type="radio"] {
    width: 16px;
    height: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--blue-primary);
    border-radius: 50%;
    cursor: pointer;
    margin: 0;
    appearance: none;
    position: relative;
}

.modal-option input[type="radio"]:checked {
    background: linear-gradient(135deg, var(--blue-primary), var(--blue-tertiary));
}

.modal-option input[type="radio"]:checked::after {
    content: '●';
    position: absolute;
    top: -3px;
    left: 3px;
    color: white;
    font-size: 10px;
}

.signal-input label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-primary);
    font-size: 14px;
}

.signal-input input {
    width: 100%;
    padding: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--blue-primary);
    border-radius: 4px;
    color: var(--text-bright);
    font-size: 14px;
}

/* Loading Animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}

.loading {
    animation: pulse 2s ease-in-out infinite;
}

body.agent-panel-open,
body.snapshot-panel-open,
body.market-panel-open {
    overflow: hidden;
}

/* DreamChart Agent Panel */
.agent-panel {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    width: clamp(300px, 30vw, 420px);
    height: 100vh;
    padding: 28px 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #000000;
    border-left: 1px solid #4a4a4a;
    box-shadow: -28px 0 52px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
    transform: translateX(110%);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.3s ease;
    z-index: 1400;
    pointer-events: none;
}

.agent-panel.agent-panel--left {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid #4a4a4a;
    box-shadow: 28px 0 52px rgba(0, 0, 0, 0.6);
    transform: translateX(-110%);
}

.agent-panel.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.agent-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.agent-panel__header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.agent-panel__side-toggle,
.snapshot-panel__side-toggle,
.symbol-area__side-toggle {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid #3a3a3a;
    color: var(--text-bright);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.agent-panel__side-toggle:hover,
.snapshot-panel__side-toggle:hover,
.symbol-area__side-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: #5a5a5a;
    transform: translateY(-1px);
}

.agent-panel__side-toggle:focus-visible,
.snapshot-panel__side-toggle:focus-visible,
.symbol-area__side-toggle:focus-visible {
    outline: 2px solid #8a8a8a;
    outline-offset: 2px;
}

.agent-panel__side-toggle[aria-pressed="true"],
.snapshot-panel__side-toggle[aria-pressed="true"],
.symbol-area__side-toggle[aria-pressed="true"] {
    background: rgba(255, 255, 255, 0.12);
    border-color: #6a6a6a;
}

.agent-panel__header h3 {
    font-size: 1.2rem;
    color: var(--text-bright);
}

.agent-panel__subtitle {
    font-size: 0.75rem;
    color: #c0c0c0;
    text-shadow: none;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.agent-panel__section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agent-panel__section--presets {
    padding: 16px;
    border: 1px solid #4a4a4a;
    border-radius: 14px;
    background: #000000;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.18);
}

.agent-panel__section--prompt {
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #4a4a4a;
    background: #000000;
}

.agent-label {
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(158, 198, 240, 0.85);
}

.agent-input,
.agent-textarea {
    width: 100%;
    background: #000000;
    border: 1px solid #4a4a4a;
    color: var(--text-bright);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.9rem;
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.agent-input:focus,
.agent-textarea:focus {
    border-color: #8a8a8a;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.agent-panel select.agent-input {
    appearance: none;
    background-color: #000000;
    color: var(--text-bright);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23c0c0c0' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px 6px;
    padding-right: 32px;
}

.agent-panel select.agent-input option {
    background-color: #000000;
    color: #f0f0f0;
}

.agent-panel select.agent-input optgroup {
    background-color: #000000;
    color: #cfcfcf;
}

.agent-input--inline {
    width: 120px;
}

.agent-input--hidden {
    display: none;
}

.agent-scope-controls {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.agent-scope-controls .agent-input--inline {
    grid-column: 1 / span 2;
}

.agent-textarea {
    min-height: 120px;
    resize: vertical;
}

.agent-panel__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.agent-panel__output {
    flex: 1;
    border-radius: 12px;
    background: #000000;
    border: 1px solid #4a4a4a;
    padding: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 0 32px rgba(0, 0, 0, 0.12);
}

.agent-output__body {
    flex: 1;
    border-radius: 8px;
    background: #000000;
    border: 1px solid var(--accent-primary, #4a90e2);
    padding: 12px;
    overflow-y: auto;
    position: relative;
    margin-bottom: 46px;
    box-shadow: 0 0 0 1px rgba(74, 144, 226, 0.65),
        0 0 12px var(--accent-primary, #4a90e2),
        inset 0 0 10px rgba(74, 144, 226, 0.28);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-bright);
}

.agent-output__body p {
    margin-bottom: 1em;
}

.agent-output__body h1,
.agent-output__body h2,
.agent-output__body h3,
.agent-output__body h4 {
    margin-top: 1.2em;
    margin-bottom: 0.6em;
    color: var(--accent-primary, #4a90e2);
    font-weight: 600;
}

.agent-output__body ul,
.agent-output__body ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.agent-output__body li {
    margin-bottom: 0.4em;
}

.agent-output__body code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.agent-output__body pre {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1em;
    border: 1px solid #333;
}

.agent-output__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    color: rgba(200, 200, 200, 0.6);
    text-align: center;
    padding: 0 24px;
}

.agent-apply-btn {
    position: absolute;
    bottom: 18px;
    left: 18px;
    padding: 6px 18px;
    font-size: 0.85rem;
    border-color: #5a5a5a;
}

.agent-panel__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: rgba(200, 200, 200, 0.72);
    gap: 12px;
}

.agent-panel__hint {
    opacity: 0.75;
}

.agent-panel-backdrop {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(18, 18, 18, 0.28), rgba(5, 5, 5, 0.88));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1350;
}

.agent-panel-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.agent-panel .close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid #3a3a3a;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
    color: var(--text-bright);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.agent-panel .close-btn:hover {
    transform: rotate(90deg);
    border-color: #8a8a8a;
}

.agent-panel .btn-primary {
    background: #000000;
    border-color: #5a5a5a;
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.4);
}

.agent-panel .btn-primary:hover {
    background: #111111;
    border-color: #8a8a8a;
}

/* Match Snaps panel Done button to Agent Apply styling */
.snapshot-panel .btn-primary {
    background: #000000;
    border-color: #5a5a5a;
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.4);
}

.snapshot-panel .btn-primary:hover {
    background: #111111;
    border-color: #8a8a8a;
}

/* Make all snapshot card buttons match the dark Apply look */
.snapshot-panel .snapshot-card-actions .btn {
    background: #000000;
    border-color: #5a5a5a;
    color: var(--chrome-button-hover-text, #ffffff);
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.35);
}

.snapshot-panel .snapshot-card-actions .btn:hover {
    background: #111111;
    border-color: #8a8a8a;
}

/* Neon focus outlines for controls in Snaps/Agent panels */
.snapshot-panel .snapshot-library-toolbar input:focus,
.snapshot-panel .snapshot-library-toolbar select:focus,
.agent-panel .agent-input:focus,
.agent-panel .agent-textarea:focus {
    outline: none;
    border-color: var(--accent-primary, #4a90e2) !important;
    box-shadow: 0 0 0 1px rgba(74, 144, 226, 0.65), 0 0 12px var(--accent-primary, #4a90e2) !important;
}

.snapshot-panel {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    width: clamp(320px, 34vw, 460px);
    height: 100vh;
    padding: 28px 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #000000;
    border-left: 1px solid #4a4a4a;
    box-shadow: -28px 0 52px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
    transform: translateX(110%);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.3s ease;
    z-index: 1425;
    pointer-events: none;
}

.snapshot-panel.snapshot-panel--left {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid #4a4a4a;
    box-shadow: 28px 0 52px rgba(0, 0, 0, 0.6);
    transform: translateX(-110%);
}

.snapshot-panel.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.snapshot-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.snapshot-panel__header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.snapshot-panel__header-actions .btn,
.snapshot-panel__header-actions .close-btn {
    flex-shrink: 0;
}

.snapshot-panel__title-block h3 {
    font-size: 1.2rem;
    color: var(--text-bright, #f2f6ff);
    margin-bottom: 4px;
}

.snapshot-panel__subtitle {
    font-size: 0.75rem;
    color: #c0c0c0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.snapshot-panel .close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid #3a3a3a;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
    color: var(--text-bright, #f2f6ff);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.snapshot-panel .close-btn:hover {
    transform: rotate(90deg);
    border-color: #8a8a8a;
}

.snapshot-panel__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow: hidden;
}

.snapshot-panel__footer {
    display: flex;
    justify-content: flex-end;
}

.snapshot-panel-backdrop {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(18, 18, 18, 0.3), rgba(5, 5, 5, 0.88));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1400;
}

.snapshot-panel-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.agent-response {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid #3a3a3a;
    background: #121212;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
    animation: agentFadeIn 0.35s ease;
}

.agent-response__meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-primary);
    opacity: 0.85;
}

.agent-response__body {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.agent-response__body strong {
    color: var(--text-bright);
}

.agent-response--status {
    border-style: dashed;
    border-color: #5a5a5a;
    background: #111111;
}

.agent-response--status p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.agent-settings-modal {
    display: none;
    z-index: 1500;
}

.agent-settings-modal.show {
    display: flex;
}

.agent-settings-modal .modal-content {
    background: linear-gradient(160deg, rgba(18, 18, 18, 0.95), rgba(8, 8, 8, 0.12));
    border: 1px solid #3a3a3a;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
}

.agent-settings-modal .modal-header h3 {
    color: var(--text-bright);
}

.agent-settings-modal input {
    background: rgba(18, 18, 18, 0.82);
    border: 1px solid #3a3a3a;
    color: var(--text-bright);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.9rem;
    width: 100%;
}

.agent-settings-modal input:focus {
    border-color: #8a8a8a;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

@media (max-width: 900px) {
    .agent-panel {
        width: min(100vw, 360px);
        padding: 20px 20px 16px;
    }

    .agent-panel__footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .snapshot-panel {
        width: min(100vw, 360px);
        padding: 20px 20px 16px;
    }
}

@keyframes agentFadeIn {
    from {
        transform: translateY(12px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Snapshot UI */
.btn-link {
    background: none;
    border: none;
    color: var(--accent-color, #4fa3ff);
    cursor: pointer;
    padding: 0;
    font-size: 12px;
    text-decoration: underline;
}

.btn-link:hover,
.btn-link:focus {
    color: var(--accent-color-strong, #7bb8ff);
}

.btn-compact {
    padding: 4px 10px;
    font-size: 12px;
}

.snapshot-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.snapshot-status #snapshotStatusLabel {
    font-weight: 600;
}

.snapshot-modal .modal-content {
    max-width: 420px;
}

.snapshot-modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.snapshot-range-block {
    background: rgba(79, 163, 255, 0.08);
    border: 1px solid rgba(79, 163, 255, 0.3);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.snapshot-range-block--note {
    gap: 6px;
}

.snapshot-range-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    font-size: 13px;
}

.snapshot-range-heading strong {
    font-size: 14px;
}

.snapshot-range-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.snapshot-range-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}

.snapshot-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}

.snapshot-field input,
.snapshot-field textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.2);
    color: inherit;
    font: inherit;
}

.snapshot-field textarea {
    resize: vertical;
    min-height: 70px;
}

.snapshot-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.snapshot-checkbox input {
    width: 16px;
    height: 16px;
}

.snapshot-error {
    padding: 8px 10px;
    background: rgba(255, 66, 66, 0.18);
    border: 1px solid rgba(255, 66, 66, 0.5);
    border-radius: 6px;
    color: #ff9999;
    font-size: 12px;
}

.snapshot-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.snapshot-library-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.snapshot-library-toolbar input,
.snapshot-library-toolbar select {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #4a4a4a;
    background: #000000;
    color: #f0f0f0;
    font: inherit;
    outline: none;
    box-shadow: none;
}

.snapshot-library-toolbar input {
    flex: 1 1 200px;
}

.snapshot-library-toolbar select {
    min-width: 140px;
    background: #000000;
    color: #f0f0f0;
}

/* Snaps panel dropdown menu items in gray */
.snapshot-panel select option {
    background-color: #000000;
    color: #f0f0f0;
}

.snapshot-panel select optgroup {
    background-color: #000000;
    color: #cfcfcf;
}

.snapshot-library-toolbar input:focus,
.snapshot-library-toolbar select:focus {
    outline: none;
    box-shadow: none;
    border-color: #8a8a8a;
}

.snapshot-library-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.75);
}

.snapshot-library-list {
    display: grid;
    gap: 12px;
    flex: 1 1 auto;
    overflow-y: auto;
    padding-right: 6px;
    padding-bottom: 6px;
    align-content: start;
    justify-content: start;
}

.snapshot-library-list .snapshot-card {
    align-self: start;
}

.snapshot-card {
    background: #000000;
    border: 1px solid var(--accent-primary, #4a90e2);
    border-radius: 10px;
    padding: 14px;
    display: grid;
    gap: 10px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(74, 144, 226, 0.45),
        0 0 8px var(--accent-primary, #4a90e2);
}

.snapshot-card:hover {
    border-color: var(--accent-primary, #4a90e2);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34),
        0 0 0 1px rgba(74, 144, 226, 0.6),
        0 0 12px var(--accent-primary, #4a90e2);
}

/* Neon accent border for selected/active snapshot cards */
.snapshot-card.is-active {
    border-color: var(--accent-primary, #4a90e2);
    box-shadow: 0 0 0 1px rgba(74, 144, 226, 0.65),
        0 0 12px var(--accent-primary, #4a90e2),
        inset 0 0 10px rgba(74, 144, 226, 0.35);
}

.snapshot-card-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.snapshot-card-label {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c0c0c0;
}

.snapshot-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.snapshot-card-title {
    font-size: 16px;
    font-weight: 600;
}

.snapshot-card-hash {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
}

.snapshot-card-hash:hover {
    color: rgba(255, 255, 255, 0.85);
}

.snapshot-card-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.snapshot-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.snapshot-tag {
    background: #000000;
    border: 1px solid #5a5a5a;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
}

.snapshot-card-notes {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.4;
    max-height: 4.5em;
    overflow: hidden;
}

.snapshot-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.snapshot-card-actions .btn {
    font-size: 12px;
    padding: 6px 12px;
}

.snapshot-empty {
    text-align: center;
    padding: 40px 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.snapshot-card-summary {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.snapshot-active-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #82ffa7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .control-bar {
        padding: 18px 18px 24px;
        gap: 20px;
    }

    .control-bar__section {
        max-width: 100%;
    }

    .control-bar__section--left {
        min-height: auto;
        padding-top: 4px;
        flex-direction: column;
        align-items: center;
        padding-left: 0;
    }

    .logo {
        position: static;
        transform: none;
        margin-bottom: 12px;
    }

    .market-toggle-btn {
        width: 100%;
        text-align: center;
    }

    .symbol-area {
        width: calc(100vw - 36px);
        padding: 22px 20px;
        left: 50%;
    }

    .market-controls,
    .ticker-controls,
    .aggregation-controls {
        padding: 14px 16px;
    }

    .controls {
        justify-content: center;
        gap: 12px;
    }

    .controls-cluster {
        gap: 8px;
    }

    .btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    .chart-container {
        padding: 15px;
    }

    .chart-wrapper {
        padding: 15px;
    }

    .tool-guide {
        width: min(260px, 90%);
    }
}


/* The Bright AfterGlow: align signal bar with theme bg */
:root.the-bright-afterglow .info-line {
    background: var(--chart-bg, var(--chrome-body-bg, var(--bg-primary))) !important;
    color: var(--chart-text-bright, #fff8dc);
}


/* The Bright AfterGlow: align status bar with theme bg and no border */
:root.the-bright-afterglow .status-bar {
    background: var(--chrome-panel-border, var(--chrome-card-border, var(--chrome-header-border, var(--bg-tertiary)))) !important;
    border: none !important;
    color: var(--chart-text-bright, #fff8dc);
}


/* CSS-only label rename: "Black/White/Gray" -> "B/W" (UI text only) */
.dropdown-content input[name="border-theme"][value="border-theme-black-white-gray"]+span {
    font-size: 0 !important;
    /* hide original text */
    position: relative;
}

.dropdown-content input[name="border-theme"][value="border-theme-black-white-gray"]+span::after {
    content: "B/W";
    font-size: 14px;
    letter-spacing: 0.02em;
}

:root.border-theme-teal {
    --chrome-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --chrome-body-bg: #081a1a;
    --chrome-header-bg: #0b1f20;
    --chrome-header-border: #134347;
    --chrome-header-text: #cfeeee;
    --chrome-surface-bg: #071516;
    --chrome-panel-bg: #0b1f20;
    --chrome-panel-border: #1a4a4f;
    --chrome-card-bg: #0b1f20;
    --chrome-card-border: #134347;
    --chrome-button-bg: #0f2b2f;
    --chrome-button-border: #1a4a4f;
    --chrome-button-text: #bfe9e9;
    --chrome-button-hover-bg: #165058;
    --chrome-button-hover-border: #20a0ac;
    --chrome-button-hover-text: #e8ffff;
    --chrome-dropdown-bg: #0b1f20;
    --chrome-dropdown-border: #1a4a4f;
    --chrome-dropdown-hover-bg: #0f2b2f;
    --chrome-dropdown-text: #cfeeee;
    --chrome-input-bg: #0f2b2f;
    --chrome-input-border: #1a4a4f;
    --chrome-input-text: #e8ffff;
    --chrome-helper-text: #7bc7c7;
    --chrome-accent: #20a0ac;
    --chrome-accent-strong: #14727b;
    --chrome-backdrop: rgba(10, 30, 30, 0.92);
}

/* Momentary Integrity Badge */
#integrityBadge {
    position: fixed;
    top: 20px;
    right: -400px;
    padding: 20px 40px;
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: right 0.5s ease-in-out;
    z-index: 2000;
    font-size: 28px;
    display: flex;
    align-items: center;
    gap: 15px;
}

#integrityBadge .dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

#integrityBadge.is-visible {
    right: 20px;
}

#integrityBadge.status-ok {
    background: #00c853;
}

#integrityBadge.status-ok .dot {
    background: white;
}

#integrityBadge.status-bad {
    background: #ff5252;
}

#integrityBadge.status-bad .dot {
    background: white;
}

/* PD Span Def2 3D Overlay */
.pd-span-overlay {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(135deg, rgba(20, 25, 35, 0.95), rgba(12, 16, 24, 0.98));
    border: 1px solid rgba(100, 150, 255, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 20px rgba(100, 150, 255, 0.15);
    backdrop-filter: blur(12px);
    z-index: 1400;
    min-width: 260px;
    transform: perspective(1000px) rotateX(2deg);
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

#pdSpanDef12Overlay {
    top: 190px;
}

.pd-span-overlay:hover {
    transform: perspective(1000px) rotateX(0deg) translateY(-2px);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 6px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 30px rgba(100, 150, 255, 0.25);
}

.pd-span-overlay--def2 {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    padding: 0;
    min-width: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: none;
}

.pd-span-overlay--def2:hover {
    transform: none;
    box-shadow: none;
}

.pd-span-overlay__pad {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--accent-primary);
    border-radius: 10px;
    padding: 6px 10px;
    color: var(--accent-primary);
}

.pd-span-overlay__name {
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.pd-span-overlay__header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(100, 150, 255, 0.2);
}

.pd-span-overlay__title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #a8c5ff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

.pd-span-overlay__controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pd-span-overlay__nav-buttons {
    display: flex;
    gap: 4px;
}

.pd-span-overlay__counter-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    padding: 0 8px;
}

.pd-span-overlay__counter-label {
    font-size: 0.7rem;
    color: rgba(168, 197, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.pd-span-overlay__counter {
    font-size: 1.3rem;
    font-weight: 700;
    color: #6fb3ff;
    text-shadow: 0 0 10px rgba(111, 179, 255, 0.5);
    min-width: 35px;
    text-align: center;
}

.pd-span-overlay--def2 .pd-span-overlay__counter-section {
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    padding: 0 6px;
}

.pd-span-overlay--def2 .pd-span-overlay__counter-label {
    font-size: 0.65rem;
    color: var(--accent-primary);
    margin-bottom: 0;
}

.pd-span-overlay--def2 .pd-span-overlay__counter {
    font-size: 1rem;
    color: var(--accent-primary);
    text-shadow: none;
    min-width: 20px;
}

.pd-span-wire-btn {
    background: transparent;
    border: 1px solid var(--accent-primary);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--accent-primary);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pd-span-wire-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 8px var(--accent-primary);
}

.pd-span-wire-btn:active {
    transform: translateY(0);
}

.pd-span-btn {
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.15), rgba(80, 120, 200, 0.1));
    border: 1px solid rgba(100, 150, 255, 0.3);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #a8c5ff;
    transition: all 0.2s ease;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.pd-span-btn:hover {
    background: linear-gradient(135deg, rgba(100, 150, 255, 0.25), rgba(80, 120, 200, 0.2));
    border-color: rgba(100, 150, 255, 0.5);
    color: #c5dbff;
    transform: translateY(-1px);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 12px rgba(100, 150, 255, 0.3);
}

.pd-span-btn:active {
    transform: translateY(0);
    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.pd-span-btn--reset {
    background: linear-gradient(135deg, rgba(255, 180, 100, 0.15), rgba(200, 120, 80, 0.1));
    border-color: rgba(255, 180, 100, 0.3);
}

.pd-span-btn--reset:hover {
    background: linear-gradient(135deg, rgba(255, 180, 100, 0.25), rgba(200, 120, 80, 0.2));
    border-color: rgba(255, 180, 100, 0.5);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 12px rgba(255, 180, 100, 0.3);
}

.pd-span-btn svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.auto-fct-exit-btn {
    position: fixed;
    top: 120px;
    right: 20px;
    z-index: 1600;
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    font-family: "Rajdhani", "Orbitron", "Share Tech Mono", sans-serif;
    letter-spacing: 0.6px;
    cursor: pointer;
}

.auto-fct-exit-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3), 0 0 12px var(--accent-primary);
}

/* Trendline Context Menu */
#trendlineContextMenu {
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-primary);
    border-radius: 8px;
    padding: 4px 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 255, 68, 0.2);
    z-index: 2000;
    min-width: 150px;
}

.context-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
    transition: background 0.2s ease;
    user-select: none;
}

.context-menu-item:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

#contextMenuPalette {
    display: flex;
    gap: 8px;
    padding: 12px;
    flex-wrap: wrap;
    max-width: 220px;
    margin-top: 8px;
    background: var(--bg-primary);
    border-radius: 6px;
    border: 1px solid var(--bg-tertiary);
}

.color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.color-swatch:hover {
    border-color: var(--accent-primary);
    transform: scale(1.15);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), 0 0 12px currentColor;
}
