/* ==========================================================================
   SoundTrade - Professional Sound Trading Terminal & Trollbox CSS
   ========================================================================== */

:root {
    --bg-main: #0a0d14;
    --bg-surface: #111622;
    --bg-surface-elevated: #182030;
    --bg-surface-hover: #1e273b;
    --border-color: #1e283d;
    --border-highlight: #2c3954;

    --color-buy: #00e676;
    --color-buy-soft: rgba(0, 230, 118, 0.12);
    --color-buy-border: rgba(0, 230, 118, 0.35);
    
    --color-sell: #ff334b;
    --color-sell-soft: rgba(255, 51, 75, 0.12);
    --color-sell-border: rgba(255, 51, 75, 0.35);

    --color-whale: #f59e0b;
    --color-whale-soft: rgba(245, 158, 11, 0.15);
    
    --color-mega: #ec4899;
    --color-mega-soft: rgba(236, 72, 153, 0.2);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #3b82f6;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Roboto Mono', Menlo, Monaco, Consolas, monospace;
}

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

body.dark-theme {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
    user-select: none;
}

.font-mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: #232d42;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #33415e;
}

/* Screen Flash for Whale Orders */
.whale-flash {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}
.whale-flash.active.flash-buy {
    opacity: 1;
    background: radial-gradient(circle, rgba(0, 230, 118, 0.25) 0%, transparent 75%);
}
.whale-flash.active.flash-sell {
    opacity: 1;
    background: radial-gradient(circle, rgba(255, 51, 75, 0.25) 0%, transparent 75%);
}
.whale-flash.active.flash-liq-long {
    opacity: 1;
    background: radial-gradient(circle, rgba(255, 152, 0, 0.35) 0%, transparent 75%);
}
.whale-flash.active.flash-liq-short {
    opacity: 1;
    background: radial-gradient(circle, rgba(33, 150, 243, 0.35) 0%, transparent 75%);
}

/* Top Navigation Bar */
.terminal-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0.55rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    text-decoration: none;
}

.brand-logo i {
    color: var(--color-buy);
    font-size: 1.4rem;
    animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); filter: drop-shadow(0 0 8px rgba(0,230,118,0.6)); }
}

.brand-badge {
    background: #1e293b;
    color: #38bdf8;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    border: 1px solid #334155;
}

/* Market Controls */
.market-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.selector-group {
    display: flex;
    align-items: center;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 2px;
}

.custom-select {
    background: transparent;
    color: var(--text-primary);
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 0.6rem;
    outline: none;
    cursor: pointer;
}

.custom-select option {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
}

/* Searchable symbol picker */
.symbol-picker { position: relative; }

.symbol-picker-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: transparent;
    color: var(--text-primary);
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    min-width: 120px;
    justify-content: space-between;
}
.symbol-picker-btn i { font-size: 0.7rem; opacity: 0.7; }

.symbol-picker-backdrop { position: fixed; inset: 0; z-index: 999; }

.symbol-picker-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1000;
    width: 300px;
    background: var(--bg-surface);
    border: 1px solid var(--border-highlight);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.symbol-picker-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary, #8a94a8);
}
.symbol-picker-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.symbol-picker-meta {
    padding: 0.35rem 0.75rem;
    font-size: 0.68rem;
    color: var(--text-secondary, #8a94a8);
    border-bottom: 1px solid var(--border-color);
}

.symbol-picker-list { max-height: 360px; overflow-y: auto; padding: 0.25rem 0; }

.symbol-picker-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 0.38rem 0.75rem;
    font-size: 0.8rem;
    text-align: left;
    cursor: pointer;
}
.symbol-picker-item:hover { background: var(--bg-surface-hover); }
.symbol-picker-item.active { background: var(--color-buy-soft); color: var(--color-buy); }
.symbol-picker-item .sym-name { font-weight: 600; }
.symbol-picker-item .sym-quote { font-weight: 400; opacity: 0.5; margin-left: 2px; }
.symbol-picker-item .sym-vol { font-size: 0.72rem; opacity: 0.65; }

.symbol-picker-empty { padding: 0.8rem; text-align: center; font-size: 0.78rem; opacity: 0.6; }

.live-price-badge {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 700;
    padding: 0.2rem 0.75rem;
    border-radius: 6px;
    transition: background-color 0.2s, color 0.2s;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
}

.price-tick-up {
    color: var(--color-buy) !important;
    background-color: var(--color-buy-soft) !important;
    border-color: var(--color-buy-border) !important;
}

.price-tick-down {
    color: var(--color-sell) !important;
    background-color: var(--color-sell-soft) !important;
    border-color: var(--color-sell-border) !important;
}

/* Status Badge with 10s Reconnection Notice */
.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}
.status-badge::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
}
.status-connected {
    background: rgba(0, 230, 118, 0.15);
    color: var(--color-buy);
    border: 1px solid var(--color-buy-border);
}
.status-connected::before {
    background: var(--color-buy);
    box-shadow: 0 0 6px var(--color-buy);
}
.status-reconnecting {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-whale);
    border: 1px solid rgba(245, 158, 11, 0.4);
    animation: blink 1s infinite;
}
.status-reconnecting::before {
    background: var(--color-whale);
}
.status-disconnected {
    background: rgba(255, 51, 75, 0.15);
    color: var(--color-sell);
    border: 1px solid var(--color-sell-border);
}
.status-disconnected::before {
    background: var(--color-sell);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-icon-action {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-icon-action:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-highlight);
}
.btn-icon-action.active-mute {
    background: var(--color-sell-soft);
    color: var(--color-sell);
    border-color: var(--color-sell-border);
}

.btn-action-text {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-action-text:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-highlight);
}
.btn-action-text.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}

/* Main Grid Layout */
.terminal-grid {
    display: grid;
    /* The trollbox is a floating window now (see .float-window), so the chart area gets the full width */
    grid-template-columns: 1fr;
    height: calc(100vh - 58px);
    overflow: hidden;
}

@media (max-width: 1080px) {
    .terminal-grid {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }
}

/* Left / Center: Trading Stream Area */
.trading-stream-col {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    height: 100%;
    overflow-y: auto;
}

