/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #070a0d;
  --panel:   #0b0f14;
  --card:    #0e1318;
  --border:  #182030;
  --border2: #1e2a3c;
  --accent:  #f0b90b;
  --buy:     #00c87a;
  --buy2:    #00e676;
  --sell:    #ff3a50;
  --sell2:   #ff1744;
  --text:    #dde4ed;
  --muted:   #3a4858;
  --muted2:  #6a7a8a;
  --mono:    'Inter', 'Noto Sans KR', 'IBM Plex Mono', monospace;
  --sans:    'Inter', 'Noto Sans KR', sans-serif;
  --r:       6px;
  --sidebar: 248px;
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 13px; line-height: 1.5; overflow: hidden; }


/* ── Loading ────────────────────────────────────────────────── */
.loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.loading-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.loading-ring {
  width: 36px; height: 36px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-family: var(--mono); font-size: 11px; color: var(--muted2); letter-spacing: 2px; }

/* ── Layout ─────────────────────────────────────────────────── */
.app-layout {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;   /* JS가 필요 시 auto로 전환 */
  transition: none;
}

/* ── Header ─────────────────────────────────────────────────── */
.header {
  display: flex; align-items: center; gap: 12px;
  padding: 0 14px; height: 48px;
  background: var(--panel); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.logo { display: flex; align-items: center; gap: 6px; }
.logo-icon { font-size: 20px; color: var(--accent); }
.logo-text { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--text); }
.logo-text em { color: var(--accent); font-style: normal; }

.live-badge {
  display: flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 20px;
  background: rgba(0,200,122,.08); border: 1px solid rgba(0,200,122,.2);
  font-family: var(--mono); font-size: 10px; color: var(--buy); font-weight: 700; letter-spacing: 1px;
}
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--buy); animation: blink 2s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

.header-price { display: flex; align-items: baseline; gap: 8px; margin-left: 12px; }
.price-main { font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--text); }
.price-change { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.price-change.up   { color: var(--buy); }
.price-change.down { color: var(--sell); }

.header-meta { display: flex; gap: 14px; margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--muted2); }
.header-right { display: flex; align-items: center; gap: 8px; }
.device-badge { font-family: var(--mono); font-size: 10px; color: var(--muted); cursor: default; }
.help-btn {
  width: 24px; height: 24px; border-radius: 12px;
  border: 1px solid var(--border2); background: transparent;
  color: var(--muted2); cursor: pointer; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: all .12s;
}
.help-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(240,185,11,.1); }

/* ── Help Modal ──────────────────────────────────────────────── */
.help-modal { width: 620px; max-width: 92vw; }
.help-body {
  padding: 16px 20px 20px;
  max-height: 72vh;
  overflow-y: auto;
}
.help-body::-webkit-scrollbar { width: 4px; }
.help-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.help-section { margin-bottom: 22px; }
.help-section:last-child { margin-bottom: 0; }
.help-section h4 {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  color: var(--accent); margin: 0 0 10px 0; letter-spacing: .6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.help-section p {
  font-family: var(--mono); font-size: 11px; color: var(--text);
  margin: 0 0 8px 0; line-height: 1.65;
}
.help-section strong { color: var(--accent); }
.help-section em { color: var(--muted2); font-style: normal; }

/* Overview card */
.help-overview-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: rgba(240,185,11,.06);
  border: 1px solid rgba(240,185,11,.18);
  border-radius: 8px;
  padding: 14px 16px;
}
.help-overview-icon { font-size: 26px; flex-shrink: 0; line-height: 1; }
.help-overview-text {
  font-family: var(--mono); font-size: 11px;
  color: var(--text); line-height: 1.7;
}
.help-overview-text strong { color: var(--accent); font-size: 12px; }
.help-overview-text em { color: var(--buy); font-style: normal; font-weight: 700; }

/* Inline badge */
.help-badge-inline {
  display: inline-block; padding: 1px 6px; border-radius: 3px;
  font-family: var(--mono); font-size: 9px; font-weight: 700;
}
.help-badge-inline.long  { background: rgba(0,230,118,.15); color: var(--buy2);  border: 1px solid rgba(0,230,118,.3); }
.help-badge-inline.short { background: rgba(255,23,68,.15);  color: var(--sell2); border: 1px solid rgba(255,23,68,.3); }

/* kbd styling */
.help-section kbd, .help-body kbd {
  display: inline-block; padding: 1px 6px; border-radius: 3px;
  background: rgba(255,255,255,.1); border: 1px solid var(--border2);
  font-family: var(--mono); font-size: 10px; color: var(--text);
  line-height: 1.5;
}

