/* ================================================================
   Kelly Agent — Design System (per design.md)
   Primary: #00FFA3 | Secondary/Surface: #1E2329 | Neutral/BG: #050505
   Headlines: Space Grotesk | Body: Inter | Mono: JetBrains Mono
   Roundedness: 1 (4px) | Spacing: 2 (normal) | Default: dark
   ================================================================ */

:root {
    --color-primary: #00FFA3;
    --color-bg: #050505;
    --color-surface: #1E2329;
    --color-text: #E8EAED;
    --color-text-muted: #6B7280;
    --color-muted: #6B7280;
    --color-border: #2A2F36;
    --color-card-bg: #0D1117;
    --radius: 4px;
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 60px;
    --right-width: 320px;
    --right-collapsed-width: 48px;
    --header-height: 48px;
}

body.light-mode {
    --color-bg: #F8F9FA;
    --color-surface: #FFFFFF;
    --color-text: #0A0A0A;
    --color-text-muted: #5F6368;
    --color-muted: #5F6368;
    --color-border: #D1D5DB;
    --color-card-bg: #FFFFFF;
}

/* ===================== GLOBAL GRID LAYOUT ===================== */
body {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr var(--right-width);
    grid-template-rows: var(--header-height) 1fr auto;
    grid-template-areas:
        "header  header       header"
        "sidebar main         right"
        "sidebar bottom-bar   right";
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    transition: background-color 0.18s ease, color 0.18s ease, grid-template-columns 0.18s ease;
}

body.sidebar-collapsed {
    grid-template-columns: var(--sidebar-collapsed-width) 1fr var(--right-width);
}
body.sidebar-collapsed .sidebar-label { opacity: 0; width: 0; overflow: hidden; pointer-events: none; }
body.sidebar-collapsed #sidebar-new-session span { display: none; }
body.sidebar-collapsed #sidebar-new-session {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    margin: 8px auto !important;
    border-radius: var(--radius) !important;
}
/* Keep the divider under NEW SESSION straight in collapsed mode */
body.sidebar-collapsed #sidebar > div:first-child {
    border-radius: 0 !important;
}
/* Show top/bottom sidebar dividers only in collapsed mode */
body:not(.sidebar-collapsed) #sidebar > div:first-child {
    border-bottom: none !important;
}
body:not(.sidebar-collapsed) #sidebar > div:last-child {
    border-top: none !important;
}
body:not(.sidebar-collapsed) #sidebar .border-t.border-border.mx-0 {
    display: none !important;
}
/* Align Recent Sessions block with nav items in expanded sidebar */
body:not(.sidebar-collapsed) #sidebar .px-4.mb-2.flex.items-center.gap-2 {
    padding-left: 24px !important;
    padding-right: 24px !important;
}
body:not(.sidebar-collapsed) #sidebar-history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 24px !important;
    padding-right: 12px !important;
}
/* Expanded: NEW SESSION spacing = top/left/right 24px */
body:not(.sidebar-collapsed) #sidebar-new-session {
    margin-top: 24px !important;
    margin-left: 24px !important;
    margin-right: 24px !important;
}
body.sidebar-collapsed .nav-item {
    justify-content: center;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
body.sidebar-collapsed .nav-item .nav-icon,
body.sidebar-collapsed #sidebar-toggle-icon {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    min-height: 18px;
    object-fit: contain;
}
body.sidebar-collapsed #sidebar .group {
    justify-content: center;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
body.sidebar-collapsed #sidebar .px-4.mb-2.flex.items-center.gap-2 {
    display: flex;
    justify-content: center;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
/* Hide verbose session cards in collapsed sidebar to avoid overflow/scrollbars */
body.sidebar-collapsed #sidebar-history-list {
    display: none !important;
}
/* Ensure collapsed sidebar never shows horizontal scroll */
body.sidebar-collapsed #sidebar,
body.sidebar-collapsed #sidebar > div {
    overflow-x: hidden !important;
}
body.sidebar-collapsed #sidebar > div:first-child {
    border-bottom-color: #2A2F36 !important;
}
body.sidebar-collapsed #sidebar .border-t.border-border.mx-0 {
    border-top-color: #2A2F36 !important;
}
body.sidebar-collapsed #sidebar > div:last-child {
    border-top-color: #2A2F36 !important;
}

body.right-collapsed {
    grid-template-columns: var(--sidebar-width) 1fr var(--right-collapsed-width);
}
body.sidebar-collapsed.right-collapsed {
    grid-template-columns: var(--sidebar-collapsed-width) 1fr var(--right-collapsed-width);
}

/* Grid area assignments */
header            { grid-area: header; }
#sidebar          { grid-area: sidebar; }
#main-area        { grid-area: main; }
#right-console    { grid-area: right; }
#bottom-bar       { grid-area: bottom-bar; display: flex; }
#bottom-bar.bar-hidden { display: none; }

/* ===================== FONTS ===================== */
.font-heading { font-family: 'Space Grotesk', sans-serif; }
.font-mono    { font-family: 'JetBrains Mono', monospace; }

/* Font scale: 12px minimum, readable hierarchy */
/* Force text-xs to never go below 12px */
.text-xs { font-size: 12px !important; }
/* Bump table body text for readability */
table tbody td { font-size: 13px; }
/* Section headers get a bump */
.tech-border > .p-4.border-b .font-heading { font-size: 15px; }

