/* ============================================================
   BitQwen 스타일시트 (다크 테마, 모바일 우선)
   상승: 적색 / 하락: 청색
   ============================================================ */

:root {
    --bg: #0b0e14;
    --bg-2: #0f131b;
    --panel: #131722;
    --panel-2: #181d29;
    --panel-3: #1e2433;
    --border: #212838;
    --border-2: #2b3447;
    --text: #e6e9ef;
    --text-2: #b7bfcd;
    --muted: #8b93a7;
    --muted-2: #5f6779;
    --up: #e5484d;
    --down: #3f7ce8;
    --up-bg: rgba(229, 72, 77, 0.12);
    --down-bg: rgba(63, 124, 232, 0.12);
    --accent: #4f7cff;
    --accent-2: #6ea0ff;
    --accent-bg: rgba(79, 124, 255, 0.14);
    --warn: #f5b942;
    --success: #3ddc97;
    --danger: #ff5c6c;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --font: 'Space Grotesk', 'IBM Plex Sans KR', -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
    --header-h: 56px;
    --bottomnav-h: 58px;
    --container: 1440px;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- 리셋 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    padding-bottom: calc(var(--bottomnav-h) + var(--safe-bottom));
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-2); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img, svg { max-width: 100%; display: inline-block; vertical-align: middle; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.3; }
p { margin: 0 0 8px; }
ul { margin: 0; padding: 0; list-style: none; }
dl, dd, dt { margin: 0; }
table { border-collapse: collapse; width: 100%; }
small { font-size: 0.85em; }
::selection { background: rgba(79, 124, 255, 0.35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent); color: #fff; padding: 8px 12px; z-index: 1000; }
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- 유틸 ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.section { padding: 20px 16px; }
.section-narrow { max-width: 760px; margin: 0 auto; padding: 24px 16px; }
.section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 14px; flex-wrap: wrap; }
.section__title { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.up { color: var(--up) !important; }
.down { color: var(--down) !important; }
.flat { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; display: inline-block; vertical-align: bottom; }
.link { color: var(--accent-2); font-size: 13px; font-weight: 600; }
.inline { display: inline; }
.mt { margin-top: 16px; }
[hidden] { display: none !important; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.card__title { font-size: 15px; margin-bottom: 12px; }
.table-card { padding: 0; overflow: hidden; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty p { margin-bottom: 14px; }
.table-empty { text-align: center; color: var(--muted); padding: 28px 12px; font-size: 13px; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--panel-3); color: var(--text-2); font-size: 11px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.tag--warn { background: rgba(245, 185, 66, 0.15); color: var(--warn); }
.tag--me { background: var(--accent-bg); color: var(--accent-2); }
.tag--open { background: rgba(245, 185, 66, 0.15); color: var(--warn); }
.tag--filled { background: rgba(61, 220, 151, 0.15); color: var(--success); }
.tag--canceled, .tag--partial { background: var(--panel-3); color: var(--muted); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; margin-left: 4px; }

.stale-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(245, 185, 66, 0.15); color: var(--warn); font-size: 11px; font-weight: 600; }
.stale-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

.flash-up { animation: flashUp 0.6s ease-out; }
.flash-down { animation: flashDown 0.6s ease-out; }
@keyframes flashUp { 0% { background: rgba(229, 72, 77, 0.35); } 100% { background: transparent; } }
@keyframes flashDown { 0% { background: rgba(63, 124, 232, 0.35); } 100% { background: transparent; } }

/* ---------- 버튼 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 16px; height: 40px; border-radius: var(--radius-sm); font-weight: 700; font-size: 14px; border: 1px solid transparent; transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s; white-space: nowrap; user-select: none; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-2); color: #fff; }
.btn--ghost { background: transparent; border-color: var(--border-2); color: var(--text-2); }
.btn--ghost:hover { border-color: var(--muted); color: var(--text); }
.btn--buy { background: var(--up); color: #fff; }
.btn--buy:hover { background: #ee5a5f; color: #fff; }
.btn--sell { background: var(--down); color: #fff; }
.btn--sell:hover { background: #5a90f0; color: #fff; }
.btn--danger { color: var(--danger); }
.btn--sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn--xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: var(--radius-xs); }
.btn--lg { height: 48px; font-size: 15px; }
.btn--block { width: 100%; }
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after { content: ''; position: absolute; width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 폼 ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field label small { color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea, .modal__body input, .modal__body textarea {
    width: 100%; height: 44px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-2); background: var(--bg-2); color: var(--text); font-size: 15px; transition: border-color 0.15s;
    -webkit-appearance: none; appearance: none;
}
.field textarea, .modal__body textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 96px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .modal__body input:focus, .modal__body textarea:focus { border-color: var(--accent); outline: none; }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%238b93a7' d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.field__hint { font-size: 12px; color: var(--muted); }
.field__hint.is-ok { color: var(--success); }
.field__hint.is-err { color: var(--danger); }
.pwfield { position: relative; }
.pwfield input { padding-right: 44px; }
.pwfield__toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; color: var(--muted); border-radius: var(--radius-xs); }
.pwfield__toggle.is-on { color: var(--accent-2); }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check a { color: var(--accent-2); text-decoration: underline; }
.inputgroup { display: flex; }
.inputgroup input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.inputgroup__btn { padding: 0 14px; border: 1px solid var(--border-2); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--panel-3); font-size: 13px; font-weight: 600; color: var(--text-2); }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { text-align: right; word-break: break-all; }

.segmented { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.segmented__btn { padding: 0 12px; height: 30px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--muted); transition: background 0.15s, color 0.15s; white-space: nowrap; }
.segmented__btn.active { background: var(--panel-3); color: var(--text); }
.segmented--sm .segmented__btn { height: 26px; padding: 0 10px; font-size: 12px; }
.segmented--full { display: flex; }
.segmented--full .segmented__btn { flex: 1; }

.search { display: flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 12px; height: 38px; color: var(--muted); flex: 1; min-width: 0; }
.search input { background: none; border: 0; outline: none; flex: 1; min-width: 0; height: 100%; color: var(--text); font-size: 14px; }
.search input::placeholder { color: var(--muted-2); }
.search--sm { height: 32px; padding: 0 10px; }
.search--sm input { font-size: 13px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 18px 0 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs__tab { padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs__tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tabpanel { display: none; }
.tabpanel.active { display: block; }

.codechip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--panel-3); color: var(--text-2); font-size: 12px; font-weight: 600; }
.codechip:hover { color: var(--accent-2); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 18px 0; }
.pagination__btn { padding: 8px 14px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; }
.pagination__info { color: var(--muted); font-size: 13px; }

/* ---------- 테이블 ---------- */
.table th, .table td { padding: 12px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; background: var(--panel-2); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td small { display: block; font-size: 11px; color: var(--muted); }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable::after { content: ''; display: inline-block; width: 0; height: 0; margin-left: 5px; border: 4px solid transparent; border-top-color: var(--muted-2); vertical-align: -3px; }
.table th.sortable.asc::after { border-top-color: transparent; border-bottom-color: var(--accent-2); vertical-align: 2px; }
.table th.sortable.desc::after { border-top-color: var(--accent-2); }
.table--history { min-width: 760px; }
.table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- 헤더 ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(11, 14, 20, 0.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.brand:hover { color: inherit; }
.brand__mark { display: block; width: 30px; height: 30px; border-radius: 8px; object-fit: cover; }
.brand__name span { color: var(--accent-2); }
.mainnav { display: none; align-items: center; gap: 4px; flex: 1; }
.mainnav__link { padding: 8px 12px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; color: var(--text-2); }
.mainnav__link:hover { background: var(--panel-2); color: var(--text); }
.mainnav__link.active { color: var(--text); background: var(--panel-3); }
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.usermenu { position: relative; }
.usermenu__btn { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid var(--border-2); color: var(--text-2); }
.usermenu__avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #6ea0ff, #3b5cff); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.usermenu__name { font-weight: 600; font-size: 13px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu__panel { position: absolute; right: 0; top: calc(100% + 8px); width: 220px; background: var(--panel); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 60; }
.usermenu__head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.usermenu__panel a, .usermenu__logout button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--text-2); }
.usermenu__panel a:hover, .usermenu__logout button:hover { background: var(--panel-3); color: var(--text); }
.usermenu__logout { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }
.usermenu__logout button { color: var(--danger); }

/* ---------- 하단 내비 (모바일) ---------- */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; background: rgba(15, 19, 27, 0.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border); padding-bottom: var(--safe-bottom); }
.bottomnav__item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--bottomnav-h); font-size: 11px; font-weight: 600; color: var(--muted); -webkit-tap-highlight-color: transparent; }
.bottomnav__item svg { width: 22px; height: 22px; fill: currentColor; }
.bottomnav__item.active { color: var(--accent-2); }