/* 3-step quickstart */
.help-steps { display: flex; flex-direction: column; gap: 8px; }
.help-step {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--panel2, rgba(255,255,255,.03));
  border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px;
}
.help-step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #000;
  font-family: var(--mono); font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.help-step-body {
  font-family: var(--mono); font-size: 11px; color: var(--text); line-height: 1.6;
  display: flex; flex-direction: column; gap: 2px;
}
.help-step-body strong { color: var(--accent); font-size: 11px; }
.help-step-body span   { color: var(--muted2); }

/* Table style */
.help-table { display: flex; flex-direction: column; gap: 2px; }
.help-tr {
  display: flex; gap: 0;
  border-radius: 4px; overflow: hidden;
}
.help-th {
  flex-shrink: 0; width: 108px; padding: 6px 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-right: none;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  color: var(--muted2);
  display: flex; align-items: center;
  border-radius: 4px 0 0 4px;
}
.help-td {
  flex: 1; padding: 6px 10px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border);
  font-family: var(--mono); font-size: 10px; color: var(--text); line-height: 1.5;
  border-radius: 0 4px 4px 0;
}
.help-td strong { color: var(--accent); }

/* MTF badge rows */
.help-mtf-badges { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.help-mtf-row { display: flex; align-items: center; gap: 10px; }
.help-mtf-desc { font-family: var(--mono); font-size: 10px; color: var(--muted2); }

/* Indicator grid */
.help-ind-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.help-ind-card {
  display: flex; gap: 9px; align-items: flex-start;
  background: rgba(255,255,255,.02); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 10px;
  transition: border-color .12s;
}
.help-ind-card:hover { border-color: rgba(240,185,11,.3); }
.help-ind-icon { font-size: 15px; flex-shrink: 0; line-height: 1.4; }
.help-ind-info { display: flex; flex-direction: column; gap: 2px; }
.help-ind-info strong {
  font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--accent);
}
.help-ind-info span {
  font-family: var(--mono); font-size: 9.5px; color: var(--muted2); line-height: 1.5;
}

/* Tips */
.help-tips { display: flex; flex-direction: column; gap: 7px; }
.help-tip {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 10px; border-radius: 6px;
  background: rgba(255,255,255,.02); border: 1px solid var(--border);
}
.help-tip-icon { font-size: 14px; flex-shrink: 0; line-height: 1.5; }
.help-tip span { font-family: var(--mono); font-size: 10.5px; color: var(--text); line-height: 1.6; }
.help-tip strong { color: var(--accent); }

/* Details/Summary (드로잉 접기) */
.help-details { }
.help-details-summary {
  cursor: pointer; list-style: none;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  color: var(--muted2); padding: 6px 0;
  border-top: 1px solid var(--border);
  transition: color .12s;
  user-select: none;
}
.help-details-summary:hover { color: var(--accent); }
.help-details-summary::-webkit-details-marker { display: none; }
.help-details[open] .help-details-summary { color: var(--accent); }

/* Help modal dismiss options */
.help-dismiss-options {
  display: flex;
  gap: 16px;
  margin-right: auto;
}
.dismiss-option {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted2);
  transition: color .12s;
}
.dismiss-option:hover { color: var(--text); }
.dismiss-option input[type="radio"] {
  accent-color: var(--accent);
  cursor: pointer;
}

.badge {
  display: inline-block; padding: 1px 6px; border-radius: 3px;
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  letter-spacing: .3px;
}
.badge.long { background: rgba(0,230,118,.15); color: var(--buy2); border: 1px solid rgba(0,230,118,.3); }
.badge.short { background: rgba(255,23,68,.15); color: var(--sell2); border: 1px solid rgba(255,23,68,.3); }
.badge.side { background: rgba(255,255,255,.08); color: var(--muted2); border: 1px solid var(--border2); }

/* ── Toolbar ────────────────────────────────────────────────── */
.toolbar {
  display: flex; align-items: center;
  padding: 0 12px; height: 36px;
  background: var(--panel); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tf-group { display: flex; align-items: center; gap: 3px; }
.tf-label { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-right: 6px; letter-spacing: .5px; }
.tf-btn {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  padding: 3px 9px; border: 1px solid var(--border2); border-radius: 4px;
  background: transparent; color: var(--muted2); cursor: pointer; transition: all .12s;
}
.tf-btn:hover { border-color: var(--accent); color: var(--accent); }
.tf-btn.active { background: rgba(240,185,11,.12); border-color: var(--accent); color: var(--accent); }

/* Toolbar right section with checkbox */
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* Toolbar help button */
.toolbar-help-btn {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--border2); background: transparent;
  color: var(--muted2); cursor: pointer; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: all .12s; font-family: var(--sans);
  pointer-events: auto;
  z-index: 10;
  position: relative;
}
.toolbar-help-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(240,185,11,.1); }

.toggle-checkbox {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; font-family: var(--mono); font-size: 10px;
  color: var(--muted2); user-select: none;
}
.toggle-checkbox input[type="checkbox"] {
  width: 14px; height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}