/* ===================== ROUNDEDNESS ===================== */
/* Design roundedness: 1 → subtle 4px. Override Tailwind's radius reset. */
/* Elements that should remain sharp (toggles, specific components) use inline overrides */
* { border-radius: var(--radius) !important; }
/* Preserve circles for dots/avatars */
.rounded-full, [class*="rounded-full"] { border-radius: 9999px !important; }
.smart-score-circle { border-radius: 50% !important; }

/* ===================== UTILITIES ===================== */
.tech-border      { border: 1px solid var(--color-border); }
.tech-green-text  { color: var(--color-primary); }
.tech-green-border{ border: 1px solid var(--color-primary); }
.tech-green-bg    { background-color: var(--color-primary); }

.nav-icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    object-fit: contain;
    display: block;
}

/* Header SVGs are white by design; invert them in light mode so they stay visible on white headers. */
body.light-mode #notif-area img,
body.light-mode a[aria-label="Settings"] img {
    filter: brightness(0) saturate(100%);
}

.sidebar-label { transition: opacity 0.12s ease, width 0.12s ease; white-space: nowrap; overflow: hidden; }
#sidebar, #right-console { transition: all 0.18s cubic-bezier(0.2, 0, 0, 1); }
#sidebar {
    border-right-color: #2A2F36 !important;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}
#sidebar > div:last-child {
    margin-top: auto;
}
body.sidebar-collapsed #sidebar {
    border-right-color: #2A2F36 !important;
}

/* ===================== MAIN SCROLL AREA ===================== */
#main-area {
    overflow-y: auto;
    position: relative;
    padding-bottom: 96px;
}

/* ===================== RIGHT CONSOLE ===================== */
#right-console {
    position: relative;
    overflow: hidden;
    border-left: 1px solid var(--color-border);
    background-color: var(--color-bg);
}

/* ── Right console view / tab system — fully CSS-controlled, beats Tailwind ── */

/* Default: monitor visible, config hidden */
#config-view          { display: none !important; }
#monitor-view         { display: flex !important; flex-direction: column; }

/* config-mode: swap views */
#right-console.config-mode #config-view  { display: flex !important; flex-direction: column; }
#right-console.config-mode #monitor-view { display: none !important; }

/* Inner config panels: always hidden unless activated */
#config-mode-section  { display: none !important; }
#copy-mode-manual     { display: none !important; }
#copy-mode-ai         { display: none !important; }
#copy-footer-apply    { display: none !important; }
#copy-footer-accept   { display: none !important; }

/* config-mode: show the tab bar */
#right-console.config-mode #config-mode-section { display: block !important; }

/* tab-ai active: show AI panel + Accept button */
#right-console.tab-ai #copy-mode-ai        { display: block !important; }
#right-console.tab-ai #copy-footer-accept  { display: block !important; }

/* tab-manual active: show Manual panel + Apply button */
#right-console.tab-manual #copy-mode-manual  { display: block !important; }
#right-console.tab-manual #copy-footer-apply { display: block !important; }

/* executing state: hide config tabs/params/buttons, show only execution feed + task card */
#exec-status-banner                              { display: none !important; }
#right-console.executing #exec-status-banner     { display: block !important; }
#right-console.executing #config-mode-section    { display: none !important; }
#right-console.executing #copy-mode-ai           { display: none !important; }
#right-console.executing #copy-mode-manual       { display: none !important; }
#right-console.executing #copy-footer-accept     { display: none !important; }
#right-console.executing #copy-footer-apply      { display: none !important; }
#right-console.executing #process-tree           { min-height: 240px !important; }

/* Hide console idle status row and risk status block per current UI requirement. */
#console-status {
    display: none !important;
}

#monitor-view > div > div:has([data-i18n="console.riskStatus"]) {
    display: none !important;
}

.right-toggle-strip {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 24px; z-index: 10;
    background: var(--color-bg);
    border-right: 1px solid #2A2F36;
    border-radius: 0 !important;
    cursor: col-resize;
    user-select: none;
}
.right-toggle-strip:hover { background: var(--color-surface); }
.right-toggle-strip.is-dragging { background: var(--color-surface); cursor: col-resize; }
body.right-resizing { cursor: col-resize !important; user-select: none !important; }

body.right-collapsed #console-content { display: none; }
body.right-collapsed #copy-trade-panel { display: none; }
body.right-collapsed #rc-tab-bar { display: none; }
body.right-collapsed #rc-chat-content { display: none; }
body.right-collapsed #right-collapsed-indicator { display: flex; }
body:not(.right-collapsed) #right-collapsed-indicator { display: none; }
body.right-collapsed #right-toggle-btn { transform: rotate(180deg); }

#console-content { padding-left: 24px; }

/* Collapsed indicator */
#right-collapsed-indicator { padding-left: 24px; }
#collapsed-status-dot.status-running {
    background-color: var(--color-primary);
    animation: pulse-dot 1.2s ease-in-out infinite;
}
#collapsed-status-dot.status-monitoring { background-color: #FBBF24; }
#collapsed-status-dot.status-terminated { background-color: #EF4444; }