/* ---------- 푸터 ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 28px 0 24px; color: var(--muted); font-size: 12px; }
.footer__inner { display: flex; flex-direction: column; gap: 16px; }
.footer__brand strong { color: var(--text-2); font-size: 14px; display: block; margin-bottom: 6px; }
.footer__brand p { line-height: 1.6; max-width: 720px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer__links a { color: var(--text-2); font-weight: 500; }
.footer__copy { color: var(--muted-2); }

/* ---------- 토스트 / 모달 / 시트 ---------- */
.toast-root { position: fixed; left: 50%; bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 16px); transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: calc(100% - 32px); max-width: 420px; pointer-events: none; }
.toast { background: var(--panel-3); color: var(--text); border: 1px solid var(--border-2); border-left: 3px solid var(--accent); padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: opacity 0.25s, transform 0.25s; line-height: 1.45; }
.toast.is-in { opacity: 1; transform: translateY(0); }
.toast--success { border-left-color: var(--success); }
.toast--error { border-left-color: var(--danger); }

.modal { position: fixed; inset: 0; z-index: 150; display: flex; align-items: flex-end; justify-content: center; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); opacity: 0; transition: opacity 0.2s; }
.modal__panel { position: relative; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; background: var(--panel); border: 1px solid var(--border-2); border-radius: 16px 16px 0 0; transform: translateY(24px); opacity: 0; transition: transform 0.2s, opacity 0.2s; display: flex; flex-direction: column; }
.modal.is-open .modal__backdrop { opacity: 1; }
.modal.is-open .modal__panel { transform: translateY(0); opacity: 1; }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal__head h3 { font-size: 16px; }
.modal__close { width: 32px; height: 32px; border-radius: 50%; color: var(--muted); font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.modal__close:hover { background: var(--panel-3); color: var(--text); }
.modal__body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px calc(16px + var(--safe-bottom)); border-top: 1px solid var(--border); }
.modal__foot .btn { min-width: 96px; }
.modal--sm .modal__panel { max-width: 400px; }