/* Custom HTML5 Canvas Chart Container */
.chart-section {
    background: #0d111a;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}
.chart-header {
    background: #0f1420;
    border-bottom: 1px solid var(--border-color);
    padding: 0.4rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chart-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Timeframe Selector Pill Group */
.chart-tf-group {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(51, 65, 85, 0.8);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}
.btn-tf {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-tf:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
}
.btn-tf.active {
    background: #0284c7;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 0 8px rgba(2, 132, 199, 0.45);
}
.canvas-chart-wrapper {
    width: 100%;
    min-height: 200px;
    position: relative;
    background: #0d111a;
    overflow: hidden;
}
#custom-trading-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* ==========================================
   Split Chart Grid (1 / 2 / 4) & Docking Panes
   ========================================== */
.chart-header-actions { display: flex; align-items: center; gap: 0.5rem; }

.chart-layout-group {
    display: flex;
    gap: 2px;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 2px;
}
.btn-layout {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
}
.btn-layout:hover { color: #f8fafc; background: rgba(255, 255, 255, 0.08); }
.btn-layout[data-active="1"] { background: #0284c7; color: #fff; box-shadow: 0 0 8px rgba(2, 132, 199, 0.45); }

.chart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    background: #070a10;
}
.chart-grid[data-layout="2"],
.chart-grid[data-layout="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* 2-pane stacked (docked top/bottom) */
.chart-grid[data-layout="2"][data-orient="v"] { grid-template-columns: minmax(0, 1fr); }

/* Active pane = target of the indicator / drawing toolbar */
.chart-pane[data-active="1"] { outline-color: rgba(245, 158, 11, 0.7); }
.pane-target-badge {
    display: none;
    align-items: center;
    gap: 3px;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 4px;
    padding: 0 5px;
    font-size: 0.62rem;
    font-weight: 700;
    white-space: nowrap;
    flex: none;
}
.chart-pane[data-active="1"] .pane-target-badge { display: inline-flex; }
.indicator-target-label {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 4px;
    padding: 0 6px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Docking overlay (positioned over the hovered pane while dragging) */
.dock-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    pointer-events: none;
}
.dock-preview {
    position: absolute;
    background: rgba(56, 189, 248, 0.18);
    border: 2px solid #38bdf8;
    border-radius: 4px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12px;
    transition: all 0.12s ease;
    inset: 0;
}
.dock-overlay[data-zone="left"] .dock-preview { inset: 0 50% 0 0; }
.dock-overlay[data-zone="right"] .dock-preview { inset: 0 0 0 50%; }
.dock-overlay[data-zone="top"] .dock-preview { inset: 0 0 50% 0; }
.dock-overlay[data-zone="bottom"] .dock-preview { inset: 50% 0 0 0; }
.dock-label {
    background: #0c4a6e;
    color: #e0f2fe;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    display: flex;
    gap: 5px;
    align-items: center;
}
.dock-guide {
    position: absolute;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid #334155;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}
.dock-guide[data-on="1"] { background: #0284c7; border-color: #38bdf8; color: #fff; }
.dock-guide[data-zone="top"] { left: 50%; top: 22%; }
.dock-guide[data-zone="bottom"] { left: 50%; top: 78%; }
.dock-guide[data-zone="left"] { left: 22%; top: 50%; }
.dock-guide[data-zone="right"] { left: 78%; top: 50%; }
.dock-guide[data-zone="center"] { left: 50%; top: 50%; }

.chart-pane {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #0d111a;
    outline: 2px solid transparent;
    outline-offset: -2px;
    transition: outline-color 0.12s ease, opacity 0.12s ease;
}
.chart-pane[data-hidden="1"] { display: none; }
/* Single layout: extra panes never show, main pane has no header bar */
.chart-grid:not([data-layout="2"]):not([data-layout="4"]) .chart-pane-extra { display: none; }
.chart-grid:not([data-layout="2"]):not([data-layout="4"]) .pane-header-main { display: none; }

.chart-pane.is-dragging { opacity: 0.45; }
.chart-pane.drop-target { outline-color: #38bdf8; }
.chart-pane.drop-target::after {
    content: '여기에 놓기';
    position: absolute;
    inset: 30px 0 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(56, 189, 248, 0.12);
    color: #7dd3fc;
    font-size: 0.85rem;
    font-weight: 700;
    pointer-events: none;
    z-index: 5;
}

.pane-header {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 6px;
    background: #111827;
    border-bottom: 1px solid #1e293b;
    font-size: 0.72rem;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
}
.pane-drag-handle {
    display: flex;
    align-items: center;
    gap: 2px;
    cursor: grab;
    color: #64748b;
    padding: 2px 4px;
    border-radius: 4px;
    user-select: none;
}
.pane-drag-handle:hover { color: #e2e8f0; background: rgba(255, 255, 255, 0.07); }
.pane-drag-handle:active { cursor: grabbing; }
.pane-no { font-size: 0.65rem; font-weight: 700; }

.pane-main-badge {
    color: #00e676;
    background: rgba(0, 230, 118, 0.12);
    border: 1px solid rgba(0, 230, 118, 0.35);
    border-radius: 4px;
    padding: 0 5px;
    font-weight: 700;
    font-size: 0.65rem;
}
.pane-main-title { font-weight: 700; color: #f1f5f9; }
.pane-main-hint { color: #64748b; font-size: 0.65rem; overflow: hidden; text-overflow: ellipsis; }

.pane-select {
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid #1e293b;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    height: 22px;
    padding: 0 4px;
    outline: none;
}
.pane-select:focus { border-color: #0284c7; }
.pane-select option { background: #0f172a; }
.pane-sym { width: 112px; text-transform: uppercase; }
.pane-sym.invalid { border-color: #ff334b; animation: pane-shake 0.3s; }
@keyframes pane-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

.pane-price { margin-left: auto; font-weight: 700; font-size: 0.78rem; color: #e2e8f0; }
.pane-price[data-dir="up"] { color: #00e676; }
.pane-price[data-dir="down"] { color: #ff334b; }

.pane-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #475569; flex: none; }
.pane-live-dot[data-state="live"] { background: #00e676; box-shadow: 0 0 5px #00e676; }
.pane-live-dot[data-state="connecting"] { background: #f59e0b; }
.pane-live-dot[data-state="down"] { background: #ff334b; }

.pane-canvas-wrap { width: 100%; min-height: 200px; position: relative; overflow: hidden; background: #0d111a; }
.pane-canvas-wrap canvas { display: block; cursor: crosshair; }

/* Dynamic Chart Resizer Bar & Quick Presets */
.chart-resizer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 32px;
    padding: 0 0.85rem;
    background: #101624;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid var(--border-color);
    cursor: row-resize;
    user-select: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.chart-resizer-bar:hover {
    background: #172033;
    border-top-color: rgba(56, 189, 248, 0.3);
}

.chart-resizer-bar.is-resizing {
    background: #1e293b;
    border-top-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.resizer-drag-indicator {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.resizer-grip-icon {
    display: flex;
    align-items: center;
    color: #64748b;
    font-size: 1.15rem;
    transition: color 0.15s ease;
}

.chart-resizer-bar:hover .resizer-grip-icon,
.chart-resizer-bar.is-resizing .resizer-grip-icon {
    color: #38bdf8;
}

.resizer-hint {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
}

.resizer-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    padding: 1px 7px;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.resizer-presets {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: default;
}

.btn-resizer-preset {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.71rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-resizer-preset:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-resizer-preset.active {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #38bdf8;
    font-weight: 700;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.legend-long-liq {
    color: #ff9800;
}
.legend-short-liq {
    color: #2196f3;
}
.btn-chart-reset {
    background: #1e293b;
    border: 1px solid #334155;
    color: #cbd5e1;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.15s ease;
}
.btn-chart-reset:hover {
    background: #334155;
    color: #fff;
}

/* Liquidation Alert Items in Ribbon */
.liq-item-long {
    border-color: rgba(255, 152, 0, 0.4) !important;
    background: rgba(255, 152, 0, 0.12) !important;
}
.liq-item-short {
    border-color: rgba(33, 150, 243, 0.4) !important;
    background: rgba(33, 150, 243, 0.12) !important;
}
.badge-liq-long {
    background: #ff9800;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.12rem 0.4rem;
    border-radius: 3px;
}
.badge-liq-short {
    background: #2196f3;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.12rem 0.4rem;
    border-radius: 3px;
}

/* Long / Short Ratio Gauge (Under the Chart) */
.gauge-section {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.gauge-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.gauge-title-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.gauge-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.timeframe-select-wrapper {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-highlight);
    border-radius: 6px;
    padding: 0.15rem 0.5rem;
}
.timeframe-select-wrapper label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
}
.timeframe-select {
    background: transparent;
    color: #38bdf8;
    font-size: 0.8rem;
    font-weight: 700;
    border: none;
    outline: none;
    cursor: pointer;
}
.timeframe-select option {
    background: #182030;
    color: #f8fafc;
}

/* Sentiment Badges */
.gauge-sentiment {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}
.badge-strong-bull {
    background: rgba(0, 230, 118, 0.25);
    color: var(--color-buy);
    border: 1px solid var(--color-buy);
}
.badge-bull {
    background: rgba(0, 230, 118, 0.15);
    color: var(--color-buy);
    border: 1px solid var(--color-buy-border);
}
.badge-neutral {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(148, 163, 184, 0.3);
}
.badge-bear {
    background: rgba(255, 51, 75, 0.15);
    color: var(--color-sell);
    border: 1px solid var(--color-sell-border);
}
.badge-strong-bear {
    background: rgba(255, 51, 75, 0.25);
    color: var(--color-sell);
    border: 1px solid var(--color-sell);
}

/* Gauge Dual-Meter Bar */
.gauge-meter-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.gauge-labels {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.95rem;
    font-weight: 700;
}
.gauge-long-label {
    color: var(--color-buy);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.gauge-short-label {
    color: var(--color-sell);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.gauge-bar-track {
    height: 14px;
    background: var(--color-sell);
    border-radius: 7px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}
.gauge-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00c853, var(--color-buy));
    transition: width 0.35s ease-out;
}

.gauge-stats-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: #0d121c;
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.gauge-stat-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.gauge-stat-item .label { color: var(--text-muted); }
.gauge-stat-item .val { font-weight: 700; font-family: var(--font-mono); }

/* Whale Alerts Ribbon */
.whale-ribbon {
    background: #0f1420;
    border-bottom: 1px solid var(--border-color);
    padding: 0.35rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 38px;
    overflow-x: auto;
}
.whale-ribbon-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-whale);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}
.whale-alerts-feed {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    flex: 1;
}
.whale-item {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    animation: fadeInSlide 0.25s ease;
}
.whale-item-buy {
    border-color: var(--color-buy-border);
    background: var(--color-buy-soft);
}
.whale-item-sell {
    border-color: var(--color-sell-border);
    background: var(--color-sell-soft);
}
@keyframes fadeInSlide {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Tape Toolbar */
.tape-toolbar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0.4rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.tape-toolbar-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.tape-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Trade Tape Table */
.trade-tape-container {
    flex: 1;
    min-height: 220px;
    overflow-y: auto;
    background: var(--bg-main);
    position: relative;
}

.tape-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.tape-table thead {
    position: sticky;
    top: 0;
    background: #0d121c;
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
}

.tape-table th {
    padding: 0.35rem 0.75rem;
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: right;
    user-select: none;
}
.tape-table th.th-time { text-align: left; }
.tape-table th.th-side { text-align: center; }

.tape-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    transition: background-color 0.1s ease;
}
.tape-row:hover {
    background-color: var(--bg-surface-elevated) !important;
}

.tape-buy { background: rgba(0, 230, 118, 0.03); }
.tape-sell { background: rgba(255, 51, 75, 0.03); }

.tape-row.row-whale {
    background: rgba(245, 158, 11, 0.12) !important;
    border-left: 3px solid var(--color-whale);
}
.tape-row.row-mega-whale {
    background: rgba(236, 72, 153, 0.18) !important;
    border-left: 4px solid var(--color-mega);
    font-weight: 600;
}

.tape-table td {
    padding: 0.3rem 0.75rem;
    text-align: right;
    white-space: nowrap;
}
.tape-table td.col-time {
    text-align: left;
    color: var(--text-muted);
    font-size: 0.76rem;
}
.tape-table td.col-side { text-align: center; }

.badge-buy {
    background: rgba(0, 230, 118, 0.2);
    color: var(--color-buy);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.12rem 0.45rem;
    border-radius: 4px;
}
.badge-sell {
    background: rgba(255, 51, 75, 0.2);
    color: var(--color-sell);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.12rem 0.45rem;
    border-radius: 4px;
}
.badge-whale {
    background: rgba(245, 158, 11, 0.25);
    color: #fde047;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.3rem;
}
.badge-mega {
    background: rgba(236, 72, 153, 0.3);
    color: #f472b6;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.3rem;
}

/* "내 거래내역" panel (replaced the live tape) */
.mt-summary { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; font-size: 0.74rem; color: var(--text-muted); justify-content: flex-end; }
.mt-summary b { color: var(--text-primary, #e5e7eb); font-variant-numeric: tabular-nums; }
.mt-summary small { font-size: 0.68rem; }
.mt-empty { padding: 1.5rem 1rem; text-align: center; color: var(--text-muted); font-size: 0.8rem; }
.mt-table td { vertical-align: top; font-variant-numeric: tabular-nums; }
.mt-table td small.mt-sub { display: block; font-size: 0.68rem; color: var(--text-muted); margin-top: 1px; }
.mt-table .mt-venue { display: block; font-size: 0.68rem; color: var(--text-muted); }
.mt-table .mt-comp { display: block; color: var(--text-primary, #e5e7eb); font-weight: 600; font-size: 0.78rem; }
.mt-table tr.mt-open { background: rgba(59, 130, 246, 0.07); border-left: 3px solid #3b82f6; }
.mt-table .mt-live { color: #60a5fa !important; }
.mt-result { font-weight: 700; padding: 0 0.3rem; border-radius: 3px; }
.mt-result.win { color: var(--color-buy); background: rgba(0, 230, 118, 0.15); }
.mt-result.loss { color: var(--color-sell); background: rgba(255, 51, 75, 0.15); }
.text-buy { color: var(--color-buy) !important; }
.text-sell { color: var(--color-sell) !important; }

/* Right Column: Trollbox Chat */
.trollbox-col {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    height: 100%;
    overflow: hidden;
}

.trollbox-header {
    background: #0f1420;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.trollbox-title {
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.trollbox-title i { color: #38bdf8; }

.online-traders-badge {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-surface-elevated);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}
.online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-buy);
    box-shadow: 0 0 5px var(--color-buy);
}

.cleanbot-status-badge {
    font-size: 0.68rem;
    font-weight: 600;
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 9999px;
    padding: 0.15rem 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: default;
    user-select: none;
    letter-spacing: -0.02em;
}
.cleanbot-status-badge i {
    color: #818cf8;
    font-size: 0.72rem;
}

.sentiment-bar {
    background: #0c1018;
    border-bottom: 1px solid var(--border-color);
    padding: 0.4rem 1rem;
}
.sentiment-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.sentiment-meter {
    height: 5px;
    background: var(--color-sell);
    border-radius: 3px;
    overflow: hidden;
}
.sentiment-bull-fill {
    height: 100%;
    background: var(--color-buy);
    transition: width 0.3s ease;
}

.trollbox-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.chat-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    transition: border-color 0.15s;
}
.chat-card:hover { border-color: var(--border-highlight); }
.chat-card-system {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.2);
}
.chat-card-bot {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(30, 27, 75, 0.3) 100%);
    border: 1px solid rgba(129, 140, 248, 0.45);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}
.chat-avatar-bot {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%) !important;
    font-size: 0.72rem !important;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}
.chat-nick-bot {
    color: #a5b4fc !important;
    font-weight: 800 !important;
}
.chat-text-bot {
    color: #e0e7ff !important;
    font-weight: 500;
    line-height: 1.45;
}

.chat-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    gap: 0.5rem;
}
.chat-user-info {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.chat-avatar-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
}
.chat-nick {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}
.chat-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.stance-pill {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.stance-bull {
    background: var(--color-buy-soft);
    color: var(--color-buy);
    border: 1px solid var(--color-buy-border);
}
.stance-bear {
    background: var(--color-sell-soft);
    color: var(--color-sell);
    border: 1px solid var(--color-sell-border);
}
.stance-neutral {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.price-snapshot-tag {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    background: #0f172a;
    color: #38bdf8;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    border: 1px solid #1e293b;
}

.chat-text {
    font-size: 0.85rem;
    color: #e2e8f0;
    word-break: break-word;
    white-space: pre-wrap;
}

.trollbox-input-section {
    background: #0d121c;
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-warning-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 0.45rem 0.75rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.35;
    animation: fadeInWarning 0.2s ease-out;
}
.chat-warning-banner i {
    color: #ef4444;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.btn-close-warning {
    background: none;
    border: none;
    color: #f87171;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.2rem;
    margin-left: auto;
}
.btn-close-warning:hover {
    color: #fff;
}
@keyframes fadeInWarning {
    from { opacity: 0; transform: translateY(-3px); }
    to { opacity: 1; transform: translateY(0); }
}

.trader-profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nick-input-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.nick-input {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    width: 110px;
    outline: none;
}
.nick-input:focus { border-color: var(--accent-blue); }

.stance-selector {
    display: flex;
    gap: 0.25rem;
}
.btn-stance {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-stance:hover { background: var(--bg-surface-hover); }
.btn-stance.selected-bull {
    background: var(--color-buy-soft);
    color: var(--color-buy);
    border-color: var(--color-buy);
}
.btn-stance.selected-bear {
    background: var(--color-sell-soft);
    color: var(--color-sell);
    border-color: var(--color-sell);
}
.btn-stance.selected-neutral {
    background: rgba(148, 163, 184, 0.2);
    color: #fff;
    border-color: #94a3b8;
}

.chat-input-row { display: flex; gap: 0.4rem; }
.chat-text-input {
    flex: 1;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.85rem;
    padding: 0.45rem 0.75rem;
    border-radius: 6px;
    outline: none;
}
.chat-text-input:focus { border-color: var(--accent-blue); }

.btn-send {
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.btn-send:hover { background: #2563eb; }

.quick-share-row { display: flex; justify-content: flex-end; }
.btn-quick-quote {
    background: transparent;
    border: none;
    color: #38bdf8;
    font-size: 0.72rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    text-decoration: underline;
}

/* Sound Settings Modal */
.settings-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.settings-modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 580px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    overflow: hidden;
}
.settings-modal-header {
    background: #0f1420;
    border-bottom: 1px solid var(--border-color);
    padding: 0.9rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.settings-modal-header h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}
.btn-close-modal:hover { color: #fff; }

.settings-modal-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.setting-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
}
.setting-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.range-slider {
    width: 100%;
    accent-color: var(--color-buy);
    cursor: pointer;
}

.sound-concept-card {
    background: #0d121c;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.sound-concept-title {
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.test-sound-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    margin-top: 0.3rem;
}
@media (max-width: 576px) {
    .test-sound-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.btn-test {
    padding: 0.4rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    text-align: center;
}
.btn-test-buy {
    background: var(--color-buy-soft);
    color: var(--color-buy);
    border-color: var(--color-buy-border);
}
.btn-test-buy:hover { background: rgba(0,230,118,0.25); }
.btn-test-sell {
    background: var(--color-sell-soft);
    color: var(--color-sell);
    border-color: var(--color-sell-border);
}
.btn-test-sell:hover { background: rgba(255,51,75,0.25); }

/* Sound Theme Selector Grid & Cards */
.theme-selector-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.35rem;
}

@media (max-width: 640px) {
    .theme-selector-grid {
        grid-template-columns: 1fr;
    }
}

.theme-card {
    background: #0b0f18;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.4rem;
    position: relative;
    user-select: none;
}

.theme-card:hover {
    border-color: var(--border-highlight);
    background: #101623;
}

.theme-card.active-buy {
    border-color: var(--color-buy);
    background: rgba(0, 230, 118, 0.08);
    box-shadow: 0 0 12px rgba(0, 230, 118, 0.15);
}

.theme-card.active-sell {
    border-color: var(--color-sell);
    background: rgba(255, 51, 75, 0.08);
    box-shadow: 0 0 12px rgba(255, 51, 75, 0.15);
}

.theme-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.theme-card-title {
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-primary);
}

.theme-card.active-buy .theme-card-title {
    color: var(--color-buy);
}

.theme-card.active-sell .theme-card-title {
    color: var(--color-sell);
}

.theme-card-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.theme-card-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    background: #1e293b;
    color: #94a3b8;
}

.theme-card.active-buy .theme-card-badge {
    background: var(--color-buy);
    color: #000;
}

.theme-card.active-sell .theme-card-badge {
    background: var(--color-sell);
    color: #fff;
}

.btn-preview-pill {
    padding: 0.2rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #141b2a;
    color: #cbd5e1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.15s;
}

.btn-preview-pill:hover {
    background: #1e293b;
    color: #fff;
    border-color: #475569;
}

.btn-preview-pill-buy:hover {
    background: var(--color-buy-soft);
    color: var(--color-buy);
    border-color: var(--color-buy);
}

.btn-preview-pill-sell:hover {
    background: var(--color-sell-soft);
    color: var(--color-sell);
    border-color: var(--color-sell);
}

.settings-modal-card {
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.settings-modal-body {
    overflow-y: auto;
}

/* Settings Tabs in Modal Header */
.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    background: #090d15;
    padding: 0.2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.btn-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.15s ease;
}

.btn-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-tab.active {
    background: #1e293b;
    color: #38bdf8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* EMA Indicator Settings */
.ema-presets-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.btn-preset-pill {
    padding: 0.25rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: #0f1624;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-preset-pill:hover {
    background: #1e293b;
    color: #38bdf8;
    border-color: #38bdf8;
}

.ema-config-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ema-config-row {
    background: #0d121c;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    transition: border-color 0.15s ease;
}

.ema-config-row.active {
    border-color: var(--border-highlight);
    background: #101623;
}

.ema-left-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.ema-toggle-checkbox {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: #38bdf8;
    cursor: pointer;
}

.ema-badge-title {
    font-size: 0.82rem;
    font-weight: 700;
    font-family: var(--font-mono);
    min-width: 55px;
}

.ema-controls-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ema-period-input-box {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.ema-period-input {
    background: #090d15;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: #f8fafc;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    width: 70px;
    text-align: center;
}

.ema-period-input:focus {
    border-color: #38bdf8;
    outline: none;
}

.ema-color-picker-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.ema-color-picker {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.ema-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.ema-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.ema-preview-line {
    width: 38px;
    height: 4px;
    border-radius: 2px;
}

/* ==========================================================================
   Dedicated Indicators Toolbar Line (지표 전용 툴바)
   ========================================================================== */
.chart-indicators-bar {
    background: #0b0f18;
    border-bottom: 1px solid var(--border-color);
    padding: 0.35rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.indicators-chip-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.indicators-bar-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: 0.25rem;
}

.indicator-chip {
    display: inline-flex;
    align-items: center;
    background: #131b2a;
    border: 1px solid #1e293b;
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.72rem;
    transition: all 0.2s ease;
}

.indicator-chip.chip-active {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.15);
}

.chip-label-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-weight: 600;
    padding: 0.24rem 0.55rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: color 0.15s ease;
}

.chip-label-btn:hover {
    color: #fff;
}

.chip-config-btn {
    background: rgba(255, 255, 255, 0.04);
    border: none;
    border-left: 1px solid #1e293b;
    color: #94a3b8;
    padding: 0.24rem 0.45rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.indicator-chip.chip-active .chip-config-btn {
    border-left-color: rgba(56, 189, 248, 0.3);
}

.chip-config-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.12);
}

.chip-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #64748b;
    display: inline-block;
    transition: all 0.2s;
}

.indicator-chip.chip-active .chip-status-dot {
    background: #00e676;
    box-shadow: 0 0 6px #00e676;
}

.chip-name {
    font-weight: 700;
}

.chip-info {
    font-size: 0.65rem;
    color: #38bdf8;
    font-weight: 700;
    font-family: var(--font-mono);
    margin-left: 0.15rem;
}

.btn-manage-indicators {
    background: transparent;
    border: 1px dashed #334155;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.22rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.btn-manage-indicators:hover {
    border-color: #38bdf8;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.05);
}

/* Indicators Toolbar Divider & Line Drawing Tool Chips */
.indicators-bar-divider {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 0.15rem;
}

.indicator-chip.chip-draw-active {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.16);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.indicator-chip.chip-draw-active .chip-name {
    color: #38bdf8;
}

.indicator-chip.chip-draw-active-yellow {
    border-color: #facc15;
    background: rgba(250, 204, 21, 0.16);
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.35);
}

.indicator-chip.chip-draw-active-yellow .chip-name {
    color: #facc15;
}

.indicator-chip.chip-draw-active-purple {
    border-color: #c084fc;
    background: rgba(192, 132, 252, 0.16);
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.35);
}

.indicator-chip.chip-draw-active-purple .chip-name {
    color: #c084fc;
}

.indicator-chip.chip-active-ai {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.14);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.indicator-chip.chip-active-ai .chip-name {
    color: #fbbf24;
}

.indicator-chip.chip-active-ai .chip-status-dot {
    background: #f59e0b;
    box-shadow: 0 0 6px #f59e0b;
}

.btn-draw-clear {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.22rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.btn-draw-clear:hover {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.45);
    color: #ef4444;
}

.btn-draw-clear.has-lines {
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

.btn-draw-clear.has-lines:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.35);
}

.indicators-bar-legend {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 600;
}

.legend-candle-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.legend-box {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    display: inline-block;
}

.bull-box {
    background: #00e676;
}

.bear-box {
    background: #ff334b;
}

.legend-vp-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #facc15;
}

.legend-poc-line {
    width: 14px;
    height: 2px;
    background: #facc15;
    border-radius: 1px;
    display: inline-block;
}

.chart-feed-badge {
    background: rgba(0, 230, 118, 0.12);
    border: 1px solid rgba(0, 230, 118, 0.3);
    color: var(--color-buy);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 12px;
    margin-left: 0.4rem;
}

/* Volume Profile Position Selector in Modal */
.vp-position-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.3rem;
}

.btn-vp-pos {
    background: #0f1420;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #cbd5e1;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.btn-vp-pos:hover {
    border-color: #475569;
    background: #151d2c;
}

.btn-vp-pos.active {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
    color: #fff;
}

.btn-vp-pos i {
    font-size: 1.25rem;
    color: #38bdf8;
    margin-bottom: 0.2rem;
}

/* ==========================================================================
   Real-Time Price Alerts Toolbar Button, Toast Banner, & Modal Styles
   ========================================================================== */

/* 1. Alerts Trigger Button in Indicators Bar */
.btn-price-alert-trigger {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.22rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.btn-price-alert-trigger:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: #f59e0b;
    color: #fbbf24;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.btn-price-alert-trigger.has-active-alerts {
    background: rgba(245, 158, 11, 0.16);
    border-color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

/* 2. Floating Top Triggered Alert Banner Toast */
.alert-toast-banner {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
    border: 2px solid #ef4444;
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.45), 0 0 20px rgba(245, 158, 11, 0.35);
    border-radius: 12px;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    max-width: 90vw;
    animation: toastPopDown 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toastPopDown {
    0% { transform: translate(-50%, -40px) scale(0.9); opacity: 0; }
    100% { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.toast-icon-pulse {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid #ef4444;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    animation: iconBellRing 0.8s infinite alternate ease-in-out;
}

@keyframes iconBellRing {
    0% { transform: rotate(-15deg) scale(1); }
    100% { transform: rotate(15deg) scale(1.15); box-shadow: 0 0 16px rgba(239, 68, 68, 0.6); }
}

.toast-details {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.toast-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.88rem;
    color: #f8fafc;
}

.toast-msg {
    font-size: 0.82rem;
    color: #cbd5e1;
}

.toast-sound-badge {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0.1rem 0.45rem;
    font-size: 0.72rem;
    margin-left: 0.3rem;
    color: #facc15;
}

.btn-toast-dismiss {
    background: #ef4444;
    color: #ffffff;
    border: none;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.45rem 0.95rem;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-toast-dismiss:hover {
    background: #dc2626;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

/* 3. Price Alerts Modal Structure */
.alert-modal-card {
    max-width: 680px;
}

.alert-form-card {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
}

.alert-form-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Quick percentage offsets */
.alert-quick-offsets {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.btn-offset-pill {
    background: #0f1624;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.15rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-offset-pill.pill-pos {
    color: #4ade80;
}

.btn-offset-pill.pill-pos:hover {
    background: rgba(74, 222, 128, 0.15);
    border-color: #4ade80;
}

.btn-offset-pill.pill-neg {
    color: #f87171;
}

.btn-offset-pill.pill-neg:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: #f87171;
}

/* Condition Pills (이상 vs 이하) */
.alert-cond-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.btn-cond-pill {
    background: #0f1624;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    transition: all 0.2s ease;
}

.btn-cond-pill:hover {
    border-color: #64748b;
    color: #f8fafc;
}

.btn-cond-pill.active-gte {
    background: rgba(245, 158, 11, 0.14);
    border-color: #f59e0b;
    color: #fbbf24;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

.btn-cond-pill.active-lte {
    background: rgba(6, 182, 212, 0.14);
    border-color: #06b6d4;
    color: #22d3ee;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

/* Sound Options Grid */
.alert-sound-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.45rem;
}

.sound-option-card {
    background: #0f1624;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
}

.sound-option-card:hover {
    border-color: #64748b;
    background: #151d2c;
}

.sound-option-card.active {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
}

.sound-option-card .sound-info {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    overflow: hidden;
}

.sound-option-card .sound-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.sound-option-card .sound-text-group {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sound-option-card .sound-title {
    font-size: 0.76rem;
    font-weight: 700;
    color: #f1f5f9;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.sound-option-card .sound-desc {
    font-size: 0.66rem;
    color: #94a3b8;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.btn-preview-sound {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.btn-preview-sound:hover {
    background: #f59e0b;
    color: #0f172a;
    border-color: #f59e0b;
}

.btn-add-alert {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #0f172a;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    transition: all 0.2s ease;
}

.btn-add-alert:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
}

/* 4. Alert Cards List */
.alert-cards-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.alert-item-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.alert-item-card:hover {
    border-color: #475569;
    background: rgba(30, 41, 59, 0.65);
}

.alert-item-card.alert-triggered {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.06);
}

.alert-item-card.alert-disabled {
    opacity: 0.6;
}

.alert-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-item-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.alert-sound-badge-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-item-test-sound {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-item-test-sound:hover {
    border-color: #f59e0b;
    color: #f59e0b;
}

.btn-delete-alert {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.2rem;
    transition: color 0.15s ease;
}

.btn-delete-alert:hover {
    color: #ef4444;
}

.alert-item-note {
    font-size: 0.72rem;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* ==========================================
   Phone push notifications (ntfy) card in the price alert modal
   ========================================== */
.ntfy-card {
    background: rgba(56, 189, 248, 0.06);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 10px;
    overflow: hidden;
    flex: none;   /* the modal body is a flex column: don't let this card be squashed */
}
.ntfy-card.is-verified { border-color: rgba(0, 230, 118, 0.4); background: rgba(0, 230, 118, 0.05); }
.ntfy-card-head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: #e2e8f0;
    text-align: left;
    cursor: pointer;
}
.ntfy-title { font-weight: 700; font-size: 0.86rem; }
.ntfy-title i { color: #38bdf8; }
.ntfy-body { padding: 0 12px 12px; }
.ntfy-steps { display: flex; flex-direction: column; gap: 12px; }
.ntfy-step { display: flex; gap: 10px; }
.ntfy-step-no {
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0284c7;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ntfy-step-main { flex: 1; min-width: 0; }
.ntfy-step-title { font-weight: 700; font-size: 0.8rem; color: #f1f5f9; margin-bottom: 5px; }
.ntfy-links { display: flex; gap: 8px; flex-wrap: wrap; }
.ntfy-links a {
    font-size: 0.74rem;
    color: #e2e8f0;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 3px 10px;
    text-decoration: none;
}
.ntfy-links a:hover { border-color: #38bdf8; color: #fff; }
.ntfy-qr-row { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.ntfy-qr {
    width: 148px;
    height: 148px;
    border-radius: 8px;
    background: #fff;
    padding: 4px;
    image-rendering: pixelated;
    flex: none;
}
.ntfy-qr-side { flex: 1; min-width: 200px; }
.ntfy-label { font-size: 0.72rem; color: #94a3b8; font-weight: 700; margin-bottom: 3px; display: block; }
.ntfy-hint { font-size: 0.7rem; color: #94a3b8; line-height: 1.5; margin-top: 6px; }
.ntfy-hint b { color: #cbd5e1; }
.ntfy-status {
    margin-top: 8px;
    font-size: 0.74rem;
    color: #fbbf24;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 6px;
    padding: 6px 8px;
}
.ntfy-status.ok { color: #4ade80; }
.ntfy-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(51, 65, 85, 0.6);
    font-size: 0.78rem;
    color: #e2e8f0;
}

/* ==========================================
   Membership: Google sign-in button, header user menu, auth gate
   ========================================== */
.btn-google-login {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #fff;
    color: #1f2937;
    border: 1px solid #dadce0;
    border-radius: 6px;
    padding: 0.45rem 0.95rem;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
}
.btn-google-login:hover { background: #f1f5f9; }
.btn-google-login .bi-google { color: #4285f4; }
.btn-google-login-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

.user-menu { position: relative; }
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 0.25rem 0.6rem 0.25rem 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.user-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none; }
.user-avatar-letter { display: inline-flex; align-items: center; justify-content: center; background: #0284c7; color: #fff; font-weight: 800; font-size: 0.75rem; }
.user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-admin-badge { font-size: 0.62rem; font-weight: 800; color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.5); border-radius: 4px; padding: 0 4px; }
.user-menu-backdrop { position: fixed; inset: 0; z-index: 1000; }
.user-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 1001;
    min-width: 220px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}
.user-menu-head { padding: 10px 12px; border-bottom: 1px solid #1e293b; font-size: 0.82rem; }
.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 9px 12px;
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 0.82rem;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
}
.user-menu-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.auth-gate {
    max-width: 420px;
    margin: 12vh auto;
    padding: 28px;
    text-align: center;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
}
.auth-gate h2 { font-size: 1.15rem; font-weight: 800; }
.auth-gate p { color: #94a3b8; }

/* ==========================================
   Admin: member management page
   ========================================== */
.admin-page { max-width: 1200px; margin: 0 auto; padding: 18px 16px 40px; user-select: text; }
.admin-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.admin-header h1 { font-size: 1.25rem; font-weight: 800; margin: 0; }
.admin-header h1 i { color: #38bdf8; }
.admin-back { color: #94a3b8; text-decoration: none; font-size: 0.85rem; }
.admin-back:hover { color: #fff; }

.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.admin-stat { background: #0f172a; border: 1px solid #1e293b; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; }
.admin-stat .v { font-size: 1.5rem; font-weight: 800; font-family: var(--font-mono); }
.admin-stat .k { font-size: 0.75rem; color: #94a3b8; }
.admin-stat.danger .v { color: #f87171; }

.admin-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.admin-search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px; background: #0f172a; border: 1px solid #334155; border-radius: 8px; padding: 6px 10px; }
.admin-search i { color: #64748b; }
.admin-search input { flex: 1; background: transparent; border: none; outline: none; color: #e2e8f0; font-size: 0.85rem; }
.admin-filters { display: flex; gap: 4px; background: #0f172a; border: 1px solid #1e293b; border-radius: 8px; padding: 3px; }
.admin-filter { background: transparent; border: none; color: #94a3b8; font-size: 0.8rem; font-weight: 600; padding: 4px 12px; border-radius: 6px; cursor: pointer; }
.admin-filter.active { background: #0284c7; color: #fff; }

.admin-message { padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; font-size: 0.82rem; background: rgba(0, 230, 118, 0.1); border: 1px solid rgba(0, 230, 118, 0.35); color: #4ade80; cursor: pointer; }
.admin-message.error { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.4); color: #fca5a5; }
.admin-empty { padding: 40px; text-align: center; color: #64748b; border: 1px dashed #334155; border-radius: 10px; }

.admin-table-wrap { overflow-x: auto; border: 1px solid #1e293b; border-radius: 10px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.admin-table th { background: #0f172a; color: #94a3b8; font-weight: 700; font-size: 0.75rem; text-align: left; padding: 9px 12px; white-space: nowrap; }
.admin-table td { padding: 9px 12px; border-top: 1px solid #1e293b; vertical-align: middle; }
.admin-table tr.is-blocked td { background: rgba(248, 113, 113, 0.05); }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-user img, .admin-user-letter { width: 34px; height: 34px; border-radius: 50%; flex: none; object-fit: cover; }
.admin-user-letter { display: inline-flex; align-items: center; justify-content: center; background: #334155; font-weight: 800; }
.admin-email { color: #94a3b8; font-size: 0.75rem; }
.admin-note { color: #fbbf24; font-size: 0.72rem; margin-top: 2px; }
.admin-actions { display: inline-flex; gap: 4px; flex-wrap: nowrap; }
.admin-actions .btn { font-size: 0.72rem; padding: 2px 8px; white-space: nowrap; }
.admin-edit-row td { background: #0b1220; }
.admin-edit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.admin-edit label { font-size: 0.78rem; color: #cbd5e1; font-weight: 700; }
.admin-edit input { flex: 1; min-width: 200px; background: #0f172a; color: #e2e8f0; border-color: #334155; }
.admin-footnote { margin-top: 8px; font-size: 0.72rem; color: #64748b; }

/* ==========================================
   Trollbox rank badges: 비회원 / 브론즈 / 실버 / 골드 / 관리자
   ========================================== */
.rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex: none;
    font-size: 0.72rem;
    line-height: 1;
    border-radius: 4px;
}
.rank-badge .rank-text { font-size: 0.6rem; font-weight: 800; }
.rank-guest { color: #94a3b8; border: 1px solid #475569; padding: 1px 4px; }
.rank-bronze { color: #cd7f32; filter: drop-shadow(0 0 2px rgba(205, 127, 50, 0.5)); font-size: 0.85rem; }
.rank-silver { color: #cbd5e1; filter: drop-shadow(0 0 3px rgba(203, 213, 225, 0.6)); font-size: 0.85rem; }
.rank-gold { color: #fbbf24; filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.8)); font-size: 0.85rem; }
.rank-admin { color: #fff; background: linear-gradient(135deg, #dc2626, #9333ea); padding: 2px 5px; box-shadow: 0 0 6px rgba(220, 38, 38, 0.5); }

.chat-nick-guest { color: #94a3b8; }
.chat-nick-bronze { color: #e2b27a; }
.chat-nick-silver { color: #e2e8f0; }
.chat-nick-gold { color: #fcd34d; }
.chat-nick-admin { color: #f87171; font-weight: 800; }

.nick-member { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 0.8rem; }
.nick-member-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nick-member-grade { font-size: 0.65rem; color: #64748b; }
.btn-nick-change {
    margin-left: auto;
    background: transparent;
    border: 1px solid #334155;
    color: #94a3b8;
    border-radius: 5px;
    font-size: 0.68rem;
    padding: 1px 7px;
    cursor: pointer;
}
.btn-nick-change:hover { color: #fff; border-color: #38bdf8; }
.nick-edit { gap: 5px; }
.btn-nick-action { background: transparent; border: 1px solid #334155; color: #94a3b8; border-radius: 5px; padding: 0 6px; cursor: pointer; }
.btn-nick-action.save { color: #4ade80; border-color: rgba(74, 222, 128, 0.5); }
.nick-guest-hint { font-size: 0.66rem; color: #64748b; margin-top: 3px; }
.nick-error { font-size: 0.7rem; color: #fca5a5; margin-top: 3px; }

.user-menu-grade { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 0.72rem; color: #94a3b8; }

/* Admin: grade column */
.admin-nick { color: #7dd3fc; font-size: 0.72rem; }
.admin-grade-select {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
}
.admin-grade-select option { color: #e2e8f0; background: #0f172a; }
.grade-gold { color: #fbbf24; }
.grade-silver { color: #cbd5e1; }
.grade-bronze { color: #cd7f32; }

/* ==========================================
   Floating window (trollbox): drag / resize / minimize - see js/floatingWindow.js
   ========================================== */
.float-window {
    position: fixed;
    right: 12px;
    bottom: 12px;
    width: 340px;
    height: 460px;
    z-index: 900;                 /* above the chart, below modals (1000+) */
    border: 1px solid #334155;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(56, 189, 248, 0.08);
    overflow: hidden;
}
.float-window[data-minimized="1"] { display: none; }
.float-window .float-window-handle { cursor: move; user-select: none; touch-action: none; }
.float-window.is-dragging-window { opacity: 0.92; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 0 2px rgba(56, 189, 248, 0.5); }
.float-window.is-dragging-window * { user-select: none; }

.float-window-controls { display: flex; gap: 2px; margin-left: 2px; }
.float-window-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    width: 24px;
    height: 24px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
}
.float-window-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

/* Resize handles on every edge / corner (floatingWindow.js lays them over the window's border) */
.float-window-resize {
    position: fixed;
    z-index: 901;
    touch-action: none;
}
.float-window-resize-n, .float-window-resize-s { cursor: ns-resize; }
.float-window-resize-e, .float-window-resize-w { cursor: ew-resize; }
.float-window-resize-nw, .float-window-resize-se { cursor: nwse-resize; }
.float-window-resize-ne, .float-window-resize-sw { cursor: nesw-resize; }
/* the edge lights up under the mouse so it's clear it can be dragged */
.float-window-resize-n:hover, .float-window-resize-s:hover,
.float-window-resize-e:hover, .float-window-resize-w:hover { background: rgba(56, 189, 248, 0.35); border-radius: 4px; }
/* visible grip in the bottom-right corner */
.float-window-resize-se {
    background: linear-gradient(135deg, transparent 0 45%, #64748b 45% 52%, transparent 52% 65%, #64748b 65% 72%, transparent 72%);
    opacity: 0.7;
}
.float-window-resize-se:hover { opacity: 1; }
.float-window-resize[data-visible="0"] { display: none; }
body.is-resizing-window, body.is-resizing-window * { user-select: none; }

.float-window-bubble {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 900;
    display: none;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #0284c7, #6366f1);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    cursor: pointer;
}
.float-window-bubble[data-visible="1"] { display: inline-flex; }
.float-window-bubble:hover { filter: brightness(1.1); }
.float-window-bubble-count {
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
    font-size: 0.7rem;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Compact trollbox header inside the floating window */
.float-window .trollbox-header { padding: 6px 6px 6px 10px; gap: 6px; flex-wrap: nowrap; }
.float-window .trollbox-title { white-space: nowrap; min-width: 0; gap: 6px; }
.float-window .trollbox-title > span:not(.cleanbot-status-badge) { overflow: hidden; text-overflow: ellipsis; }
.float-window .cleanbot-status-badge > span { display: none; }   /* keep just the shield icon (tooltip explains it) */
.float-window .online-traders-badge { white-space: nowrap; }

/* Members-only panel (price alerts for guests) */
.members-only-panel { text-align: center; padding: 28px 16px; }
.members-only-panel > i { font-size: 2.2rem; color: #64748b; }
.members-only-panel h5 { font-weight: 800; margin: 10px 0 6px; }
.members-only-panel p { color: #94a3b8; font-size: 0.85rem; margin-bottom: 16px; }

/* Trollbox: "messages skipped" marker during chat bursts */
.chat-skipped {
    text-align: center;
    font-size: 0.7rem;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.08);
    border: 1px dashed rgba(245, 158, 11, 0.35);
    border-radius: 6px;
    padding: 3px 8px;
    margin: 2px 0;
}

/* Dynamic sound sensitivity (settings > sound) */
.sens-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.sens-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 8px 4px;
    color: #cbd5e1;
    cursor: pointer;
}
.sens-pill .sens-label { font-weight: 800; font-size: 0.85rem; }
.sens-pill .sens-desc { font-size: 0.66rem; color: #64748b; }
.sens-pill.active { border-color: #38bdf8; background: rgba(56, 189, 248, 0.12); color: #fff; }
.sens-pill.active .sens-desc { color: #7dd3fc; }
.sens-live {
    position: relative;
    margin-top: 8px;
    padding: 7px 34px 7px 10px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid #1e293b;
    font-size: 0.74rem;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.sens-last { color: #94a3b8; font-size: 0.7rem; }
.btn-sens-refresh {
    position: absolute;
    right: 6px;
    top: 6px;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
}
.btn-sens-refresh:hover { color: #fff; }

/* Main chart pane header: its own exchange / coin / interval pickers */
.pane-header-main { overflow: visible; position: relative; z-index: 5; }   /* let the coin search panel drop down */
.pane-symbol-picker { position: relative; }
.pane-sym-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    cursor: pointer;
    max-width: 150px;
}
.pane-sym-btn span { overflow: hidden; text-overflow: ellipsis; }
.pane-sym-btn i { font-size: 0.6rem; opacity: 0.7; }
.pane-symbol-picker .symbol-picker-panel { top: calc(100% + 4px); white-space: normal; }

/* Alarm style picker (settings > sound) */
.alarm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: 8px; }
.alarm-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.alarm-card:hover { border-color: #475569; }
.alarm-card.active { border-color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
.alarm-card-top { display: flex; align-items: center; justify-content: space-between; }
.alarm-label { font-weight: 800; font-size: 0.82rem; }
.alarm-check { color: #f59e0b; }
.alarm-desc { font-size: 0.68rem; color: #94a3b8; }
.alarm-previews { display: flex; gap: 4px; justify-content: flex-end; margin-top: 2px; }

/* ==========================================
   Backtest page
   ========================================== */
a.btn-action-text { text-decoration: none; }
.bt-page { max-width: 1400px; margin: 0 auto; padding: 16px; user-select: text; }
.bt-header { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.bt-header h1 { font-size: 1.3rem; font-weight: 800; margin: 0; }
.bt-header h1 i { color: #a78bfa; }
.bt-sub { color: #94a3b8; font-size: 0.82rem; }
.bt-layout { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1000px) { .bt-layout { grid-template-columns: 1fr; } }

.bt-card { background: #0f172a; border: 1px solid #1e293b; border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.bt-card-title { font-weight: 800; font-size: 0.85rem; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bt-hint { color: #64748b; font-size: 0.72rem; font-weight: 500; }
.bt-row { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.bt-input {
    background: #0b1220;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 0.8rem;
    outline: none;
}
.bt-input:focus { border-color: #a78bfa; }
.bt-row > .bt-input { flex: 1; min-width: 0; }
.bt-symbol { text-transform: uppercase; font-weight: 700; }
.bt-num { width: 64px; }

.bt-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.bt-preset { background: #1e293b; color: #e2e8f0; border: 1px solid #334155; border-radius: 999px; padding: 4px 10px; font-size: 0.75rem; cursor: pointer; }
.bt-preset:hover { border-color: #a78bfa; color: #fff; }

.bt-side { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bt-side-btn { background: #0b1220; border: 1px solid #334155; color: #94a3b8; border-radius: 6px; padding: 6px; font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.bt-side-btn.active.long { border-color: #22c55e; color: #4ade80; background: rgba(34, 197, 94, 0.1); }
.bt-side-btn.active.short { border-color: #ef4444; color: #f87171; background: rgba(239, 68, 68, 0.1); }

.bt-cond { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 6px; border: 1px dashed #334155; border-radius: 8px; margin-bottom: 6px; }
.bt-operand { display: inline-flex; gap: 4px; }
.bt-op { color: #c4b5fd; font-weight: 700; }
.bt-remove { margin-left: auto; background: transparent; border: none; color: #64748b; cursor: pointer; }
.bt-remove:hover { color: #f87171; }
.bt-add { background: transparent; border: 1px dashed #475569; color: #94a3b8; border-radius: 6px; padding: 4px 10px; font-size: 0.75rem; cursor: pointer; width: 100%; }
.bt-add:hover { color: #fff; border-color: #a78bfa; }
.bt-sltp { margin-top: 8px; }
.bt-sltp label { display: flex; flex-direction: column; gap: 3px; font-size: 0.72rem; color: #94a3b8; flex: 1; }
.bt-advanced summary { cursor: pointer; font-weight: 800; font-size: 0.82rem; }

.bt-run {
    width: 100%;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 11px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
}
.bt-run:disabled { opacity: 0.6; cursor: wait; }
.bt-error { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.35); color: #fca5a5; font-size: 0.8rem; }

.bt-empty { text-align: center; padding: 80px 20px; color: #94a3b8; border: 1px dashed #334155; border-radius: 12px; }
.bt-empty > i { font-size: 2.4rem; color: #475569; display: block; margin-bottom: 8px; }
.bt-summary { font-weight: 700; font-size: 0.88rem; color: #e2e8f0; margin-bottom: 2px; }
.bt-period { color: #64748b; font-size: 0.74rem; margin-bottom: 10px; }

.bt-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.bt-metric { background: #0f172a; border: 1px solid #1e293b; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.bt-metric .k { color: #94a3b8; font-size: 0.72rem; }
.bt-metric .v { font-size: 1.25rem; font-weight: 800; font-family: var(--font-mono); }
.bt-metric .s { color: #64748b; font-size: 0.7rem; }
.bt-metric.big .v { font-size: 1.6rem; }
.bt-metric.big.up { border-color: rgba(34, 197, 94, 0.5); }
.bt-metric.big.down { border-color: rgba(239, 68, 68, 0.5); }
.bt-metric.big.up .v, .bt-page .up { color: #4ade80; }
.bt-metric.big.down .v, .bt-page .down { color: #f87171; }

.bt-legend { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 0.7rem; color: #94a3b8; margin-left: auto; }
.bt-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.bt-legend .lg-strat { background: #a78bfa; }
.bt-legend .lg-hold { background: #64748b; }
.bt-legend .mk-entry { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid #22c55e; border-radius: 0; }
.bt-legend .mk-win { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 9px solid #38bdf8; border-radius: 0; }
.bt-legend .mk-loss { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 9px solid #f59e0b; border-radius: 0; }

.bt-equity { width: 100%; height: 220px; display: block; }
.bt-equity polyline { fill: none; vector-effect: non-scaling-stroke; }
.bt-eq-strat { stroke: #a78bfa; stroke-width: 2.2; }
.bt-eq-hold { stroke: #64748b; stroke-width: 1.4; stroke-dasharray: 4 3; }
.bt-eq-base { stroke: #334155; stroke-width: 1; vector-effect: non-scaling-stroke; }

.bt-chart-wrap { width: 100%; height: 440px; position: relative; overflow: hidden; background: #0d111a; border-radius: 8px; }
.bt-chart-wrap canvas { display: block; }
.bt-chart-wrap { height: 460px; }
.bt-chart-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 0.82rem; background: rgba(13, 17, 26, 0.75); pointer-events: none; }
.bt-trades tbody tr.selected td { background: rgba(56, 189, 248, 0.14); }
.bt-trades tbody tr.selected td:first-child { box-shadow: inset 3px 0 0 #38bdf8; }

.bt-trades-wrap { max-height: 360px; overflow: auto; }
.bt-trades { width: 100%; border-collapse: collapse; font-size: 0.76rem; }
.bt-trades th { position: sticky; top: 0; background: #0f172a; color: #94a3b8; text-align: left; padding: 6px 8px; font-weight: 700; }
.bt-trades td { padding: 5px 8px; border-top: 1px solid #1e293b; white-space: nowrap; }
.bt-trades tbody tr { cursor: pointer; }
.bt-trades tbody tr:hover td { background: rgba(167, 139, 250, 0.08); }
.bt-disclaimer { color: #64748b; font-size: 0.7rem; line-height: 1.6; margin-top: 6px; }

/* ==========================================
   Leaderboard submit card (backtest page) + leaderboard page
   ========================================== */
.bt-link { margin-left: auto; color: #a78bfa; font-size: 0.75rem; text-decoration: none; font-weight: 700; }
.bt-link:hover { color: #c4b5fd; }
.bt-submit { border-color: rgba(251, 191, 36, 0.35); }
.bt-leagues { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px; margin-bottom: 8px; }
.bt-league { display: flex; flex-direction: column; gap: 2px; text-align: left; background: #0b1220; border: 1px solid #334155; border-radius: 8px; padding: 8px 10px; color: #e2e8f0; cursor: pointer; }
.bt-league.active { border-color: #fbbf24; background: rgba(251, 191, 36, 0.08); }
.bt-league-name { font-weight: 800; font-size: 0.82rem; }
.bt-league-desc { color: #94a3b8; font-size: 0.68rem; }
.bt-public { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; margin-bottom: 8px; cursor: pointer; }
.bt-submit-btn { width: 100%; background: linear-gradient(135deg, #d97706, #f59e0b); color: #1c1917; border: none; border-radius: 8px; padding: 9px; font-weight: 800; cursor: pointer; }
.bt-submit-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.bt-submit-result { margin-top: 8px; padding: 9px 11px; border-radius: 8px; font-size: 0.8rem; display: flex; flex-direction: column; gap: 4px; }
.bt-submit-result.ok { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.35); }
.bt-submit-result.warn { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.35); }
.bt-submit-result .bt-link { margin-left: 0; }
.bt-submit-nums { color: #cbd5e1; font-size: 0.76rem; }

/* Strategy chat + job list + report */
.bt-header .lb-cta { margin-left: auto; }
.bt-reset { background: none; border: none; cursor: pointer; padding: 0; }
.bt-chat { height: 360px; overflow-y: auto; display: flex; flex-direction: column-reverse; gap: 8px; padding: 4px 2px 8px; }
.bt-msg { max-width: 88%; padding: 8px 11px; border-radius: 12px; font-size: 0.82rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.bt-msg.held { align-self: flex-end; background: #334155; color: #cbd5e1; border-bottom-right-radius: 4px; }
.bt-msg.user { align-self: flex-end; background: linear-gradient(135deg, #6d28d9, #4338ca); color: #fff; border-bottom-right-radius: 4px; }
.bt-msg.assistant { align-self: flex-start; background: #1e293b; color: #e2e8f0; border-bottom-left-radius: 4px; }
.bt-msg.system { align-self: center; background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); color: #fcd34d; font-size: 0.75rem; }
.bt-msg.typing { display: inline-flex; gap: 4px; }
.bt-msg.typing span { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; animation: bt-dot 1s infinite ease-in-out; }
.bt-msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.bt-msg.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bt-dot { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
.bt-chat-empty { margin: auto 0; color: #64748b; font-size: 0.78rem; text-align: center; padding: 20px; border: 1px dashed #334155; border-radius: 10px; }
.bt-chat-input { display: flex; gap: 6px; }
.bt-chat-input .bt-input { flex: 1; padding: 8px 10px; font-size: 0.85rem; }
.bt-send { background: #7c3aed; color: #fff; border: none; border-radius: 8px; width: 42px; cursor: pointer; }
.bt-send:disabled { opacity: 0.45; cursor: not-allowed; }
.bt-presets .bt-hint { align-self: center; }
.bt-preset:disabled { opacity: 0.5; }
.bt-draft { font-size: 0.82rem; color: #e2e8f0; background: #0b1220; border: 1px solid #334155; border-radius: 8px; padding: 8px 10px; line-height: 1.5; }
.bt-notice { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 10px; padding: 9px 11px; border-radius: 8px; font-size: 0.8rem; line-height: 1.55; color: #fde68a; background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.35); }
.bt-notice > i { margin-top: 2px; }
.bt-market { margin-top: 10px; padding: 8px; border: 1px solid #1e293b; border-radius: 8px; background: #0b1220; }
.bt-market.disabled { opacity: 0.55; }
.bt-market-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.bt-market-row label { display: flex; flex-direction: column; gap: 3px; font-size: 0.7rem; color: #94a3b8; min-width: 0; }
.bt-market-row .bt-input { width: 100%; }
.bt-market-row { grid-template-columns: 1fr 1fr; }
.bt-date-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: end; margin-top: 6px; }
.bt-date-row label { display: flex; flex-direction: column; gap: 3px; font-size: 0.7rem; color: #94a3b8; min-width: 0; }
.bt-date-row .bt-input { width: 100%; color-scheme: dark; }
.bt-date-sep { color: #64748b; padding-bottom: 6px; }
.bt-period-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; }
.bt-chip { background: #1e293b; color: #cbd5e1; border: 1px solid #334155; border-radius: 999px; padding: 2px 9px; font-size: 0.72rem; cursor: pointer; }
.bt-chip.active { border-color: #fbbf24; color: #fbbf24; background: rgba(251, 191, 36, 0.1); }
.bt-chip:disabled { opacity: 0.4; cursor: not-allowed; }
.bt-period-chips .bt-hint { margin-left: 4px; }
.bt-draft-market { color: #c4b5fd; font-weight: 700; margin-bottom: 4px; }
.bt-draft-state { margin-top: 6px; font-size: 0.76rem; color: #fbbf24; }
.bt-draft-state.ok { color: #4ade80; }
.bt-jobs { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.bt-job { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; text-align: left; background: #0b1220; border: 1px solid #1e293b; border-radius: 8px; padding: 7px 10px; color: #e2e8f0; cursor: pointer; font-size: 0.8rem; }
.bt-job.active { border-color: #a78bfa; background: rgba(167, 139, 250, 0.08); }
.bt-job-league { font-weight: 700; }
.bt-job-time { color: #64748b; font-size: 0.72rem; }
.bt-st { font-size: 0.72rem; font-weight: 800; border-radius: 6px; padding: 1px 7px; font-family: var(--font-mono); }
.bt-st.queued { color: #94a3b8; border: 1px solid #475569; }
.bt-st.running { color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.5); }
.bt-st.failed { color: #f87171; border: 1px solid rgba(248, 113, 113, 0.5); }
.bt-st.done { border: 1px solid #334155; }
.bt-waiting { display: flex; align-items: center; gap: 8px; color: #94a3b8; font-size: 0.82rem; margin-top: 8px; }
.bt-months { width: 100%; border-collapse: separate; border-spacing: 2px; font-size: 0.72rem; font-family: var(--font-mono); }
.bt-months th { color: #94a3b8; font-weight: 700; text-align: center; padding: 4px; position: sticky; top: 0; background: #0f172a; }
.bt-months td { text-align: center; padding: 5px 4px; border-radius: 4px; color: #f1f5f9; white-space: nowrap; }
.bt-months td.yr { color: #94a3b8; font-weight: 700; }
.bt-months td.na { color: #334155; }
.bt-months td.total { font-weight: 800; text-align: left; padding-right: 10px; }
.bt-months td.total .bh { color: #64748b; font-weight: 500; margin-left: 4px; }
.lb-simple { max-width: 640px; }

.lb-page { max-width: 1300px; margin: 0 auto; padding: 16px; user-select: text; }
.lb-trophy { color: #fbbf24 !important; }
.lb-cta { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff; border-radius: 8px; padding: 6px 12px; font-weight: 800; font-size: 0.8rem; text-decoration: none; }
.lb-cta:hover { color: #fff; filter: brightness(1.1); }
.lb-leagues { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin-bottom: 10px; }
.lb-league { display: flex; flex-direction: column; gap: 2px; text-align: left; background: #0f172a; border: 1px solid #1e293b; border-radius: 10px; padding: 10px 12px; color: #e2e8f0; cursor: pointer; }
.lb-league.active { border-color: #fbbf24; box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.3); }
.lb-league-name { font-weight: 800; }
.lb-league-desc { color: #94a3b8; font-size: 0.75rem; }
.lb-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.lb-metrics { display: flex; gap: 4px; background: #0f172a; border: 1px solid #1e293b; border-radius: 8px; padding: 3px; }
.lb-window { color: #64748b; font-size: 0.72rem; }
.lb-table td { vertical-align: middle; }
.lb-rank { font-size: 1.1rem; font-weight: 800; width: 56px; }
.lb-user { display: flex; align-items: center; gap: 6px; }
.lb-me td { background: rgba(167, 139, 250, 0.08); }
.lb-me-tag { font-size: 0.62rem; font-weight: 800; color: #c4b5fd; border: 1px solid rgba(167, 139, 250, 0.5); border-radius: 4px; padding: 0 4px; }
.lb-up { color: #4ade80; }
.lb-down { color: #f87171; }
.lb-spark { width: 100px; height: 28px; display: block; }
.lb-spark polyline { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.lb-spark polyline.up { stroke: #4ade80; }
.lb-spark polyline.down { stroke: #f87171; }
.lb-strategy { max-width: 320px; font-size: 0.74rem; color: #cbd5e1; white-space: normal; }
.lb-private { color: #64748b; font-size: 0.72rem; margin-left: 4px; }

/* ===== Trading bot monitor (/admin/bot, admin only, read-only) ===== */
.bot-page .admin-header { flex-wrap: wrap; }
.bot-light { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 0.85rem; }
.bot-light i { width: 10px; height: 10px; border-radius: 50%; background: #64748b; }
.bot-light.ok i { background: #22c55e; } .bot-light.warn i { background: #f59e0b; } .bot-light.bad i { background: #ef4444; }
.bot-badge { padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; background: #0f3320; color: #4ade80; }
.bot-badge.live { background: #7f1d1d; color: #fff; }
.bot-readonly { font-size: 0.78rem; color: #94a3b8; background: #0f172a; border: 1px dashed #1e293b; border-radius: 8px; padding: 7px 12px; margin-bottom: 12px; }
.bot-alert { border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; font-weight: 700; font-size: 0.85rem; }
.bot-alert.bad { background: #7f1d1d; color: #fff; } .bot-alert.warn { background: #3b2f0b; color: #fde68a; }
.bot-page .pos { color: #22c55e; } .bot-page .neg { color: #f87171; } .bot-page .warn { color: #f59e0b; }
.bot-kpis .admin-stat { gap: 2px; }
.bot-kpis .admin-stat .v { font-size: 1.35rem; }
.bot-bar { display: block; position: relative; height: 6px; background: #1e293b; border-radius: 3px; overflow: hidden; margin-top: 6px; }
.bot-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: #ef4444; border-radius: 3px; }
.bot-bar em { position: absolute; top: 0; bottom: 0; width: 2px; background: #f8fafc; opacity: .7; }
.bot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-bottom: 16px; }
.bot-card { background: #0f172a; border: 1px solid #1e293b; border-radius: 10px; padding: 12px 14px; font-size: 0.85rem; }
.bot-row { display: flex; align-items: center; gap: 8px; }
.bot-sub { color: #94a3b8; font-size: 0.75rem; margin-top: 3px; }
.bot-coin { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 0.7rem; font-weight: 800; background: #1e293b; color: #93c5fd; }
.bot-coin.BTC { color: #fbbf24; }
.bot-tag { font-size: 0.7rem; padding: 1px 6px; border-radius: 4px; border: 1px solid #1e293b; color: #94a3b8; }
.bot-section { margin-bottom: 16px; min-width: 0; }
.bot-section h2 { font-size: 0.95rem; font-weight: 800; margin: 0 0 8px; }
.bot-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .bot-two { grid-template-columns: 1fr; } }
.bot-chart { position: relative; background: #0f172a; border: 1px solid #1e293b; border-radius: 10px; height: 240px; padding: 10px 70px 22px 10px; }
.bot-chart svg { width: 100%; height: 100%; display: block; }
.bot-axis { position: absolute; font-size: 0.7rem; color: #94a3b8; font-family: var(--font-mono); }
.bot-axis.hi { right: 8px; top: 8px; } .bot-axis.lo { right: 8px; bottom: 24px; }
.bot-axis.from { left: 10px; bottom: 4px; } .bot-axis.to { right: 70px; bottom: 4px; }
.bot-heat td { min-width: 56px; font-family: var(--font-mono); font-size: 0.78rem; }
.bot-scroll { max-height: 420px; overflow: auto; }
.bot-log { max-height: 360px; overflow: auto; font: 0.75rem/1.55 var(--font-mono); background: #0f172a; border: 1px solid #1e293b; border-radius: 10px; padding: 8px 10px; white-space: pre-wrap; }
.bot-log .k-fill { color: #93c5fd; } .bot-log .k-trade { color: #e5e7eb; } .bot-log .k-warn { color: #fbbf24; }
.bot-log .k-error { color: #f87171; } .bot-log .k-control { color: #c4b5fd; } .bot-log .k-info { color: #94a3b8; }
.bot-tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid #1e293b; overflow-x: auto; }
.bot-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; font-weight: 800; font-size: 0.85rem; color: #94a3b8;
  text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.bot-tabs a:hover { color: #e2e8f0; }
.bot-tabs a.on { color: #f8fafc; border-bottom-color: #38bdf8; }
.bot-tabs .bot-light { font-size: 0; }
a.bot-card.bot-venue { display: block; color: inherit; text-decoration: none; transition: border-color .15s; }
a.bot-card.bot-venue:hover { border-color: #38bdf8; }
.bot-venue .bot-name { font-size: 1rem; font-weight: 800; }
.bot-venue .bot-big { font-size: 1.3rem; font-weight: 800; font-family: var(--font-mono); margin-top: 8px; }
.bot-venue dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 8px 0 0; font-size: 0.78rem; }
.bot-venue dt { color: #94a3b8; font-weight: 500; } .bot-venue dd { margin: 0; text-align: right; font-family: var(--font-mono); }
.bot-venue .bot-alert { font-size: 0.75rem; padding: 5px 8px; margin: 8px 0 0; }
.bot-venue.off { opacity: .6; }
/* ===== Admin "내 전략" chart overlay menu ===== */
.strat-chip .chip-name i { color: #fbbf24; margin-right: 2px; }
.strat-menu-backdrop { position: fixed; inset: 0; z-index: 1999; }
.strat-menu { position: fixed; top: 120px; left: 50%; transform: translateX(-50%); z-index: 2000; width: min(420px, calc(100vw - 32px));
  background: #0f172a; border: 1px solid #334155; border-radius: 12px; padding: 10px; box-shadow: 0 16px 40px rgba(0,0,0,.55); }
.strat-menu-head { font-weight: 800; font-size: .85rem; padding: 2px 4px 8px; display: flex; justify-content: space-between; }
.strat-menu-head span { color: #64748b; font-weight: 500; font-size: .75rem; }
.strat-menu-empty { color: #94a3b8; font-size: .8rem; padding: 8px 4px; }
.strat-item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; background: #131b2a; border: 1px solid #1e293b;
  border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; color: #e2e8f0; cursor: pointer; }
.strat-item:hover { border-color: #38bdf8; }
.strat-item.on { border-color: #fbbf24; background: rgba(251,191,36,.08); }
.strat-item-title { font-weight: 700; font-size: .82rem; }
.strat-item-sub { color: #94a3b8; font-size: .74rem; }
.strat-item.strat-off { flex-direction: row; gap: 6px; color: #f87171; }
.strat-menu-foot { color: #64748b; font-size: .72rem; padding: 4px 4px 0; }
.deriv-menu { max-height: calc(100vh - 140px); overflow-y: auto; }
/* ===== Personal trading tools (risk strip, journal, signals, mobile, panel hiding) ===== */
.risk-strip { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; padding: 8px 14px; margin: 0 0 12px;
    border: 1px solid #1e293b; border-left: 4px solid #22c55e; border-radius: 10px; background: #0f172a; font-size: .82rem; }
.risk-strip.warn { border-left-color: #f59e0b; }
.risk-strip.bad { border-left-color: #ef4444; background: rgba(239, 68, 68, .07); }
.risk-strip.compact { margin: 0; border-radius: 0; border-width: 0 0 1px 3px; padding: 5px 12px; font-size: .74rem; gap: 4px 14px; }
.risk-item { display: inline-flex; align-items: baseline; gap: 5px; font-variant-numeric: tabular-nums; }
.risk-item .k { color: #94a3b8; font-size: .72rem; }
.risk-item b { color: #e5e7eb; }
.risk-item .neg, .risk-strip .neg { color: #f87171 !important; }
.risk-item .pos { color: #4ade80 !important; }
.risk-item .warn, .warn-text { color: #fbbf24 !important; }
.risk-venues { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 16px; color: #64748b; font-size: .72rem; }
.bot-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.bot-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; border: 1px solid #1e293b;
    background: #0f172a; color: #cbd5e1; font-size: .8rem; font-weight: 700; text-decoration: none; }
.bot-btn:hover { border-color: #3b82f6; color: #fff; }
.bot-btn:disabled { opacity: .45; cursor: not-allowed; }
.bot-btn.danger { color: #f87171; border-color: #7f1d1d; }
.bot-btn.danger:hover { border-color: #ef4444; color: #fecaca; }
.bot-ctl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-bottom: 10px; }
.bot-ctl { display: flex; flex-direction: column; gap: 6px; background: #0f172a; border: 1px solid #1e293b; border-radius: 10px; padding: 10px 12px; }
.bot-ctl.danger { border-color: #7f1d1d; }
.bot-ctl label { font-size: .74rem; color: #94a3b8; }
.bot-ctl label b { color: #fca5a5; }
.bot-ctl .row { display: flex; gap: 6px; }
.bot-ctl input { flex: 1; min-width: 0; background: #020617; color: #e5e7eb; border: 1px solid #334155; border-radius: 6px; padding: 5px 8px; font-size: .8rem; }
.bot-ctl-msg { margin: 6px 0 10px; padding: 7px 12px; border-radius: 8px; font-size: .8rem; border: 1px solid #14532d; color: #4ade80; background: rgba(34,197,94,.07); }
.bot-ctl-msg.bad { border-color: #7f1d1d; color: #f87171; background: rgba(239,68,68,.07); }
.bot-dev-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; font-size: .8rem; }
.bot-dev { padding: 2px 10px; border-radius: 999px; font-weight: 700; border: 1px solid #1e293b; }
.bot-dev.ok { color: #4ade80; } .bot-dev.warn { color: #fbbf24; border-color: #92400e; } .bot-dev.bad { color: #f87171; border-color: #991b1b; background: rgba(239,68,68,.08); }
.admin-table tr.sig-near td { background: rgba(250, 204, 21, .08); }
.bot-notes { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.bot-note { background: #0f172a; border: 1px solid #1e293b; border-radius: 8px; padding: 8px 10px; font-size: .8rem; }
.bot-note .bot-row { display: flex; align-items: center; gap: 8px; }
.bot-note-text { margin-top: 4px; white-space: pre-wrap; color: #cbd5e1; }
.mt-note-btn { background: none; border: 0; color: #64748b; padding: 0 0 0 6px; cursor: pointer; font-size: .85rem; }
.mt-note-btn.has, .mt-note-btn:hover { color: #60a5fa; }
.mt-note-row td { background: #0b1220; padding: 8px 12px !important; text-align: left !important; white-space: normal !important; }
.mt-note-edit { display: flex; flex-direction: column; gap: 6px; }
.mt-note-edit textarea { width: 100%; background: #020617; color: #e5e7eb; border: 1px solid #334155; border-radius: 6px; padding: 6px 8px; font-size: .8rem; }
.mt-stars button { background: none; border: 0; color: #334155; font-size: 1.1rem; padding: 0 2px; cursor: pointer; }
.mt-stars button.on { color: #facc15; }
.mt-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.mt-tags button { background: #0f172a; border: 1px solid #1e293b; color: #94a3b8; border-radius: 999px; padding: 1px 9px; font-size: .72rem; cursor: pointer; }
.mt-tags button.on { border-color: #3b82f6; color: #bfdbfe; background: rgba(59,130,246,.15); }
.mt-note-actions { display: flex; justify-content: flex-end; gap: 6px; }
.view-toggle { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid #1e293b; cursor: pointer; }
.view-toggle input { margin-top: 4px; }
.view-toggle span { display: flex; flex-direction: column; }
.view-toggle small { color: #94a3b8; }
html.hide-gauge .gauge-section, html.hide-whale .whale-ribbon, html.hide-trollbox #trollbox-window { display: none !important; }
/* phone page (/m) */
.m-page { max-width: 560px; margin: 0 auto; padding: 12px 16px 40px; color: #e5e7eb; }
.m-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 10px; }
.m-head b { font-size: 1.05rem; margin-right: auto; }
.m-head .bot-light { font-size: .75rem; }
.m-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.m-kpis div { background: #0f172a; border: 1px solid #1e293b; border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.m-kpis .k { color: #94a3b8; font-size: .72rem; }
.m-kpis b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.m-page .risk-strip { border-radius: 10px; border-width: 1px 1px 1px 4px; margin-bottom: 10px; }
.m-h { font-size: .9rem; font-weight: 800; margin: 16px 0 6px; }
.m-card { background: #0f172a; border: 1px solid #1e293b; border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; font-size: .82rem; }
.m-row { display: flex; align-items: center; gap: 8px; }
.m-sub { color: #94a3b8; font-size: .74rem; margin-top: 3px; font-variant-numeric: tabular-nums; }
.m-empty { color: #64748b; font-size: .8rem; }
.m-foot { margin-top: 18px; color: #64748b; font-size: .75rem; }
.m-foot a { color: #38bdf8; }
.m-page .pos { color: #4ade80; } .m-page .neg { color: #f87171; }
@media (max-width: 760px) { .bot-two { grid-template-columns: minmax(0, 1fr); } }
.m-page .text-muted, .risk-strip .text-muted { color: #94a3b8 !important; font-size: .76rem; }