#agent-header-dot.status-running {
    background-color: var(--color-primary);
    animation: pulse-dot 1.2s ease-in-out infinite;
}
#agent-header-dot.status-monitoring { background-color: #FBBF24; }
#agent-header-dot.status-terminated { background-color: #EF4444; }
#stream-indicator.status-active {
    background-color: var(--color-primary);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ===================== BOTTOM BAR (AI Input) ===================== */
#bottom-bar {
    align-items: stretch;
    background: var(--color-bg);
    overflow: hidden;
    position: fixed;
    left: var(--sidebar-width);
    right: var(--right-width);
    bottom: 0;
    z-index: 60;
    border-top: 1px solid #2A2F36;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.28);
    transition: left 0.18s cubic-bezier(0.2, 0, 0, 1), right 0.18s cubic-bezier(0.2, 0, 0, 1);
}
body.sidebar-collapsed #bottom-bar { left: var(--sidebar-collapsed-width); }
body.right-collapsed #bottom-bar { right: var(--right-collapsed-width); }
body.sidebar-collapsed.right-collapsed #bottom-bar {
    left: var(--sidebar-collapsed-width);
    right: var(--right-collapsed-width);
}
#bottom-bar #ai-input-widget {
    width: 100%;
    box-shadow: none !important;
    border: none !important;
    border-top: 1px solid #2A2F36 !important;
    background: var(--color-bg);
    border-radius: 0 !important;
}
#bottom-input-widget { border-radius: 0 !important; }
#hero-selected-tags:empty,
#bottom-selected-tags:empty { display: none !important; }
#hero-selected-tags:not(:empty),
#bottom-selected-tags:not(:empty) {
    display: flex; flex-wrap: wrap; align-items: center;
}

@keyframes widgetSlideIn {
    from { opacity: 0.6; transform: translateY(6px); }
    to   { opacity: 1;   transform: translateY(0); }
}
.input-widget-enter { animation: widgetSlideIn 0.2s ease-out forwards; }

/* ===================== STICKY INPUT BAR ===================== */
.sticky-input-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--color-card-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.sticky-input-bar.hidden {
    display: none;
}
.sticky-input-bar.sticky-visible {
    display: block;
    animation: stickySlideIn 0.2s ease-out forwards;
}
@keyframes stickySlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
#sticky-selected-tags:empty { display: none !important; }
#sticky-selected-tags:not(:empty) {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 6px; padding: 4px 16px 6px;
    background: var(--color-card-bg);
}

/* Ensure main area accounts for sticky bar height when scrolling */
#main-area {
    scroll-padding-top: 56px;
}

/* ===================== SELECTED TAGS CONTAINER ===================== */
#ai-input-row  { order: 1; }
#selected-tags { order: 2; }
#bottom-bar #ai-input-row  { order: 2; }
#bottom-bar #selected-tags { order: 1; }

#selected-tags:empty { display: none !important; }
#selected-tags:not(:empty) {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 6px; padding: 8px 16px;
}

/* ===================== ADDRESS CHIP STYLE ===================== */
.addr-clickable {
    cursor: pointer;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    padding: 1px 6px;
    border: 1px solid transparent;
    border-radius: var(--radius) !important;
}
.addr-clickable:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: rgba(0, 255, 163, 0.06);
}
.addr-clickable.selected-addr {
    color: var(--color-primary);
    background: rgba(0, 255, 163, 0.15);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px rgba(0, 255, 163, 0.25);
    font-weight: 600;
}

.md-inline-token.addr-clickable {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #00FFA3 !important;
}

.md-inline-token.addr-clickable:hover {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #00FFA3 !important;
}

.md-inline-token.addr-clickable.selected-addr {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #00FFA3 !important;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ===================== TAG CHIPS IN INPUT ===================== */
.input-tag-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(0,255,163,0.1);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    padding: 2px 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

/* ===================== SESSION CARDS ===================== */
#notif-dropdown > div:first-child > span:last-child {
    display: none !important;
}

.session-card {
    width: 100%; cursor: pointer;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
    position: relative; text-align: left; display: block;
}
.session-card-inner {
    padding: 10px 10px;
    border-radius: 8px;
}
.session-card:hover {
    background: var(--color-surface);
    border-color: var(--color-border);
}
.session-card:hover .session-title { color: var(--color-text); }
.session-card:hover .session-delete-btn { opacity: 1; }
.session-card.session-active {
    background: #1a232f;
    border-color: rgba(255, 255, 255, 0.04);
    border-left: none;
}
.session-card.session-active .session-title { color: #7b8698; }
.session-card.session-active .session-delete-btn { opacity: 1; }

.session-delete-btn {
    opacity: 0; transition: opacity 0.15s;
    background: none; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--color-muted); line-height: 1;
    width: 24px;
    height: 24px;
    border-radius: 9999px;
}
.session-delete-btn:hover {
    color: #e6edf7;
    background: rgba(255, 255, 255, 0.12);
}
.session-card.session-active .session-delete-btn {
    background: rgba(255, 255, 255, 0.14);
    color: #d7deea;
}
.session-delete-btn svg {
    display: none;
}
.session-delete-btn::before {
    content: "•••";
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1;
    color: #c8d0dc;
}

/* Recent sessions: hide time + status row */
.session-card .session-card-inner > .sidebar-label.flex.justify-between.items-center.w-full.mt-1 {
    display: none !important;
}

