/* TADPOLE SCANNER — 공용 스타일. 다크 기본 / 라이트는 [data-theme=light]. 외부 파일 참조 없음. */
:root {
  --bg: #0b0e14; --panel: #11151d; --panel2: #161b25; --line: rgba(255,255,255,.08); --line-soft: rgba(255,255,255,.04);
  --text: #e6e9ef; --muted: #8b93a3; --accent: #2bb8a0; --accent-2: #3dd4ba; --red: #ef5350; --green: #26a69a; --amber: #d9a441;
  --chip: #161b25; --chip-on: rgba(43,184,160,.16); --row-hover: rgba(255,255,255,.03); --radius: 10px; --shadow: 0 8px 30px rgba(0,0,0,.35);
}
[data-theme="light"] {
  --bg: #f6f7f9; --panel: #ffffff; --panel2: #f0f2f5; --line: rgba(0,0,0,.1); --line-soft: rgba(0,0,0,.05);
  --text: #1c2130; --muted: #6b7280; --accent: #0f9d84; --accent-2: #0b7f6a; --red: #d93025; --green: #188a6f; --amber: #b7791f;
  --chip: #f0f2f5; --chip-on: rgba(15,157,132,.12); --row-hover: rgba(0,0,0,.03); --shadow: 0 8px 30px rgba(0,0,0,.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--text); font-family: 'Pretendard Variable', Pretendard, -apple-system, system-ui, 'Segoe UI', sans-serif; font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; } button { font-family: inherit; cursor: pointer; color: inherit; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.pos { color: var(--green); } .neg { color: var(--red); } .muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* 헤더 */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--panel); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 22px; height: 54px; }
.wordmark { font-weight: 800; letter-spacing: .06em; font-size: 15px; white-space: nowrap; }
.wordmark .accent { color: var(--accent); }
.main-nav { display: flex; gap: 4px; align-items: center; flex: 1; }
.main-nav a { color: var(--muted); font-size: 13.5px; font-weight: 600; padding: 6px 10px; border-radius: 8px; }
.main-nav a:hover { color: var(--text); background: var(--panel2); }
.main-nav a.active { color: var(--accent-2); background: var(--chip-on); }
.nav-right { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.icon-btn { background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 700; padding: 5px 9px; height: 30px; }
.icon-btn:hover { color: var(--text); border-color: var(--muted); }
.plan-badge { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.plan-badge.pro { border-color: rgba(43,184,160,.5); color: var(--accent-2); background: var(--chip-on); }
.plan-badge.member { border-color: rgba(59,130,246,.5); color: #5b9cf6; background: rgba(59,130,246,.12); }

main { padding: 18px 0 64px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 14px; }
.card h2 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.page-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.page-desc { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.note { color: var(--muted); font-size: 12.5px; }
.note.warn { color: var(--amber); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-size: 13.5px; font-weight: 700; padding: 9px 16px; }
.btn:hover { background: var(--accent-2); }
.btn.ghost { background: none; border: 1px solid var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent-2); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.input { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; padding: 9px 12px; outline: none; }
.input:focus { border-color: var(--accent); }
select.input { appearance: none; }
.lock { font-size: 11px; color: var(--muted); }

/* 시장 요약 띠 */
.market-strip { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; padding: 10px 0 14px; font-size: 12.5px; color: var(--muted); }
.market-strip b { color: var(--text); font-weight: 700; }
.market-strip .hint { margin-left: auto; }

/* 스크리너 헤더 (유니버스·거래소·TF) */
.screener-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: none; border: none; padding: 6px 12px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--chip-on); color: var(--accent-2); }
.sel { background: var(--chip); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; font-weight: 600; color: var(--text); font-family: inherit; }
.screener-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }

/* 칩 행 */
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.chip-row .label { font-size: 11.5px; color: var(--muted); font-weight: 700; letter-spacing: .04em; margin-right: 4px; width: 44px; }
.chip { background: var(--chip); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: var(--muted); }
.chip.on { background: var(--chip-on); border-color: var(--accent); color: var(--accent-2); }
.chip.setup { font-weight: 700; }
.chip .x { color: var(--muted); font-size: 11px; }
.chip.add { color: var(--muted); }
.chip.disabled { opacity: .5; }

/* 필터 팝오버 */
.popover { position: absolute; z-index: 60; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; box-shadow: var(--shadow); min-width: 240px; }
.popover .row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.popover .row input { width: 100%; }
.popover .title { font-size: 12.5px; font-weight: 700; }
.popover .actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }

/* 컬럼 탭 + 툴바 */
.table-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 8px; }
.col-tab { background: none; border: none; padding: 6px 10px; font-size: 13px; font-weight: 700; color: var(--muted); border-radius: 8px; }
.col-tab.on { color: var(--text); background: var(--panel2); }
.table-toolbar .right { margin-left: auto; display: flex; gap: 6px; }
.table-meta { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.table-meta .search { width: 220px; padding: 6px 10px; }

/* 결과표 */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.sc-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 900px; }
.sc-table th { text-align: right; color: var(--muted); font-size: 11.5px; font-weight: 600; border-bottom: 1px solid var(--line); padding: 9px 10px; white-space: nowrap; cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--panel); }
.sc-table th:first-child, .sc-table td:first-child { text-align: left; }
.sc-table th.sorted { color: var(--text); }
.sc-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); text-align: right; white-space: nowrap; }
.sc-table tr:hover td { background: var(--row-hover); }
.sc-table td[data-c] { transition: background-color .7s ease-out; }
.sc-table td.tick-up { background: rgba(38, 166, 154, .22); transition: none; }
.sc-table td.tick-down { background: rgba(239, 83, 80, .22); transition: none; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #26a69a; margin-right: 5px; vertical-align: middle; }
.live-dot.off { background: var(--muted); }
.sc-table td.sym { font-weight: 700; }
.sc-table td.sym a { color: var(--text); }
.sc-table td.sym .name { color: var(--muted); font-weight: 500; font-size: 11.5px; margin-left: 6px; }
.sc-table td .star { background: none; border: none; color: var(--muted); font-size: 14px; margin-right: 6px; }
.sc-table td .star.on { color: var(--amber); }
.badge { display: inline-block; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 6px; border: 1px solid rgba(43,184,160,.45); color: var(--accent-2); background: var(--chip-on); margin-left: 4px; }
.badge.new { border-color: rgba(43,184,160,.8); }
.tv-link { color: var(--accent-2); font-weight: 700; font-size: 12px; }
.empty { color: var(--muted); font-size: 13px; padding: 28px 0; text-align: center; }
.rsi-bar { display: inline-block; width: 40px; height: 4px; background: var(--line); border-radius: 2px; margin-left: 6px; vertical-align: middle; position: relative; }
.rsi-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 2px; }