.sheet { position: fixed; inset: 0; z-index: 150; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); opacity: 0; transition: opacity 0.2s; }
.sheet__panel { position: absolute; left: 0; right: 0; bottom: 0; height: 86vh; background: var(--panel); border-radius: 16px 16px 0 0; border: 1px solid var(--border-2); display: flex; flex-direction: column; transform: translateY(100%); transition: transform 0.22s ease-out; }
.sheet.is-open .sheet__backdrop { opacity: 1; }
.sheet.is-open .sheet__panel { transform: translateY(0); }
.sheet__handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border-2); margin: 10px auto 4px; }
.sheet__head { display: flex; gap: 8px; align-items: center; padding: 8px 14px 10px; border-bottom: 1px solid var(--border); }
.sheet__close { font-size: 14px; font-weight: 600; color: var(--accent-2); padding: 0 6px; }
.sheet__body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: var(--safe-bottom); }
.sheet-row { display: grid; grid-template-columns: 28px 1fr auto auto; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.sheet-row.active { background: var(--accent-bg); }
.sheet-row__name { display: flex; flex-direction: column; min-width: 0; }
.sheet-row__name span { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-row__name small { color: var(--muted); font-size: 11px; }
.sheet-row__price { font-weight: 600; }
.sheet-row__change { min-width: 64px; font-size: 12px; }

.favbtn { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted-2); border-radius: 50%; flex: none; }
.favbtn svg { fill: none; stroke: currentColor; stroke-width: 1.6; }
.favbtn.is-on { color: var(--warn); }
.favbtn.is-on svg { fill: currentColor; }

/* ---------- 홈 ---------- */
.hero { padding: 28px 0 8px; background: radial-gradient(ellipse at top left, rgba(79, 124, 255, 0.12), transparent 55%); }
.hero__inner { display: flex; flex-direction: column; gap: 20px; }
.hero__title { font-size: 28px; letter-spacing: -0.02em; line-height: 1.2; }
.hero__sub { color: var(--text-2); font-size: 15px; margin: 12px 0 18px; max-width: 520px; line-height: 1.6; }
.hero__cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero__stats { display: flex; gap: 24px; margin-top: 22px; }
.hero__stats li { display: flex; flex-direction: column; }
.hero__stats strong { font-size: 20px; font-weight: 800; }
.hero__stats span { font-size: 12px; color: var(--muted); }
.hero__chart { padding: 14px; }
.hero__chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.hero__chart-name { font-size: 14px; font-weight: 600; }
.hero__chart-price { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; margin-top: 2px; }
.hero__chart-change { font-size: 13px; font-weight: 600; }
.hero__chart-change span { margin-left: 6px; opacity: 0.85; }
.hero__chart-body { height: 240px; border-radius: var(--radius-sm); overflow: hidden; }

.quickgrid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.quickcard { padding: 14px; }
.quickcard__title { font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.quickcard__list li a { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--border); }
.quickcard__list li:last-child a { border-bottom: 0; }
.quickcard__name { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quickcard__empty { padding: 8px 0; font-size: 13px; }
.rankno { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 6px; background: var(--panel-3); color: var(--text-2); font-size: 11px; font-weight: 700; flex: none; }
.rankno--1 { background: linear-gradient(135deg, #ffd766, #f5a623); color: #1a1200; }
.rankno--2 { background: linear-gradient(135deg, #e6ebf2, #b7c0cc); color: #1a1f2a; }
.rankno--3 { background: linear-gradient(135deg, #e3a26b, #b9713d); color: #2a1608; }

.market-tools { display: flex; gap: 8px; align-items: center; flex: 1; min-width: 0; justify-content: flex-end; }
.market-tools .search { max-width: 280px; }
.market-table .col-fav { width: 36px; padding-left: 8px; padding-right: 0; }
.market-table .col-name { min-width: 120px; }
.market-table .col-change .change-price { display: block; font-size: 11px; opacity: 0.8; }
.market-table .col-volume small { display: inline; margin-left: 2px; color: var(--muted); }
.market-link { display: flex; }
.market-link__name { font-weight: 600; }
.market-link__sym { font-size: 11px; color: var(--muted); }
.market-table td.col-price { font-weight: 600; }

.sharegrid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.sharecard { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: border-color 0.15s, transform 0.15s; }
.sharecard:hover { border-color: var(--border-2); transform: translateY(-2px); color: inherit; }
.sharecard__thumb { display: block; aspect-ratio: 1200 / 630; background: var(--panel-2) center/cover no-repeat; }
.sharecard__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.sharecard__market { font-size: 12px; font-weight: 600; }
.sharecard__title { font-size: 15px; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sharecard__meta { display: flex; gap: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.sharecard__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.sharecard__actions { display: flex; gap: 6px; margin-top: 6px; }

.featuregrid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.feature { padding: 20px; }
.feature__icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-bg); color: var(--accent-2); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.feature h3 { font-size: 16px; margin-bottom: 6px; }
.feature p { color: var(--text-2); font-size: 13px; line-height: 1.6; margin: 0; }

/* ---------- 인증 ---------- */
.auth__card { padding: 24px 20px; }
.auth__title { font-size: 22px; margin-bottom: 6px; }
.auth__sub { color: var(--muted); margin-bottom: 20px; font-size: 13px; }
.auth__foot { margin-top: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.auth__foot a { color: var(--accent-2); font-weight: 600; }

/* ---------- 페이지 헤더 / 통계 ---------- */
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; flex-wrap: wrap; }
.pagehead__title { font-size: 22px; letter-spacing: -0.01em; }
.pagehead__meta { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.statgrid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.stat { padding: 14px 16px; }
.stat__label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.stat__value { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat__value small { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat__sub { font-size: 12px; margin-top: 2px; font-weight: 600; }

.twocol { display: grid; grid-template-columns: 1fr; gap: 12px; }
.assetcell { display: flex; align-items: center; gap: 10px; }
.assetcell div { display: flex; flex-direction: column; line-height: 1.25; }
.assetcell small { color: var(--muted); font-size: 11px; }
.coinicon { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #2a3346, #1b2130); color: var(--text-2); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex: none; }
.coinicon--krw { background: linear-gradient(135deg, #4f7cff, #3b5cff); color: #fff; }
.assets-table td.num small { display: block; }

.translist__item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.translist__item:last-child { border-bottom: 0; }
.translist__dir { flex: none; width: 44px; height: 44px; border-radius: 10px; background: var(--panel-3); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.translist__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.translist__main { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: 13px; }
.translist__main strong { font-variant-numeric: tabular-nums; }
.translist__meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.translist__meta time { flex: none; }
.verify-status { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(245, 185, 66, 0.08); border: 1px solid rgba(245, 185, 66, 0.25); font-size: 13px; color: var(--text-2); }
.verify-status__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }

/* ---------- 출금 안내 ---------- */
.notice-card { padding: 28px 20px; text-align: center; }
.notice-card__icon { color: var(--warn); margin-bottom: 12px; }
.notice-card__title { font-size: 20px; margin-bottom: 8px; }
.notice-card__lead { color: var(--text-2); font-size: 14px; margin-bottom: 16px; }
.notice-card__box { text-align: left; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; font-size: 14px; line-height: 1.7; }
.notice-card__strong { font-weight: 700; color: var(--text); }
.notice-card__detail { text-align: left; margin-bottom: 20px; }
.notice-card__detail > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.notice-card__detail > div:last-child { border-bottom: 0; }
.notice-card__detail dt { color: var(--muted); flex: none; }
.notice-card__detail dd { text-align: right; min-width: 0; }
.notice-card__actions { display: flex; flex-direction: column; gap: 8px; }

/* ---------- 포트폴리오 ---------- */
.overview { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.overview__label { font-size: 12px; color: var(--muted); }
.overview__value { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.overview__value small { font-size: 13px; color: var(--muted); }
.overview__pnl { display: flex; gap: 10px; align-items: baseline; font-weight: 700; font-size: 15px; margin-top: 2px; }
.overview__rate { font-size: 13px; padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); }
.overview__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.overview__grid dt { font-size: 11px; color: var(--muted); }
.overview__grid dd { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.holdings { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 20px; }
.holding { display: block; padding: 14px; }
.holding:hover { border-color: var(--border-2); color: inherit; }
.holding__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.holding__weight { text-align: right; display: flex; flex-direction: column; }
.holding__bar { height: 4px; border-radius: 2px; background: var(--panel-3); overflow: hidden; margin-bottom: 10px; }
.holding__bar span { display: block; height: 100%; background: var(--accent); }
.holding__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.holding__grid dt { font-size: 11px; color: var(--muted); }
.holding__grid dd { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.historical-overview { margin-bottom: 10px; }
.historical-overview .overview__grid { padding-top: 0; border-top: 0; }
.historical-holdings { margin-top: 10px; }
.myrank { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.myrank__label { font-size: 12px; color: var(--muted); }
.myrank__value { font-size: 22px; font-weight: 800; }
.myrank__stats { display: flex; gap: 12px; font-size: 13px; font-weight: 600; flex-wrap: wrap; }

/* ---------- 랭킹 ---------- */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.podium__item { text-align: center; padding: 14px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.podium__item--1 { border-color: rgba(245, 185, 66, 0.5); background: linear-gradient(180deg, rgba(245, 185, 66, 0.08), var(--panel)); order: 0; }
.podium__rank { font-size: 12px; font-weight: 800; color: var(--muted); }
.podium__item--1 .podium__rank { color: var(--warn); }
.podium__avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #2a3346, #1b2130); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }
.podium__item--1 .podium__avatar { background: linear-gradient(135deg, #ffd766, #f5a623); color: #1a1200; }
.podium__name { font-weight: 700; font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium__rate { font-weight: 800; font-size: 15px; }
.podium__meta { font-size: 11px; }
.ranking-table .col-rank { width: 56px; }
.ranking-table tr.is-me td { background: var(--accent-bg); }
.ranking-name { font-weight: 600; }
.ranking-note { margin-top: 12px; line-height: 1.6; }

/* ---------- 관리자 ---------- */
.admin-layout { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
.admin-users, .admin-main { min-width: 0; }
.admin-search { margin-bottom: 10px; }
.admin-userlist { padding: 5px; max-height: 520px; overflow-y: auto; }
.admin-user { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 10px; border-radius: var(--radius-sm); }
.admin-user:hover, .admin-user.active { background: var(--panel-3); color: inherit; }
.admin-user.active { box-shadow: inset 2px 0 var(--accent); }
.admin-user__body { display: flex; flex-direction: column; min-width: 0; }
.admin-user__body strong, .admin-user__body small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user__body strong { font-size: 13px; }
.admin-user__body small { color: var(--muted); font-size: 11px; }
.admin-profile { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.admin-profile h2 { font-size: 18px; margin-bottom: 3px; }
.admin-role-form { display: flex; gap: 8px; width: 100%; }
.admin-role-form select { flex: 1; height: 34px; padding: 0 32px 0 10px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--bg-2); color: var(--text); }
.admin-stats { margin-bottom: 12px; }
.admin-editor-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.admin-form-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.admin-form-actions, .admin-row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.admin-row-actions form { display: inline-flex; }
.admin-records-table { min-width: 980px; }
.admin-ledgers .table { min-width: 560px; }

/* ---------- 공유 페이지 ---------- */
.share-view__head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.share-view__market { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.share-view__title { font-size: 22px; line-height: 1.3; letter-spacing: -0.01em; }
.share-view__meta { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.share-view__author { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; }
.avatar { width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, #6ea0ff, #3b5cff); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.share-view__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.share-chart { padding: 10px; margin-bottom: 12px; }
.share-chart__foot { display: flex; justify-content: space-between; gap: 8px; padding: 8px 4px 0; flex-wrap: wrap; }
.share-comment { white-space: pre-wrap; line-height: 1.7; font-size: 14px; word-break: break-word; }
.share-cta { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; margin: 16px 0 24px; background: linear-gradient(135deg, rgba(79, 124, 255, 0.12), var(--panel)); }
.share-cta h3 { font-size: 17px; margin-bottom: 4px; }
.share-desc { font-size: 13px; line-height: 1.6; }
.share-summary { display: flex; flex-wrap: wrap; gap: 4px; }
.share-link { display: flex; gap: 6px; }
.share-link input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; }
.share-result__title { font-weight: 700; font-size: 15px; }
.share-result__actions { display: flex; gap: 8px; }

/* ---------- 문서 ---------- */
.doc__section { margin-bottom: 12px; line-height: 1.7; font-size: 14px; }
.doc__section h2 { font-size: 16px; margin: 0 0 10px; }
.doc__section h2:not(:first-child) { margin-top: 20px; }
.doc__section ul { padding-left: 18px; list-style: disc; }
.doc__section li { margin-bottom: 6px; }
.doc__section code { font-family: var(--mono); background: var(--panel-3); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.doc__note { padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius-sm); font-size: 13px; color: var(--text-2); }
.doc__section .table th, .doc__section .table td { padding: 8px 10px; }
.errorbox { text-align: center; padding: 48px 16px; }
.errorbox__code { font-size: 56px; font-weight: 900; color: var(--accent); letter-spacing: -0.03em; line-height: 1; margin-bottom: 12px; }
.errorbox__title { font-size: 18px; margin-bottom: 8px; }
.errorbox__actions { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }

/* ============================================================
   거래 화면
   ============================================================ */
.exchange { padding-bottom: 72px; }
.exchange__head { background: var(--bg-2); border-bottom: 1px solid var(--border); }
.exchange__head-inner { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; padding-bottom: 12px; position: relative; }
.exchange__head-inner .stale-badge { position: absolute; right: 16px; top: 12px; }
.mhead { display: flex; flex-direction: column; gap: 4px; }
.mhead__select { display: inline-flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 800; color: var(--text); padding: 4px 0; align-self: flex-start; }
.mhead__sym { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.mhead__select svg { color: var(--muted); }
.mhead__price { display: flex; align-items: baseline; gap: 6px; }
.mhead__price-value { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; border-radius: 4px; padding: 0 2px; }
.mhead__price-unit { font-size: 13px; color: var(--muted); font-weight: 600; }
.mhead__change { display: flex; gap: 8px; font-size: 13px; font-weight: 600; }
.mstats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 16px; }
.mstats > div { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.mstats dt { color: var(--muted); }
.mstats dd { font-weight: 600; font-variant-numeric: tabular-nums; }
.mstats dd small { color: var(--muted); font-weight: 500; }

.exchange__tabs { display: flex; position: sticky; top: var(--header-h); z-index: 40; background: var(--bg); border-bottom: 1px solid var(--border); padding: 0; }
.exchange__tab { flex: 1; height: 44px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.exchange__tab.active { color: var(--text); border-bottom-color: var(--accent); }

.exchange__grid { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }
.exchange__grid > .card { padding: 0; }
.exchange__markets { display: none; }
.exchange__chart { display: flex; flex-direction: column; position: relative; min-height: 380px; }

/* 모바일 탭 전환 */
.exchange[data-tab] .exchange__grid > [data-panel] { display: none; }
.exchange[data-tab="chart"] .exchange__grid > [data-panel="chart"],
.exchange[data-tab="orderbook"] .exchange__grid > [data-panel="orderbook"],
.exchange[data-tab="order"] .exchange__grid > [data-panel="order"],
.exchange[data-tab="orders"] .exchange__grid > [data-panel="orders"] { display: flex; flex-direction: column; }
.exchange[data-tab="order"] .exchange__grid > [data-panel="orders"] { display: flex; flex-direction: column; }

.chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.chart-toolbar::-webkit-scrollbar { display: none; }
.chart-toolbar__group { display: flex; align-items: center; gap: 2px; flex: none; }
.chart-toolbar__btn { height: 30px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.chart-toolbar__btn:hover { background: var(--panel-3); color: var(--text); }
.chart-toolbar__btn.active { background: var(--panel-3); color: var(--text); }
.chart-toolbar__btn--accent { color: var(--accent-2); border: 1px solid rgba(79, 124, 255, 0.4); }
.chart-toolbar__btn--accent:hover { background: var(--accent-bg); }
.draw-toolbar { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--border); background: var(--panel-2); overflow-x: auto; scrollbar-width: none; }
.draw-toolbar::-webkit-scrollbar { display: none; }
.draw-tool { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 52px; height: 46px; padding: 4px 6px; border-radius: 6px; color: var(--muted); font-size: 10px; font-weight: 600; flex: none; }
.draw-tool svg { width: 18px; height: 18px; fill: currentColor; }
.draw-tool:hover, .draw-tool.active { background: var(--panel-3); color: var(--text); }
.draw-tool.active { color: var(--accent-2); }
.draw-toolbar__sep { width: 1px; height: 28px; background: var(--border-2); margin: 0 4px; flex: none; }
.draw-color { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; border: 2px solid var(--border-2); flex: none; margin: 0 4px; cursor: pointer; }
.draw-color input { width: 40px; height: 40px; border: 0; padding: 0; margin: -6px; background: none; cursor: pointer; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 6px 10px 0; font-size: 11px; color: var(--muted); min-height: 22px; font-variant-numeric: tabular-nums; }
.chart-legend b { font-weight: 500; margin-right: 3px; }
.chart-legend i { font-style: normal; margin-right: 8px; }
.legend__ohlc, .legend__ind { display: flex; flex-wrap: wrap; gap: 2px 0; }
.legend__ind span { margin-right: 10px; }
.chart-stack { display: flex; flex-direction: column; flex: 1; }
.chart-pane { width: 100%; position: relative; }
.chart-pane--main { height: 340px; min-height: 260px; flex: 1; }
.chart-pane--sub { height: 120px; border-top: 1px solid var(--border); }
.chart-loading { position: absolute; left: 50%; top: 55%; transform: translate(-50%, -50%); color: var(--muted); font-size: 13px; background: rgba(19, 23, 34, 0.85); padding: 8px 14px; border-radius: 8px; }
.bq-chart { touch-action: pan-x pan-y; }
.bq-chart.is-drawing { touch-action: none; }
.bq-chart__delete { position: absolute; z-index: 5; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; padding: 5px 9px; border-radius: 6px; box-shadow: var(--shadow); }

.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.panel__head--sub { border-top: 1px solid var(--border); }
.panel__title { font-size: 13px; font-weight: 700; }
.ob-summary { display: flex; gap: 12px; font-size: 11px; font-weight: 600; }
.ob-summary b { font-weight: 700; }
.orderbook { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.ob-row { position: relative; display: grid; grid-template-columns: 1fr auto 60px; align-items: center; gap: 6px; height: 30px; padding: 0 10px; font-size: 12px; cursor: pointer; overflow: hidden; }
.ob-row:hover { background: rgba(255, 255, 255, 0.04); }
.ob-row__bar { position: absolute; top: 3px; bottom: 3px; right: 0; border-radius: 2px 0 0 2px; opacity: 0.18; pointer-events: none; }
.ob-row--ask .ob-row__bar { background: var(--down); }
.ob-row--bid .ob-row__bar { background: var(--up); }
.ob-row__size { color: var(--text-2); text-align: left; }
.ob-row__price { font-weight: 700; text-align: right; }
.ob-row__rate { font-size: 11px; text-align: right; opacity: 0.85; }
.ob-row.is-cur .ob-row__price { outline: 1px solid var(--border-2); outline-offset: 1px; border-radius: 3px; padding: 0 3px; }
.orderbook__mid { display: flex; align-items: center; justify-content: center; height: 36px; background: var(--panel-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-weight: 800; font-size: 15px; }
.ticks { max-height: 260px; overflow-y: auto; font-variant-numeric: tabular-nums; font-size: 12px; }
.ticks__head, .ticks__row { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 5px 12px; }
.ticks__head { color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); }
.ticks__row span:nth-child(2), .ticks__row span:nth-child(3), .ticks__head span:nth-child(2), .ticks__head span:nth-child(3) { text-align: right; }

.ordertabs { display: flex; }
.ordertab { flex: 1; height: 46px; font-size: 15px; font-weight: 700; color: var(--muted); border-bottom: 2px solid var(--border); background: var(--panel-2); }
.ordertab--buy.active { color: var(--up); border-bottom-color: var(--up); background: var(--panel); }
.ordertab--sell.active { color: var(--down); border-bottom-color: var(--down); background: var(--panel); }
.order-login { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.order-login__btns { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.orderform { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.orderform__avail { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); }
.orderform__avail strong { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.orderform__avail small { color: var(--muted); font-weight: 600; }
.field--inline { flex-direction: row; align-items: center; gap: 10px; }
.field--inline label { width: 64px; flex: none; }
.field--inline input { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.stepper { display: flex; flex: 1; }
.stepper input { border-radius: 0; text-align: center; }
.stepper__btn { width: 42px; flex: none; border: 1px solid var(--border-2); background: var(--panel-3); font-size: 18px; color: var(--text-2); }
.stepper__btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: 0; }
.stepper__btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: 0; }
.pctbtns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pctbtns button { height: 32px; border: 1px solid var(--border-2); border-radius: var(--radius-xs); font-size: 12px; font-weight: 600; color: var(--text-2); }
.pctbtns button:hover { border-color: var(--muted); color: var(--text); }
.orderform__summary { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-2); font-size: 12px; color: var(--muted); }
.orderform__summary > div { display: flex; justify-content: space-between; gap: 8px; }
.orderform__summary strong { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.orderform__hint { font-size: 11px; color: var(--muted-2); text-align: center; margin: 0; }
.orderform[data-side="sell"] .pctbtns button:hover { border-color: var(--down); }
.orderform[data-side="buy"] .pctbtns button:hover { border-color: var(--up); }

.position-info { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.position-info b { color: var(--text); font-variant-numeric: tabular-nums; }
.orders-list { min-height: 120px; }
.olist__row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); align-items: center; font-size: 12px; }
.olist__row:last-child { border-bottom: 0; }
.olist__main { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.olist__side { font-weight: 800; }
.olist__market small { color: var(--muted); }
.olist__time { margin-left: auto; font-weight: 400; font-size: 11px; }
.olist__detail { display: flex; gap: 12px; color: var(--muted); grid-column: 1; flex-wrap: wrap; }
.olist__detail b { color: var(--text-2); font-variant-numeric: tabular-nums; }
.olist__row > .btn { grid-column: 2; grid-row: 1 / span 2; }
.olist__row--done { grid-template-columns: 1fr; }

.exchange__mobile-cta { position: fixed; left: 0; right: 0; bottom: calc(var(--bottomnav-h) + var(--safe-bottom)); z-index: 45; display: flex; gap: 8px; padding: 8px 12px; background: rgba(11, 14, 20, 0.92); backdrop-filter: blur(10px); border-top: 1px solid var(--border); }
.exchange__mobile-cta .btn { flex: 1; height: 44px; }
.exchange[data-tab="order"] .exchange__mobile-cta { display: none; }

.mpanel__head { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-bottom: 1px solid var(--border); }
.mpanel__list { overflow-y: auto; flex: 1; }
.mrow { display: grid; grid-template-columns: 26px 1fr auto; grid-template-rows: auto auto; align-items: center; gap: 0 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 12px; }
.mrow:hover { background: rgba(255, 255, 255, 0.03); color: inherit; }
.mrow.active { background: var(--accent-bg); }
.mrow .favbtn { grid-row: 1 / span 2; }
.mrow__name { display: flex; flex-direction: column; min-width: 0; grid-row: 1 / span 2; }
.mrow__name span { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow__name small { color: var(--muted); font-size: 11px; }
.mrow__price { font-weight: 700; }
.mrow__change { font-size: 11px; }

/* 지표 모달 */
.indicator-form { gap: 10px; }
.ind-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.ind-row .check { font-weight: 600; color: var(--text); }
.ind-params { display: flex; flex-direction: column; gap: 4px; padding-left: 26px; }
.ind-params input { height: 36px !important; font-size: 13px !important; }
.ind-params small { color: var(--muted); font-size: 11px; }
.ind-params--row { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.ind-params--row label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.ind-params--row input { width: 72px !important; }

/* ============================================================
   반응형
   ============================================================ */
@media (min-width: 600px) {
    .quickgrid { grid-template-columns: repeat(3, 1fr); }
    .sharegrid { grid-template-columns: repeat(2, 1fr); }
    .statgrid { grid-template-columns: repeat(3, 1fr); }
    .twocol { grid-template-columns: 1fr 1fr; }
    .holdings { grid-template-columns: repeat(2, 1fr); }
    .notice-card__actions { flex-direction: row; justify-content: center; }
    .modal { align-items: center; padding: 16px; }
    .modal__panel { border-radius: 16px; max-height: 88vh; }
    .modal__foot { padding-bottom: 12px; }
    .share-cta { flex-direction: row; align-items: center; justify-content: space-between; }
    .share-view__head { flex-direction: row; justify-content: space-between; align-items: flex-start; }
    .featuregrid { grid-template-columns: repeat(3, 1fr); }
    .hero__title { font-size: 34px; }
    .mstats { grid-template-columns: repeat(4, auto); }
    .mstats > div { flex-direction: column; gap: 0; }
    .mhead { flex-direction: row; align-items: baseline; gap: 14px; flex-wrap: wrap; }
    .admin-profile { flex-direction: row; align-items: center; }
    .admin-role-form { width: auto; }
    .admin-form-grid { grid-template-columns: repeat(2, 1fr); }
    .overview { flex-direction: row; align-items: center; }
    .overview__main { flex: 1; }
    .overview__grid { flex: 1.2; border-top: 0; border-left: 1px solid var(--border); padding: 0 0 0 24px; grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
    body { padding-bottom: 0; }
    .bottomnav { display: none; }
    .mainnav { display: flex; }
    .section { padding: 28px 16px; }
    .hero { padding: 40px 0 16px; }
    .hero__inner { flex-direction: row; align-items: center; gap: 40px; }
    .hero__text { flex: 1; }
    .hero__chart { flex: 1.2; }
    .hero__chart-body { height: 280px; }
    .sharegrid { grid-template-columns: repeat(3, 1fr); }
    .holdings { grid-template-columns: repeat(3, 1fr); }
    .footer__inner { flex-direction: row; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
    .footer__copy { width: 100%; }
    .toast-root { bottom: 24px; }
    .twocol--wide { grid-template-columns: 1fr 1fr; }
    .twocol--share { grid-template-columns: 2fr 1fr; }
    .admin-layout { grid-template-columns: 300px minmax(0, 1fr); }
    .admin-users { position: sticky; top: calc(var(--header-h) + 12px); }
    .admin-stats { grid-template-columns: repeat(4, 1fr); }
    .admin-editor-grid { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr); }

    /* 거래 화면 데스크톱 */
    .exchange { padding-bottom: 24px; }
    .exchange__tabs { display: none; }
    .exchange__mobile-cta { display: none; }
    .exchange__head-inner { flex-direction: row; align-items: center; justify-content: space-between; }
    .exchange__head-inner .stale-badge { position: static; }
    .exchange[data-tab] .exchange__grid > [data-panel] { display: flex; flex-direction: column; }
    .exchange__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "chart orderbook" "orders order"; gap: 12px; align-items: start; }
    .exchange__chart { grid-area: chart; min-height: 520px; }
    .exchange__orderbook { grid-area: orderbook; }
    .exchange__order { grid-area: order; }
    .exchange__orders { grid-area: orders; }
    .chart-pane--main { height: 420px; }
    .ob-row { grid-template-columns: 1fr auto 64px; }
    .ticks { max-height: 220px; }
}

@media (min-width: 1240px) {
    .exchange__grid { grid-template-columns: 260px minmax(0, 1fr) 340px; grid-template-areas: "markets chart orderbook" "markets orders order"; }
    .exchange__markets { display: flex; flex-direction: column; grid-area: markets; height: calc(100vh - var(--header-h) - 120px); min-height: 640px; position: sticky; top: calc(var(--header-h) + 12px); }
    .chart-pane--main { height: 460px; }
}

@media (max-width: 599px) {
    /* 내역 테이블 → 카드형 목록 */
    .table--history { min-width: 0; }
    .table--history thead { display: none; }
    .table--history tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
    .table--history tbody tr:last-child { border-bottom: 0; }
    .table--history tbody td { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 !important; border: 0; font-size: 13px; min-width: 0; }
    .table--history tbody td::before { content: attr(data-label); color: var(--muted); font-size: 11px; flex: none; }
    .table--history tbody td[data-label=""]::before { display: none; }
    .table--history tbody td[data-full] { grid-column: 1 / -1; }
    .table--history tbody td.ellipsis { display: flex; white-space: normal; }
    .table--history tbody tr:hover td { background: transparent; }
    .market-table .col-volume { display: none; }
    .market-table th, .market-table td { padding: 10px 8px; }
    .hero__stats { gap: 16px; }
    .hero__cta .btn { flex: 1; }
    .pagehead__title { font-size: 20px; }
    .podium { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .podium__item { padding: 10px 4px; }
    .podium__avatar { width: 36px; height: 36px; font-size: 15px; }
    .podium__rate { font-size: 13px; }
    .ranking-table td:nth-child(4), .ranking-table th:nth-child(4) { display: none; }
    .assets-table td:nth-child(3), .assets-table th:nth-child(3) { display: none; }
    .table th, .table td { padding: 10px 10px; font-size: 12px; }
    .section__head .market-tools { width: 100%; }
    .chart-pane--main { height: 320px; }
}

@media (hover: none) {
    .btn:hover { background: inherit; }
    .btn--primary:hover { background: var(--accent); }
    .btn--buy:hover { background: var(--up); }
    .btn--sell:hover { background: var(--down); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}

/* ---------- 마켓 전환 드롭다운 ---------- */
.qswitch { position: relative; }
.qswitch__btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--border, rgba(255,255,255,.14)); border-radius: 8px; background: transparent; color: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.qswitch__btn:hover { border-color: rgba(255,255,255,.3); }
.qswitch__panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 168px; padding: 6px; border: 1px solid var(--border, rgba(255,255,255,.14)); border-radius: 10px; background: var(--panel, #151a24); box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 60; }
.qswitch__panel a { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 13px; font-weight: 600; }
.qswitch__panel a small { font-weight: 400; font-size: 11px; opacity: .55; }
.qswitch__panel a:hover { background: rgba(255,255,255,.06); }
.qswitch__panel a.active { background: rgba(255,255,255,.08); }
@media (max-width: 640px) { .qswitch__btn span { font-size: 12px; } .qswitch__btn { padding: 6px 9px; } }

/* ---------- 코인 로고 ---------- */
.coinicon--img { background: #fff; object-fit: contain; padding: 2px; }
.coinicon--sm { width: 22px; height: 22px; font-size: 10px; }
.coinicon--sm.coinicon--img { padding: 1px; }
.market-link { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.market-link .coinicon--sm { flex: none; }
.market-link__text { display: flex; flex-direction: column; }
.mrow .coinicon--sm { flex: none; margin-right: 2px; }
.sheet-row .coinicon--sm { flex: none; margin-right: 8px; }

/* ============================================================
   모바일 개편 (헤더/마켓 테이블/전반)
   ============================================================ */
.num, .mono, .ob-row, .mrow__price, .col-price, .mhead__price-value { font-variant-numeric: tabular-nums; }

/* 헤더: 좁은 화면 재배분 */
.topbar__actions { min-width: 0; }
.qswitch--lang .qswitch__btn svg:first-child { flex: none; }
@media (max-width: 720px) {
    .topbar__inner { gap: 8px; padding: 0 12px; }
    .brand { font-size: 16px; gap: 6px; }
    .brand__mark { width: 26px; height: 26px; }
    .topbar__actions { gap: 6px; }
    .qswitch__btn { padding: 6px 8px; gap: 4px; font-size: 12px; }
    .qswitch--lang .qswitch__label { display: none; }   /* 언어: 지구본만 */
    .qswitch__suffix { display: none; }                  /* 마켓: KRW만 */
    .usermenu__name { display: none; }                   /* 아바타만 */
    .usermenu__btn { padding: 3px; border: 0; }
    .btn--sm { padding: 0 10px; height: 32px; font-size: 12px; }
}
@media (max-width: 380px) {
    .brand__name { display: none; }                      /* 초소형: 로고 마크만 */
}

/* 홈 마켓 테이블: 밀도/정렬 개선 */
@media (max-width: 599px) {
    .market-table { table-layout: fixed; width: 100%; }
    .market-table .col-fav { width: 30px; padding-left: 4px; }
    .market-table .col-fav .favbtn { width: 28px; height: 28px; }
    .market-table th.col-name { width: auto; }
    .market-table th.col-price { width: 31%; }
    .market-table th.col-change { width: 25%; }
    .market-table th, .market-table td { padding: 9px 6px; }
    .market-link { gap: 8px; min-width: 0; }
    .market-link .coinicon--sm { width: 26px; height: 26px; }
    .market-link__text { min-width: 0; }
    .market-link__name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .market-link__sym { font-size: 10px; }
    .market-table td.col-price { font-size: 13px; }
    .market-table .col-change { font-size: 12px; }
    .market-table .col-change .change-price { font-size: 10px; }
    .quickcard__list li a { padding: 8px 0; }
    .hero { padding: 24px 0 8px; }
    .hero__title { font-size: 27px; }
    .hero__sub { font-size: 13.5px; }
    .hero__stats { gap: 14px 22px; flex-wrap: wrap; }
    .section { padding: 18px 12px; }
    .section__title { font-size: 17px; }
}

/* iOS 자동 확대 방지: 모바일 입력 16px */
@media (max-width: 959px) {
    .orderform input[type="text"], .orderform input[type="number"],
    .search input, .field input, .field select, .field textarea { font-size: 16px; }
    .exchange__order .orderform { padding-bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 16px); }
}

/* 호가: 밀도 개선 */
.ob-row { height: 28px; font-size: 12px; }
.ob-row--synth .ob-row__size { opacity: 0.55; }
@media (max-width: 959px) {
    .orderbook__asks, .orderbook__bids { max-height: none; }
}

/* ---------- 지갑 자산 테이블 압축 / 전역 가로 오버플로 방지 ---------- */
html, body { overflow-x: clip; }
.assetcell .coinicon { width: 26px; height: 26px; font-size: 11px; }
.assets-table td.num small { font-size: 10.5px; }
@media (max-width: 599px) {
    .assets-table { table-layout: fixed; width: 100%; }
    .assets-table th, .assets-table td { padding: 9px 5px; font-size: 12px; }
    .assets-table th:nth-child(1) { width: 50px; }
    .assets-table th:nth-child(2) { width: 27%; }
    .assets-table th:nth-child(5) { width: 24%; }
    .assets-table th, .assets-table td { padding: 9px 4px; }
    .assets-table td.num { font-size: 11.5px; }
    .assets-table .assetcell div strong { font-size: 11px; }
    .assets-table td.num small { font-size: 10px; }
    .assets-table .assetcell { gap: 6px; }
    .assets-table .assetcell .coinicon { width: 22px; height: 22px; }
    .assets-table .assetcell div strong { font-size: 12px; }
    .assets-table .assetcell div small { display: none; }        /* 심볼은 이름 대신 표기 */
    .assets-table .assetcell div strong small { display: inline; }
    .assets-table td.num { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .assets-table td.num small { display: block; white-space: nowrap; }
}

.assets-table .asset-sym { display: none; }
@media (max-width: 599px) {
    .assets-table .asset-name { display: none; }
    .assets-table .asset-sym { display: block; font-size: 12px; }
}

/* ---------- 잔여 내부 가로 스크롤 제거 (모바일) ---------- */
@media (max-width: 599px) {
    /* 랭킹 테이블: +22px 압축 */
    .ranking-table .col-rank { width: 40px; }
    .ranking-table th, .ranking-table td { padding: 9px 6px; font-size: 12px; }
    .ranking-table .ranking-name { display: inline-block; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

    /* 거래소 차트 툴바: 스크롤 대신 두 줄 배치 */
    .chart-toolbar { flex-wrap: wrap; overflow-x: visible; row-gap: 4px; }
    .chart-toolbar__group.intervals { flex-wrap: wrap; }
    .chart-toolbar__btn { height: 28px; padding: 0 8px; font-size: 11.5px; }

    /* 내역/지갑 탭 바: 스크롤 대신 균등 분배 */
    .tabs { display: flex; overflow-x: visible; }
    .tabs__tab { flex: 1; text-align: center; padding: 10px 4px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- 지갑 자산 테이블(모바일): 아이콘 제거 + 정렬 ---------- */
@media (max-width: 599px) {
    .assets-table .assetcell .coinicon { display: none; }
    .assets-table .assetcell { justify-content: center; }
    .table.assets-table th, .table.assets-table th.num { text-align: center; }
    .assets-table td:first-child { text-align: center; }
    .assets-table td.num { text-align: right; }
}