/* Recent sessions action button override (match target mock) */
.session-delete-btn {
    width: 22px !important;
    height: 22px !important;
    margin-left: 8px !important;
    border-radius: 9999px !important;
    background: transparent !important;
    border: 0 !important;
    transition: opacity 0.15s ease, background-color 0.15s ease, border-color 0.15s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.session-card:hover .session-delete-btn,
.session-card-inner:hover .session-delete-btn,
.session-card:focus-within .session-delete-btn {
    opacity: 1 !important;
}
.session-delete-btn:hover {
    background: transparent !important;
    border-color: transparent !important;
}
.session-delete-btn::before {
    content: "..." !important;
    display: block !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    line-height: 1 !important;
    color: #c8d0dc !important;
    transform: translateY(-1px) !important;
}

.session-delete-btn svg {
    display: block !important;
    width: 13px !important;
    height: 13px !important;
    color: #c8d0dc !important;
}

.session-delete-btn::before {
    content: none !important;
    display: none !important;
}

/* ===================== SORTABLE TABLE HEADERS ===================== */
.sortable-th { cursor: pointer; user-select: none; transition: color 0.15s; white-space: nowrap; }
.sortable-th:hover { color: var(--color-primary); }
.sortable-th .sort-arrow { margin-left: 4px; font-size: 12px; opacity: 0; transition: opacity 0.15s; }
.sortable-th.sort-active .sort-arrow { opacity: 1; color: var(--color-primary); }

/* ===================== TABLE ROW EXPAND & ACTIONS ===================== */
.expand-chevron { transition: transform 0.2s ease; cursor: pointer; }
.expand-chevron.rotate-180 { transform: rotate(180deg); }
.positions-expand-row td { padding: 0 !important; }

.actions-dropdown {
    animation: dropdownIn 0.12s ease-out;
    background-color: #182028 !important;
}
@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.action-trigger:hover {
    border-color: var(--color-primary) !important;
    color: var(--color-primary);
}

/* ===================== SMART MONEY TABLE TONE TUNING ===================== */
#sm-top-perf-card .sm-top-perf-toolbar {
    border-bottom-color: rgba(125, 145, 172, 0.22) !important;
}
#table-top-performers {
    background: #0D1117;
}
#table-top-performers thead tr {
    border-bottom-color: rgba(125, 145, 172, 0.18) !important;
    background: #0D1117;
}
#table-top-performers tbody tr {
    border-bottom-color: rgba(125, 145, 172, 0.24) !important;
    background: #0D1117;
}
#table-top-performers tbody tr:hover td {
    background: #0D1117 !important;
}

/* ===================== LEADERBOARD TABLE TONE TUNING ===================== */
#data-section-leaderboard .grid.grid-cols-4 .tech-border.bg-card-bg,
#data-section-leaderboard .grid.grid-cols-3 .tech-border.bg-card-bg {
    background: #0D1117;
}
#data-section-leaderboard .tech-border.bg-card-bg.mt-6 {
    background: #0D1117;
}
#data-section-leaderboard .tech-border.bg-card-bg.mt-6 > .p-5 {
    background: #1E2329;
    border-bottom-color: rgba(125, 145, 172, 0.14) !important;
}
#table-leaderboard {
    background: #0D1117;
}
#table-leaderboard thead tr {
    border-bottom-color: rgba(125, 145, 172, 0.12) !important;
    background: #0D1117;
}
#table-leaderboard tbody tr {
    border-bottom-color: rgba(125, 145, 172, 0.16) !important;
    background: #0D1117;
}
#table-leaderboard tbody tr:hover td {
    background: #0D1117 !important;
}

/* ===================== FOUR TAB UNIFIED BACKGROUND ===================== */
#data-section .tech-border.bg-card-bg,
#data-section-leaderboard .tech-border.bg-card-bg,
#data-section-watchlist .tech-border.bg-card-bg,
#data-section-portfolio .tech-border.bg-card-bg,
#data-section-detail .tech-border.bg-card-bg,
#data-section-asset-overview .tech-border.bg-card-bg {
    background: #0D1117;
}

#data-section .bg-surface,
#data-section-leaderboard .bg-surface,
#data-section-watchlist .bg-surface,
#data-section-portfolio .bg-surface,
#data-section-detail .bg-surface,
#data-section-asset-overview .bg-surface {
    background: #1E2329;
}

#data-section table,
#data-section-leaderboard table,
#data-section-watchlist table,
#data-section-portfolio table,
#data-section-detail table,
#data-section-asset-overview table {
    background: #0D1117;
}

#data-section table thead tr,
#data-section-leaderboard table thead tr,
#data-section-watchlist table thead tr,
#data-section-portfolio table thead tr,
#data-section-detail table thead tr,
#data-section-asset-overview table thead tr {
    background: #0D1117;
    border-bottom-color: rgba(125, 145, 172, 0.12) !important;
}

#data-section table tbody tr,
#data-section-leaderboard table tbody tr,
#data-section-watchlist table tbody tr,
#data-section-portfolio table tbody tr,
#data-section-detail table tbody tr,
#data-section-asset-overview table tbody tr {
    background: #0D1117;
    border-bottom-color: rgba(125, 145, 172, 0.16) !important;
}

#data-section .tech-border,
#data-section-leaderboard .tech-border,
#data-section-watchlist .tech-border,
#data-section-portfolio .tech-border,
#data-section-detail .tech-border,
#data-section-asset-overview .tech-border {
    border-color: rgba(125, 145, 172, 0.22) !important;
}

