:root {
    --bg: #000;
    --panel: #0a0a0a;
    --line: #1c2623;
    --amber: #22ab94;              /* TradingView Signature Teal Green */
    --amber-dim: #135d51;          /* Dim Teal Border */
    --mint-glow: rgba(34, 171, 148, 0.45);
    --mint-bg: rgba(34, 171, 148, 0.08);
    --text: #e8e8e8;
    --muted: #8b8b8b;
    --flat: #c8c8c8;
    --up: #ace5dc;                 /* Binance/OKX Crisp Emerald Bullish */
    --dn: #e65100;                 /* Binance/OKX Crisp Crimson Bearish */
    --up-rgb: 172, 229, 220;
    --dn-rgb: 230, 81, 0;
}
body.color-kr, body { --up: #ace5dc; --dn: #e65100; --up-rgb: 172, 229, 220; --dn-rgb: 230, 81, 0; }
/* unified palette */

* { box-sizing: border-box; margin: 0; padding: 0; }
button, input, select, textarea { font-family: inherit; box-sizing: border-box; }
button {
    background: #111a16;
    color: #ccc;
    border: 1px solid #1f2e27;
    border-radius: 2px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
button:hover {
    background: #182821;
    color: #fff;
    border-color: #2a4338;
}

html, body { height: 100%; background: var(--bg); color: var(--text); }
body {
    font-family: 'JetBrains Mono', 'Noto Sans KR', monospace;
    font-size: 12px;
    overflow: hidden;
    font-variant-numeric: tabular-nums;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #050505; }
::-webkit-scrollbar-thumb { background: #1c2824; }
::-webkit-scrollbar-thumb:hover { background: var(--amber-dim); }

#app { display: flex; flex-direction: column; height: 100vh; }
.mob-tabbar { display: none; }
.up { color: var(--up); }
.dn { color: var(--dn); }
.flat { color: var(--flat); }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 14px; text-align: center; font-family: 'Noto Sans KR', sans-serif; }

/* ---------- Top bar ---------- */
.topbar {
    display: flex; align-items: center; gap: 18px;
    height: 34px; padding: 0 12px;
    background: #09110e; border-bottom: 1px solid var(--line);
    white-space: nowrap; overflow: hidden; flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 7px; font-weight: 700; color: var(--amber); letter-spacing: 0.5px; user-select: none; cursor: pointer; transition: filter .15s ease, transform .15s ease; }
.brand:hover { filter: brightness(1.15); transform: translateY(-0.5px); }
.brand:active { transform: scale(0.97); }
.brand-icon {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    background: #000000;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

    .brand-logo {
        background: transparent !important;
        color: #22ab94 !important;
        padding: 0 !important;
        border: none !important;
        font-weight: 800 !important;
        font-size: 14.5px !important;
        letter-spacing: 1.2px !important;
        font-family: 'Cinzel', serif !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

.brand-edition {
    font-size: 8.5px; font-weight: 800; letter-spacing: 1.2px; color: #22ab94;
    border: 1px solid rgba(34, 171, 148, 0.6); padding: 1px 5px; border-radius: 2px;
    background: rgba(34, 171, 148, 0.12); font-family: 'JetBrains Mono', monospace;
}
.brand-sub { font-family: 'Noto Sans KR', sans-serif; color: var(--muted); font-weight: 500; font-size: 11px; margin-left: 4px; letter-spacing: -0.2px; }
.clocks span { margin-right: 12px; color: var(--muted); }
.clocks b { color: var(--text); font-weight: 500; margin-left: 4px; }
.sessions .ss { margin-right: 10px; color: var(--muted); }
.ss i { font-style: normal; padding: 1px 5px; border-radius: 2px; font-size: 10px; margin-left: 4px; font-family: 'Noto Sans KR', sans-serif; }
.ss .open { background: #0d3621; color: #34d399; }
.ss .pre { background: #0c2b24; color: #22ab94; }
.ss .closed { background: #222; color: #888; }
.conn { margin-left: auto; color: var(--muted); display: flex; align-items: center; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #555; margin: 0 4px 0 10px; }
.dot.on { background: #22ab94; box-shadow: 0 0 6px #22ab94; }
.dot.off { background: #ef4444; }
.toplink { color: var(--amber); text-decoration: none; border: 1px solid var(--amber-dim); padding: 2px 8px; font-size: 11px; margin-left: 12px; font-family: 'Noto Sans KR', sans-serif; }
.toplink:hover { background: var(--amber); color: #000; }

/* ---------- Command bar ---------- */
.cmdbar {
    display: flex; align-items: center; gap: 8px;
    height: 32px; padding-left: 10px;
    background: #000; border-bottom: 1px solid var(--line);
    position: relative; flex-shrink: 0;
}
.cmd-prompt { color: var(--amber); font-weight: 700; text-shadow: 0 0 6px var(--mint-glow); }
#cmd {
    flex: 1; min-width: 120px; background: transparent; border: 0; outline: 0;
    color: #a0ece0; font: inherit; font-size: 13px; caret-color: var(--amber);
}
#cmd::placeholder { color: #204c40; font-family: 'Noto Sans KR', sans-serif; }
.fkeys { display: flex; gap: 3px; padding-right: 8px; }
.fkeys button {
    background: #22ab94; color: #000; border: 0; cursor: pointer; border-radius: 2px;
    font: 700 11px 'Noto Sans KR', sans-serif; padding: 3px 8px; box-shadow: 0 0 8px rgba(34, 171, 148, 0.3);
}
.fkeys button:hover { background: #2ed6ba; }
.fkeys button.alt { background: #0c201b; color: #a0ece0; border: 1px solid var(--amber-dim); }
.fkeys button.alt:hover { background: #13332b; }
.cmd-suggest {
    position: absolute; top: 31px; left: 22px; min-width: 380px; z-index: 60;
    background: #0b1714; border: 1px solid var(--amber-dim); display: none;
}
.cmd-suggest.show { display: block; }
.sg { padding: 5px 10px; display: flex; gap: 12px; cursor: pointer; }
.sg.sel, .sg:hover { background: #0e2920; }
.sg .k { color: var(--amber); min-width: 64px; }
.sg .d { color: var(--muted); font-family: 'Noto Sans KR', sans-serif; }

/* ---------- Ticker tape ---------- */
.tape { height: 24px; overflow: hidden; border-bottom: 1px solid var(--line); background: #050505; white-space: nowrap; flex-shrink: 0; }
.tape-inner { display: inline-block; animation: tape 70s linear infinite; }
.tape:hover .tape-inner { animation-play-state: paused; }
@keyframes tape { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ti { display: inline-block; padding: 0 16px; line-height: 24px; border-right: 1px solid #1a1a1a; cursor: pointer; }
.ti b { color: var(--amber); margin-right: 6px; font-weight: 500; }

/* ---------- Grid ---------- */
.grid {
    flex: 1; min-height: 0; display: grid; gap: 3px; padding: 3px;
    grid-template-columns: 330px minmax(0, 0.92fr) minmax(0, 0.98fr) 365px;
    grid-template-rows: minmax(0, 1.45fr) minmax(0, 0.50fr) minmax(0, 1.05fr);
    grid-template-areas:
        "mon main main ob"
        "mon main main ts"
        "heat kimp fx fx";
}
.p-monitor { grid-area: mon; }
.p-main { grid-area: main; }
.p-ob { grid-area: ob; }
.p-ts { grid-area: ts; }
.p-heat { grid-area: heat; }
.p-kimp { grid-area: kimp; }
.p-fx { grid-area: fx; }

.panel {
    background: var(--panel); border: 1px solid var(--line);
    display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative;
    overflow: hidden;
}
.panel.flash { animation: pflash 1.4s; }
@keyframes pflash { 0%, 60% { box-shadow: 0 0 0 2px var(--amber); } 100% { box-shadow: none; } }
.panel.maxed { position: fixed; inset: 92px 6px 26px 6px; z-index: 40; }
.ph {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    height: 24px; padding: 0 8px; flex-shrink: 0;
    background: var(--hdr); border-bottom: 1px solid var(--line); user-select: none;
}
.pt { color: var(--amber); font-weight: 700; font-size: 11px; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt .num { background: var(--amber); color: #000; padding: 0 4px; margin-right: 6px; }
.pt .ko { font-family: 'Noto Sans KR', sans-serif; color: #a0ece0; font-weight: 500; margin-left: 6px; }
.pmeta { color: var(--muted); font-size: 10.5px; font-family: 'Noto Sans KR', sans-serif; white-space: nowrap; }
.tabs { display: flex; gap: 2px; flex-shrink: 0; }
.tabs button {
    background: transparent; border: 1px solid #222e28; color: var(--muted); cursor: pointer;
    font: 500 10.5px 'Noto Sans KR', sans-serif; padding: 1px 7px;
}
.tabs button.on { border-color: var(--amber); color: #000; background: var(--amber); font-weight: 700; }
.tabs button:hover:not(.on) { color: var(--text); border-color: #3e5c4e; }
.pb { flex: 1; min-height: 0; overflow: auto; }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
    position: sticky; top: 0; z-index: 1; background: #0c120f; color: var(--muted);
    font: 500 10.5px 'Noto Sans KR', sans-serif; text-align: right;
    padding: 4px 6px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 3px 6px; text-align: right; border-bottom: 1px solid #131313; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: #111a16; }
.tbl tr.sel { background: #082820 !important; }
.tbl tr.whale td { font-weight: 700; background: rgba(34, 171, 148, .08); }
.nm { font-family: 'Noto Sans KR', sans-serif; font-weight: 500; }
.nm small { color: var(--muted); font-family: 'JetBrains Mono', monospace; margin-left: 4px; font-size: 10px; font-weight: 400; }
.star { color: #3a3a3a; cursor: pointer; margin-right: 5px; }
.star.on { color: var(--amber); }
.warn { background: #a16207; color: #fff; font: 500 9px 'Noto Sans KR', sans-serif; padding: 0 3px; margin-left: 4px; border-radius: 2px; vertical-align: 1px; }
.fl-up { animation: flu .9s; }
.fl-dn { animation: fld .9s; }
@keyframes flu { from { background: rgba(var(--up-rgb), .35); } to { background: transparent; } }
@keyframes fld { from { background: rgba(var(--dn-rgb), .35); } to { background: transparent; } }

/* ---------- Security header ---------- */
.sec-head {
    display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 22px;
    padding: 8px 10px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.sh-name { font: 700 15px 'Noto Sans KR', sans-serif; }
.sh-name small { color: var(--muted); font: 400 11px 'JetBrains Mono', monospace; margin-left: 6px; }
.sh-price { font-size: 28px; font-weight: 700; line-height: 1.15; }
.sh-price em { font-style: normal; font-size: 11px; color: var(--muted); margin-left: 6px; font-weight: 400; }
.sh-chg { font-size: 13px; }
.sh-chg .muted { font-family: 'Noto Sans KR', sans-serif; font-size: 11px; margin-left: 4px; }
.sh-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px 16px; align-self: center; }
.st { display: flex; justify-content: space-between; gap: 6px; border-bottom: 1px dotted #222; padding: 2px 0; }
.st span { color: var(--muted); font: 400 10.5px 'Noto Sans KR', sans-serif; white-space: nowrap; }
.st b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-wrap {
    flex: 1;
    min-height: 0;
    position: relative;
    cursor: crosshair;
    overflow: hidden;
    width: 100%;
}
#chart {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Center-Anchored Fixed-Pivot Orderbook (현재가 중심 고정 축) ---------- */
#ob-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.ob-ask-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    min-height: 0;
}
.ob-center-pivot {
    height: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    background: #09130f;
    border-top: 1px solid #1a3328;
    border-bottom: 1px solid #1a3328;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.7);
    z-index: 5;
}
.ob-pivot-left {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
}
.ob-pivot-mid {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ob-pivot-price {
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: -0.2px;
}
.ob-pivot-arrow {
    font-size: 11px;
    font-weight: 900;
}
.ob-pivot-right {
    font-size: 9.5px;
    color: var(--muted);
}
.ob-bid-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    min-height: 0;
}

/* ---------- Order book rows ---------- */
.obr { display: grid; grid-template-columns: 1fr 1.15fr 1fr; height: 19px; align-items: center; border-bottom: 1px solid #0e0e0e; }
.c-sz { position: relative; padding: 0 6px; font-size: 11px; height: 100%; display: flex; align-items: center; overflow: hidden; }
.c-sz i { position: absolute; top: 2px; bottom: 2px; opacity: .28; }
.c-sz em { position: relative; font-style: normal; }
.ask .c-sz { justify-content: flex-end; }
.ask .c-sz i { right: 0; background: var(--dn); }
.bid .c-sz { justify-content: flex-start; }
.bid .c-sz i { left: 0; background: var(--up); }
.c-p { display: flex; justify-content: space-between; align-items: center; gap: 4px; padding: 0 8px; height: 100%; font-weight: 700; }
.c-p small { font-weight: 400; font-size: 10px; }
.obr.ask .c-p { background: rgba(var(--dn-rgb), .07); }
.obr.bid .c-p { background: rgba(var(--up-rgb), .07); }
.obr.cur .c-p { outline: 1px solid var(--amber); outline-offset: -1px; }
.c-info { font: 400 10px 'Noto Sans KR', sans-serif; color: var(--muted); padding: 0 6px; display: flex; justify-content: space-between; }
.c-info b { color: var(--text); font: 400 10px 'JetBrains Mono', monospace; }
.c-mt { font-size: 10.5px; padding: 0 6px; display: flex; justify-content: space-between; }
.ob-foot { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: center; height: 24px; border-top: 1px solid var(--line); font-size: 11px; flex-shrink: 0; }
.ob-foot > div { padding: 0 6px; }
.ob-foot .r { text-align: right; }
.ratio { height: 6px; background: rgba(var(--dn-rgb), .65); position: relative; }
.ratio i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--up); }
.ratio-l { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--muted); margin-top: 1px; }

/* ---------- Heatmap ---------- */
#heat { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.ht {
    position: absolute; box-shadow: inset 0 0 0 1px #000; overflow: hidden; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); transition: background-color .6s;
    line-height: 1.15;
}
.ht b { font-weight: 700; }
.ht span { opacity: .95; }
.ht:hover { box-shadow: inset 0 0 0 2px var(--amber); }
.ht.sel { box-shadow: inset 0 0 0 2px #fff; }

/* ---------- Kimchi premium ---------- */
.kchips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.kc { padding: 4px 8px; border-right: 1px solid #161616; min-height: 46px; display: flex; flex-direction: column; justify-content: center; }
.kc:last-child { border-right: 0; }
.kc span { display: block; font: 500 10px 'Noto Sans KR', sans-serif; color: var(--muted); }
.kc b { font-size: 13.5px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.p-kimp .tbl th, .p-kimp .tbl td { padding: 4px 6px; font-size: 10.5px; }

/* ---------- FX & signals ---------- */
.fx-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; flex-shrink: 0; border-bottom: 1px solid var(--line); }
.fx { padding: 5px 8px; border-bottom: 1px solid #141414; border-right: 1px solid #141414; }
.fx span { display: block; color: var(--muted); font: 400 10px 'Noto Sans KR', sans-serif; }
.fx b { font-size: 13.5px; font-weight: 500; }
.fx small { font-size: 10px; margin-left: 4px; }
.fx-src { padding: 3px 8px; color: #5f5f5f; font: 400 9.5px 'Noto Sans KR', sans-serif; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.subh { display: flex; justify-content: space-between; align-items: center; height: 22px; padding: 0 8px; background: #101010; border-bottom: 1px solid var(--line); color: var(--amber); font-size: 10.5px; font-weight: 700; flex-shrink: 0; }
.subh .pmeta { font-weight: 400; }
.sig { padding: 3px 8px; border-bottom: 1px solid #121212; font: 400 11px 'Noto Sans KR', sans-serif; line-height: 1.45; }
.sig[data-code] { cursor: pointer; }
.sig[data-code]:hover { background: #151515; }
.sig time { color: var(--muted); font-family: 'JetBrains Mono', monospace; margin-right: 6px; font-size: 10.5px; }
.sig.sys { color: #9ca3af; }
.sig.alert { color: #22ab94; font-weight: 700; }
.sig.prmanr-long { color: var(--up); font-weight: 700; background: rgba(var(--up-rgb), 0.1); border-left: 3px solid var(--up); }
.sig.prmanr-short { color: var(--dn); font-weight: 700; background: rgba(var(--dn-rgb), 0.1); border-left: 3px solid var(--dn); }

/* ---------- Status bar ---------- */
.statusbar {
    display: flex; justify-content: space-between; gap: 16px; align-items: center;
    height: 22px; padding: 0 10px; background: #090e0c; border-top: 1px solid var(--line);
    color: #6b6b6b; font: 400 10.5px 'Noto Sans KR', sans-serif; white-space: nowrap; overflow: hidden; flex-shrink: 0;
}
.statusbar kbd { background: #0f261f; color: #22ab94; padding: 0 4px; border-radius: 2px; font-family: 'JetBrains Mono', monospace; font-size: 10px; border: 1px solid rgba(34, 171, 148, 0.25); }

/* ---------- Modal & toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .82); z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.mbox { background: #081512; border: 1px solid var(--amber); box-shadow: 0 0 20px rgba(34, 171, 148, 0.25); width: min(780px, 94vw); max-height: 86vh; overflow: auto; }
.mbox .ph { position: sticky; top: 0; }
.mclose { background: none; border: 0; color: var(--amber); cursor: pointer; font-size: 14px; }
.help-tbl td { padding: 5px 10px; font-family: 'Noto Sans KR', sans-serif; }
.help-tbl td:first-child { color: #22ab94; font-family: 'JetBrains Mono', monospace; white-space: nowrap; }
.help-note { padding: 10px 12px; color: var(--muted); font: 400 11px/1.6 'Noto Sans KR', sans-serif; border-top: 1px solid var(--line); }
.toast {
    position: fixed; right: 14px; bottom: 34px; z-index: 120; max-width: 360px;
    background: #08241d; border: 1px solid var(--amber); color: #a0ece0;
    padding: 9px 12px; font: 500 12px 'Noto Sans KR', sans-serif;
    box-shadow: 0 0 14px rgba(34, 171, 148, 0.35);
    opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 1400px) {
    .grid {
        grid-template-columns: 270px minmax(0, 1fr) minmax(240px, 0.85fr) 320px;
        grid-template-areas:
            "mon main main ob"
            "mon main main ts"
            "heat kimp fx fx";
    }
    .clocks span:nth-child(n+3) { display: none; }
}
@media (max-width: 900px) {
    html, body {
        overflow: hidden !important;
        height: 100% !important;
        height: 100dvh !important;
        -webkit-text-size-adjust: 100%;
    }
    #app {
        height: 100% !important;
        height: 100dvh !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        position: relative;
    }

    /* Compact Top Bar */
    .topbar {
        height: 38px !important;
        padding: 0 8px !important;
        gap: 6px !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        flex-shrink: 0 !important;
    }
    .topbar::-webkit-scrollbar { display: none; }
    .brand-logo { font-size: 14px !important; padding: 2px 8px !important; }
    .brand-sub, .clocks, .sessions { display: none !important; }
    .macro-badges {
        display: flex !important;
        gap: 4px !important;
        align-items: center;
        flex-shrink: 0;
    }
    .macro-item {
        font-size: 9.5px !important;
        padding: 2px 5px !important;
    }
    .conn {
        margin-left: auto;
        gap: 4px !important;
        font-size: 10px !important;
        flex-shrink: 0;
    }
    .conn .dot { width: 5px !important; height: 5px !important; margin: 0 2px 0 4px !important; }
    .top-btn {
        padding: 2px 6px !important;
        font-size: 9.5px !important;
        height: 22px !important;
        margin-right: 2px !important;
    }
    #top-grid-btn, #top-sound-btn, #top-snap-btn, #top-report-btn { display: none !important; }
    #top-auth-btn { display: inline-flex !important; align-items: center; font-weight: 700 !important; }

    /* Compact Command Bar */
    .cmdbar {
        height: 32px !important;
        padding: 0 6px !important;
        gap: 4px !important;
        flex-shrink: 0 !important;
    }
    .cmd-prompt { font-size: 12px !important; }
    #cmd {
        font-size: 11.5px !important;
        padding: 2px 6px !important;
    }
    .cmd-suggest {
        left: 6px !important;
        right: 6px !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
    .fkeys {
        display: flex !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 2px !important;
        flex-shrink: 0 !important;
        max-width: 48% !important;
    }
    .fkeys::-webkit-scrollbar { display: none; }
    .fkeys button {
        padding: 2px 5px !important;
        font-size: 9.5px !important;
        height: 22px !important;
    }

    /* Ticker Tape */
    .tape {
        height: 20px !important;
        font-size: 10px !important;
        flex-shrink: 0 !important;
    }
    .ti {
        padding: 0 10px !important;
        line-height: 20px !important;
    }

    /* Fixed Mobile Bottom Tab Bar - Sleek Institutional Terminal Design */
    .mob-tabbar {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 48px !important;
        background: #090e0c !important;
        border-top: 1px solid #1c2621 !important;
        z-index: 100 !important;
        justify-content: space-around !important;
        align-items: center !important;
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.7) !important;
    }
    .mob-tab-btn {
        flex: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 100% !important;
        background: transparent !important;
        border: none !important;
        border-top: 2px solid transparent !important;
        color: #7b8e85 !important;
        cursor: pointer !important;
        padding: 0 4px !important;
        transition: all .15s ease !important;
        -webkit-tap-highlight-color: transparent !important;
    }
    .mob-tab-btn .mob-txt {
        font: 700 12px 'Noto Sans KR', sans-serif !important;
        letter-spacing: -0.2px !important;
    }
    .mob-tab-btn.active {
        color: #ffffff !important;
        border-top-color: #ff3b30 !important;
        background: linear-gradient(180deg, rgba(255, 59, 48, 0.12) 0%, transparent 100%) !important;
    }

    /* Mobile Segmented View Layout */
    .grid {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
        min-height: 0 !important;
        padding: 2px 2px calc(50px + env(safe-area-inset-bottom, 0px)) 2px !important;
        overflow: hidden !important;
        grid-template-columns: none !important;
        grid-template-rows: none !important;
        grid-template-areas: none !important;
        gap: 2px !important;
    }
    .grid .panel {
        display: none !important;
        width: 100% !important;
        height: 100% !important;
        flex: 1 !important;
        min-height: 0 !important;
        border-radius: 2px !important;
    }

    /* TAB 1: 시세 (mob-view-mon) - 김프 & 도미넌스 상단 + 전체 시세 하단 */
    .grid.mob-view-mon .p-kimp { display: flex !important; order: 1 !important; }
    .grid.mob-view-mon .p-monitor,
    .grid:not([class*="mob-view-"]) .p-monitor { display: flex !important; order: 2 !important; }

    /* TAB 2: 차트 (mob-view-main) - 차트 상단 + 하단 포지션 & 미체결 */
    .grid.mob-view-main .p-main { display: flex !important; order: 1 !important; }
    .grid.mob-view-main .p-fx { display: flex !important; order: 2 !important; }

    /* TAB 3: 호가 (mob-view-ob) - 전면 호가창 + 하단 호가 주문패드 */
    .grid.mob-view-ob .p-ob { display: flex !important; order: 1 !important; }
    .grid.mob-view-ob .p-ts { display: none !important; }

    /* Panel Maxed on Mobile */
    .panel.maxed {
        position: fixed !important;
        inset: 0 0 calc(52px + env(safe-area-inset-bottom, 0px)) 0 !important;
        z-index: 50 !important;
    }

    /* Security Header Responsive */
    .sec-head {
        display: flex !important;
        flex-direction: column !important;
        gap: 3px !important;
        padding: 5px 8px !important;
        border-bottom: 1px solid var(--line) !important;
        flex-shrink: 0 !important;
    }
    .sec-head > div:first-child {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: baseline !important;
        justify-content: space-between !important;
        gap: 2px 8px !important;
    }
    .sh-name {
        width: 100% !important;
        font-size: 13px !important;
        line-height: 1.2 !important;
    }
    .sh-name small {
        font-size: 9.5px !important;
    }
    .sh-price {
        font-size: 19px !important;
        line-height: 1.15 !important;
    }
    .sh-chg {
        font-size: 11px !important;
    }
    .sh-stats {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 1px 8px !important;
        width: 100% !important;
        padding-top: 2px !important;
        border-top: 1px dotted #1d2c25 !important;
    }
    /* Hide 52주 최고/최저, 전일종가, 체결강도 on mobile to conserve 40px of canvas height */
    .sh-stats .st:nth-child(n+5) {
        display: none !important;
    }
    .st {
        padding: 1px 0 !important;
    }
    .st span {
        font-size: 9px !important;
    }
    .st b {
        font-size: 9.5px !important;
    }

    /* Horizontal Touch Scrolling Toolbars */
    .chart-subbar {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 4px 6px !important;
        gap: 4px !important;
        flex-shrink: 0 !important;
        justify-content: space-between !important;
    }
    .chart-subbar::-webkit-scrollbar { display: none; }
    .chart-ind-group {
        display: flex !important;
        gap: 4px !important;
        flex-shrink: 0 !important;
        align-items: center !important;
    }
    .chart-meta-group {
        display: flex !important;
        gap: 3px !important;
        flex-shrink: 0 !important;
        margin-left: 4px !important;
    }
    /* Mobile Indicators: Show PRMANR AI, 하모닉, 엘리엇, 피보나치, and RESET */
    .chart-subbar #btn-ind-rsi,
    .chart-subbar #btn-ind-ha {
        display: none !important;
    }
    .chart-subbar #prmanr-status-badge {
        display: none !important;
    }
    #btn-ind-prmanr {
        font-size: 10.5px !important;
        padding: 3px 8px !important;
        height: 24px !important;
    }
    #btn-ind-harmonic,
    #btn-ind-elliott,
    #btn-ind-fibo {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 10px !important;
        padding: 2px 7px !important;
        height: 24px !important;
        white-space: nowrap !important;
    }
    #btn-chart-reset {
        font-size: 10px !important;
        padding: 3px 8px !important;
        height: 24px !important;
    }
    .ind-btn {
        font-size: 10px !important;
        padding: 2px 7px !important;
        height: 24px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
    .chart-badge {
        font-size: 9.5px !important;
        padding: 2px 6px !important;
        height: 22px !important;
    }
    .chart-hdr-tools #tf-tabs {
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .chart-hdr-tools #tf-tabs::-webkit-scrollbar { display: none; }
    .chart-hdr-tools #tf-tabs button {
        padding: 2px 6px !important;
        font-size: 10px !important;
    }

    /* Chart Canvas Touch Handling */
    .chart-wrap {
        flex: 1 !important;
        min-height: 180px !important;
        width: 100% !important;
        position: relative !important;
        touch-action: none !important;
    }
    #chart {
        touch-action: none !important;
        user-select: none !important;
        -webkit-user-select: none !important;
    }

    /* Touch-friendly Trade Pad */
    .trade-pad {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
        height: auto !important;
        padding: 5px 6px !important;
        background: #09120e !important;
        border-top: 1px solid var(--line) !important;
        flex-shrink: 0 !important;
    }
    .tp-wallet {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        font-size: 10px !important;
        border-bottom: 1px dotted #1d2a23 !important;
        padding-bottom: 3px !important;
    }
    .tp-inputs {
        display: flex !important;
        align-items: center !important;
        gap: 3px !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 2px 0 !important;
    }
    .tp-inputs::-webkit-scrollbar { display: none; }
    .tp-type-btn {
        height: 26px !important;
        padding: 0 7px !important;
        font-size: 10px !important;
    }
    .tp-chips button {
        height: 26px !important;
        padding: 0 6px !important;
        font-size: 10px !important;
    }
    #tp-amount-input {
        height: 26px !important;
        width: 80px !important;
        font-size: 11px !important;
    }
    .tp-act {
        height: 26px !important;
        padding: 0 8px !important;
        font-size: 10px !important;
        flex-shrink: 0 !important;
    }

    /* Monitor Category Bar */
    .mon-cat-bar {
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 4px 6px !important;
        gap: 3px !important;
    }
    .mon-cat-bar::-webkit-scrollbar { display: none; }
    .mon-cat-bar button {
        padding: 2px 7px !important;
        font-size: 9.5px !important;
    }

    /* Tables & Orderbook Rows Compact */
    .tbl th, .tbl td {
        padding: 4px 4px !important;
        font-size: 10.5px !important;
    }
    .nm small {
        display: block !important;
        margin-left: 0 !important;
        font-size: 9px !important;
    }
    .obr {
        font-size: 10px !important;
        min-height: 18px !important;
    }
    .obr .c-info { font-size: 9px !important; }
    .obr .c-p { font-size: 10px !important; }

    /* Kimchi Premium Panel Mobile */
    .p-kimp .pb {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .p-kimp .tbl th, .p-kimp .tbl td {
        padding: 3px 3px !important;
        font-size: 9.5px !important;
    }
    .kchips {
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 4px 6px !important;
        gap: 4px !important;
    }
    .kchips::-webkit-scrollbar { display: none; }

    /* Modals & Statusbar */
    .mbox {
        width: 95vw !important;
        max-height: 90vh !important;
    }
    .statusbar {
        display: none !important;
    }
}

/* ---------- Enhanced Upgrades (v2.0) ---------- */
.macro-badges { display: flex; gap: 8px; align-items: center; }
.macro-item {
    font-size: 10.5px; color: var(--muted); background: #141414; border: 1px solid #242424;
    padding: 2px 7px; border-radius: 2px; white-space: nowrap; font-family: 'Noto Sans KR', sans-serif;
}
.macro-item b { color: var(--text); margin-left: 3px; font-family: 'JetBrains Mono', monospace; }
.top-btn {
    background: #121815; color: #bbb; border: 1px solid #24332c; font: 500 10.5px 'Noto Sans KR', sans-serif;
    padding: 2px 8px; border-radius: 2px; cursor: pointer; transition: all .2s; margin-right: 4px;
}
.top-btn:hover { background: #1a2a22; color: #fff; border-color: var(--amber); }
.top-btn.on { background: #08261e; color: var(--amber); border-color: var(--amber); }
.top-btn.grid-btn { background: #08241d; color: #a0ece0; border-color: var(--amber-dim); font-weight: 700; }
.top-btn.grid-btn:hover { background: var(--amber); color: #000; box-shadow: 0 0 8px var(--mint-glow); }

/* Chart Header Tools & Return Grid Button */
.chart-hdr-tools { display: flex; align-items: center; gap: 8px; }
.back-grid-btn {
    background: #08241d; border: 1px solid var(--amber-dim); color: #a0ece0; cursor: pointer;
    font: 700 10.5px 'Noto Sans KR', sans-serif; padding: 1px 8px; border-radius: 2px;
    transition: all .2s; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px;
}
.back-grid-btn:hover { background: var(--amber); color: #000; border-color: var(--amber); box-shadow: 0 0 8px var(--mint-glow); }
.panel.maxed .back-grid-btn { background: var(--amber); color: #000; animation: pulse-glow 1.2s infinite alternate; }
@keyframes pulse-glow { from { box-shadow: 0 0 4px var(--amber); } to { box-shadow: 0 0 14px var(--amber); } }

/* Monitor Search */
.mon-search-bar {
    display: flex; align-items: center; background: #0a110e; border-bottom: 1px solid var(--line);
    padding: 3px 8px; gap: 6px; flex-shrink: 0;
}
.search-icon { color: var(--muted); font-size: 11px; }
#mon-search {
    flex: 1; background: transparent; border: 0; outline: 0; color: #fff;
    font: 400 11px 'Noto Sans KR', sans-serif;
}
#mon-search::placeholder { color: #3b5247; }
.search-clear-btn {
    background: none; border: 0; color: #666; cursor: pointer; font-size: 11px;
    display: none; padding: 0 4px;
}
.search-clear-btn.show { display: inline-block; }
.search-clear-btn:hover { color: #fff; }

/* Chart Subbar */
.chart-subbar {
    display: flex; justify-content: space-between; align-items: center;
    height: 27px; padding: 0 8px; background: #090f0c; border-bottom: 1px solid var(--line);
    flex-shrink: 0; overflow-x: auto; white-space: nowrap; gap: 6px;
}
.chart-subbar::-webkit-scrollbar { display: none; }
.chart-ind-group { display: flex; gap: 4px; align-items: center; flex-shrink: 0; white-space: nowrap; }
.ind-btn {
    background: #111a16; border: 1px solid #23332b; color: #888; cursor: pointer;
    font: 600 10px 'Noto Sans KR', 'JetBrains Mono', monospace; padding: 2px 8px; border-radius: 2px;
    white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    height: 21px; line-height: 1;
}
.ind-btn:hover { color: #fff; border-color: #3d594b; }
.ind-btn.on { background: #08261f; border-color: var(--amber); color: var(--amber); }
.ind-btn.prmanr-btn {
    border: 1px solid #ff3b30 !important;
    color: #ff8585 !important;
    background: #200606 !important;
    font-weight: 800 !important;
    font-size: 10.5px !important;
    letter-spacing: 0.5px;
    padding: 2px 9px !important;
    border-radius: 3px !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 0 8px rgba(255, 59, 48, 0.4);
    position: relative;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}
.ind-btn.prmanr-btn:hover {
    color: #ffffff !important;
    border-color: #ff5252 !important;
    background: #380808 !important;
    box-shadow: 0 0 12px rgba(255, 59, 48, 0.7);
}
.ind-btn.prmanr-btn .prmanr-glow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff3b30;
    box-shadow: 0 0 6px #ff3b30;
    display: inline-block;
    animation: prmanrPulse 1.4s infinite ease-in-out;
}
@keyframes prmanrPulse {
    0%, 100% { transform: scale(0.85); opacity: 0.75; box-shadow: 0 0 4px #ff3b30; }
    50% { transform: scale(1.35); opacity: 1; box-shadow: 0 0 10px #ff3b30, 0 0 16px rgba(255, 59, 48, 0.8); }
}
.ind-btn.prmanr-btn.on {
    background: linear-gradient(135deg, #7f1d1d 0%, #dc2626 50%, #ef4444 100%) !important;
    border: 1px solid #ffa3a3 !important;
    color: #ffffff !important;
    font-weight: 900 !important;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.85), 0 0 4px #ffffff !important;
    transform: scale(1.04);
}
.ind-btn.prmanr-btn.on .prmanr-glow-dot {
    background: #ffffff;
    box-shadow: 0 0 8px #ffffff;
}
.ind-btn.ict-btn { border-color: #17695c; color: #22ab94; background: #0a1f1a; font-weight: 700; }
.ind-btn.ict-btn.on { background: linear-gradient(135deg, #0b352c 0%, #17695c 100%); border-color: #22ab94; color: #e6fffa; box-shadow: 0 0 8px rgba(34, 171, 148, 0.4); }
.ind-btn.harmonic-btn.on { background: linear-gradient(135deg, #2b113d 0%, #581c87 100%); border-color: #a855f7; color: #f3e8ff; box-shadow: 0 0 8px rgba(168, 85, 247, 0.45); }
.ind-btn.elliott-btn.on { background: linear-gradient(135deg, #082836 0%, #0e7490 100%); border-color: #06b6d4; color: #cffafe; box-shadow: 0 0 8px rgba(6, 182, 212, 0.45); }
.ind-btn.fibo-btn.on { background: linear-gradient(135deg, #332005 0%, #b45309 100%); border-color: #f59e0b; color: #fef3c7; box-shadow: 0 0 8px rgba(245, 158, 11, 0.45); }
.chart-meta-group { display: flex; align-items: center; gap: 8px; flex-shrink: 0; white-space: nowrap; }
.chart-badge {
    font: 500 10.5px 'JetBrains Mono', monospace; color: #a0ece0;
    background: rgba(34, 171, 148, 0.08); border: 1px solid var(--amber-dim);
    padding: 1px 6px; border-radius: 2px; white-space: nowrap;
}
.chart-badge.prmanr-badge {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid #ef4444 !important;
    color: #fca5a5 !important;
    font-weight: 700 !important;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.35);
}
.chart-badge.prmanr-badge.bull { background: rgba(0, 245, 160, 0.16) !important; border-color: var(--up) !important; color: #a7f3d0 !important; box-shadow: 0 0 10px rgba(var(--up-rgb), 0.35); }
.chart-badge.prmanr-badge.bear { background: rgba(255, 87, 34, 0.16) !important; border-color: var(--dn) !important; color: #fed7aa !important; box-shadow: 0 0 10px rgba(var(--dn-rgb), 0.35); }
.chart-badge.ict-badge { background: rgba(var(--up-rgb), 0.12); border: 1px solid var(--up); color: var(--up); font-weight: 600; box-shadow: 0 0 8px rgba(var(--up-rgb), 0.25); transition: all .25s ease; }
.chart-badge.ict-badge.bull { background: rgba(var(--up-rgb), 0.16); border-color: var(--up); color: #ffcc80; box-shadow: 0 0 10px rgba(var(--up-rgb), 0.35); }
.chart-badge.ict-badge.bear { background: rgba(var(--dn-rgb), 0.16); border-color: var(--dn); color: var(--dn); box-shadow: 0 0 10px rgba(var(--dn-rgb), 0.35); }

/* Multi-Exchange & Source Badges */
.source-badge {
    font: 600 9.5px 'JetBrains Mono', 'Noto Sans KR', sans-serif;
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 1.5px 6px;
    border-radius: 3px;
    margin-left: 6px;
    display: inline-block;
    vertical-align: middle;
    letter-spacing: 0.2px;
}
.source-badge.index { color: #38bdf8; border-color: rgba(56, 189, 248, 0.45); background: rgba(14, 116, 144, 0.25); }
.source-badge.binance { color: #facc15; border-color: rgba(250, 204, 21, 0.5); background: rgba(161, 98, 7, 0.25); }
.source-badge.okx { color: #c084fc; border-color: rgba(192, 132, 252, 0.5); background: rgba(107, 33, 168, 0.25); }
.source-badge.upbit { color: #60a5fa; border-color: rgba(96, 165, 250, 0.5); background: rgba(30, 64, 175, 0.25); }
.source-badge.toss { color: #34d399; border-color: rgba(52, 211, 153, 0.5); background: rgba(6, 95, 70, 0.25); }

.cat-tag {
    font-size: 8.5px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 2px;
    margin-right: 4px;
    display: inline-block;
    vertical-align: middle;
    letter-spacing: 0.2px;
}
.cat-tag.upbit { background: #1e3a8a; color: #93c5fd; border: 1px solid #3b82f6; }
.cat-tag.binance { background: #451a03; color: #fde047; border: 1px solid #eab308; }
.cat-tag.okx { background: #2e1065; color: #e9d5ff; border: 1px solid #a855f7; }
.cat-tag.toss { background: #064e3b; color: #6ee7b7; border: 1px solid #10b981; }
.cat-tag.index { background: #0c4a6e; color: #7dd3fc; border: 1px solid #0284c7; }
.cat-tag.comm { background: #713f12; color: #fde68a; border: 1px solid #d97706; }
.cat-tag.macro { background: #374151; color: #d1d5db; border: 1px solid #6b7280; }

.mon-cat-bar button[data-cat="binance"].on { border-color: #eab308; color: #fef08a; background: #2a1f05; }
.mon-cat-bar button[data-cat="okx"].on { border-color: #a855f7; color: #f3e8ff; background: #240d42; }
.mon-cat-bar button[data-cat="upbit"].on { border-color: #3b82f6; color: #dbeafe; background: #0b2247; }

/* Quick Trading Pad (Futures: Long / Short / Close / Leverage) */
.trade-pad {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    min-height: 38px; padding: 3px 10px; background: #0a110e; border-top: 1px solid var(--line);
    flex-shrink: 0; overflow-x: auto; white-space: nowrap;
}
.trade-pad::-webkit-scrollbar { display: none; }
.tp-wallet { display: flex; align-items: center; gap: 6px; font-size: 11px; white-space: nowrap; flex-shrink: 0; }
.tp-lbl { color: var(--muted); font: 400 10px 'Noto Sans KR', sans-serif; white-space: nowrap; }
.tp-wallet b { color: #a0ece0; font-weight: 700; font-family: 'JetBrains Mono', monospace; white-space: nowrap; }

.tp-lev-wrap { display: flex; align-items: center; gap: 4px; flex-shrink: 0; white-space: nowrap; }
.tp-lev-select {
    background: #111e18; border: 1px solid #284435; color: #f59e0b;
    font: 700 11px 'JetBrains Mono', monospace; padding: 1px 4px; border-radius: 2px;
    outline: 0; cursor: pointer; height: 22px; transition: all .15s;
}
.tp-lev-select:hover, .tp-lev-select:focus {
    border-color: var(--amber); box-shadow: 0 0 6px rgba(245, 158, 11, 0.35);
}

.tp-pos { color: #aaa; font-family: 'Noto Sans KR', sans-serif; font-size: 10.5px; display: flex; align-items: center; gap: 4px; white-space: nowrap; flex-shrink: 0; }
.tp-pnl { font-weight: 700; font-family: 'JetBrains Mono', monospace; font-size: 11px; white-space: nowrap; flex-shrink: 0; }

.pos-badge {
    display: inline-block; padding: 1px 5px; border-radius: 2px;
    font: 800 9.5px 'JetBrains Mono', sans-serif; letter-spacing: 0.5px; text-transform: uppercase;
    white-space: nowrap;
}
.pos-badge.long {
    background: rgba(var(--up-rgb), 0.22); color: var(--up); border: 1px solid var(--up);
    box-shadow: 0 0 6px rgba(var(--up-rgb), 0.3);
}
.pos-badge.short {
    background: rgba(var(--dn-rgb), 0.22); color: var(--dn); border: 1px solid var(--dn);
    box-shadow: 0 0 6px rgba(var(--dn-rgb), 0.3);
}
.liq-price { color: #f97316; font-weight: 700; font-size: 10px; font-family: 'JetBrains Mono', monospace; white-space: nowrap; }

.tp-inputs { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; white-space: nowrap; flex-shrink: 0; }
.tp-type-group { display: flex; border: 1px solid #283a30; border-radius: 2px; overflow: hidden; flex-shrink: 0; }
.tp-type-btn {
    background: #101a15; border: 0; color: #777; cursor: pointer;
    font: 600 10px 'Noto Sans KR', sans-serif; padding: 2px 6px; height: 22px;
    transition: all .15s; white-space: nowrap;
}
.tp-type-btn:hover { color: #fff; background: #172620; }
.tp-type-btn.on { background: #08261f; color: var(--amber); font-weight: 700; box-shadow: inset 0 0 6px rgba(34, 171, 148, 0.3); }

.tp-price-wrap { display: flex; align-items: center; flex-shrink: 0; }
#tp-price-input {
    width: 96px; height: 22px; background: #0c1813; border: 1px solid var(--amber-dim); color: #fff;
    font: 600 11px 'JetBrains Mono', monospace; padding: 0 6px; outline: 0; text-align: right;
    border-radius: 2px; transition: border-color .2s, box-shadow .2s;
}
#tp-price-input:focus { border-color: var(--amber); box-shadow: 0 0 6px rgba(34, 171, 148, 0.4); }
#tp-price-input.pulse-flash { animation: price-pulse 0.6s ease; }
@keyframes price-pulse { 0% { background: #17695c; } 100% { background: #0c1813; } }

.tp-chips { display: flex; gap: 2px; flex-shrink: 0; }
.tp-chips button {
    background: #141f19; border: 1px solid #283a30; color: #888; cursor: pointer;
    font: 500 10px 'JetBrains Mono', monospace; padding: 2px 5px; border-radius: 2px; white-space: nowrap;
}
.tp-chips button:hover { background: #1f3328; color: #fff; }
#tp-amount-input {
    width: 84px; height: 22px; background: #0d1612; border: 1px solid #283a30; color: #fff;
    font: 500 11px 'JetBrains Mono', monospace; padding: 0 6px; outline: 0; text-align: right;
    border-radius: 2px; flex-shrink: 0;
}
#tp-amount-input:focus { border-color: var(--amber); }

.tp-act {
    height: 22px; padding: 0 8px; border: 0; cursor: pointer; border-radius: 2px;
    font: 800 10.5px 'Noto Sans KR', sans-serif; letter-spacing: 0.2px; transition: all .15s ease;
    white-space: nowrap; flex-shrink: 0;
}
.tp-act.long, .tp-act.buy {
    background: var(--up); color: #000; font-weight: 800;
    box-shadow: 0 0 8px rgba(var(--up-rgb), 0.35);
}
.tp-act.long:hover, .tp-act.buy:hover { filter: brightness(1.2); }
.tp-act.short, .tp-act.sell {
    background: var(--dn); color: #fff; font-weight: 800;
    box-shadow: 0 0 8px rgba(var(--dn-rgb), 0.35);
}
.tp-act.short:hover, .tp-act.sell:hover { filter: brightness(1.1); }
.tp-act.close {
    background: #3b220c; border: 1px solid #854d0e; color: #fbbf24; font-weight: 700;
}
.tp-act.close:hover { background: #f59e0b; color: #000; border-color: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
.tp-act.scale-in {
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    font-weight: 900 !important;
    letter-spacing: 0.3px;
    box-shadow: 0 0 10px rgba(var(--up-rgb), 0.5);
}
.tp-act.short.scale-in {
    box-shadow: 0 0 10px rgba(var(--dn-rgb), 0.5);
}
.tp-act.reset { background: #1c2420; color: #777; font-weight: 400; font-size: 10px; border: 1px solid #283830; }
.tp-act.reset:hover { background: #283830; color: #ccc; }

/* Interactive Orderbook Rows */
.obr { cursor: pointer; transition: background .12s ease; position: relative; }
.obr:hover { background: rgba(34, 171, 148, 0.12) !important; }
.obr.ask:hover { background: rgba(var(--dn-rgb), 0.15) !important; }
.obr.bid:hover { background: rgba(var(--up-rgb), 0.15) !important; }
.obr .c-p { cursor: pointer; }
.obr .c-p:hover span:first-child { text-decoration: underline; }
.obr .ob-quick-act {
    display: none; font-size: 9px; font-weight: 800; padding: 1px 5px; border-radius: 2px;
    cursor: pointer; border: 0; line-height: 1.2;
}
.obr:hover .ob-quick-act { display: inline-block; }
.obr .ob-quick-act.long, .obr.bid .ob-quick-act { background: var(--up); color: #000; font-weight: 800; box-shadow: 0 0 6px rgba(var(--up-rgb), 0.5); }
.obr .ob-quick-act.short, .obr.ask .ob-quick-act { background: var(--dn); color: #fff; font-weight: 800; box-shadow: 0 0 6px rgba(var(--dn-rgb), 0.5); }
.obr .ob-quick-act.close { background: #f59e0b; color: #000; box-shadow: 0 0 6px rgba(245, 158, 11, 0.5); }
.obr.has-order::after {
    content: '★내주문'; position: absolute; left: 4px; top: 2px; font-size: 8px; font-weight: 800;
    background: #f59e0b; color: #000; padding: 0 4px; border-radius: 2px; z-index: 5;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

/* Portfolio Panel */
#pos-table-wrap { flex: 1; overflow: auto; min-height: 0; }
.pos-close-btn, .open-order-cancel-btn {
    background: #2a1515; border: 1px solid #552222; color: #f87171;
    padding: 2px 6px; font-size: 10px; cursor: pointer; border-radius: 2px; font-weight: 700;
    transition: all .15s ease; white-space: nowrap; flex-shrink: 0;
}
.pos-close-btn:hover, .open-order-cancel-btn:hover { background: #ef4444; color: #000; border-color: #ef4444; }

/* ---------- PRMANR Multi-Asset & AI Indicators Styles (v2.5) ---------- */
.mon-cat-bar {
    display: flex; gap: 3px; padding: 4px 6px; background: #070d0b; border-bottom: 1px solid var(--line);
    overflow-x: auto; flex-shrink: 0;
}
.mon-cat-bar button {
    background: transparent; border: 1px solid #1a2922; color: #777; cursor: pointer;
    font: 500 10px 'Noto Sans KR', sans-serif; padding: 2px 7px; border-radius: 2px; white-space: nowrap;
    transition: all .15s;
}
.mon-cat-bar button:hover { color: #fff; border-color: #2e4a3c; }
.mon-cat-bar button.on { background: #08261f; color: var(--amber); border-color: var(--amber); font-weight: 700; }
.mon-cat-bar button[data-cat="toss-kr"],
.mon-cat-bar button[data-cat="toss-us"] { border-color: #1a3250; color: #79a6d2; }
.mon-cat-bar button[data-cat="toss-kr"]:hover,
.mon-cat-bar button[data-cat="toss-us"]:hover { border-color: #0064ff; color: #fff; }
.mon-cat-bar button[data-cat="toss-kr"].on,
.mon-cat-bar button[data-cat="toss-us"].on { background: #0a1f38; color: #3b9cff; border-color: #0064ff; }
.toss-badge { display: inline-block; padding: 1px 5px; background: #0064ff; color: #fff; font: 700 9.5px 'Noto Sans KR', sans-serif; border-radius: 2px; margin-left: 6px; vertical-align: middle; }

.ob-controls { display: flex; gap: 3px; align-items: center; margin-left: auto; }
.ob-controls button {
    background: #141f19; border: 1px solid #283a30; color: #aaa; width: 18px; height: 18px;
    font: bold 11px monospace; cursor: pointer; border-radius: 2px; line-height: 1; display: flex;
    align-items: center; justify-content: center;
}
.ob-controls button:hover { background: #1f3328; color: #fff; border-color: var(--amber); }

/* Dynamic orderbook row scale support */
.obr.scaled-ob { min-height: 17px; }

/* ---------- PRMANR v9.3: Back Navigation, BTC Dominance, Portfolio & Auth ---------- */
.panel-unmax-btn {
    display: none;
    background: var(--amber);
    color: #000;
    border: 1px solid #5eead4;
    font: 800 10px 'Noto Sans KR', sans-serif;
    padding: 1px 8px;
    border-radius: 2px;
    cursor: pointer;
    margin-left: auto;
    white-space: nowrap;
    box-shadow: 0 0 8px var(--mint-glow);
}
.panel.maxed .panel-unmax-btn {
    display: inline-flex;
    align-items: center;
}

/* BTC Dominance Bar inside Panel 6 (Kimchi Premium) */
.btc-dom-bar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 5px 8px;
    background: linear-gradient(90deg, #0d1612 0%, #101b16 100%);
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
.dom-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10.5px;
    white-space: nowrap;
    gap: 6px;
}
.dom-lbl { color: #cbd5e1; font-weight: 700; font-family: 'Noto Sans KR', sans-serif; }
.dom-val { color: #f59e0b; font: 800 11.5px 'JetBrains Mono', monospace; }
.dom-val.eth { color: #60a5fa; font-size: 10.5px; }
.dom-val.alt { color: #a78bfa; font-size: 10.5px; }
.dom-sep { color: #2b3d34; }
.dom-sub { color: var(--muted); font-size: 9.5px; }
.dom-meter {
    height: 5px;
    width: 100%;
    background: #231934;
    border-radius: 3px;
    overflow: hidden;
    display: flex;
}
.dom-fill-btc {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
    transition: width .4s ease;
}
.dom-fill-eth {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
    transition: width .4s ease;
}

/* Portfolio Dashboard Bar inside Panel 7 */
.pos-dashboard-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 5px 8px;
    background: #0a1410;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
    flex-wrap: wrap;
}
.pd-item {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 10.5px;
    white-space: nowrap;
}
.pd-item span { color: var(--muted); font-size: 9.5px; }
.pd-item b { color: #e2e8f0; font: 700 11px 'JetBrains Mono', monospace; }
.pd-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.pd-act {
    background: #13221b;
    border: 1px solid #264235;
    color: #cbd5e1;
    font: 700 10px 'Noto Sans KR', sans-serif;
    padding: 2px 7px;
    border-radius: 2px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
}
.pd-act:hover { background: var(--amber); color: #000; border-color: var(--amber); }
.pd-act.close-all { background: #3b1c0c; border-color: #9a3412; color: #fdba74; }
.pd-act.close-all:hover { background: #f97316; color: #000; }
.pd-act.sync { background: #0c2922; border-color: #14b8a6; color: #5eead4; }
.pd-act.sync:hover { background: #14b8a6; color: #000; }

/* Recent Chart History Chips in Panel 7 */
.chart-hist-bar {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background: #08110d;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    white-space: nowrap;
    flex-shrink: 0;
}
.chart-hist-bar::-webkit-scrollbar { display: none; }
.ch-lbl { color: var(--amber); font: 700 9.5px 'Noto Sans KR', sans-serif; flex-shrink: 0; }
.ch-list { display: flex; gap: 4px; align-items: center; }
.ch-empty { color: #556b60; font-size: 10px; }
.ch-chip {
    background: #101d17;
    border: 1px solid #21382d;
    color: #d1fae5;
    font: 600 10px 'Noto Sans KR', 'JetBrains Mono', sans-serif;
    padding: 1.5px 7px;
    border-radius: 2px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
}
.ch-chip:hover { background: var(--amber); color: #000; border-color: var(--amber); }

/* Top Auth Button & Auth Modal */
.top-btn.auth-btn {
    background: linear-gradient(135deg, #0d3b2e 0%, #115e59 100%);
    color: #a7f3d0;
    border: 1px solid #14b8a6;
    font-weight: 700;
    white-space: nowrap;
}
.top-btn.auth-btn:hover {
    background: #14b8a6;
    color: #000;
    box-shadow: 0 0 10px rgba(20, 184, 166, 0.5);
}
.top-btn.auth-btn.logged-in {
    background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 100%);
    border-color: #f87171;
    color: #fff;
}

.auth-mbox { width: 420px; max-width: 94vw; }
.auth-mbox .ph { display: flex; align-items: center; justify-content: space-between; z-index: 5; }
.mclose {
    background: transparent; border: 1px solid transparent; color: var(--amber);
    cursor: pointer; font-size: 15px; font-weight: 700; padding: 2px 8px;
    border-radius: 2px; line-height: 1.2; transition: all .15s;
}
.mclose:hover { background: rgba(34, 171, 148, 0.18); color: #fff; border-color: var(--amber); }
.auth-body { display: flex; flex-direction: column; gap: 12px; padding: 14px !important; }
.auth-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.auth-tab-btn {
    flex: 1; background: #101915; border: 1px solid #21332a; color: #888;
    font: 700 12px 'Noto Sans KR', sans-serif; padding: 7px 0; border-radius: 2px; cursor: pointer;
    transition: all .15s;
}
.auth-tab-btn:hover { color: #e2e8f0; border-color: #2e4a3d; }
.auth-tab-btn.on { background: #08261f; color: var(--amber); border-color: var(--amber); }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-field { display: flex; flex-direction: column; gap: 4px; }
.auth-field label { font: 600 11px 'Noto Sans KR', sans-serif; color: #cbd5e1; }
.auth-field input {
    background: #09110e; border: 1px solid #23382e; color: #fff;
    font: 500 12px 'JetBrains Mono', 'Noto Sans KR', sans-serif; padding: 8px 10px; border-radius: 2px; outline: 0;
    width: 100%; box-sizing: border-box;
}
.auth-field input:focus { border-color: var(--amber); box-shadow: 0 0 6px rgba(34, 171, 148, 0.35); }
.auth-id-row { display: flex; gap: 6px; align-items: stretch; }
.auth-id-row input { flex: 1; min-width: 0; }
.auth-check-btn {
    background: #11261f; border: 1px solid #14b8a6; color: #5eead4;
    font: 700 11px 'Noto Sans KR', sans-serif; padding: 0 12px; border-radius: 2px;
    cursor: pointer; white-space: nowrap; flex-shrink: 0; transition: all .15s;
}
.auth-check-btn:hover { background: #14b8a6; color: #000; }
.auth-check-btn.checked { background: #064e3b; border-color: #10b981; color: #a7f3d0; }
.auth-id-status { font-size: 10.5px; min-height: 14px; color: #94a3b8; font-family: 'Noto Sans KR', sans-serif; }
.auth-id-status.ok { color: #34d399; }
.auth-id-status.err { color: #f87171; }
.auth-consent {
    display: flex; align-items: center; gap: 6px; font-size: 11px; color: #94a3b8;
    cursor: pointer; margin-top: 2px; user-select: none;
}
.auth-consent input[type="checkbox"] { accent-color: var(--amber); width: 14px; height: 14px; cursor: pointer; }
.auth-consent a { color: var(--amber); text-decoration: underline; }
.auth-submit-btn {
    background: var(--amber); color: #000; border: 0; font: 800 12px 'Noto Sans KR', sans-serif;
    padding: 9px 12px; border-radius: 2px; cursor: pointer; margin-top: 4px; transition: all .15s;
}
.auth-submit-btn:hover { filter: brightness(1.15); box-shadow: 0 0 10px var(--mint-glow); }
.auth-submit-btn.logout { background: #2a1515; color: #fca5a5; border: 1px solid #7f1d1d; }
.auth-submit-btn.logout:hover { background: #dc2626; color: #fff; }
.auth-msg { font-size: 11px; min-height: 16px; color: #fbbf24; text-align: center; }
.auth-msg.ok { color: #34d399; }
.auth-msg.err { color: #f87171; }
.user-card { background: #0a1612; border: 1px solid var(--amber-dim); padding: 12px; border-radius: 3px; }
.uc-title { font: 800 13px 'Noto Sans KR', sans-serif; color: #fff; margin-bottom: 8px; }
.uc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 11px; }
.uc-grid div { background: #070e0b; padding: 6px 8px; border-radius: 2px; border: 1px solid #17261f; }
.uc-grid span { color: var(--muted); display: block; font-size: 9.5px; }
.uc-grid b { color: #a7f3d0; font-family: 'JetBrains Mono', monospace; }
.uc-actions { display: flex; gap: 6px; margin-top: 10px; }
.uc-actions button { flex: 1; }

.hidden { display: none !important; }

.pdb-item {
    display: flex; align-items: baseline; gap: 5px; font-size: 10.5px; white-space: nowrap;
}
.pdb-item span { color: var(--muted); font-size: 9.5px; }
.pdb-item b { color: #e2e8f0; font: 700 11px 'JetBrains Mono', monospace; }
.pdb-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.pos-close-all-btn {
    background: #3b1c0c; border: 1px solid #9a3412; color: #fdba74;
    font: 700 10px 'Noto Sans KR', sans-serif; padding: 2px 8px; border-radius: 2px;
    cursor: pointer; white-space: nowrap; transition: all .15s;
}
.pos-close-all-btn:hover { background: #f97316; color: #000; border-color: #f97316; }
.pos-reset-all-btn {
    background: #14221d; border: 1px solid #28473b; color: #cbd5e1;
    font: 700 10px 'Noto Sans KR', sans-serif; padding: 2px 8px; border-radius: 2px;
    cursor: pointer; white-space: nowrap; transition: all .15s;
}
.pos-reset-all-btn:hover { background: var(--amber); color: #000; border-color: var(--amber); }
.pos-close-half-btn {
    background: #13221b; border: 1px solid #264235; color: #94a3b8;
    font: 700 10px 'Noto Sans KR', sans-serif; padding: 2px 6px; border-radius: 2px;
    cursor: pointer; white-space: nowrap; transition: all .15s;
}
.pos-close-half-btn:hover { background: var(--amber); color: #000; border-color: var(--amber); }
.chart-hist-chip {
    background: #101d17; border: 1px solid #21382d; color: #d1fae5;
    font: 600 10px 'Noto Sans KR', 'JetBrains Mono', sans-serif;
    padding: 2px 8px; border-radius: 2px; cursor: pointer; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 4px; transition: all .15s;
}
.chart-hist-chip:hover, .chart-hist-chip.on { background: #08261f; color: var(--amber); border-color: var(--amber); }

.auth-user-header {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: #0a1612; border: 1px solid var(--amber-dim); padding: 12px; border-radius: 3px;
}
.auth-user-badge {
    display: inline-flex; align-items: center; gap: 5px; font: 700 10px 'JetBrains Mono', monospace;
    color: #34d399;
}
.auth-user-actions { display: flex; gap: 6px; align-items: center; }
.auth-act-btn {
    background: #11261f; border: 1px solid #14b8a6; color: #5eead4;
    font: 700 11px 'Noto Sans KR', sans-serif; padding: 6px 10px; border-radius: 2px; cursor: pointer;
    transition: all .18s ease; display: inline-flex; align-items: center; gap: 6px;
}
.auth-act-btn:hover { background: #14b8a6; color: #000; }
.auth-act-btn.sync-toggle-btn {
    background: #0b1310;
    border: 1px solid #22352c;
    color: #64748b;
    box-shadow: none;
    min-width: 92px;
    justify-content: center;
}
.auth-act-btn.sync-toggle-btn:hover {
    border-color: #385a4a;
    color: #cbd5e1;
    background: #111e19;
}
.auth-act-btn.sync-toggle-btn .sync-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #334155;
    border: 1px solid #475569;
    display: inline-block;
    flex-shrink: 0;
    transition: all .2s ease;
}
.auth-act-btn.sync-toggle-btn.on {
    background: linear-gradient(135deg, #064e3b 0%, #0d9488 100%);
    border: 1px solid #34d399;
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 0 14px rgba(52, 211, 153, 0.55), inset 0 0 6px rgba(167, 243, 208, 0.25);
}
.auth-act-btn.sync-toggle-btn.on:hover {
    filter: brightness(1.1);
    color: #ffffff;
}
.auth-act-btn.sync-toggle-btn.on .sync-led {
    background: #34d399;
    border-color: #ecfdf5;
    box-shadow: 0 0 8px #10b981, 0 0 14px #34d399;
}
.auth-act-btn.danger { background: #2a1515; border-color: #7f1d1d; color: #fca5a5; }
.auth-act-btn.danger:hover { background: #dc2626; color: #fff; }
.auth-manage-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 4px;
    border-top: 1px solid #16261f;
}
.auth-act-btn.reset-btn {
    flex: 1.4;
    justify-content: center;
    background: #0d1d17;
    border: 1px solid #264a3b;
    color: #a7f3d0;
}
.auth-act-btn.reset-btn:hover {
    background: var(--amber);
    color: #000;
    border-color: var(--amber);
}
.auth-act-btn.withdraw-btn {
    flex: 0.8;
    justify-content: center;
    background: #1a0f10;
    border: 1px solid #5c1d24;
    color: #f87171;
}
.auth-act-btn.withdraw-btn:hover {
    background: #b91c1c;
    color: #fff;
    border-color: #ef4444;
}
.auth-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ast-item {
    background: #070e0b; border: 1px solid #17261f; padding: 8px 10px; border-radius: 2px;
    display: flex; flex-direction: column; gap: 2px;
}
.ast-item span { color: var(--muted); font-size: 10px; }
.ast-item b { color: #a7f3d0; font: 700 12px 'JetBrains Mono', monospace; }

/* Footer Policy Links & Help Modal Policy Links */
.status-links { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.status-links a { color: #8fa69b; text-decoration: none; font-size: 10px; transition: color .15s; }
.status-links a:hover { color: var(--amber); text-decoration: underline; }
.status-sep { color: #2b3d34; margin: 0 4px; }
.help-policy-links {
    display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; padding-top: 8px;
    border-top: 1px dotted #1e3329;
}
.help-policy-links a { color: var(--amber); font-size: 11px; text-decoration: none; font-weight: 600; }
.help-policy-links a:hover { text-decoration: underline; }

/* Hide chart back button on desktop normal grid (only show when panel is maximized or on mobile) */
.panel-max-btn {
    background: #101d17;
    border: 1px solid #233b30;
    color: #94a3b8;
    font: 700 9.5px 'Noto Sans KR', sans-serif;
    padding: 1px 6px;
    border-radius: 2px;
    cursor: pointer;
    margin-left: auto;
    white-space: nowrap;
    transition: all .15s;
    flex-shrink: 0;
}
.panel-max-btn:hover {
    background: var(--amber);
    color: #000;
    border-color: var(--amber);
}
.chart-hdr-tools .panel-max-btn,
.ob-controls .panel-max-btn {
    margin-left: 4px;
}
.panel.maxed .panel-max-btn {
    display: none !important;
}
@media (max-width: 900px) {
    .panel-max-btn {
        display: none !important;
    }
}
@media (min-width: 901px) {
    .p-main:not(.maxed) #btn-return-grid {
        display: none !important;
    }
}
.p-main.maxed .panel-unmax-btn {
    display: none !important;
}

/* Semantic Crawl Guide (Offscreen so 100vh terminal layout remains strict) */
.sr-adsense-guide {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================================================================
   v10.0 — Universal Loading Indicators, Chart Touch Hint, Smooth Orderbook,
   & Panel 7 Core Macro Indicators (Expectation vs Concern)
   ========================================================================= */
@keyframes prmanrSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(16, 217, 154, 0.22);
    border-top-color: #10D99A;
    border-radius: 50%;
    animation: prmanrSpin 0.72s linear infinite;
    vertical-align: -2px;
    margin-right: 6px;
    flex-shrink: 0;
}

.loading-box {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 12px !important;
    color: #94a3b8 !important;
    font: 500 11.5px 'Noto Sans KR', sans-serif;
}

.mon-sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font: 600 9.5px 'Noto Sans KR', sans-serif;
    color: #10D99A;
    background: rgba(16, 217, 154, 0.08);
    border: 1px solid rgba(16, 217, 154, 0.28);
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 6px;
}

/* Chart Wrap Overlays: Loading Indicator & Concise Double-Tap Hint */
.chart-wrap {
    position: relative;
}

.chart-loading-overlay {
    position: absolute;
    top: 10px;
    left: 12px;
    z-index: 6;
    display: none;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.82);
    border: 1px solid rgba(16, 217, 154, 0.45);
    color: #d1fae5;
    font: 600 11px 'Noto Sans KR', sans-serif;
    padding: 4px 10px;
    border-radius: 4px;
    pointer-events: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}
.chart-loading-overlay.show {
    display: inline-flex;
}


.chart-touch-guide:hover,
.chart-touch-guide:active {
    color: #10D99A;
    border-color: #10D99A;
    background: rgba(16, 217, 154, 0.12);
}

/* Smooth Orderbook Depth Bar Transitions */
.obr .c-sz i {
    transition: width 0.14s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: width;
}

/* Panel 7: Core Macro Investment Indicators (기대 vs 우려) */
.macro-insight-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 6px 8px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.mi-card {
    background: #070e0b;
    border: 1px solid #16261f;
    border-left: 3px solid #264235;
    border-radius: 3px;
    padding: 6px 9px;
    cursor: pointer;
    transition: background 0.14s ease, border-color 0.14s ease;
}
.mi-card:hover {
    background: #0c1813;
    border-color: #284b3c;
}
.mi-card.expect {
    border-left-color: #10D99A;
}
.mi-card.concern {
    border-left-color: #f97316;
}

.mi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 3px;
}

.mi-name-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.mi-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: 800 10px 'Noto Sans KR', sans-serif;
    padding: 1px 6px;
    border-radius: 2px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.mi-badge.expect {
    background: rgba(16, 217, 154, 0.16);
    border: 1px solid #10D99A;
    color: #34d399;
}
.mi-badge.concern {
    background: rgba(249, 115, 22, 0.16);
    border: 1px solid #f97316;
    color: #fb923c;
}

.mi-title {
    font: 700 11.5px 'Noto Sans KR', sans-serif;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mi-val {
    font: 700 11px 'JetBrains Mono', monospace;
    white-space: nowrap;
    flex-shrink: 0;
}

.mi-desc {
    font: 400 11px 'Noto Sans KR', sans-serif;
    color: #cbd5e1;
    line-height: 1.42;
    word-break: keep-all;
}
.mi-desc b {
    color: #ffffff;
    font-weight: 700;
}


/* =========================================================================
   v14.0 — Mobile Gain Default, Clean PRMANR Signals & Direct Orderbook Ordering
   ========================================================================= */

/* Prominent Change Rate Percentage Column */
.col-chg {
    font-weight: 800 !important;
    font-family: 'JetBrains Mono', monospace !important;
    white-space: nowrap !important;
    text-align: right !important;
    font-size: 11px !important;
}
.col-chg.up {
    color: var(--up) !important;
}
.col-chg.dn, .col-chg.down {
    color: var(--dn) !important;
}

/* Orderbook Direct Ordering Bar */
.ob-order-bar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
    background: #09120e;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
.ob-bar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.ob-bar-label {
    font: 700 10.5px 'Noto Sans KR', sans-serif;
    color: var(--muted);
    flex-shrink: 0;
}
.ob-bar-price {
    font: 700 11.5px 'JetBrains Mono', monospace;
    color: #fff;
    background: #14221c;
    padding: 2px 8px;
    border-radius: 2px;
    border: 1px solid #233b30;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ob-bar-chips {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}
.ob-chip-btn {
    background: #14221c;
    border: 1px solid #233b30;
    color: #888;
    font: 600 9.5px 'Noto Sans KR', sans-serif;
    padding: 2px 6px;
    border-radius: 2px;
    cursor: pointer;
    transition: all .15s;
}
.ob-chip-btn.on, .ob-chip-btn:hover {
    background: var(--amber);
    color: #000;
    border-color: var(--amber);
}
.ob-bar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}
.ob-order-btn {
    height: 28px;
    border: 0;
    border-radius: 2px;
    font: 700 11.5px 'Noto Sans KR', sans-serif;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ob-order-btn:active {
    transform: scale(0.98);
    opacity: 0.85;
}
.ob-order-btn.buy {
    background: var(--up);
    color: #000;
}
.ob-order-btn.sell {
    background: var(--dn);
    color: #fff;
}

/* Selected Orderbook Row Highlight */
.obr.selected-obr {
    background: rgba(255, 255, 255, 0.12) !important;
    outline: 1px solid var(--amber) !important;
    outline-offset: -1px;
}

@media (max-width: 900px) {
    #p-monitor .tbl {
        width: 100% !important;
        table-layout: fixed !important;
    }
    #p-monitor .tbl th:nth-child(1), #p-monitor .tbl td:nth-child(1) {
        width: 36% !important;
        padding: 5px 3px !important;
    }
    #p-monitor .tbl th:nth-child(2), #p-monitor .tbl td:nth-child(2) {
        width: 25% !important;
        padding: 5px 3px !important;
        font-size: 10.5px !important;
    }
    #p-monitor .tbl th:nth-child(3), #p-monitor .tbl td:nth-child(3) {
        width: 20% !important;
        padding: 5px 3px !important;
        font-size: 11px !important;
        font-weight: 800 !important;
    }
    #p-monitor .tbl th:nth-child(4), #p-monitor .tbl td:nth-child(4) {
        width: 19% !important;
        padding: 5px 3px !important;
        font-size: 9.5px !important;
    }
    .obr .ob-quick-act {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        font-size: 8.5px !important;
        padding: 1px 4px !important;
        margin-left: 3px !important;
        height: 16px !important;
        min-width: 24px !important;
    }
}


/* =========================================================================
   v15.0 — Elegant Positions, 1%~100% Chips, & ICT Smart Money Engine
   ========================================================================= */

/* ICT Indicator Button Styling */
.ind-btn.ict-btn {
    border-color: #6b21a8 !important;
    color: #c084fc !important;
    background: #150924 !important;
    font-weight: 700 !important;
}
.ind-btn.ict-btn:hover {
    border-color: #a855f7 !important;
    color: #fff !important;
}
.ind-btn.ict-btn.on {
    background: linear-gradient(135deg, #2e0854 0%, #6b21a8 100%) !important;
    border-color: #a855f7 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.45) !important;
}

/* Expanded Chips (1% ~ 100%) Horizontal Smooth Touch Scroll */
.tp-chips {
    display: flex !important;
    gap: 3px !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 2px 0 !important;
    max-width: 260px;
}
.tp-chips::-webkit-scrollbar { display: none; }
.tp-chips button {
    height: 24px !important;
    padding: 0 6px !important;
    font-size: 10px !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
}
.tp-chips button.on {
    background: var(--amber) !important;
    color: #000 !important;
    border-color: var(--amber) !important;
}

.ob-bar-chips {
    display: flex !important;
    gap: 3px !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 1px 0 !important;
}
.ob-bar-chips::-webkit-scrollbar { display: none; }
.ob-bar-chips button {
    height: 22px !important;
    padding: 0 5px !important;
    font-size: 9.5px !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
}
.ob-bar-chips button.on {
    background: var(--amber) !important;
    color: #000 !important;
    border-color: var(--amber) !important;
}

@media (max-width: 900px) {
    #btn-ind-ict,
    #btn-ind-harmonic,
    #btn-ind-elliott,
    #btn-ind-fibo {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 10px !important;
        padding: 2px 7px !important;
        height: 24px !important;
        white-space: nowrap !important;
    }
}


/* Prominent Change Rate Percentage Column & Badge */
.col-chg {
    font-weight: 800 !important;
    font-family: 'JetBrains Mono', monospace !important;
    white-space: nowrap !important;
    text-align: right !important;
    font-size: 11.5px !important;
    letter-spacing: -0.2px !important;
    padding: 3px 6px !important;
}
.col-chg.up {
    color: #10d99a !important;
}
.col-chg.dn, .col-chg.down {
    color: #ff3b30 !important;
}
.chg-badge {
    display: inline-block;
    padding: 1.5px 6px;
    border-radius: 3px;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: -0.2px;
    line-height: 1.25;
    text-align: right;
    transition: background 0.2s ease, color 0.2s ease;
}
.chg-badge.up {
    background: rgba(16, 217, 154, 0.14);
    color: #10d99a;
}
.chg-badge.dn, .chg-badge.down {
    background: rgba(255, 59, 48, 0.14);
    color: #ff3b30;
}


/* ==========================================================================
   v21.0 MASTER ADDITIONS: NAV TABS, MODE TOGGLES, PRO MODAL, AUTOBOT
   ========================================================================== */

/* Top Navigation Tabs */
.top-nav-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 12px;
}
.top-nav-link {
    color: #888;
    text-decoration: none;
    font: 600 11px 'Noto Sans KR', sans-serif;
    padding: 3px 8px;
    border-radius: 2px;
    border: 1px solid transparent;
    transition: all .15s ease;
}
.top-nav-link:hover {
    color: #fff;
    background: #141f19;
    border-color: #283a30;
}
.top-nav-link.on {
    color: #fff;
    background: #0d241c;
    border-color: #1a4d3b;
    font-weight: 700;
}
.top-nav-link.pro-badge {
    background: #2a1a05;
    border-color: #78350f;
    color: #fbbf24;
    font-weight: 700;
}
.top-nav-link.pro-badge:hover {
    background: #78350f;
    color: #fff;
}

/* TradePad Mode Toggle */
.tp-mode-toggle {
    display: flex;
    gap: 4px;
    padding: 4px 6px;
    background: #080c0a;
    border-bottom: 1px solid #141f19;
    align-items: center;
}
.tp-mode-btn {
    flex: 1;
    background: #101914;
    border: 1px solid #203028;
    color: #888;
    font: 600 10px 'Noto Sans KR', sans-serif;
    padding: 3px 6px;
    border-radius: 2px;
    cursor: pointer;
    transition: all .15s ease;
}
.tp-mode-btn:hover { color: #fff; background: #16261f; }
.tp-mode-btn.on {
    background: #0c2b20;
    border-color: #1b543e;
    color: var(--amber);
    font-weight: 700;
}
.btn-autobot {
    background: #101914;
    border: 1px solid #78350f;
    color: #fbbf24;
    font: 700 10px 'Noto Sans KR', sans-serif;
    padding: 3px 8px;
    border-radius: 2px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s ease;
}
.btn-autobot.on {
    background: #78350f;
    color: #fff;
    border-color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

/* AutoBot Dashboard & Auto-Alpha Table */
.autobot-dashboard-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #0a110e;
    border-bottom: 1px solid #141f19;
}
.autobot-badge {
    padding: 2px 6px;
    border-radius: 2px;
    font: 700 9.5px 'JetBrains Mono', monospace;
    margin-right: 6px;
}
.autobot-badge.running { background: #1b543e; color: #10d99a; }
.autobot-badge.stopped { background: #222; color: #777; }
.rank-badge {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: #141f19;
    border-radius: 2px;
    font-weight: 700;
    font-size: 10px;
}
.rank-badge.top1 { background: #78350f; color: #fbbf24; }
.score-pill {
    padding: 1px 5px;
    background: #0f2e22;
    color: #10d99a;
    border-radius: 2px;
    font-weight: 700;
}
.bias-badge {
    padding: 1px 6px;
    border-radius: 2px;
    font-weight: 800;
}
.bias-badge.l { background: #0c2b20; color: #10d99a; border: 1px solid #16523c; }
.bias-badge.s { background: #3b1408; color: #ff5252; border: 1px solid #63220f; }
.pro-locked-row { opacity: 0.6; cursor: pointer; }
.pro-locked-row:hover { opacity: 1; background: rgba(120, 53, 15, 0.15); }
.pro-tag {
    background: #78350f;
    color: #fbbf24;
    padding: 1px 4px;
    font-size: 9px;
    border-radius: 2px;
    font-weight: 800;
}
.btn-unlock-pro {
    background: #78350f;
    color: #fff;
    border: 0;
    padding: 2px 6px;
    border-radius: 2px;
    font-weight: 700;
    cursor: pointer;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-box {
    background: #0c120f;
    border: 1px solid #20382b;
    border-radius: 4px;
    width: 94%;
    max-width: 480px;
    max-height: 88vh;
    max-height: 88dvh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.9);
    overflow: hidden;
}
.modal-body {
    padding: 16px;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #080d0a;
    border-bottom: 1px solid #14241b;
}
.modal-header h3 { margin: 0; font-size: 14px; font-weight: 700; color: #fff; }
.modal-close {
    background: 0; border: 0; color: #888; font-size: 18px; cursor: pointer;
}
.modal-close:hover { color: #fff; }
.modal-body { padding: 16px; }

/* PRO Modal Styling */
.pro-price-card {
    text-align: center;
    padding: 16px;
    background: #141b17;
    border: 1px solid #78350f;
    border-radius: 4px;
    margin-bottom: 16px;
}
.pro-plan-badge {
    background: #78350f;
    color: #fbbf24;
    font: 800 10px 'JetBrains Mono', monospace;
    padding: 2px 8px;
    border-radius: 2px;
    display: inline-block;
    margin-bottom: 8px;
}
.pro-price { font-size: 24px; color: #fff; }
.pro-price b { color: #fbbf24; }
.pro-subtext { color: #888; font-size: 11px; margin: 4px 0 0; }
.pro-feature-list { list-style: none; padding: 0; margin: 0 0 16px; }
.pro-feature-list li {
    padding: 7px 0;
    border-bottom: 1px solid #14221a;
    font-size: 12px;
    color: #ccc;
}
.btn-pro-activate {
    width: 100%;
    padding: 12px;
    background: #f59e0b;
    color: #000;
    border: 0;
    border-radius: 3px;
    font: 800 13px 'Noto Sans KR', sans-serif;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
    transition: all .15s ease;
}
.btn-pro-activate:hover { filter: brightness(1.15); }

/* API Modal Styling */
.api-notice {
    background: #141b17;
    border-left: 3px solid var(--amber);
    padding: 8px 12px;
    font-size: 11px;
    color: #aaa;
    margin-bottom: 14px;
    line-height: 1.5;
}
.api-form-group { margin-bottom: 12px; }
.api-form-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #888;
    margin-bottom: 4px;
}
.api-select, .api-input {
    width: 100%;
    height: 32px;
    background: #060a08;
    border: 1px solid #20382b;
    color: #fff;
    padding: 0 8px;
    border-radius: 2px;
    font: 500 11.5px 'JetBrains Mono', monospace;
    outline: 0;
    box-sizing: border-box;
}
.btn-save-api {
    width: 100%;
    height: 34px;
    background: var(--amber);
    color: #000;
    border: 0;
    font: 800 12px 'Noto Sans KR', sans-serif;
    border-radius: 2px;
    cursor: pointer;
    margin-top: 8px;
}

/* Semantic Quant Column & Strategy Footer (AdSense High Quality Content) */
.terminal-semantic-footer {
    background: #030604;
    border-top: 1px solid #14241b;
    padding: 36px 20px 48px;
    color: #88928c;
    font-family: -apple-system, BlinkMacSystemFont, "Noto Sans KR", sans-serif;
    line-height: 1.7;
}
.quant-article h2 {
    color: #d1d8d4;
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 20px;
    border-left: 3px solid var(--amber);
    padding-left: 10px;
}
.quant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.quant-sec h3 {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 8px;
}
.quant-sec p {
    font-size: 11.5px;
    margin: 0;
    text-align: justify;
}
.legal-disclaimer-box {
    border-top: 1px solid #14241b;
    padding-top: 18px;
    font-size: 10.5px;
    color: #66726b;
}
.legal-disclaimer-box a {
    color: #88928c;
    text-decoration: none;
}
.legal-disclaimer-box a:hover {
    color: var(--amber);
}


/* ==========================================================================
   v21.3 MOBILE ZERO-CUTOFF & EXPLANATION ENHANCEMENTS
   ========================================================================== */
@media (max-width: 900px) {
    /* Topbar clean horizontal swipe */
    .topbar {
        display: flex !important;
        align-items: center !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        flex-shrink: 0 !important;
        width: 100% !important;
        padding: 0 6px !important;
        gap: 6px !important;
        box-sizing: border-box !important;
    }
    .topbar::-webkit-scrollbar { display: none; }
    .top-nav-tabs {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        flex-shrink: 0 !important;
        margin-right: 6px !important;
    }
    .top-nav-link {
        font-size: 11px !important;
        padding: 3px 7px !important;
        flex-shrink: 0 !important;
    }
    .top-nav-link.help-badge {
        background: #142820 !important;
        border-color: #22ab94 !important;
        color: #22ab94 !important;
        font-weight: 700 !important;
    }

    /* Modal box mobile sizing */
    .modal-overlay {
        padding: 10px !important;
    }
    .modal-box {
        width: 96% !important;
        max-height: 88dvh !important;
    }
    .modal-body {
        padding: 14px 12px !important;
        max-height: calc(88dvh - 50px) !important;
    }
    .pro-price {
        font-size: 20px !important;
    }
    .pro-feature-list li {
        font-size: 11.5px !important;
        line-height: 1.5 !important;
        word-break: keep-all;
    }

    /* Help & Auth Modal on Mobile */
    .mbox {
        width: 96vw !important;
        max-height: 88dvh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        display: block !important;
        box-sizing: border-box !important;
        padding: 0 0 16px 0 !important;
    }
    .mbox .ph {
        position: sticky !important;
        top: 0 !important;
        background: #081512 !important;
        z-index: 10 !important;
        padding: 8px 12px !important;
        border-bottom: 1px solid var(--line) !important;
    }
    .mbox .help-tbl {
        display: table !important;
        width: 100% !important;
    }
    .mbox .help-tbl td {
        padding: 6px 8px !important;
        font-size: 11px !important;
        word-break: keep-all !important;
    }
    .mbox .help-note {
        padding: 10px 12px !important;
        font-size: 11.5px !important;
        line-height: 1.65 !important;
        word-break: keep-all !important;
    }
    .mbox .auth-body {
        padding: 12px !important;
    }

    /* AdSense Container 320x50 on mobile to prevent viewport expansion */
    .adsense-fixed-slot {
        min-height: 52px !important;
        max-height: 52px !important;
        width: 100% !important;
        padding: 0 !important;
        overflow: hidden !important;
    }
    .adsense-fixed-slot ins {
        width: 320px !important;
        max-width: 100% !important;
        height: 50px !important;
    }

    /* Semantic Footer Mobile Layout */
    .terminal-semantic-footer {
        padding: 24px 14px 44px !important;
    }
    .quant-article h2 {
        font-size: 16px !important;
        line-height: 1.4 !important;
        word-break: keep-all;
    }
    .quant-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .quant-sec h3 {
        font-size: 13.5px !important;
        line-height: 1.4 !important;
        word-break: keep-all;
    }
    .quant-sec p {
        font-size: 12px !important;
        line-height: 1.7 !important;
        text-align: left !important;
        word-break: keep-all;
    }
}



/* ---------- High-Grade Topbar (Line 1: Logo, Demo Mode, Login, PRO Subscribe) ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 38px;
    padding: 0 12px;
    background: #09110e;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    overflow: hidden;
    flex-shrink: 0;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.brand {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    color: var(--amber);
    letter-spacing: 0.5px;
    user-select: none;
    cursor: pointer;
    transition: filter .15s ease;
}
.brand:hover { filter: brightness(1.2); }
.brand-icon { width: 18px; height: 18px; }
/* Restored signature emerald gradient badge */

    .brand-logo {
        background: transparent !important;
        color: #22ab94 !important;
        padding: 0 !important;
        border: none !important;
        font-weight: 800 !important;
        font-size: 14.5px !important;
        letter-spacing: 1.2px !important;
        font-family: 'Cinzel', serif !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }


.mode-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    font: 800 11px 'Noto Sans KR', sans-serif;
    border-radius: 3px;
    cursor: pointer;
    line-height: 1.2;
    transition: all .15s ease;
    border: 1px solid transparent;
}
.mode-badge.demo {
    background: rgba(34, 197, 94, 0.14);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.4);
}
.mode-badge.demo:hover {
    background: rgba(34, 197, 94, 0.25);
}
.mode-badge.real {
    background: rgba(239, 68, 68, 0.16);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.45);
}

.top-btn.pro-btn {
    background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%) !important;
    color: #000 !important;
    border: none !important;
    font: 800 11px 'Noto Sans KR', sans-serif !important;
    padding: 3px 9px !important;
    border-radius: 2px !important;
    cursor: pointer !important;
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.3) !important;
    transition: filter .15s ease !important;
}
.top-btn.pro-btn:hover { filter: brightness(1.15) !important; }

/* ---------- Line 2: Command Bar (Search + Guide) ---------- */
.cmdbar {
    display: flex;
    align-items: center;
    height: 34px;
    padding: 0 8px;
    background: #050a08;
    border-bottom: 1px solid var(--line);
    gap: 8px;
    flex-shrink: 0;
}
.cmd-prompt {
    color: var(--amber);
    font-weight: 700;
    font-size: 13px;
    user-select: none;
    flex-shrink: 0;
}
.cmd-input-wrap {
    flex: 1;
    position: relative;
    min-width: 0;
}
#cmd {
    width: 100%;
    height: 26px;
    background: #0d1713;
    border: 1px solid #1c2b24;
    border-radius: 2px;
    color: #fff;
    padding: 0 8px;
    font-size: 11.5px;
    outline: none;
    box-sizing: border-box;
}
#cmd:focus {
    border-color: var(--amber);
}
.cmd-guide-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    padding: 0 10px;
    background: rgba(34, 171, 148, 0.15);
    border: 1px solid #22ab94;
    color: #22ab94;
    font: 700 11px 'Noto Sans KR', sans-serif;
    border-radius: 2px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all .15s ease;
}
.cmd-guide-btn:hover {
    background: #22ab94;
    color: #000;
}

/* ---------- Kimp Panel Macro & Sentiment Overview ---------- */
.kimp-macro-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    background: #08110e;
    border-bottom: 1px solid #1a2a22;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.kimp-macro-bar .macro-item {
    font-size: 11px;
    color: #889c93;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.kimp-macro-bar .macro-item b {
    color: #fff;
    font-weight: 700;
}
.kimp-macro-bar .macro-item b.up { color: var(--up); }
.kimp-macro-bar .macro-item b.dn { color: var(--dn); }

/* ---------- Comprehensive Help Modal & Comparison Table ---------- */
.help-mbox {
    width: min(840px, 95vw) !important;
    max-height: 88vh;
    max-height: 88dvh;
    background: #08120e;
    border: 1px solid var(--amber);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.help-scroll-container {
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}
.help-section {
    background: #0b1713;
    border: 1px solid #1b2e24;
    border-radius: 4px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pro-highlight-section {
    background: linear-gradient(180deg, #121c17 0%, #0d1713 100%);
    border-color: #ca8a04;
    box-shadow: 0 0 16px rgba(202, 138, 4, 0.12);
}
.sec-badge {
    display: inline-block;
    align-self: flex-start;
    font: 800 10px 'JetBrains Mono', 'Noto Sans KR', sans-serif;
    color: #eab308;
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.4);
    padding: 2px 6px;
    border-radius: 2px;
    text-transform: uppercase;
}
.help-section h3 {
    font: 700 14px 'Noto Sans KR', sans-serif;
    color: #fff;
    margin: 0;
}
.help-section p {
    font: 400 12px/1.65 'Noto Sans KR', sans-serif;
    color: #a2b7ac;
    margin: 0;
    word-break: keep-all;
}
.api-security-box {
    background: rgba(34, 197, 94, 0.08);
    border-left: 3px solid #22c55e;
    padding: 8px 12px;
    font-size: 11.5px;
    line-height: 1.6;
    color: #86efac;
    word-break: keep-all;
}
.risk-guard-box {
    background: rgba(239, 68, 68, 0.08);
    border-left: 3px solid #ef4444;
    padding: 8px 12px;
    font-size: 11.5px;
    line-height: 1.6;
    color: #fca5a5;
    word-break: keep-all;
}
.compare-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 8px 0;
    border: 1px solid #1c2b23;
    border-radius: 4px;
}
.compare-table-wrap h4 {
    font: 700 12.5px 'Noto Sans KR', sans-serif;
    color: #eab308;
    padding: 8px 12px;
    background: #0f1c16;
    margin: 0;
    border-bottom: 1px solid #1c2b23;
}
.compare-tbl {
    width: 100%;
    font-size: 11.5px;
    border-collapse: collapse;
}
.compare-tbl th, .compare-tbl td {
    padding: 8px 12px;
    border-bottom: 1px solid #16241d;
    text-align: left;
    word-break: keep-all;
}
.compare-tbl th {
    background: #0c1612;
    color: #889c93;
    font-weight: 700;
}
.highlight-th {
    color: #eab308 !important;
    background: rgba(234, 179, 8, 0.1) !important;
}
.highlight-td {
    color: #fef08a !important;
    background: rgba(234, 179, 8, 0.04) !important;
}
.pro-action-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.btn-open-pro-from-help {
    background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
    color: #000;
    font: 800 12.5px 'Noto Sans KR', sans-serif;
    padding: 9px 18px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: filter .15s ease;
}
.btn-open-pro-from-help:hover { filter: brightness(1.1); }
.link-detail-page {
    color: #a2b7ac;
    text-decoration: underline;
    font-size: 12px;
}
.help-bullet-list {
    margin: 0;
    padding-left: 18px;
    color: #a2b7ac;
    font: 400 12px/1.7 'Noto Sans KR', sans-serif;
}
.help-bullet-list li { margin-bottom: 4px; word-break: keep-all; }
.help-bullet-list b { color: #fff; }
.help-formula-box {
    background: #070e0b;
    border: 1px dashed #203b2e;
    padding: 8px 12px;
    font: 600 11.5px/1.6 'JetBrains Mono', monospace;
    color: #4ade80;
    border-radius: 3px;
    overflow-x: auto;
    word-break: break-all;
}
.pro-auto-trade-notice {
    background: rgba(234, 179, 8, 0.08);
    border-left: 3px solid #eab308;
    padding: 8px 12px;
    font-size: 11.5px;
    line-height: 1.6;
    color: #fef08a;
    margin-bottom: 12px;
    word-break: keep-all;
}



/* ==========================================================================
   v22.0 GALAXY S26 ULTRA & MOBILE MASTER RESPONSIVE OVERHAUL (ZERO CUTOFF)
   ========================================================================== */
@media (max-width: 900px) {
    html, body {
        overflow: hidden !important;
        height: 100% !important;
        height: 100dvh !important;
        width: 100% !important;
        -webkit-text-size-adjust: 100%;
    }
    #app {
        height: 100% !important;
        height: 100dvh !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        position: relative !important;
    }

    /* Topbar on Mobile: Perfectly balanced Row 1 (No horizontal scrolling required) */
    .topbar {
        height: 38px !important;
        padding: 0 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        overflow: hidden !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .topbar-left {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex-shrink: 0 !important;
    }
    .topbar-right {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex-shrink: 0 !important;
    }
    
    .brand-logo {
        background: transparent !important;
        color: #22ab94 !important;
        padding: 0 !important;
        border: none !important;
        font-weight: 800 !important;
        font-size: 14.5px !important;
        letter-spacing: 1.2px !important;
        font-family: 'Cinzel', serif !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    .brand-icon {
        width: 19px !important;
        height: 19px !important;
        border-radius: 3px !important;
    }
    .mode-badge {
        font-size: 10.5px !important;
        padding: 2px 6px !important;
    }
    .top-btn {
        padding: 3px 7px !important;
        font-size: 10.5px !important;
        height: 24px !important;
    }

    /* Cmdbar on Mobile: Row 2 (Search + Guide button) */
    .cmdbar {
        height: 34px !important;
        padding: 0 6px !important;
        gap: 6px !important;
        display: flex !important;
        align-items: center !important;
        flex-shrink: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .cmd-prompt { font-size: 12px !important; }
    #cmd {
        font-size: 11px !important;
        padding: 2px 6px !important;
        height: 25px !important;
    }
    .cmd-guide-btn {
        height: 25px !important;
        font-size: 10.5px !important;
        padding: 0 8px !important;
        flex-shrink: 0 !important;
    }
    .cmd-suggest {
        left: 6px !important;
        right: 6px !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    /* Ticker Tape */
    .tape {
        height: 18px !important;
        font-size: 9.5px !important;
        flex-shrink: 0 !important;
    }
    .ti {
        padding: 0 8px !important;
        line-height: 18px !important;
    }

    /* Fixed Mobile Bottom Tab Bar */
    .mob-tabbar {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 50px !important;
        background: #090e0c !important;
        border-top: 1px solid #1c2621 !important;
        z-index: 1000 !important;
        justify-content: space-around !important;
        align-items: center !important;
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.7) !important;
    }
    .mob-tab-btn {
        flex: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 100% !important;
        background: transparent !important;
        border: none !important;
        border-top: 2px solid transparent !important;
        color: #7b8e85 !important;
        cursor: pointer !important;
        padding: 0 4px !important;
        transition: all .15s ease !important;
        -webkit-tap-highlight-color: transparent !important;
    }
    .mob-tab-btn .mob-txt {
        font: 700 12px 'Noto Sans KR', sans-serif !important;
        letter-spacing: -0.2px !important;
    }
    .mob-tab-btn.active {
        color: #ffffff !important;
        border-top-color: #ff3b30 !important;
        background: linear-gradient(180deg, rgba(255, 59, 48, 0.12) 0%, transparent 100%) !important;
    }

    /* Mobile Segmented View Layout - CRITICAL ZERO-CUTOFF FIX */
    .grid {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
        min-height: 0 !important;
        padding: 2px 2px calc(52px + env(safe-area-inset-bottom, 12px)) 2px !important;
        overflow: hidden !important;
        grid-template-columns: none !important;
        grid-template-rows: none !important;
        grid-template-areas: none !important;
        gap: 2px !important;
        box-sizing: border-box !important;
    }
    .grid .panel {
        display: none !important;
        width: 100% !important;
        height: 100% !important;
        flex: 1 !important;
        min-height: 0 !important;
        border-radius: 2px !important;
        box-sizing: border-box !important;
    }

    /* TAB 1: 시세 (mob-view-mon) - 김프 & 도미넌스 상단 + 전체 시세 하단 */
    .grid.mob-view-mon {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 6px !important;
        padding-bottom: 60px !important;
    }
    .grid.mob-view-mon .p-kimp {
        display: flex !important;
        flex-direction: column !important;
        flex-shrink: 0 !important;
        height: auto !important;
        max-height: 320px !important;
        width: 100% !important;
        order: 1 !important;
    }
    .grid.mob-view-mon .p-monitor,
    .grid:not([class*="mob-view-"]) .p-monitor {
        display: flex !important;
        flex-direction: column !important;
        flex-shrink: 0 !important;
        min-height: 520px !important;
        width: 100% !important;
        order: 2 !important;
    }
    .grid.mob-view-mon .p-monitor .pb {
        flex: 1 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* TAB 2: 차트 (mob-view-main) - 차트 + 슬림 주문패드 + 스크롤 시 보유포지션 & 미체결 지정가 */
    .grid.mob-view-main {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 6px !important;
        padding-bottom: 60px !important;
    }
    .grid.mob-view-main .p-main {
        display: flex !important;
        flex-direction: column !important;
        flex: none !important;
        height: auto !important;
        min-height: 0 !important;
        width: 100% !important;
        order: 1 !important;
        overflow: visible !important;
    }
    .grid.mob-view-main .p-main .chart-wrap {
        height: 380px !important;
        min-height: 320px !important;
        max-height: 48vh !important;
        flex: none !important;
        width: 100% !important;
        position: relative !important;
        touch-action: none !important;
    }
    .grid.mob-view-main .p-main .trade-pad {
        flex-shrink: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 5px !important;
        padding: 6px 8px 12px 8px !important;
        background: #0a110e !important;
        border-top: 1px solid var(--line) !important;
    }
    .grid.mob-view-main .p-fx {
        display: flex !important;
        flex-direction: column !important;
        flex-shrink: 0 !important;
        width: 100% !important;
        min-height: 420px !important;
        order: 2 !important;
        margin-top: 6px !important;
        margin-bottom: 20px !important;
    }

    /* TAB 3: 호가 (mob-view-ob) - 전면 호가창 + 하단 호가 즉각 매수/매도/청산 바 */
    .grid.mob-view-ob {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        overflow: hidden !important;
        padding-bottom: 52px !important;
    }
    .grid.mob-view-ob .p-ob {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        height: 100% !important;
        min-height: 0 !important;
        width: 100% !important;
    }
    .grid.mob-view-ob .p-ts {
        display: none !important;
    }

    /* Modals on Mobile: Perfectly scrollable without overflow */
    .modal-overlay {
        padding: 8px !important;
    }
    .modal-box {
        width: 96% !important;
        max-height: 88dvh !important;
    }
    .modal-body {
        padding: 12px !important;
        max-height: calc(88dvh - 48px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .help-mbox {
        width: 96vw !important;
        max-height: 88dvh !important;
    }
    .help-scroll-container {
        padding: 12px !important;
    }

    .statusbar {
        display: none !important;
    }
}



/* ==========================================================================
   v23.0 INSTANT DUAL ENVIRONMENT (PC VS MOBILE SPECIFIC REFINEMENT)
   ========================================================================== */

/* ---------- Panel 7 Equal 50:50 Split (Active Positions vs Open Limit Orders) ---------- */
.pos-table-wrap, .open-orders-wrap {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

/* ---------- Segmented Demo vs Real Mode Toggle Group ---------- */
.mode-toggle-group {
    display: inline-flex;
    align-items: center;
    background: #060d0a;
    border: 1px solid #1a2a22;
    border-radius: 3px;
    padding: 2px;
    gap: 2px;
}
.mode-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #6d8076;
    font: 800 11px 'Noto Sans KR', sans-serif;
    padding: 2px 8px;
    border-radius: 2px;
    cursor: pointer;
    line-height: 1.2;
    transition: all .15s ease;
}
.mode-btn:hover { color: #fff; }
.mode-btn.on#btn-mode-demo {
    background: rgba(34, 197, 94, 0.16) !important;
    color: #4ade80 !important;
    border-color: rgba(34, 197, 94, 0.45) !important;
}
.mode-btn.on#btn-mode-real {
    background: rgba(239, 68, 68, 0.22) !important;
    color: #f87171 !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
}

/* Desktop Only Elements */
.desktop-only {
    display: inline-flex !important;
}

/* ---------- P-Main Header: Title & 2 Badge Anti-Clipping ---------- */
.p-main-title-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
    min-width: 0 !important;
}
.p-main-title-wrap .pt {
    flex-shrink: 0 !important;
    overflow: visible !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
}
.p-main-title-wrap .pt .num {
    display: inline-block !important;
    background: var(--amber) !important;
    color: #000 !important;
    font-weight: 900 !important;
    padding: 0 5px !important;
    margin-right: 6px !important;
    border-radius: 2px !important;
    line-height: 14px !important;
    height: 14px !important;
}

/* ---------- Real Mode Activation Modal ---------- */
.real-modal-box {
    width: min(520px, 94vw);
    max-height: 88dvh;
    background: #09120e;
    border: 1px solid #ef4444;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85);
}
.real-mode-badge-card {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 4px;
    padding: 12px 14px;
    margin-bottom: 12px;
}
.real-active-badge {
    display: inline-block;
    font: 800 10px 'JetBrains Mono', monospace;
    background: #ef4444;
    color: #fff;
    padding: 2px 6px;
    border-radius: 2px;
    margin-bottom: 6px;
}
.real-mode-badge-card h4 {
    font: 700 13.5px 'Noto Sans KR', sans-serif;
    color: #fca5a5;
    margin: 4px 0 6px 0;
}
.real-mode-badge-card p {
    font: 400 12px/1.6 'Noto Sans KR', sans-serif;
    color: #cbd5e1;
    margin: 0;
    word-break: keep-all;
}
.real-feature-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}
.rf-item {
    background: #0e1713;
    border-left: 3px solid #ef4444;
    padding: 8px 12px;
    border-radius: 0 3px 3px 0;
}
.rf-item b {
    font: 700 12px 'Noto Sans KR', sans-serif;
    color: #fff;
    display: block;
    margin-bottom: 3px;
}
.rf-item p {
    font: 400 11.5px/1.55 'Noto Sans KR', sans-serif;
    color: #94a3b8;
    margin: 0;
    word-break: keep-all;
}
.real-action-buttons {
    display: flex;
    gap: 8px;
}
.btn-real-api {
    flex: 1;
    background: #1e293b;
    border: 1px solid #334155;
    color: #f1f5f9;
    font: 700 12px 'Noto Sans KR', sans-serif;
    padding: 10px 0;
    border-radius: 3px;
    cursor: pointer;
    transition: all .15s ease;
}
.btn-real-api:hover { background: #334155; }
.btn-real-pro {
    flex: 1;
    background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
    border: none;
    color: #000;
    font: 800 12px 'Noto Sans KR', sans-serif;
    padding: 10px 0;
    border-radius: 3px;
    cursor: pointer;
    transition: filter .15s ease;
}
.btn-real-pro:hover { filter: brightness(1.1); }

/* ---------- Mobile Distinct Overhaul (Strict No-Overflow & Dignified Aesthetics) ---------- */
@media (max-width: 900px) {
    /* Hide desktop-only elements cleanly */
    .desktop-only {
        display: none !important;
    }

    /* Restored Original Iconic PRMANR Gradient Badge on Mobile */
    .mode-toggle-group {
        padding: 1px !important;
        gap: 1px !important;
    }
    .mode-btn {
        font-size: 10px !important;
        padding: 2px 6px !important;
    }

    /* Mobile Chart Panel Header: Hide Back Button & Keep "2 CHART" Visible */
    .p-main-title-wrap .back-grid-btn {
        display: none !important;
    }
    .chart-hdr-tools {
        flex: 1 !important;
        min-width: 0 !important;
        overflow-x: auto !important;
    }

    /* Help Modal on Mobile: Strict Zero Horizontal Empty Space & Vertical Only */
    .help-mbox {
        width: 96vw !important;
        max-width: 96vw !important;
        max-height: 88dvh !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    .help-scroll-container {
        padding: 10px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .help-section {
        padding: 12px 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    .compare-table-wrap {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        box-sizing: border-box !important;
        margin: 8px 0 !important;
    }
    .compare-tbl {
        width: 100% !important;
        min-width: 380px !important;
        table-layout: auto !important;
        font-size: 10.5px !important;
    }
    .compare-tbl th, .compare-tbl td {
        padding: 7px 6px !important;
        word-break: break-word !important;
        font-size: 10.5px !important;
        line-height: 1.35 !important;
    }
    .compare-tbl th:nth-child(1), .compare-tbl td:nth-child(1) { width: auto !important; white-space: nowrap !important; }
    .compare-tbl th:nth-child(2), .compare-tbl td:nth-child(2) { width: auto !important; text-align: center !important; }
    .compare-tbl th:nth-child(3), .compare-tbl td:nth-child(3) { width: auto !important; text-align: center !important; }
    
    .help-tbl {
        width: 100% !important;
        table-layout: fixed !important;
    }
    .help-tbl td {
        padding: 5px 3px !important;
        font-size: 10.5px !important;
        word-break: keep-all !important;
    }
    .help-tbl td:nth-child(1) { width: 36% !important; }
    .help-tbl td:nth-child(2) { width: 64% !important; }
}


/* ==========================================================================
   v24.0 HIGH DENSITY RESPONSIVE TABLES & BINANCE/OKX VIBRANT CONTRAST
   ========================================================================== */

/* ---------- Market Monitor (#p-monitor) Fixed Table & Truncation Prevention ---------- */
#p-monitor .tbl {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
}
#p-monitor .tbl th, #p-monitor .tbl td {
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    padding: 5px 4px !important;
}
#p-monitor .tbl th:nth-child(1), #p-monitor .tbl td:nth-child(1) {
    width: 40% !important;
    text-align: left !important;
}
#p-monitor .tbl th:nth-child(2), #p-monitor .tbl td:nth-child(2) {
    width: 32% !important;
    text-align: right !important;
    font-variant-numeric: tabular-nums !important;
    font-weight: 700 !important;
    font-size: 11.5px !important;
    letter-spacing: -0.2px !important;
}
#p-monitor .tbl th:nth-child(3), #p-monitor .tbl td:nth-child(3) {
    width: 28% !important;
    text-align: right !important;
    padding-right: 4px !important;
}
#p-monitor .tbl th:nth-child(4), #p-monitor .tbl td:nth-child(4) {
    display: none !important;
}

#p-monitor .nm {
    display: inline-flex !important;
    align-items: baseline !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 11.5px !important;
}
#p-monitor .nm small {
    font-size: 9.5px !important;
    opacity: 0.75 !important;
    margin-left: 3px !important;
}

/* ---------- Active Positions & Unfilled Orders (Zero Horizontal Scroll) ---------- */
.pos-table-wrap, .open-orders-wrap {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
}
.pos-table-wrap .tbl, .open-orders-wrap .tbl {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
}
.pos-table-wrap .tbl th, .pos-table-wrap .tbl td,
.open-orders-wrap .tbl th, .open-orders-wrap .tbl td {
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    padding: 5px 3px !important;
    font-size: 11px !important;
}
.pos-table-wrap .tbl th:nth-child(1), .pos-table-wrap .tbl td:nth-child(1),
.open-orders-wrap .tbl th:nth-child(1), .open-orders-wrap .tbl td:nth-child(1) {
    width: 34% !important;
    text-align: left !important;
}
.pos-table-wrap .tbl th:nth-child(2), .pos-table-wrap .tbl td:nth-child(2),
.open-orders-wrap .tbl th:nth-child(2), .open-orders-wrap .tbl td:nth-child(2) {
    width: 26% !important;
    text-align: right !important;
}
.pos-table-wrap .tbl th:nth-child(3), .pos-table-wrap .tbl td:nth-child(3),
.open-orders-wrap .tbl th:nth-child(3), .open-orders-wrap .tbl td:nth-child(3) {
    width: 25% !important;
    text-align: right !important;
}
.pos-table-wrap .tbl th:nth-child(4), .pos-table-wrap .tbl td:nth-child(4),
.open-orders-wrap .tbl th:nth-child(4), .open-orders-wrap .tbl td:nth-child(4) {
    width: 15% !important;
    text-align: center !important;
}

.pos-close-btn {
    background: #7f1d1d !important;
    border: 1px solid #dc2626 !important;
    color: #fecaca !important;
    width: 100% !important;
    max-width: 44px !important;
    padding: 3px 0 !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    border-radius: 2px !important;
    cursor: pointer !important;
}
.pos-close-btn:hover { background: #dc2626 !important; color: #fff !important; }

.open-order-cancel-btn {
    background: #1e293b !important;
    border: 1px solid #475569 !important;
    color: #cbd5e1 !important;
    width: 100% !important;
    max-width: 44px !important;
    padding: 3px 0 !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    border-radius: 2px !important;
    cursor: pointer !important;
}
.open-order-cancel-btn:hover { background: #334155 !important; color: #fff !important; }

/* ---------- Crisp High-Contrast Badges & Numbers ---------- */
.chg-badge {
    display: inline-block !important;
    padding: 2px 6px !important;
    border-radius: 2px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    font-variant-numeric: tabular-nums !important;
    line-height: 1.25 !important;
    letter-spacing: -0.3px !important;
}
.chg-badge.up {
    background: rgba(0, 192, 135, 0.16) !important;
    color: #00c087 !important;
    border: 1px solid rgba(0, 192, 135, 0.45) !important;
}
.chg-badge.dn {
    background: rgba(255, 77, 79, 0.16) !important;
    color: #ff4d4f !important;
    border: 1px solid rgba(255, 77, 79, 0.45) !important;
}

/* User Icon on Login Button */
.top-auth-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}


/* ==========================================================================
   v26.0 MASTER HARMONIZATION (ZERO-CLIPPING, WHALE & RETAIL EXCELLENCE)
   ========================================================================== */

/* 1. Global Topbar (Desktop & Mobile): Uniform 42px height, perfect vertical center */
.topbar {
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 12px !important;
    background: #09110e !important;
    border-bottom: 1px solid var(--line) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    width: 100% !important;
}
.topbar-left, .topbar-right {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
}
.brand {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    user-select: none !important;
}
.brand-icon {
    width: 20px !important;
    height: 20px !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
}
.brand-logo {
    font-family: 'Cinzel', serif !important;
    font-weight: 800 !important;
    font-size: 14.5px !important;
    color: #22ab94 !important;
    letter-spacing: 1.2px !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}
.mode-toggle-group {
    display: inline-flex !important;
    align-items: center !important;
    background: #060e0b !important;
    border: 1px solid #1c2b23 !important;
    border-radius: 3px !important;
    padding: 2px !important;
    gap: 2px !important;
    height: 26px !important;
}
.mode-btn {
    height: 20px !important;
    line-height: 18px !important;
    padding: 0 7px !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    border-radius: 2px !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    color: #6d8076 !important;
    cursor: pointer !important;
}
.mode-btn.on#btn-mode-demo {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #4ade80 !important;
    border-color: rgba(34, 197, 94, 0.5) !important;
}
.mode-btn.on#btn-mode-real {
    background: rgba(239, 68, 68, 0.25) !important;
    color: #f87171 !important;
    border-color: rgba(239, 68, 68, 0.6) !important;
}
.top-btn {
    height: 26px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
    border-radius: 2px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}
.top-btn.pro-btn {
    background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%) !important;
    color: #000 !important;
    border: none !important;
    font-weight: 800 !important;
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.35) !important;
}
.top-btn.auth-btn {
    background: #0e1e17 !important;
    border: 1px solid #1a3328 !important;
    color: #a7f3d0 !important;
    font-weight: 700 !important;
}

/* 2. Command Bar (Row 2): Search + Guide */
.cmdbar {
    height: 36px !important;
    min-height: 36px !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 10px !important;
    gap: 8px !important;
    background: #050a08 !important;
    border-bottom: 1px solid var(--line) !important;
    box-sizing: border-box !important;
}
.cmd-guide-btn {
    height: 26px !important;
    padding: 0 10px !important;
    font-size: 11px !important;
    background: rgba(34, 171, 148, 0.15) !important;
    border: 1px solid #22ab94 !important;
    color: #22ab94 !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    border-radius: 2px !important;
}

/* 3. Timeframes & Sub-toolbars: Prevent text truncation */
#tf-tabs {
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
}
#tf-tabs::-webkit-scrollbar { display: none !important; }
#tf-tabs button {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    padding: 2px 7px !important;
    font-size: 10.5px !important;
    background: transparent !important;
    border: 1px solid #203028 !important;
    color: #888 !important;
    height: 22px !important;
    border-radius: 2px !important;
}
#tf-tabs button.on {
    background: var(--amber) !important;
    color: #000 !important;
    font-weight: 700 !important;
    border-color: var(--amber) !important;
}
.chart-subbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 3px 6px !important;
    gap: 6px !important;
    background: #060b09 !important;
    border-bottom: 1px solid var(--line) !important;
    flex-shrink: 0 !important;
}
.chart-subbar::-webkit-scrollbar { display: none !important; }
.chart-ind-group, .chart-meta-group {
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

/* 4. Panel 7 Equal 50:50 Split (Active Positions vs Open Limit Orders) */
.p-fx .pb {
    display: flex !important;
    flex-direction: column !important;
    height: calc(100% - 34px) !important;
    overflow: hidden !important;
}
.pos-table-wrap, .open-orders-wrap {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
}

/* 5. Mobile Layout Refinements (<= 900px) */
@media (max-width: 900px) {
    .sec-head {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
        padding: 6px 8px !important;
        border-bottom: 1px solid var(--line) !important;
    }
    .sec-head > div:first-child {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: baseline !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 2px 8px !important;
    }
    .sh-name {
        width: 100% !important;
        font-size: 13.5px !important;
        line-height: 1.25 !important;
    }
    .sh-price {
        font-size: 20px !important;
        font-weight: 700 !important;
    }
    .sh-chg {
        font-size: 11.5px !important;
    }
    .sh-stats {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2px 10px !important;
        width: 100% !important;
        padding-top: 4px !important;
        border-top: 1px dotted #1d2c25 !important;
    }
    .sh-stats .st:nth-child(n+5) {
        display: none !important;
    }
    
    .mon-cat-bar {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        gap: 4px !important;
        padding: 4px 6px !important;
    }
    .mon-cat-bar::-webkit-scrollbar { display: none !important; }
    .mon-cat-bar button {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        height: 24px !important;
        padding: 0 8px !important;
        font-size: 11px !important;
        background: #0d1612 !important;
        border: 1px solid #1c2a22 !important;
        color: #889 !important;
        border-radius: 2px !important;
    }
    .mon-cat-bar button.on {
        background: #08241d !important;
        color: var(--amber) !important;
        border-color: var(--amber) !important;
        font-weight: 700 !important;
    }

    /* Monitor Table Cell Layout: Clean alignment */
    #p-monitor .tbl th:nth-child(1), #p-monitor .tbl td:nth-child(1) { width: 44% !important; }
    #p-monitor .tbl th:nth-child(2), #p-monitor .tbl td:nth-child(2) { width: 30% !important; }
    #p-monitor .tbl th:nth-child(3), #p-monitor .tbl td:nth-child(3) { width: 26% !important; }

    .nm {
        display: inline-flex !important;
        align-items: center !important;
        gap: 3px !important;
        max-width: 100% !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }
    .nm-txt {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-weight: 600 !important;
        font-size: 11px !important;
    }
    .nm small {
        font-size: 9px !important;
        color: #6d8076 !important;
        flex-shrink: 0 !important;
        margin-left: 2px !important;
    }
}

/* Fix Flex Shrink Crushing in Monitor Rows */
.cat-tag {
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
#p-monitor .nm, .nm {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}
#p-monitor .nm-txt, .nm-txt {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-weight: 600 !important;
    font-size: 11.5px !important;
}
#p-monitor .nm small, .nm small {
    flex-shrink: 0 !important;
    font-size: 9.5px !important;
    color: #6d8076 !important;
    margin-left: 2px !important;
}

/* --- PRMANR v27 High-Precision Trading UX Styles --- */
.mode-btn.autobot-btn {
    background: #0f241a !important;
    color: #34d399 !important;
    border: 1px solid #059669 !important;
    font-weight: 700 !important;
    padding: 0 8px !important;
    font-size: 11px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}
.mode-btn.autobot-btn:hover {
    background: #143526 !important;
    color: #6ee7b7 !important;
}
.mode-btn.autobot-btn.on {
    background: #059669 !important;
    color: #fff !important;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4) !important;
}

/* Hide chart reset button on mobile (증거금 쪽에 리셋이 있으므로 모바일 차트 위 숨김) */
@media (max-width: 900px) {
    #btn-chart-reset {
        display: none !important;
    }
    
    /* Command bar on mobile (검색창 + 가이드·설명 + PRO 구독 한 줄 배치, 가로 스크롤 완전 제거) */
    .cmdbar {
        display: flex !important;
        align-items: center !important;
        gap: 3px !important;
        padding: 3px 6px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        flex-wrap: nowrap !important;
    }
    .cmdbar .cmd-prompt {
        flex-shrink: 0 !important;
        margin-right: 2px !important;
    }
    .cmdbar .cmd-input-wrap {
        flex: 1 1 auto !important;
        min-width: 60px !important;
        overflow: hidden !important;
    }
    .cmdbar #cmd {
        width: 100% !important;
        font-size: 11px !important;
        padding: 4px 6px !important;
        box-sizing: border-box !important;
    }
    .cmd-guide-btn, .cmdbar .cmd-pro-btn {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        font-size: 10px !important;
        padding: 3px 6px !important;
        height: 25px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Trade Pad Inputs on Mobile (비율 1%~100% 셀렉트 + 증거금 + 매수/숏/청산/리셋 한 화면 쏙 들어감) */
    .tp-inputs {
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 3px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    .tp-pct-wrap {
        flex-shrink: 0 !important;
    }
    .tp-pct-select {
        background: #0d1712 !important;
        color: var(--amber) !important;
        border: 1px solid #1f3328 !important;
        border-radius: 3px !important;
        font-weight: 700 !important;
        font-size: 11px !important;
        height: 27px !important;
        padding: 0 3px !important;
        outline: none !important;
        cursor: pointer !important;
    }
    #tp-amount-input {
        flex: 1 1 auto !important;
        min-width: 50px !important;
        height: 27px !important;
        font-size: 11px !important;
        padding: 0 4px !important;
        box-sizing: border-box !important;
    }
    .tp-act {
        flex-shrink: 0 !important;
        height: 27px !important;
        padding: 0 6px !important;
        font-size: 11px !important;
        white-space: nowrap !important;
    }

    /* Orderbook Bar (호가창 하단 즉각 매수/매도/청산 트레이딩 바) */
    .ob-order-bar {
        display: flex !important;
        flex-direction: column !important;
        gap: 3px !important;
        padding: 5px 6px !important;
        background: #09120e !important;
        border-top: 1px solid var(--line) !important;
        flex-shrink: 0 !important;
        box-sizing: border-box !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }
    .ob-bar-row {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        font-size: 11px !important;
        color: #99a !important;
    }
    .ob-price-display {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
    }
    .ob-bar-price {
        color: var(--amber) !important;
        font-weight: 700 !important;
        font-size: 11.5px !important;
    }
    .ob-bar-wallet {
        display: flex !important;
        align-items: center !important;
        gap: 3px !important;
        color: #889 !important;
        font-size: 10px !important;
    }
    .ob-bar-wallet b {
        color: #e5e7eb !important;
    }
    .ob-bar-controls {
        display: flex !important;
        align-items: center !important;
        gap: 3px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    #ob-amount-input {
        flex: 1 1 auto !important;
        min-width: 50px !important;
        height: 27px !important;
        background: #060e0a !important;
        border: 1px solid #1c2b22 !important;
        color: #fff !important;
        border-radius: 3px !important;
        padding: 0 4px !important;
        font-size: 11px !important;
        box-sizing: border-box !important;
    }
    .ob-order-btn {
        flex-shrink: 0 !important;
        height: 27px !important;
        padding: 0 7px !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        border-radius: 3px !important;
        cursor: pointer !important;
        border: none !important;
        white-space: nowrap !important;
    }
    .ob-order-btn.buy {
        background: #16a34a !important;
        color: #fff !important;
    }
    .ob-order-btn.sell {
        background: #dc2626 !important;
        color: #fff !important;
    }
    .ob-order-btn.close {
        background: #4b5563 !important;
        color: #fff !important;
    }
}

/* ==========================================================================
   PRMANR v28.0 MASTER UPGRADES: Orderbook Symmetry, Mobile Depth, Profile Tiers
   ========================================================================== */

/* 1. Orderbook Header Selected Asset Info */
.ob-selected-asset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    font-size: 11px;
}
.ob-asset-tag {
    font: 800 9px 'Noto Sans KR', sans-serif;
    padding: 1px 5px;
    border-radius: 2px;
    background: #00e5a3;
    color: #04120a;
    letter-spacing: 0.3px;
}
.ob-asset-name {
    font: 700 11.5px 'Noto Sans KR', sans-serif;
    color: #ffffff;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ob-asset-price {
    font: 700 11.5px 'JetBrains Mono', monospace;
    color: #ffffff;
}
.ob-asset-chg {
    font: 700 10.5px 'JetBrains Mono', monospace;
}
.ob-asset-chg.up, .ob-asset-price.up { color: var(--up); }
.ob-asset-chg.dn, .ob-asset-price.dn { color: var(--dn); }

/* 2. Orderbook Bilateral Symmetry: 숫자 (롱) 수치 (숏) 숫자 */
.obr .c-sz {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
    padding: 0 5px !important;
    font-family: 'JetBrains Mono', monospace !important;
}
.obr.bid .c-sz {
    flex-direction: row !important; /* 숫자 on left, (롱) on right adjacent to center */
}
.obr.ask .c-sz {
    flex-direction: row !important; /* (숏) on left adjacent to center, 숫자 on right */
}
.obr .ob-quick-act {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font: 800 8.5px 'Noto Sans KR', sans-serif !important;
    padding: 0 4px !important;
    height: 15px !important;
    min-width: 22px !important;
    border-radius: 2px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    user-select: none !important;
    transition: transform .1s, filter .1s !important;
}
.obr .ob-quick-act:hover {
    filter: brightness(1.2) !important;
    transform: scale(1.08) !important;
}
.obr .ob-quick-act.long {
    background: #00e5a3 !important;
    color: #04120a !important;
}
.obr .ob-quick-act.short {
    background: #ff3b69 !important;
    color: #ffffff !important;
}
.obr .ob-quick-act.close {
    background: #f59e0b !important;
    color: #000000 !important;
}

/* 3. PC Orderbook Order Bar Institutional Design */
.ob-order-bar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 5px 8px;
    background: linear-gradient(180deg, #07100b 0%, #050b08 100%) !important;
    border-top: 1px solid #1a2f24 !important;
    border-bottom: 1px solid #1a2f24 !important;
    flex-shrink: 0;
}
.ob-bar-controls {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    width: 100% !important;
}
#ob-pct-select {
    background: #0b1610 !important;
    border: 1px solid #234333 !important;
    color: #ffb700 !important;
    font: 700 11px 'JetBrains Mono', monospace !important;
    border-radius: 3px !important;
    height: 26px !important;
    padding: 0 4px !important;
    outline: none !important;
    cursor: pointer !important;
}
#ob-pct-select:hover, #ob-pct-select:focus {
    border-color: #ffb700 !important;
    box-shadow: 0 0 6px rgba(255, 183, 0, 0.25) !important;
}
#ob-amount-input {
    background: #08120c !important;
    border: 1px solid #203a2c !important;
    color: #ffffff !important;
    font: 600 11px 'JetBrains Mono', monospace !important;
    border-radius: 3px !important;
    height: 26px !important;
    padding: 0 6px !important;
    flex: 1 !important;
    min-width: 65px !important;
    outline: none !important;
}
#ob-amount-input:hover, #ob-amount-input:focus {
    border-color: #00e5a3 !important;
    box-shadow: 0 0 6px rgba(0, 229, 163, 0.2) !important;
}
.ob-order-btn {
    height: 26px !important;
    border: none !important;
    border-radius: 3px !important;
    font: 700 11px 'Noto Sans KR', sans-serif !important;
    padding: 0 8px !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all .15s !important;
}
.ob-order-btn:hover {
    filter: brightness(1.1) !important;
    transform: translateY(-1px) !important;
}
.ob-order-btn:active {
    transform: translateY(1px) !important;
}
.ob-order-btn.buy {
    background: linear-gradient(180deg, #00e5a3 0%, #00b37e 100%) !important;
    color: #04120a !important;
    box-shadow: 0 2px 4px rgba(0, 229, 163, 0.25) !important;
}
.ob-order-btn.sell {
    background: linear-gradient(180deg, #ff3b69 0%, #d91b48 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(255, 59, 105, 0.25) !important;
}
.ob-order-btn.close {
    background: linear-gradient(180deg, #ffaa00 0%, #cc8800 100%) !important;
    color: #000000 !important;
    box-shadow: 0 2px 4px rgba(255, 170, 0, 0.25) !important;
}

/* 4. Profile Tier Badges (Standard, Private, Master) */
.auth-tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font: 800 10px 'Noto Sans KR', sans-serif;
    padding: 2px 7px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.auth-tier-badge.standard {
    background: #1e2923;
    color: #94a3b8;
    border: 1px solid #334155;
}
.auth-tier-badge.private {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: #c7d2fe;
    border: 1px solid #6366f1;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.35);
}
.auth-tier-badge.master {
    background: linear-gradient(135deg, #451a03 0%, #78350f 50%, #b45309 100%);
    color: #fef08a;
    border: 1px solid #f59e0b;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

/* 5. Mobile Orderbook Tab: 15 Depth levels + Bottom positions/orders */
@media (max-width: 900px) {
    .grid.mob-view-ob {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .grid.mob-view-ob .p-ob {
        display: flex !important;
        flex-direction: column !important;
        flex-shrink: 0 !important;
        width: 100% !important;
        min-height: 620px !important;
        height: auto !important;
        order: 1 !important;
    }
    .grid.mob-view-ob .p-fx {
        display: flex !important;
        flex-direction: column !important;
        flex-shrink: 0 !important;
        width: 100% !important;
        min-height: 420px !important;
        order: 2 !important;
        margin-top: 6px !important;
        margin-bottom: 24px !important;
    }
    .grid.mob-view-ob .p-ts {
        display: none !important;
    }
    #p-monitor .ph .pt {
        overflow: visible !important;
        text-overflow: clip !important;
    }
}

/* ==========================================================================
   PRMANR v28.0 MASTER UPGRADES: Orderbook Symmetry, Mobile Depth, Profile Tiers
   ========================================================================== */

/* 1. Orderbook Header Selected Asset Info */
.ob-selected-asset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    font-size: 11px;
}
.ob-asset-tag {
    font: 800 9px 'Noto Sans KR', sans-serif;
    padding: 1px 5px;
    border-radius: 2px;
    background: #00e5a3;
    color: #04120a;
    letter-spacing: 0.3px;
}
.ob-asset-name {
    font: 700 11.5px 'Noto Sans KR', sans-serif;
    color: #ffffff;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ob-asset-price {
    font: 700 11.5px 'JetBrains Mono', monospace;
    color: #ffffff;
}
.ob-asset-chg {
    font: 700 10.5px 'JetBrains Mono', monospace;
}
.ob-asset-chg.up, .ob-asset-price.up { color: var(--up); }
.ob-asset-chg.dn, .ob-asset-price.dn { color: var(--dn); }

/* 2. Orderbook Bilateral Symmetry: 숫자 (롱) 수치 (숏) 숫자 */
.obr .c-sz {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
    padding: 0 5px !important;
    font-family: 'JetBrains Mono', monospace !important;
}
.obr.bid .c-sz {
    flex-direction: row !important; /* 숫자 on left, (롱) on right adjacent to center */
}
.obr.ask .c-sz {
    flex-direction: row !important; /* (숏) on left adjacent to center, 숫자 on right */
}
.obr .ob-quick-act {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font: 800 8.5px 'Noto Sans KR', sans-serif !important;
    padding: 0 4px !important;
    height: 15px !important;
    min-width: 22px !important;
    border-radius: 2px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    user-select: none !important;
    transition: transform .1s, filter .1s !important;
}
.obr .ob-quick-act:hover {
    filter: brightness(1.2) !important;
    transform: scale(1.08) !important;
}
.obr .ob-quick-act.long {
    background: #00e5a3 !important;
    color: #04120a !important;
}
.obr .ob-quick-act.short {
    background: #ff3b69 !important;
    color: #ffffff !important;
}
.obr .ob-quick-act.close {
    background: #f59e0b !important;
    color: #000000 !important;
}

/* 3. PC Orderbook Order Bar Institutional Design */
.ob-order-bar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 5px 8px;
    background: linear-gradient(180deg, #07100b 0%, #050b08 100%) !important;
    border-top: 1px solid #1a2f24 !important;
    border-bottom: 1px solid #1a2f24 !important;
    flex-shrink: 0;
}
.ob-bar-controls {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    width: 100% !important;
}
#ob-pct-select {
    background: #0b1610 !important;
    border: 1px solid #234333 !important;
    color: #ffb700 !important;
    font: 700 11px 'JetBrains Mono', monospace !important;
    border-radius: 3px !important;
    height: 26px !important;
    padding: 0 4px !important;
    outline: none !important;
    cursor: pointer !important;
}
#ob-pct-select:hover, #ob-pct-select:focus {
    border-color: #ffb700 !important;
    box-shadow: 0 0 6px rgba(255, 183, 0, 0.25) !important;
}
#ob-amount-input {
    background: #08120c !important;
    border: 1px solid #203a2c !important;
    color: #ffffff !important;
    font: 600 11px 'JetBrains Mono', monospace !important;
    border-radius: 3px !important;
    height: 26px !important;
    padding: 0 6px !important;
    flex: 1 !important;
    min-width: 65px !important;
    outline: none !important;
}
#ob-amount-input:hover, #ob-amount-input:focus {
    border-color: #00e5a3 !important;
    box-shadow: 0 0 6px rgba(0, 229, 163, 0.2) !important;
}
.ob-order-btn {
    height: 26px !important;
    border: none !important;
    border-radius: 3px !important;
    font: 700 11px 'Noto Sans KR', sans-serif !important;
    padding: 0 8px !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all .15s !important;
}
.ob-order-btn:hover {
    filter: brightness(1.1) !important;
    transform: translateY(-1px) !important;
}
.ob-order-btn:active {
    transform: translateY(1px) !important;
}
.ob-order-btn.buy {
    background: linear-gradient(180deg, #00e5a3 0%, #00b37e 100%) !important;
    color: #04120a !important;
    box-shadow: 0 2px 4px rgba(0, 229, 163, 0.25) !important;
}
.ob-order-btn.sell {
    background: linear-gradient(180deg, #ff3b69 0%, #d91b48 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(255, 59, 105, 0.25) !important;
}
.ob-order-btn.close {
    background: linear-gradient(180deg, #ffaa00 0%, #cc8800 100%) !important;
    color: #000000 !important;
    box-shadow: 0 2px 4px rgba(255, 170, 0, 0.25) !important;
}

/* 4. Profile Tier Badges (Standard, Private, Master) */
.auth-tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font: 800 10px 'Noto Sans KR', sans-serif;
    padding: 2px 7px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.auth-tier-badge.standard {
    background: #1e2923;
    color: #94a3b8;
    border: 1px solid #334155;
}
.auth-tier-badge.private {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: #c7d2fe;
    border: 1px solid #6366f1;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.35);
}
.auth-tier-badge.master {
    background: linear-gradient(135deg, #451a03 0%, #78350f 50%, #b45309 100%);
    color: #fef08a;
    border: 1px solid #f59e0b;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

/* 5. Mobile Orderbook Tab: 15 Depth levels + Bottom positions/orders */
@media (max-width: 900px) {
    .grid.mob-view-ob {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    }
    .grid.mob-view-ob .p-ob {
        display: flex !important;
        flex-direction: column !important;
        flex-shrink: 0 !important;
        width: 100% !important;
        min-height: 620px !important;
        height: auto !important;
        order: 1 !important;
    }
    .grid.mob-view-ob .p-fx {
        display: flex !important;
        flex-direction: column !important;
        flex-shrink: 0 !important;
        width: 100% !important;
        min-height: 420px !important;
        order: 2 !important;
        margin-top: 6px !important;
        margin-bottom: 24px !important;
    }
    .grid.mob-view-ob .p-ts {
        display: none !important;
    }
    #p-monitor .ph .pt {
        overflow: visible !important;
        text-overflow: clip !important;
    }
}


/* ==========================================================================
   PRMANR v29.0 Master Upgrade Styles
   ========================================================================== */

/* 1. Global Candle Color Harmonization (#ace5dc Up / #e65100 Down) */
:root {
    --up: #ace5dc !important;
    --dn: #e65100 !important;
    --up-rgb: 172, 229, 220 !important;
    --dn-rgb: 230, 81, 0 !important;
}

.up, .c-p.up, .r.up, .c-chg.up, .ast-pnl.up, .sh-chg.up, .ob-pivot-price.up {
    color: var(--up) !important;
}
.dn, .c-p.dn, .r.dn, .c-chg.dn, .ast-pnl.dn, .sh-chg.dn, .ob-pivot-price.dn {
    color: var(--dn) !important;
}

/* Orderbook Ask / Bid Row Highlights */
.obr.ask .c-p {
    background: rgba(var(--dn-rgb), 0.08) !important;
}
.obr.bid .c-p {
    background: rgba(var(--up-rgb), 0.08) !important;
}
.obr.ask .c-sz i {
    background: var(--dn) !important;
}
.obr.bid .c-sz i {
    background: var(--up) !important;
}

/* Orderbook Quick Actions */
.obr .ob-quick-act.long {
    background: var(--up) !important;
    color: #0b101b !important;
    font-weight: 800 !important;
}
.obr .ob-quick-act.short {
    background: var(--dn) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
}
.obr .ob-quick-act.close {
    background: #f59e0b !important;
    color: #0b101b !important;
    font-weight: 800 !important;
}

/* PC Order Bar Action Buttons */
.ob-action-btn.buy {
    background: var(--up) !important;
    color: #0b101b !important;
    font-weight: 800 !important;
}
.ob-action-btn.sell {
    background: var(--dn) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
}

/* 2. PC Profile Modal Expansion & Typography Scaled Up */
.auth-mbox {
    width: 520px !important;
    max-width: 95vw !important;
}
.auth-user-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid var(--line) !important;
}
.auth-user-name {
    font-size: 18px !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    margin: 2px 0 !important;
}
.auth-user-id {
    font-size: 12px !important;
    color: #94a3b8 !important;
}
.auth-tier-badge {
    font-size: 11px !important;
    font-weight: 800 !important;
    padding: 3px 8px !important;
    letter-spacing: 0.5px !important;
}
.auth-tier-badge.master {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border: 1px solid #38bdf8 !important;
    color: #38bdf8 !important;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3) !important;
}

/* Profile Logout & Sync ON in 1 Horizontal Row with Equal Height (34px) */
.auth-user-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
}
.auth-act-btn {
    height: 34px !important;
    padding: 0 14px !important;
    font: 700 12px 'Noto Sans KR', sans-serif !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    transition: all .18s ease !important;
}
.auth-act-btn.sync-toggle-btn {
    min-width: 105px !important;
    height: 34px !important;
    background: #0b1310 !important;
    border: 1px solid #22352c !important;
    color: #94a3b8 !important;
}
.auth-act-btn.sync-toggle-btn.on {
    background: linear-gradient(135deg, #064e3b 0%, #0d9488 100%) !important;
    border: 1px solid #34d399 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
}
.auth-act-btn.danger {
    min-width: 80px !important;
    height: 34px !important;
    background: rgba(230, 81, 0, 0.16) !important;
    border: 1px solid #e65100 !important;
    color: #ff9800 !important;
}
.auth-act-btn.danger:hover {
    background: #e65100 !important;
    color: #ffffff !important;
}

.auth-stats-grid .ast-item span {
    font-size: 11.5px !important;
    color: #94a3b8 !important;
}
.auth-stats-grid .ast-item b {
    font-size: 14.5px !important;
    color: #ffffff !important;
}
.auth-exchange-api-box {
    margin-top: 6px !important;
    padding: 10px 12px !important;
    background: #0a110e !important;
    border: 1px solid #1f3328 !important;
    border-radius: 4px !important;
}
.auth-exchange-api-box select, .auth-exchange-api-box input {
    font-size: 12px !important;
}

/* 3. Trade Pad 2-Row Layout: Row 1 Parameters, Row 2 Action Buttons */
.trade-pad {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    padding: 6px 8px !important;
    background: #080f0c !important;
    border-top: 1px solid var(--line) !important;
    box-sizing: border-box !important;
    width: 100% !important;
    overflow-x: hidden !important;
}
.tp-inputs-row1 {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
.tp-inputs-row1 .tp-type-group {
    display: flex !important;
    flex-shrink: 0 !important;
}
.tp-inputs-row1 .tp-price-wrap {
    flex: 1 1 70px !important;
    min-width: 60px !important;
}
.tp-inputs-row1 .tp-price-wrap input {
    width: 100% !important;
    height: 25px !important;
    font-size: 11px !important;
    box-sizing: border-box !important;
}
.tp-inputs-row1 .tp-pct-wrap {
    flex-shrink: 0 !important;
}
.tp-inputs-row1 .tp-pct-select {
    height: 25px !important;
    font-size: 11px !important;
    padding: 0 4px !important;
}
.tp-inputs-row1 #tp-amount-input {
    flex: 1 1 80px !important;
    min-width: 70px !important;
    height: 25px !important;
    font-size: 11px !important;
    padding: 0 6px !important;
    box-sizing: border-box !important;
}
.tp-inputs-row1 #tp-btn-reset {
    flex-shrink: 0 !important;
    height: 25px !important;
    padding: 0 8px !important;
    font-size: 10.5px !important;
}

/* Row 2: Action Execution Row */
.tp-actions-row {
    display: flex !important;
    align-items: stretch !important;
    gap: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 2px !important;
}
.tp-actions-row .tp-act {
    flex: 1 1 0 !important;
    height: 32px !important;
    font: 800 12px 'Noto Sans KR', sans-serif !important;
    border-radius: 3px !important;
    border: none !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all .15s ease !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}
.tp-actions-row .tp-act.long {
    background: var(--up) !important;
    color: #0b101b !important;
    box-shadow: 0 0 8px rgba(var(--up-rgb), 0.35) !important;
}
.tp-actions-row .tp-act.long:hover {
    filter: brightness(1.15) !important;
}
.tp-actions-row .tp-act.short {
    background: var(--dn) !important;
    color: #ffffff !important;
    box-shadow: 0 0 8px rgba(var(--dn-rgb), 0.35) !important;
}
.tp-actions-row .tp-act.short:hover {
    filter: brightness(1.15) !important;
}
.tp-actions-row .tp-act.close {
    background: #2b1808 !important;
    border: 1px solid #b45309 !important;
    color: #fbbf24 !important;
}
.tp-actions-row .tp-act.close:hover {
    background: #b45309 !important;
    color: #0b101b !important;
}

/* 4. Kimp vs Dominance View Toggle in Panel 6 */
.kimp-view-toggle {
    display: flex !important;
    gap: 6px !important;
    padding: 6px 8px !important;
    background: #09120e !important;
    border-bottom: 1px solid var(--line) !important;
    flex-shrink: 0 !important;
}
.kimp-view-toggle .kv-tab {
    flex: 1 1 0 !important;
    padding: 6px 10px !important;
    background: #101c17 !important;
    border: 1px solid #1f3529 !important;
    color: #94a3b8 !important;
    font: 700 11.5px 'Noto Sans KR', sans-serif !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    transition: all .15s ease !important;
    text-align: center !important;
    white-space: nowrap !important;
}
.kimp-view-toggle .kv-tab:hover {
    color: #ffffff !important;
    border-color: #385a4a !important;
}
.kimp-view-toggle .kv-tab.on {
    background: #08261f !important;
    color: var(--amber) !important;
    border-color: var(--amber) !important;
    font-weight: 800 !important;
    box-shadow: 0 0 8px rgba(34, 171, 148, 0.25) !important;
}

/* Autobot Dashboard Badges */
.autobot-badge.demo {
    background: rgba(34, 171, 148, 0.2) !important;
    border: 1px solid #22ab94 !important;
    color: #5eead4 !important;
}
.autobot-badge.real {
    background: rgba(230, 81, 0, 0.25) !important;
    border: 1px solid #e65100 !important;
    color: #ff9800 !important;
}


/* Desktop Trade Pad Elegance & Spot Short Display Fix */
.tp-actions-row .tp-act[style*="display: none"] {
    display: none !important;
}

@media (min-width: 901px) {
    .tp-inputs-row1 {
        justify-content: flex-start !important;
        gap: 8px !important;
        max-width: 650px !important;
    }
    .tp-inputs-row1 #tp-amount-input {
        flex: 0 0 130px !important;
        max-width: 130px !important;
    }
    .tp-actions-row {
        justify-content: flex-start !important;
        gap: 8px !important;
        max-width: 650px !important;
    }
    .tp-actions-row .tp-act {
        flex: 0 0 auto !important;
        min-width: 130px !important;
        max-width: 200px !important;
        height: 28px !important;
        font-size: 11.5px !important;
    }
}
