/* ========== Quick & Easy 패널 ========== */

#quickPanel {
    position: relative;
    display: none;
    flex-direction: column;
    
    overflow: hidden;
}

.qe-content {
    padding: 0;
 /* space for fixed qe-bottom-bar */
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ========== 어카운트 섹션 (상단 고정, 3칸) ========== */
.qe-account-bar {
    padding: 6px 12px;
    background: #0a0a0f;
    position: sticky;
    top: 0;
    z-index: 10;
}

.qe-account-grid {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.qe-grid-cell {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    padding: 6px 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 10px;
}

.qe-grid-divider {
    display: none;
}

.qe-account-label {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    white-space: nowrap;
}

.qe-account-value {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.qe-account-value.positive { color: #00d4a4; }
.qe-account-value.negative { color: #ff4d5a; }

/* ========== 종목 셀렉터 ========== */
.qe-symbol-cell {
    position: relative;
}

.qe-symbol-btn {
    display: flex;
    align-items: center;
    gap: 1px;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.qe-symbol-btn:active {
    opacity: 0.7;
}

.qe-symbol-icon {
    font-size: 14px;
    line-height: 1;
    margin-right: 2px;
}

.qe-symbol-text {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.qe-symbol-arrow {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 6px;
    line-height: 1;
    transition: transform 0.2s;
    position: relative;
    top: -3px;
}

.qe-symbol-arrow.open {
    transform: rotate(180deg);
}

/* 종목 드롭다운 */
.qe-symbol-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #12121c;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    padding: 6px;
    min-width: 200px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    z-index: 100;
}

.qe-symbol-dropdown.open {
    display: block;
}

.qe-symbol-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 8px;
}

.qe-symbol-option:active {
    background: rgba(255, 255, 255, 0.08);
}

.qe-symbol-option + .qe-symbol-option {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.qe-opt-icon {
    font-size: 15px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.qe-opt-name {
    flex: 1;
}

.qe-opt-code {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.06);
    padding: 3px 7px;
    border-radius: 4px;
    border-left: none;
    margin-left: auto;
}

/* ========== 하단 고정 바 ========== */
.qe-bottom-bar {
    display: none;
    position: fixed;
    bottom: 58px;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    background: #0a0a0f;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 101;
}

/* ========== 주문섹션 (라벨 박스 내부) ========== */
.qe-order-section {
    display: flex;
    gap: 10px;
    padding: 8px 12px 6px 12px;
}

.qe-order-box {
    flex: 1;
}

.qe-order-box-inner {
    display: flex;
    align-items: center;
    width: 100%;
    height: 44px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 10px;
    overflow: hidden;
}

.qe-ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 100%;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.12s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.qe-ctrl-btn:active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: scale(0.92);
}

.qe-ctrl-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
}

.qe-ctrl-label {
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.qe-ctrl-value {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
}

/* ========== SELL / BUY 버튼 ========== */
.qe-trade-buttons {
    display: flex;
    gap: 10px;
    padding: 6px 12px 10px 12px;
}

.qe-sell-btn,
.qe-buy-btn {
    flex: 1;
    display: flex;
    align-items: center;
    height: 46px;
    padding: 0 12px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.qe-sell-btn::before,
.qe-buy-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.qe-sell-btn {
    background: linear-gradient(135deg, rgba(220,53,69,0.85) 0%, rgba(200,35,51,0.95) 100%);
    box-shadow: 0 4px 20px rgba(220,53,69,0.3), inset 0 1px 0 rgba(255,255,255,0.12);
}

.qe-buy-btn {
    background: linear-gradient(135deg, rgba(0,212,164,0.85) 0%, rgba(0,163,131,0.95) 100%);
    box-shadow: 0 4px 20px rgba(0,184,148,0.3), inset 0 1px 0 rgba(255,255,255,0.12);
}

.qe-sell-btn:active,
.qe-buy-btn:active {
    transform: scale(0.97);
}

.qe-btn-arrow { flex-shrink: 0; }

.qe-btn-title {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 2px;
    color: #ffffff;
    flex: 1;
    text-align: center;
}

.qe-sell-btn .qe-btn-title {
    margin-left: -6px;
}

.qe-buy-btn .qe-btn-title {
    margin-right: -6px;
}

.qe-btn-payout {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
}


/* ========== 호가 오버레이 (차트 위) ========== */
.qe-quote-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    pointer-events: none;
    padding: 8px 10px;
}

.qe-quote-bar {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.qe-quote-price {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.5px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.qe-quote-change {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.qe-change-value {
    font-size: 13px;
    font-weight: 600;
    color: #00d4a4;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.qe-change-pct {
    font-size: 13px;
    font-weight: 600;
    color: #00d4a4;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.qe-change-value.negative,
.qe-change-pct.negative {
    color: #ff4d5a;
}

/* 종목 정보 바 */
.qe-quote-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.qe-info-symbol {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
}

.qe-info-dot {
    color: rgba(255, 255, 255, 0.5);
}

.qe-info-category {
    font-weight: 500;
}

.qe-info-status {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #00d4a4;
    margin-left: 2px;
    box-shadow: 0 0 4px rgba(0, 212, 164, 0.5);
}

/* ========== 틱차트 영역 ========== */
.qe-chart-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
    margin: 0;
    min-height: 0;
    width: 100%;
}

.qe-chart-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* ========== 현재가 펄스 마커 ========== */
.qe-pulse-marker {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #00d2ff;
    z-index: 10;
    pointer-events: none;
    left: 0;
    top: 0;
    will-change: transform;
}

.qe-pulse-marker::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(0, 210, 255, 0.4);
    transform: translate(-50%, -50%);
    animation: qePulse 1.5s ease-out infinite;
}

@keyframes qePulse {
    0% {
        width: 7px;
        height: 7px;
        opacity: 0.6;
    }
    100% {
        width: 22px;
        height: 22px;
        opacity: 0;
    }
}


/* ========== 포지션 활성화 뷰 ========== */
.qe-position-view {
    display: none;
}

.qe-position-info {
    display: flex;
    justify-content: space-between;
    padding: 0;
    margin: 8px 12px 6px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    height: 45px;
    align-items: center;
}

.qe-pos-col {
    flex: 1;
    text-align: center;
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    position: relative;
}
.qe-pos-col + .qe-pos-col::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: rgba(255, 255, 255, 0.12);
}

.qe-pos-label {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 3px;
}

.qe-pos-value {
    font-size: clamp(14px, 4vw, 17px);
    font-weight: bold;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
    font-family: "Orbitron", sans-serif;
}

.qe-pos-value.buy-type {
    color: var(--buy-color, #00b450);
}

.qe-pos-value.sell-type {
    color: var(--sell-color, #dc3246);
}

/* CLOSE TRADE 버튼 */
.qe-close-section {
    padding: 6px 12px 10px 12px;
    display: flex;
    gap: 10px;
}

.qe-close-btn {
    flex: 1;
    height: 45px;
    border: none;
    border-radius: 12px;
    font-size: clamp(15px, 4.5vw, 18px);
    font-weight: 900;
    letter-spacing: clamp(1px, 0.5vw, 2px);
    color: #ffffff;
    background: linear-gradient(135deg, #5a9ee0 0%, #4080c0 100%);
    box-shadow: 0 4px 20px rgba(74,144,217,0.5);
    cursor: pointer;
    transition: all 0.2s;
    font-family: "Orbitron", sans-serif;
}

.qe-close-btn:active {
    transform: scale(0.98);
}
.qe-close-btn:hover {
    transform: scale(1.02);
}

/* ========== Target / Lot Picker Popup ========== */
.qe-picker-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}
.qe-picker-overlay.show {
    display: flex;
}

.qe-picker-modal {
    width: 100%;
    max-width: 340px;
    background: linear-gradient(165deg, #1e2230 0%, #161a24 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 212, 255, 0.06);
    animation: qePickerIn 0.2s ease-out;
}
@keyframes qePickerIn {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.qe-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.qe-picker-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--accent-cyan, #00d4ff);
    text-transform: uppercase;
}
.qe-picker-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
}
.qe-picker-close:active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: scale(0.9);
}

/* Grid: 3열 2행 */
.qe-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 4px;
}

.qe-picker-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 56px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.qe-picker-card:active {
    transform: scale(0.95);
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.4);
}
.qe-picker-card.selected {
    background: rgba(0, 212, 255, 0.12);
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
}

.qe-picker-card-value {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}
.qe-picker-card.selected .qe-picker-card-value {
    color: var(--accent-cyan, #00d4ff);
}

/* 직접입력 카드 */
.qe-picker-card.custom-card {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.12);
}
.qe-picker-card.custom-card .qe-picker-card-value {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.5px;
}

/* 직접입력 영역 */
.qe-picker-custom {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    animation: qePickerIn 0.15s ease-out;
}
.qe-picker-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    height: 44px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 10px;
    padding: 0 12px;
    gap: 4px;
}
.qe-picker-input-prefix {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-cyan, #00d4ff);
}
.qe-picker-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    font-family: inherit;
    width: 100%;
    -moz-appearance: textfield;
}
.qe-picker-input::-webkit-outer-spin-button,
.qe-picker-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.qe-picker-confirm {
    height: 44px;
    padding: 0 20px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 212, 255, 0.1));
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 10px;
    color: var(--accent-cyan, #00d4ff);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.qe-picker-confirm:active {
    transform: scale(0.95);
    background: rgba(0, 212, 255, 0.3);
}

/* qeCtrlCenter 터치 커서 */
.qe-ctrl-center.touchable {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.qe-ctrl-center.touchable:active {
    opacity: 0.7;
}