#data-section .border-b.border-border,
#data-section-leaderboard .border-b.border-border,
#data-section-watchlist .border-b.border-border,
#data-section-portfolio .border-b.border-border,
#data-section-detail .border-b.border-border,
#data-section-asset-overview .border-b.border-border {
    border-bottom-color: rgba(125, 145, 172, 0.14) !important;
}

#data-section-asset-overview .border-t.border-border,
#data-section-asset-overview .border.border-border {
    border-color: rgba(125, 145, 172, 0.14) !important;
}

#data-section-asset-overview .divide-y > * + * {
    border-top-color: rgba(125, 145, 172, 0.14) !important;
}

/* Portfolio-only: make divider lines softer than other tabs */
#data-section-portfolio .tech-border {
    border-color: rgba(125, 145, 172, 0.16) !important;
}
#data-section-portfolio .border.border-border {
    border-color: rgba(125, 145, 172, 0.10) !important;
}
#data-section-portfolio .border-b.border-border,
#data-section-portfolio .border-t.border-border {
    border-color: rgba(125, 145, 172, 0.10) !important;
}
#data-section-portfolio .portfolio-task-details {
    border-top-color: rgba(125, 145, 172, 0.10) !important;
}

#data-section table tbody tr:hover td,
#data-section-leaderboard table tbody tr:hover td,
#data-section-watchlist table tbody tr:hover td,
#data-section-portfolio table tbody tr:hover td,
#data-section-detail table tbody tr:hover td,
#data-section-asset-overview table tbody tr:hover td {
    background: #0D1117 !important;
}

/* Light mode: undo the dark-only page tone overrides above. */
body.light-mode #sm-top-perf-card,
body.light-mode #table-top-performers,
body.light-mode #table-top-performers thead tr,
body.light-mode #table-top-performers tbody tr,
body.light-mode #table-leaderboard,
body.light-mode #table-leaderboard thead tr,
body.light-mode #table-leaderboard tbody tr,
body.light-mode #data-section table,
body.light-mode #data-section-leaderboard table,
body.light-mode #data-section-watchlist table,
body.light-mode #data-section-portfolio table,
body.light-mode #data-section-detail table,
body.light-mode #data-section-asset-overview table,
body.light-mode #data-section table thead tr,
body.light-mode #data-section-leaderboard table thead tr,
body.light-mode #data-section-watchlist table thead tr,
body.light-mode #data-section-portfolio table thead tr,
body.light-mode #data-section-detail table thead tr,
body.light-mode #data-section-asset-overview table thead tr,
body.light-mode #data-section table tbody tr,
body.light-mode #data-section-leaderboard table tbody tr,
body.light-mode #data-section-watchlist table tbody tr,
body.light-mode #data-section-portfolio table tbody tr,
body.light-mode #data-section-detail table tbody tr,
body.light-mode #data-section-asset-overview table tbody tr {
    background: var(--color-card-bg) !important;
}

body.light-mode #data-section .tech-border.bg-card-bg,
body.light-mode #data-section-leaderboard .tech-border.bg-card-bg,
body.light-mode #data-section-watchlist .tech-border.bg-card-bg,
body.light-mode #data-section-portfolio .tech-border.bg-card-bg,
body.light-mode #data-section-detail .tech-border.bg-card-bg,
body.light-mode #data-section-asset-overview .tech-border.bg-card-bg,
body.light-mode #data-section-leaderboard .grid.grid-cols-4 .tech-border.bg-card-bg,
body.light-mode #data-section-leaderboard .grid.grid-cols-3 .tech-border.bg-card-bg,
body.light-mode #data-section-leaderboard .tech-border.bg-card-bg.mt-6 {
    background: var(--color-card-bg) !important;
}

body.light-mode #data-section .bg-surface,
body.light-mode #data-section-leaderboard .bg-surface,
body.light-mode #data-section-watchlist .bg-surface,
body.light-mode #data-section-portfolio .bg-surface,
body.light-mode #data-section-detail .bg-surface,
body.light-mode #data-section-asset-overview .bg-surface,
body.light-mode #data-section-leaderboard .tech-border.bg-card-bg.mt-6 > .p-5 {
    background: var(--color-surface) !important;
}

body.light-mode #data-section .tech-border,
body.light-mode #data-section-leaderboard .tech-border,
body.light-mode #data-section-watchlist .tech-border,
body.light-mode #data-section-portfolio .tech-border,
body.light-mode #data-section-detail .tech-border,
body.light-mode #data-section-asset-overview .tech-border {
    border-color: var(--color-border) !important;
}

body.light-mode #data-section .border-b.border-border,
body.light-mode #data-section-leaderboard .border-b.border-border,
body.light-mode #data-section-watchlist .border-b.border-border,
body.light-mode #data-section-portfolio .border-b.border-border,
body.light-mode #data-section-detail .border-b.border-border,
body.light-mode #data-section-asset-overview .border-b.border-border {
    border-bottom-color: var(--color-border) !important;
}

body.light-mode #data-section table tbody tr:hover td,
body.light-mode #data-section-leaderboard table tbody tr:hover td,
body.light-mode #data-section-watchlist table tbody tr:hover td,
body.light-mode #data-section-portfolio table tbody tr:hover td,
body.light-mode #data-section-detail table tbody tr:hover td,
body.light-mode #data-section-asset-overview table tbody tr:hover td,
body.light-mode #table-top-performers tbody tr:hover td,
body.light-mode #table-leaderboard tbody tr:hover td {
    background: #F3F6F9 !important;
}