/* Symbol 상세 */
.symbol-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.symbol-head h1 { font-size: 24px; font-weight: 800; }
.symbol-head .price { font-size: 22px; font-weight: 800; }
.symbol-layout { display: grid; grid-template-columns: 1fr 320px; gap: 14px; align-items: start; }
#chart { height: 380px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; font-size: 13px; }
.stat-grid .k { color: var(--muted); }
.stat-grid .v { text-align: right; font-weight: 700; }

/* Scanner(감시 목록) */
.watch-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.watch-item .name { font-weight: 700; }
.watch-item .meta { color: var(--muted); font-size: 12px; }
.switch { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--line); border: none; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: var(--accent); } .switch.on::after { left: 18px; }
.locked-overlay { position: relative; }
.locked-overlay .blur { filter: blur(3px); pointer-events: none; user-select: none; }
.locked-overlay .gate { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: color-mix(in srgb, var(--bg) 60%, transparent); border-radius: 10px; text-align: center; padding: 20px; }

/* 코인 아이콘 · 스파크라인 · 뷰 전환 */
.coin { width: 20px; height: 20px; border-radius: 50%; vertical-align: middle; margin-right: 8px; background: var(--panel2); flex-shrink: 0; }
.coin.letter { display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: var(--muted); border: 1px solid var(--line); }
.sc-table td.sym a { display: inline-flex; align-items: center; vertical-align: middle; }
.sc-table td.sym .name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.sc-table th.nosort { cursor: default; }
.sc-table td.spark-cell { padding: 4px 10px; }
.spark { display: block; margin-left: auto; }
.seg.sm button { padding: 4px 10px; font-size: 12px; }
.icon-btn.mini { height: 22px; padding: 0 6px; font-size: 12px; margin-left: 4px; }
.heat-legend { display: inline-flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--muted); margin-left: 10px; }
.sel-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.heat-cell .coin { width: 1.7em; height: 1.7em; margin: 0 0 .25em; }
.dd-table { min-width: 0; font-size: 12.5px; }
.dd-table th { position: static; }
.dd-table tr.sel td { background: var(--chip-on); }
.heat-legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }
.col-picker label { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12.5px; cursor: pointer; }
.col-picker input { accent-color: var(--accent); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.coin-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: block; min-width: 0; }
.coin-card:hover { border-color: var(--muted); }
.coin-card .top { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; }
.coin-card .top .name { color: var(--muted); font-weight: 500; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.coin-card .top .pct { margin-left: auto; font-size: 12.5px; }
.coin-card .price { font-size: 17px; font-weight: 800; margin: 6px 0 2px; transition: background-color .7s ease-out; border-radius: 4px; }
.coin-card .price.tick-up { background: rgba(38,166,154,.22); transition: none; }
.coin-card .price.tick-down { background: rgba(239,83,80,.22); transition: none; }
.coin-card .spark-big svg { width: 100%; height: 56px; }
.coin-card .foot { color: var(--muted); font-size: 11.5px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heat { position: relative; height: 640px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.heat-cell { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--bg); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.55); line-height: 1.15; box-sizing: border-box; }
.heat-cell b { font-weight: 800; } .heat-cell span { font-weight: 600; font-size: .8em; opacity: .92; }
.heat-cell:hover { outline: 2px solid var(--text); z-index: 2; }
[data-theme="light"] .heat-cell { color: #16202c; text-shadow: none; }
.sym-chip { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--chip); border: 1px solid var(--line); margin: 4px 4px 0 0; }
.sym-chip.new { border-color: var(--accent); color: var(--accent-2); }
.watch-item.off { opacity: .55; }
.hist-row { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.hist-row .meta { color: var(--muted); font-size: 12px; }

/* 모달 */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-bg.show { display: flex; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: 100%; max-width: 560px; padding: 22px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow); }
.modal h2 { font-size: 16px; font-weight: 800; }
.field { display: grid; grid-template-columns: 170px 1fr auto; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.field label { color: var(--muted); font-size: 12.5px; }
.field input[type=range] { width: 100%; accent-color: var(--accent); }
.field .val { font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; font-weight: 700; }
.field input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* 기타 페이지 */
.narrow { max-width: 440px; margin: 40px auto 0; }
.code-input { letter-spacing: .4em; text-align: center; font-size: 22px; font-weight: 800; }
.status-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.status-row .k { color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.price-big { font-size: 30px; font-weight: 800; }
.price-big .unit { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.compare { width: 100%; border-collapse: collapse; font-size: 13px; }
.compare th, .compare td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.compare th { color: var(--muted); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line-soft); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 13.5px; }
.faq p { color: var(--muted); font-size: 13px; margin-top: 6px; }
.legal h2 { font-size: 16px; margin: 18px 0 6px; } .legal p { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { background: none; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 6px 14px; }
.tab.active { border-color: var(--accent); color: var(--accent-2); }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; font-size: 12.5px; box-shadow: var(--shadow); z-index: 300; }

/* 개발용 상태 스위치 (프로토타입 전용) */
.dev-switch { position: fixed; bottom: 14px; right: 14px; z-index: 200; background: var(--panel); border: 1px dashed var(--amber); border-radius: 8px; padding: 6px 10px; font-size: 11.5px; color: var(--amber); display: flex; gap: 6px; align-items: center; }
.dev-switch select { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-family: inherit; font-size: 11.5px; }

.site-footer { border-top: 1px solid var(--line); padding: 20px 0 36px; }
.site-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.site-footer nav { display: flex; gap: 14px; }
.site-footer nav a:hover { color: var(--text); }

@media (max-width: 900px) {
  .symbol-layout, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .field { grid-template-columns: 1fr; gap: 6px; } .field .val { text-align: left; }
  .main-nav a { padding: 6px 7px; font-size: 12.5px; }
  .chip-row .label { width: auto; }
  #chart { height: 280px; }
}