.toggle-checkbox .check-label {
  transition: color .12s;
}
.toggle-checkbox:hover .check-label { color: var(--text); }
.toggle-checkbox input:checked + .check-label { color: var(--accent); }

/* ── Main area ──────────────────────────────────────────────── */
/*
  구조: [sidebar] [center-right-wrap] [panel-right]
  - sidebar: flex-shrink 0, 고정 너비
  - center-right-wrap: flex:1, 세로로 차트+하단패널
  - panel-right: flex-shrink 0, 고정 너비, 전체 높이 자동
*/
.main-area {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}

/* ── Center wrap: 차트 + 하단패널만 세로 배치 ─────────────── */
.center-right-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Chart area ─────────────────────────────────────────────── */
.chart-area {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ── Right panel: main-area 직속 → 전체 높이 자동 확보 ─────── */
.panel-right {
  width: 220px;
  flex-shrink: 0;
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
}
.panel-right::-webkit-scrollbar { width: 3px; }
.panel-right::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.rp-section {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.rp-section-title {
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  color: var(--muted); letter-spacing: .8px; text-transform: uppercase;
  margin-bottom: 8px;
}
.rp-label {
  font-family: var(--mono); font-size: 9px; color: var(--muted);
  letter-spacing: .5px; text-transform: uppercase; margin-bottom: 4px;
}
.rp-price {
  font-family: var(--mono); font-size: 17px; font-weight: 700;
  color: var(--text); line-height: 1.2;
}
.rp-change {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  color: var(--muted2); margin-top: 2px;
}
.rp-change.up   { color: var(--buy); }
.rp-change.down { color: var(--sell); }
.rp-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 3px 0;
}
.rp-key { font-family: var(--mono); font-size: 10px; color: var(--muted2); }
.rp-val { font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--text); }
.rp-buy  { color: var(--buy) !important; }
.rp-sell { color: var(--sell) !important; }
.rp-links { display: flex; flex-direction: column; gap: 6px; }
.rp-link {
  font-family: var(--mono); font-size: 10px; color: var(--muted2);
  text-decoration: none; padding: 5px 8px; border-radius: 5px;
  border: 1px solid var(--border2); text-align: center;
  transition: all .12s;
}
.rp-link:hover { color: var(--accent); border-color: rgba(240,185,11,.4); background: rgba(240,185,11,.06); }