body.light-mode .session-card.session-active {
    background: #EEF3F7;
    border-color: var(--color-border);
}

body.light-mode .session-card.session-active .session-title {
    color: var(--color-text);
}

body.light-mode .session-delete-btn {
    background: #EEF3F7 !important;
    border-color: var(--color-border) !important;
}

body.light-mode .session-delete-btn:hover {
    background: #E4EBF2 !important;
    border-color: #B8C2CC !important;
}

body.light-mode .session-card.session-active .session-delete-btn {
    background: #E4EBF2 !important;
    color: var(--color-text);
}

body.light-mode .session-delete-btn::before {
    color: var(--color-text-muted) !important;
}

body.light-mode .actions-dropdown {
    background-color: var(--color-card-bg) !important;
    border-color: var(--color-border) !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

body.light-mode input.sr-only.peer + div[class*="w-12"][class*="h-7"][class*="rounded-full"] {
    background: #F1F5F9 !important;
    border-color: #CBD5E1 !important;
}

body.light-mode input.sr-only.peer + div[class*="w-12"][class*="h-7"][class*="rounded-full"]::after {
    background: #FFFFFF !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18) !important;
}

body.light-mode input.sr-only.peer:focus + div[class*="w-12"][class*="h-7"][class*="rounded-full"] {
    box-shadow: 0 0 0 3px rgba(0, 255, 163, 0.14) !important;
}

/* Settings page: keep key surfaces aligned with tab content tone */
#settings-scroll-container .bg-card-bg {
    background: var(--color-card-bg) !important;
}
#settings-scroll-container .bg-surface {
    background: var(--color-surface) !important;
}
#settings-scroll-container .settings-nav-item.bg-surface {
    background: var(--color-card-bg) !important;
}
#settings-scroll-container .settings-nav-item.border-primary {
    border-left-color: #01F49D !important;
    color: #01F49D !important;
}
#settings-scroll-container .settings-nav-item:hover {
    background: var(--color-card-bg) !important;
}
#settings-scroll-container select[class*="bg-surface"],
#settings-scroll-container input[class*="bg-surface"],
#settings-scroll-container button[class*="bg-surface"] {
    background: var(--color-surface) !important;
}

/* Address detail: back bar should have a visible but soft bottom divider */
#detail-back-bar {
    background-color: #0F141B !important;
    border-bottom-color: rgba(125, 145, 172, 0.16) !important;
}

body.light-mode #detail-back-bar {
    background-color: var(--color-card-bg) !important;
    border-bottom-color: #D8DEE6 !important;
}

body.light-mode #detail-back-bar a {
    color: #5F6368 !important;
}

body.light-mode #detail-back-bar a:hover {
    color: #00995F !important;
}

/* Hero route tag active state */
.hero-route-active {
    background-color: var(--color-primary) !important;
    color: #000 !important;
    border: 1px solid var(--color-primary) !important;
    font-weight: 700;
}

/* Session status badges */
.session-status-badge { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.session-status-done { color: var(--color-muted); }
.session-status-running {
    color: var(--color-primary);
    animation: pulse-text 1.2s ease-in-out infinite;
}
@keyframes pulse-text {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ===================== ACTIVE SESSION INDICATOR ===================== */
.session-active-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--color-primary);
    display: inline-block; flex-shrink: 0;
    animation: pulse-session-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-session-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,255,163,0.4); }
    50% { opacity: 0.6; box-shadow: 0 0 6px 2px rgba(0,255,163,0.25); }
}
.session-status-active {
    color: var(--color-primary);
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
}

/* ===================== TOAST NOTIFICATION ===================== */
.kelly-toast {
    position: fixed; top: 11vh; left: 50%;
    transform: translate(-50%, -50%) scale(0.94);
    background: linear-gradient(135deg, rgba(0, 255, 163, 0.18), rgba(10, 18, 24, 0.96));
    border: 1px solid var(--color-primary);
    color: var(--color-primary); font-family: 'JetBrains Mono', monospace;
    font-size: 15px; font-weight: 700; padding: 16px 28px; z-index: 9999;
    opacity: 0; transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: none; white-space: normal; text-align: center;
    min-width: 220px; max-width: calc(100vw - 48px);
    box-shadow: 0 0 0 1px rgba(0, 255, 163, 0.28), 0 0 26px rgba(0, 255, 163, 0.45), 0 16px 48px rgba(0, 0, 0, 0.55);
    text-shadow: 0 0 10px rgba(0, 255, 163, 0.55);
}
.kelly-toast.toast-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ===================== SCROLLBARS ===================== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px !important; }

/* ===================== SCANLINE ===================== */
.scanline {
    width: 100%; height: 2px;
    background: linear-gradient(to right, transparent, var(--color-primary), transparent);
    opacity: 0.04; position: absolute;
    animation: scanline 4s linear infinite; pointer-events: none;
    border-radius: 0 !important;
}
@keyframes scanline { 0% { transform: translateY(-100%); } 100% { transform: translateY(100%); } }