/* ── Bottom panel ───────────────────────────────────────────── */
.panel-bottom {
  grid-area: bottom;
  background: var(--panel);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.bottom-tab-bar {
  display: flex; align-items: center;
  height: 32px; padding: 0 8px; gap: 2px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.btm-tab {
  padding: 3px 10px; border-radius: 4px; border: none;
  background: transparent; cursor: pointer;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  color: var(--muted); transition: all .12s;
}
.btm-tab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.btm-tab.active { color: var(--accent); background: rgba(240,185,11,.1); }

.bottom-body { flex: 1; overflow: hidden; position: relative; }
.btm-pane {
  display: none; height: 100%; overflow-y: auto; padding: 8px 10px;
}
.btm-pane.active { display: block; }
.btm-pane::-webkit-scrollbar { width: 3px; }
.btm-pane::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.btm-empty {
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  text-align: center; padding: 16px 0;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── Panel ──────────────────────────────────────────────────── */
.panel {
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
/* Panel settings button in header */
.panel-settings-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all .12s;
  margin-left: auto;
}
.panel-settings-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(240,185,11,.08);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px 7px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.015);
  gap: 8px;
}
.panel-title {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  color: var(--muted2); letter-spacing: .5px; text-transform: uppercase;
  display: flex; align-items: center; gap: 5px;
}
.panel-hint { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.panel-body { padding: 6px 8px 8px; }

/* ── MTF Panel ──────────────────────────────────────────────── */
.mtf-loading { font-family: var(--mono); font-size: 10px; color: var(--muted); padding: 6px; }
.mtf-row {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 3px; border-bottom: 1px solid rgba(255,255,255,.03);
  font-family: var(--mono);
}
.mtf-row:last-child { border-bottom: none; }
.mtf-tf { width: 28px; font-size: 10px; color: var(--muted2); flex-shrink: 0; }
.mtf-badge {
  flex: 1; font-size: 10px; font-weight: 700; letter-spacing: .5px;
  padding: 2px 6px; border-radius: 3px; text-align: center;
}
.mtf-long  { background: rgba(0,230,118,.1); color: var(--buy2); border: 1px solid rgba(0,230,118,.2); }
.mtf-short { background: rgba(255,23,68,.1);  color: var(--sell2); border: 1px solid rgba(255,23,68,.2); }
.mtf-side  { background: rgba(255,255,255,.04); color: var(--muted2); border: 1px solid var(--border2); }

/* Weak trend styles */
.mtf-long-weak { background: rgba(0,230,118,.05); color: #4ade80; border: 1px solid rgba(0,230,118,.15); }
.mtf-short-weak { background: rgba(255,23,68,.05); color: #f87171; border: 1px solid rgba(255,23,68,.15); }
.mtf-adx { font-size: 8px; color: var(--muted); flex-shrink: 0; width: 40px; text-align: right; }
.mtf-gear-btn {
  flex-shrink: 0; width: 18px; height: 18px; border-radius: 4px;
  border: 1px solid var(--border2); background: transparent;
  color: var(--muted); cursor: pointer; font-size: 10px;
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: all .12s;
}
.mtf-gear-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(240,185,11,.08); }

/* ── Signal panels ──────────────────────────────────────────── */
.signal-panel .panel-head { position: sticky; top: 0; z-index: 2; }
.long-panel  .panel-head { border-left: 2px solid rgba(0,200,122,.5); }
.short-panel .panel-head { border-left: 2px solid rgba(255,58,80,.5); }

.side-dot { font-size: 10px; }
.long-dot  { color: var(--buy); }
.short-dot { color: var(--sell); }

.signal-live-badge {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 8px; color: var(--buy2);
  animation: sigpulse 1s ease-in-out infinite;
}
.signal-live-badge.short-badge { color: var(--sell2); }
@keyframes sigpulse { 0%,100%{opacity:1} 50%{opacity:.3} }

.add-btn {
  width: 20px; height: 20px; border-radius: 5px;
  border: 1px solid var(--border2); background: transparent;
  font-size: 14px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted2); transition: all .12s; padding: 0;
}
.long-add:hover  { border-color: var(--buy);  color: var(--buy);  background: rgba(0,200,122,.08); }
.short-add:hover { border-color: var(--sell); color: var(--sell); background: rgba(255,58,80,.08); }

.sig-list { padding: 6px 6px; display: flex; flex-direction: column; gap: 4px; min-height: 40px; }
.sig-empty { font-family: var(--mono); font-size: 10px; color: var(--muted); padding: 8px 4px; text-align: center; }

/* ── Signal item ────────────────────────────────────────────── */
.sig-item {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 7px; border-radius: 6px;
  background: rgba(255,255,255,.025); border: 1px solid var(--border);
  cursor: default; transition: border-color .12s, opacity .12s;
  position: relative;
}
.sig-item:hover { border-color: var(--border2); }
.sig-item.dragging { opacity: .5; }
.sig-item.drag-over { border-color: var(--accent); background: rgba(240,185,11,.05); }
.sig-item.disabled { opacity: .4; background: rgba(255,255,255,.01); }
.sig-item.disabled .sig-name, .sig-item.disabled .sig-desc, .sig-item.disabled .sig-icon { opacity: .6; }

.sig-enable-check {
  width: 12px; height: 12px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

.sig-drag-handle {
  flex-shrink: 0; font-size: 11px; color: var(--muted); cursor: grab;
  line-height: 1; user-select: none;
}
.sig-drag-handle:active { cursor: grabbing; }

.sig-order {
  flex-shrink: 0; width: 16px; height: 16px;
  background: var(--border2); border-radius: 3px;
  font-family: var(--mono); font-size: 8px; font-weight: 700;
  color: var(--muted2); display: flex; align-items: center; justify-content: center;
}

.sig-body { flex: 1; min-width: 0; }
.sig-top-row { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.sig-icon { font-size: 10px; flex-shrink: 0; }
.sig-name { font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--text); white-space: nowrap; }
.sig-desc { font-family: var(--mono); font-size: 9px; color: var(--muted2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mode-tag {
  font-family: var(--mono); font-size: 8px; font-weight: 700;
  padding: 1px 4px; border-radius: 3px; letter-spacing: .3px;
  text-transform: uppercase; flex-shrink: 0;
}
.mode-tag.state   { background: rgba(59,130,246,.15); color: #60a5fa; border: 1px solid rgba(59,130,246,.25); }
.mode-tag.trigger { background: rgba(168,85,247,.15); color: #c084fc; border: 1px solid rgba(168,85,247,.25); }

.sig-actions { display: flex; gap: 2px; flex-shrink: 0; }
.sig-act-btn {
  width: 18px; height: 18px; border-radius: 4px; border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer; font-size: 10px;
  display: flex; align-items: center; justify-content: center; padding: 0; line-height: 1;
  transition: all .12s;
}
.sig-act-btn:hover        { background: rgba(255,255,255,.06); color: var(--text); border-color: var(--border2); }
.sig-act-btn.gear:hover   { color: var(--accent); border-color: rgba(240,185,11,.3); background: rgba(240,185,11,.06); }
.sig-act-btn.del:hover    { color: var(--sell); border-color: rgba(255,58,80,.3); background: rgba(255,58,80,.06); }
.sig-act-btn:disabled     { opacity: .25; cursor: default; }
.sig-act-btn:disabled:hover { background: transparent; color: var(--muted); border-color: transparent; }

/* ── Drawing Toolbar ─────────────────────────────────────────── */
.drawing-toolbar {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 4px 6px 5px;
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: 0 8px 8px 0;
  border-left: none;
  z-index: 100;
  box-shadow: 2px 4px 12px rgba(0,0,0,.3);
}
.tool-btn {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all .15s;
}
.tool-btn svg {
  width: 12px;
  height: 12px;
}
.tool-btn:hover {
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-color: var(--border2);
}
.tool-btn.active {
  background: rgba(240,185,11,.12);
  color: var(--accent);
  border-color: var(--accent);
}
.tool-divider {
  height: 1px;
  background: var(--border2);
  margin: 3px 0;
}

/* ── Drawing Object Edit Popup (canvas-absolute) ────────────── */
.draw-edit-popup {
  position: absolute;
  z-index: 200;
  background: #1a2332;
  border: 1px solid #2e3d52;
  border-radius: 8px;
  padding: 6px 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.6);
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: all;
  animation: depIn .15s ease;
}
@keyframes depIn {
  from { opacity: 0; transform: translateY(4px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);   }
}
.dep-color-row { display: flex; gap: 5px; align-items: center; }
.dep-color {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer; padding: 0;
  transition: transform .1s, border-color .1s;
  flex-shrink: 0;
}
.dep-color:hover  { transform: scale(1.25); }
.dep-color.active { border-color: #fff; }
.dep-action-row {
  display: flex; gap: 4px; align-items: center;
  border-top: 1px solid #2e3d52;
  padding-top: 5px;
}
.dep-btn {
  flex: 1; height: 22px;
  border-radius: 4px;
  border: 1px solid #2e3d52;
  background: transparent;
  color: #9ba8b8; font-size: 11px;
  cursor: pointer; transition: all .1s;
  white-space: nowrap; padding: 0 6px;
}
.dep-btn:hover       { background: rgba(255,255,255,.08); color: #dde4ed; }
.dep-delete:hover    { background: rgba(255,58,80,.12); color: #ff3a50; border-color: #ff3a5044; }

/* ── Text Input Overlay (canvas-relative) ───────────────────── */
.text-input-overlay {
  position: absolute; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8,14,22,.55);
  backdrop-filter: blur(2px);
}
.text-input-box {
  background: #1a2332;
  border: 1px solid #2e3d52;
  border-radius: 10px;
  padding: 12px 14px; width: 280px;
  box-shadow: 0 12px 40px rgba(0,0,0,.7);
  animation: depIn .15s ease;
}
.tib-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 10px;
}
.tib-title { font-family: var(--mono); font-size: 12px; font-weight: 600; color: #dde4ed; }
.tib-colors { display: flex; gap: 5px; }
.tib-color {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer; padding: 0;
  transition: transform .1s, border-color .1s;
}
.tib-color:hover  { transform: scale(1.2); }
.tib-color.active { border-color: #fff; }
.tib-textarea {
  width: 100%; box-sizing: border-box;
  background: #0f1621;
  border: 1px solid #2e3d52; border-radius: 6px;
  color: #dde4ed; font-family: var(--mono); font-size: 12px;
  line-height: 1.5; padding: 8px 10px; resize: none; outline: none;
  transition: border-color .15s;
}
.tib-textarea:focus { border-color: #3a7bd5; }
.tib-footer {
  display: flex; align-items: center;
  justify-content: space-between; margin-top: 8px; gap: 8px;
}
.tib-hint { font-size: 10px; color: #5a6a7e; flex: 1; line-height: 1.3; }
.tib-btns { display: flex; gap: 6px; }
.tib-cancel, .tib-ok {
  height: 26px; border-radius: 5px;
  border: 1px solid #2e3d52; font-size: 11px;
  font-family: var(--mono); cursor: pointer;
  padding: 0 12px; transition: all .1s;
}
.tib-cancel { background: transparent; color: #9ba8b8; }
.tib-cancel:hover { background: rgba(255,255,255,.06); color: #dde4ed; }
.tib-ok { background: #3a7bd5; color: #fff; border-color: #3a7bd5; font-weight: 600; }
.tib-ok:hover { background: #4a8be5; }

/* ── Chart wrap ──────────────────────────────────────────────── */
.chart-wrap { 
  overflow: visible;
  position: relative; 
  flex: 1;
  min-height: 0;
  touch-action: none;
}
.chart-wrap canvas { display: block; cursor: grab; touch-action: none; }

/* ── Modal backdrop ─────────────────────────────────────────── */
.modal-backdrop {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}

.modal-box {
  background: var(--card); border: 1px solid var(--border2);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  max-height: 90vh; overflow-y: auto;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--card); z-index: 1;
}
.modal-title { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--text); }
.modal-close { background: none; border: none; color: var(--muted2); font-size: 13px; cursor: pointer; padding: 2px 6px; border-radius: 4px; transition: all .12s; }
.modal-close:hover { color: var(--sell); background: rgba(255,58,80,.08); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); }

/* ── Add indicator grid ─────────────────────────────────────── */
.add-ind-modal { width: 520px; }

/* Category sections */
.add-ind-section {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
}
.add-ind-section:last-child {
  border-bottom: none;
}
.add-ind-section-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  padding-top: 4px;
}

.add-ind-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.add-ind-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 12px 8px; border-radius: 8px;
  border: 1px solid var(--border2); background: rgba(255,255,255,.02);
  cursor: pointer; transition: all .15s; text-align: center;
}
.add-ind-card:hover { border-color: var(--accent); background: rgba(240,185,11,.06); transform: translateY(-1px); }
.add-ind-icon  { font-size: 22px; line-height: 1; }
.add-ind-name  { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--text); }
.add-ind-desc  { font-size: 10px; color: var(--muted2); font-family: var(--mono); }

/* ── Indicator settings modal ───────────────────────────────── */
.is-modal { width: 380px; }
.is-body  { padding: 0; }
.is-section { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.is-section:last-child { border-bottom: none; }
.is-section-title { font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--muted2); letter-spacing: .8px; text-transform: uppercase; margin-bottom: 10px; }

/* Mode cards */
.mode-cards { display: flex; gap: 8px; }
.mode-card  { flex: 1; cursor: pointer; }
.mode-card input { display: none; }
.mode-card-inner {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border2); background: rgba(255,255,255,.02);
  transition: all .12s;
}
.mode-card input:checked + .mode-card-inner {
  border-color: var(--accent); background: rgba(240,185,11,.06);
}
.mode-card-icon { font-size: 16px; line-height: 1; }
.mode-card-name { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--text); }
.mode-card-desc { font-size: 10px; color: var(--muted2); font-family: var(--mono); line-height: 1.4; }

/* Param fields */
.is-params { display: flex; flex-direction: column; gap: 10px; }
.is-field  { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.is-label  { font-family: var(--mono); font-size: 10px; color: var(--muted2); flex-shrink: 0; }
.is-input, .is-select {
  background: rgba(0,0,0,.6); border: 1px solid var(--border2);
  border-radius: 5px; color: var(--text);
  font-family: var(--mono); font-size: 11px;
  padding: 5px 8px; width: 120px; text-align: right;
}
.is-select { text-align: left; width: 180px; cursor: pointer; }
.is-select option { background: #1a1a1a; color: #f0f0f0; }
.is-input:focus, .is-select:focus { outline: none; border-color: rgba(240,185,11,.4); }

/* MTF panel modal (all timeframes) */
.mtf-panel-modal { width: 280px; }
.mtf-tf-toggles { display: flex; flex-direction: column; gap: 12px; }
.mtf-tf-toggles .toggle-row { padding: 4px 0; }

/* MTF modal */
.mtf-modal { width: 320px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.toggle-label { font-family: var(--mono); font-size: 11px; color: var(--text); }
.toggle-check { display: none; }
.toggle-slider {
  width: 36px; height: 20px; border-radius: 10px;
  background: var(--border2); position: relative; transition: background .2s;
}
.toggle-slider::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--muted2); transition: all .2s;
}
.toggle-check:checked + .toggle-slider { background: var(--accent); }
.toggle-check:checked + .toggle-slider::after { transform: translateX(16px); background: #000; }

/* Buttons */
.btn-primary {
  padding: 7px 18px; border-radius: 6px; border: none; cursor: pointer;
  background: var(--accent); color: #000;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  transition: all .12s;
}
.btn-primary:hover { background: var(--accent2 ); }
.btn-ghost {
  padding: 7px 14px; border-radius: 6px;
  border: 1px solid var(--border2); background: transparent; cursor: pointer;
  color: var(--muted2); font-family: var(--mono); font-size: 11px;
  transition: all .12s;
}
.btn-ghost:hover { border-color: var(--text); color: var(--text); }

/* ── Mobile Sidebar Toggle ───────────────────────────────── */
.sidebar-toggle {
  display: none;
  width: 32px; height: 32px; border-radius: 6px;
  border: 1px solid var(--border2); background: transparent;
  color: var(--muted2); cursor: pointer; font-size: 14px;
  align-items: center; justify-content: center; padding: 0;
  transition: all .12s; margin-right: 8px;
}
.sidebar-toggle:hover { border-color: var(--accent); color: var(--accent); }
.sidebar-toggle.active { background: rgba(240,185,11,.1); border-color: var(--accent); color: var(--accent); }

/* Mobile responsive */
@media (max-width: 768px) {
  /* ── 기본: html/body 스크롤 허용 ── */
  html, body { overflow: auto; height: auto; }

  /* ── 앱 레이아웃: 고정 높이 해제 ── */
  .app-layout { height: auto; min-height: 100vh; overflow: visible; }
  .main-area  { overflow: visible; flex-direction: column; }

  /* ── 사이드바 토글 버튼 표시 ── */
  .sidebar-toggle { display: flex; }

  /* ── 사이드바: 슬라이드 오버레이 ── */
  .sidebar {
    position: fixed; left: 0; top: 84px; bottom: 0; z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,.4);
    width: min(280px, 85vw);
    overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0) !important; }
  .sidebar-overlay {
    display: none; position: fixed; inset: 84px 0 0 0; z-index: 999;
    background: rgba(0,0,0,.5);
    transition: opacity 0.3s ease;
    opacity: 0;
  }
  .sidebar-overlay.active { display: block; opacity: 1; }

  /* ── 우측 패널 숨김 (모바일) ── */
  .panel-right { display: none; }

  /* ── center-right-wrap: 세로 플렉스, 스크롤 없음 ── */
  .center-right-wrap { overflow: visible; }

  /* ── 차트 영역: 뷰포트 높이의 50% 고정, touch-action ── */
  .chart-area {
    height: 50vh;
    min-height: 260px;
    flex: none;
    overflow: hidden;
  }
  .chart-wrap { touch-action: none; }
  .chart-wrap canvas { touch-action: none; }

  /* ── 차트 리사이즈 핸들: 모바일에서 숨김 (터치로 직접 드래그 대신 고정) ── */
  .chart-resize-handle { display: none; }

  /* ── 하단 패널(메모): 고정 높이 해제 → 자연 높이, 항상 표시 ── */
  .panel-bottom {
    display: flex !important;
    height: auto !important;
    flex-basis: auto !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    min-height: 200px;
    overflow: visible;
  }
  .bottom-body { overflow: visible; min-height: 160px; height: auto; }
  .memo-textarea { height: 160px; min-height: 120px; }

  /* ── 툴바: 타임프레임 버튼 가로 스크롤 ── */
  .toolbar {
    height: auto;
    padding: 6px 8px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .tf-group { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 2px; }
  .tf-group::-webkit-scrollbar { display: none; }
  .tf-btn { padding: 4px 8px; font-size: 11px; flex-shrink: 0; }
  .toolbar-right { gap: 6px; }
  .toggle-checkbox .check-label { font-size: 10px; }

  /* ── 헤더: 통계 축소 ── */
  .header { padding: 0 10px; gap: 8px; }
  .header-meta { display: none; }
  .header-price { margin-left: 6px; }
  .price-main { font-size: 15px; }

  /* ── 드로잉 툴바: 버튼 좀 더 크게 ── */
  .tool-btn { width: 30px; height: 30px; }

  /* ── 모달: 전체 너비 ── */
  .modal-box { width: 95vw !important; max-width: 95vw !important; }
  .help-modal { width: 95vw; }
  .add-ind-modal { width: 95vw; }
  .is-modal { width: 95vw; }

  /* ── 지표 추가 그리드: 2열 ── */
  .add-ind-grid { grid-template-columns: repeat(2, 1fr); }

  /* ── 도움말 인디케이터 그리드: 1열 ── */
  .help-ind-grid { grid-template-columns: 1fr; }

  /* ── 모달 help dismiss 옵션 세로 배열 ── */
  .help-dismiss-options { flex-direction: column; gap: 8px; }
}

/* 중간 화면: 우측 패널 축소 */
@media (max-width: 1100px) and (min-width: 769px) {
  :root { --sidebar: 200px; }
  .panel-right { width: 180px; }
}

/* Desktop - always show sidebar */
@media (min-width: 769px) {
  .sidebar { transform: translateX(0) !important; position: relative; top: auto; }
  .sidebar-overlay { display: none !important; }
}

/* ── Chart Controls ─────────────────────────────────────────── */
/* Chart reset button (center bottom) */
.chart-reset-btn {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: rgba(11, 15, 20, 0.9);
  color: var(--muted2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all .15s;
  z-index: 10;
  backdrop-filter: blur(4px);
}
.chart-reset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(240, 185, 11, 0.1);
  transform: translateX(-50%) scale(1.05);
}
.chart-reset-btn:active {
  transform: translateX(-50%) scale(0.95);
}

/* Chart resize handle: chart-area 와 panel-bottom 사이 flex 아이템 */
.chart-resize-handle {
  flex-shrink: 0;
  height: 6px;
  background: transparent;
  cursor: ns-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
  border-top: 1px solid var(--border);
}
.chart-resize-handle:hover,
.chart-resize-handle.dragging {
  background: rgba(240, 185, 11, 0.12);
  border-top-color: var(--accent);
}
.chart-resize-handle .resize-line {
  width: 48px;
  height: 2px;
  background: var(--border2);
  border-radius: 1px;
}
.chart-resize-handle:hover .resize-line,
.chart-resize-handle.dragging .resize-line {
  background: var(--accent);
}
.chart-resize-handle .resize-dots {
  position: absolute;
  display: flex;
  gap: 3px;
}
.chart-resize-handle .resize-dots span {
  width: 3px; height: 3px;
  background: var(--muted);
  border-radius: 50%;
}
.chart-resize-handle:hover .resize-dots span,
.chart-resize-handle.dragging .resize-dots span {
  background: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   MEMO NOTEBOOK — Bottom Panel
═══════════════════════════════════════════════════════════════ */
.memo-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  padding: 0;
}

/* Tab bar overrides for memo tabs */
.bottom-tab-bar {
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
}
.bottom-tab-bar::-webkit-scrollbar { height: 3px; }
.bottom-tab-bar::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.btm-tab-memo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  transition: all .12s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btm-tab-memo:hover { color: var(--text); background: rgba(255,255,255,.04); }
.btm-tab-memo.active {
  color: var(--accent);
  background: rgba(240,185,11,.1);
}

.btm-tab-title {
  cursor: pointer;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btm-tab-del {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 0 1px;
  margin-left: 1px;
  opacity: .5;
  transition: opacity .12s, color .12s;
}
.btm-tab-memo:hover .btm-tab-del,
.btm-tab-memo.active .btm-tab-del { opacity: 1; }
.btm-tab-del:hover { color: var(--sell) !important; }

.btm-tab-rename-input {
  background: var(--panel2, #1a1c1f);
  border: 1px solid var(--accent);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  width: 90px;
  outline: none;
}

.btm-tab-add {
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px dashed var(--border2);
  background: transparent;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 4px;
  transition: all .12s;
}
.btm-tab-add:hover {
  color: var(--accent);
  border-color: rgba(240,185,11,.5);
  background: rgba(240,185,11,.06);
}

.memo-textarea {
  flex: 1;
  width: 100%;
  height: 100%;
  background: var(--panel);
  border: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  padding: 10px 14px;
  resize: none;
  outline: none;
  box-sizing: border-box;
  overflow-y: auto;
}
.memo-textarea::placeholder { color: var(--muted); opacity: .6; }
.memo-textarea::-webkit-scrollbar { width: 3px; }
.memo-textarea::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ═══════════════════════════════════════════════════════════════
   RIGHT PANEL — Enhanced: Kimchi Premium + Indicator Values
═══════════════════════════════════════════════════════════════ */

/* Kimchi premium color classes */
.rp-kimchi { font-weight: 700; }
.rp-kimchi.kimchi-pos { color: #f0b90b !important; }   /* positive = premium */
.rp-kimchi.kimchi-neg { color: var(--sell) !important; } /* discount */

/* Indicator values */
.rp-ind-empty {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  padding: 10px 0 6px;
  line-height: 1.6;
}
.rp-ind-row {
  border-top: 1px solid var(--border);
  padding-top: 3px;
  margin-top: 2px;
}
.rp-ind-row:first-child { border-top: none; margin-top: 0; }

/* ── Right panel indicator value layout fix ──────────────── */
.rp-ind-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 4px 0;
  border-top: 1px solid var(--border);
  gap: 6px;
}
.rp-ind-row:first-child { border-top: none; }
.rp-ind-label {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted2);
  flex-shrink: 0;
  padding-top: 1px;
  max-width: 90px;
}
.rp-ind-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.rp-ind-sub {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
  line-height: 1.3;
  text-align: right;
}

/* ── Mobile: Right Panel as bottom sheet ────────────────────── */
@media (max-width: 768px) {
  /* 정보 버튼 표시 */
  .mob-info-btn { display: flex !important; }
  .mob-info-btn.active { background: rgba(240,185,11,.15); border-color: var(--accent); color: var(--accent); }

  /* 우측 패널: 하단에서 슬라이드업 */
  .panel-right {
    display: block;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 70vh;
    max-height: 70vh;
    border-left: none;
    border-top: 1px solid var(--border2);
    border-radius: 14px 14px 0 0;
    z-index: 1100;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -8px 32px rgba(0,0,0,.5);
    overflow-y: auto;
  }
  .panel-right.mob-panel-open {
    transform: translateY(0);
  }
  /* 패널 상단 드래그 핸들 표시용 */
  .panel-right::before {
    content: '';
    display: block;
    width: 40px; height: 4px;
    background: var(--border2);
    border-radius: 2px;
    margin: 10px auto 6px;
    flex-shrink: 0;
  }
}