/* ===================== SMART SCORE CIRCLE ===================== */
.smart-score-circle {
    width: 28px; height: 28px;
    border-radius: 50% !important;
    border: 1px solid var(--color-border);
    position: relative;
    border-bottom-color: var(--color-primary);
    border-right-color: var(--color-primary);
}

/* ===================== LIGHT MODE ===================== */
body.light-mode .light-mode-translate { transform: translateX(2rem); }

/* ===================== PROCESS TREE STEPS ===================== */
.process-step {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 12px; font-family: 'JetBrains Mono', monospace;
    padding: 3px 0; border-left: 1px solid var(--color-border);
    padding-left: 8px; color: var(--color-muted); transition: color 0.2s;
}
.process-step.step-done { color: var(--color-primary); border-left-color: var(--color-primary); }
.process-step.step-active { color: var(--color-text); border-left-color: var(--color-primary); animation: pulse-text 0.8s ease-in-out infinite; }

.task-step {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-family: 'JetBrains Mono', monospace;
    color: var(--color-muted); padding: 2px 0;
}
.task-step.task-done::before   { content: '✓'; color: var(--color-primary); font-size: 12px; }
.task-step.task-pending::before { content: '○'; color: var(--color-muted); font-size: 12px; }
.task-step.task-active::before  { content: '►'; color: var(--color-primary); font-size: 12px; animation: pulse-text 0.6s ease-in-out infinite; }

/* ===================== VIEW TRANSITION ANIMATIONS (I09) ===================== */
.view-fade-in {
    animation: viewFadeIn 300ms ease forwards;
}
@keyframes viewFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.view-fade-out {
    animation: viewFadeOut 200ms ease forwards;
}
@keyframes viewFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.view-slide-down {
    animation: viewSlideDown 300ms ease forwards;
}
@keyframes viewSlideDown {
    from { max-height: 0; opacity: 0; overflow: hidden; }
    to   { max-height: 80vh; opacity: 1; overflow: auto; }
}

/* ===================== DATA PANEL TAB SYSTEM (I07) ===================== */
#data-panel-tabs {
    display: none;
    min-height: 32px;
    flex-shrink: 0;
}
#data-panel-tabs:not(.hidden) { display: flex; }

.data-panel-tab {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 4px 12px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--color-muted);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    white-space: nowrap;
    max-width: 180px;
}
.data-panel-tab:hover { color: var(--color-text); border-color: var(--color-text); }
.data-panel-tab.tab-active {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
    background: var(--color-card-bg);
}
.data-panel-tab .tab-close {
    font-size: 14px; line-height: 1;
    color: var(--color-muted);
    cursor: pointer;
    transition: color 0.15s;
    margin-left: 4px;
}
.data-panel-tab .tab-close:hover { color: #EF4444; }

/* Data panel content area */
#data-panel-content {
    background: var(--color-card-bg);
    border-bottom: 1px solid var(--color-border);
    transition: max-height 0.3s ease;
}
#data-panel-content.hidden { max-height: 0 !important; overflow: hidden; display: block; border: none; }

/* Panel header with search + export */
.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}
.panel-header .panel-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    color: var(--color-text);
}
.panel-search-input {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    padding: 4px 10px;
    outline: none;
    width: 200px;
    transition: border-color 0.15s;
}
.panel-search-input:focus { border-color: var(--color-primary); }
.panel-search-input::placeholder { color: var(--color-muted); }

.panel-export-btn {
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    padding: 4px 12px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.panel-export-btn:hover { color: var(--color-primary); border-color: var(--color-primary); }

/* Full-size panel table */
.panel-table { width: 100%; text-align: left; font-family: 'JetBrains Mono', monospace; font-size: 13px; border-collapse: collapse; }
.panel-table th {
    padding: 10px 16px;
    font-weight: normal;
    color: var(--color-muted);
    border-bottom: 1px solid var(--color-border);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
    white-space: nowrap;
}
.panel-table th:hover { color: var(--color-primary); }
.panel-table th .sort-arrow { margin-left: 4px; font-size: 12px; opacity: 0.4; }
.panel-table th.sort-active .sort-arrow { opacity: 1; color: var(--color-primary); }
.panel-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}
.panel-table tr:hover td { background: var(--color-surface); }
.panel-table tr { transition: background 0.1s; cursor: pointer; }

/* ===================== CHAT INLINE TABLE (I04) ===================== */
/* ===================== FOLDED SESSION PILL ===================== */
#folded-session-pill {
    animation: fadeInUp 300ms ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* Chat control bar subtle styling */
#chat-control-bar {
    backdrop-filter: blur(8px);
    background: rgba(13, 17, 23, 0.9);
}

body.light-mode #chat-control-bar {
    background: rgba(255, 255, 255, 0.9);
}

/* ===================== CHAT INLINE TABLE (I04) ===================== */
.chat-inline-table-wrap {
    margin-top: 12px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    position: relative;
}
.chat-inline-table-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 10px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}
.chat-inline-table-header .table-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.expand-to-panel-btn {
    display: inline-flex; align-items: center; gap: 4px;
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    padding: 2px 8px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.expand-to-panel-btn:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: rgba(0, 255, 163, 0.06);
}

.chat-inline-table { width: 100%; text-align: left; font-family: 'JetBrains Mono', monospace; font-size: 12px; border-collapse: collapse; }
.chat-inline-table th {
    padding: 6px 8px;
    font-weight: normal;
    color: var(--color-muted);
    border-bottom: 1px solid var(--color-border);
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}
.chat-inline-table th:hover { color: var(--color-primary); }
.chat-inline-table th .sort-arrow { margin-left: 2px; font-size: 12px; opacity: 0.4; }
.chat-inline-table th.sort-active .sort-arrow { opacity: 1; color: var(--color-primary); }
.chat-inline-table td { padding: 5px 8px; border-bottom: 1px solid var(--color-border); color: var(--color-text); font-size: 12px; }
.chat-inline-table tr:hover td { background: var(--color-surface); }
.chat-inline-table tr { transition: background 0.1s; cursor: pointer; }

/* ── Hero tab strip — glass/blur when sticky ───────────────────── */
#hero-tab-strip {
    background: transparent !important;
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border-bottom: 1px solid rgba(42, 47, 54, 0.6);
}
body.light-mode #hero-tab-strip {
    border-bottom-color: rgba(209, 213, 219, 0.6);
}

/* Data sections below hero — push content lower so only title + ~1.5 stat rows show initially */
#data-section,
#data-section-leaderboard,
#data-section-watchlist,
#data-section-portfolio {
    padding-top: 3.5rem;
}

/* ── Hub Hero — visual enhancements ────────────────────────────── */

/* Animated grid background */
.hero-grid-bg {
    background-image:
        linear-gradient(rgba(0,255,163,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,255,163,0.08) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: hero-grid-drift 20s linear infinite;
}
@keyframes hero-grid-drift {
    0%   { background-position: 0 0; }
    100% { background-position: 60px 60px; }
}

/* Title gradient text */
.hero-title-text {
    background: linear-gradient(135deg, var(--color-text) 0%, #00FFA3 50%, var(--color-text) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: hero-title-shimmer 6s ease-in-out infinite;
}
@keyframes hero-title-shimmer {
    0%, 100% { background-position: 0% center; }
    50%      { background-position: 200% center; }
}

/* Accent line pulse */
.hero-accent-line {
    background: linear-gradient(90deg, transparent, #00FFA3, transparent);
    animation: hero-accent-pulse 3s ease-in-out infinite;
}
@keyframes hero-accent-pulse {
    0%, 100% { opacity: 0.4; transform: scaleX(0.8); }
    50%      { opacity: 1;   transform: scaleX(1.2); }
}

/* Badge glow */
.hero-badge-glow {
    box-shadow: 0 0 20px rgba(0,255,163,0.08);
    animation: hero-badge-breathe 4s ease-in-out infinite;
}
@keyframes hero-badge-breathe {
    0%, 100% { box-shadow: 0 0 20px rgba(0,255,163,0.06); }
    50%      { box-shadow: 0 0 30px rgba(0,255,163,0.15); }
}

/* Input glow */
.hero-input-glow {
    box-shadow: 0 0 30px rgba(0,0,0,0.4);
    transition: box-shadow 0.3s;
}
.hero-input-glow:focus-within {
    box-shadow: 0 0 40px rgba(0,255,163,0.12), 0 0 80px rgba(0,255,163,0.05);
}

/* Light mode overrides */
body.light-mode .hero-grid-bg {
    background-image:
        linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
}
body.light-mode .hero-title-text {
    background: linear-gradient(135deg, var(--color-text) 0%, #00994D 50%, var(--color-text) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
body.light-mode .hero-input-glow {
    box-shadow: 0 0 30px rgba(0,0,0,0.08);
}
body.light-mode .hero-input-glow:focus-within {
    box-shadow: 0 0 40px rgba(0,153,77,0.1);
}

/* Force-hide all table selection checkboxes (per UI requirement) */
#sm-select-all,
#lb-select-all,
#wl-select-all,
.wl-select-all-cb,
.sm-row-cb,
.lb-row-cb,
.wl-row-cb {
    display: none !important;
}

/* ===================== SKELETON LOADER ===================== */
@keyframes skeleton-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}
.skeleton {
    border-radius: 4px;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.10) 50%,
        rgba(255,255,255,0.04) 75%
    );
    background-size: 800px 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
    display: inline-block;
    min-height: 14px;
}
body.light-mode .skeleton {
    background: linear-gradient(
        90deg,
        rgba(0,0,0,0.06) 25%,
        rgba(0,0,0,0.13) 50%,
        rgba(0,0,0,0.06) 75%
    );
    background-size: 800px 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
.skeleton-row td {
    padding: 12px 16px;
}
.skeleton-stat-value {
    width: 80px;
    height: 28px;
    margin-bottom: 6px;
}
.skeleton-stat-label {
    width: 120px;
    height: 12px;
}

/* ===================== EDIT CONFIG TOOLTIPS ===================== */
.edit-config-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    flex-shrink: 0;
}

.edit-config-help-trigger {
    width: 14px;
    height: 14px;
    padding: 0;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.edit-config-help-trigger:hover,
.edit-config-help:focus-within .edit-config-help-trigger {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: rgba(0, 255, 163, 0.08);
}

.edit-config-help-trigger svg {
    display: block;
}

.edit-config-help-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: -4px;
    z-index: 30;
    width: 260px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    background: var(--color-card-bg);
    color: var(--color-text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: normal;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
    pointer-events: none;
}

.edit-config-help:hover .edit-config-help-panel,
.edit-config-help:focus-within .edit-config-help-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
