/* 코인덕 모바일 셸 /m/ — 정본: docs/superpowers/specs/2026-08-10-mobile-shell-design.md
   토큰 = 메인 사이트 정본과 동일 값 (다크 앰버 :root / 라이트 딥블루 [data-theme="light"]).
   등락 색 = 한국 거래소 표준, 방향 불변 (SITE_IDENTITY §15). */

:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel-hover: #1f242c;
  --border: #3a4250;
  --text: #f0f6fc;
  --text-dim: #c4ccd6;
  --text-muted: #a8b2bd;
  --accent: #f59e0b;
  --accent-rgb: 245,158,11;
  --accent-soft: #f59e0b2e;
  --accent-ink: #1a1205;
  --link: #79b8ff;
  --price-up: #ff7b72;
  --price-down: #79b8ff;
  --card-radius: 10px;
  --shadow-card: none;
}
[data-theme="light"] {
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-hover: #f1f4f8;
  --border: #e3e7ed;
  --text: #18212f;
  --text-dim: #4a5567;
  --text-muted: #687180;
  --accent: #0062df;
  --accent-rgb: 0,98,223;
  --accent-soft: rgba(0,98,223,.10);
  --accent-ink: #ffffff;
  --link: #0062df;
  --price-up: #dd3c44;
  --price-down: #1375ec;
  --shadow-card: 0 1px 2px rgba(16,24,40,.05), 0 2px 6px rgba(16,24,40,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: calc(68px + env(safe-area-inset-bottom));
}
a { color: inherit; text-decoration: none; }

/* ── 헤더 — 640px 앱 컬럼 중앙 정렬 (골프덕 패턴, 2026-08-11) ── */
.mh {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; padding: 0 14px;
  max-width: 640px; margin: 0 auto;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.mh-logo { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; color: var(--accent); letter-spacing: -.5px; }
.mh-logo img { width: 30px; height: 30px; border-radius: 50%; }
.mh-actions { display: flex; gap: 8px; }
.mh-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); color: var(--text-dim);
  font-size: 13px; font-weight: 600; cursor: pointer;
}
#push-toggle.on { border-color: rgba(var(--accent-rgb), .6); background: var(--accent-soft); }
#push-toggle:disabled { opacity: .5; }
.mh-login { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* ── 탭바 — 골프덕 스타일 (2026-08-11): 640px 중앙, SVG 아이콘, active dot, 소프트 섀도 ── */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 20;
  width: 100%; max-width: 640px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--panel);
  box-shadow: 0 -1px 0 rgba(0,0,0,.3), 0 -8px 24px rgba(0,0,0,.25);
  padding-bottom: env(safe-area-inset-bottom);
}
[data-theme="light"] .tabbar { box-shadow: 0 -1px 0 rgba(16,24,40,.06), 0 -8px 24px rgba(16,24,40,.08); }
.tab {
  position: relative;
  height: 60px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-decoration: none;
}
.tab-ic { width: 22px; height: 22px; display: block; }
.tab-lb { line-height: 1; }
.tab-dot {
  position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent); opacity: 0;
}
.tab.active { color: var(--accent); font-weight: 700; }
.tab.active .tab-dot { opacity: 1; }

/* ── 공통 레이아웃 ── */
.view { max-width: 640px; margin: 0 auto; padding: 14px 14px 24px; }
.sec { margin-bottom: 22px; }
.sec-h {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px;
}
.sec-h h2 { font-size: 16px; font-weight: 800; }
.sec-h .more { font-size: 12px; color: var(--text-muted); }
.empty { text-align: center; color: var(--text-muted); padding: 40px 0; }
.empty button {
  margin-top: 10px; padding: 8px 18px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); color: var(--text); font-size: 14px; cursor: pointer;
}

/* ── 세그먼트 (홈 신규상장 업비트|빗썸) ── */
.seg {
  display: inline-flex; border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; margin-bottom: 10px;
}
.seg button {
  padding: 6px 16px; font-size: 13px; font-weight: 700;
  background: var(--panel); color: var(--text-muted); border: 0; cursor: pointer;
}
.seg button.on { background: var(--accent); color: var(--accent-ink); }

/* ── 카드·행 공통 ── */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--card-radius); box-shadow: var(--shadow-card);
}

/* 신규상장 카드 */
.nl-card { display: block; padding: 12px 14px; margin-bottom: 8px; }
.nl-top { display: flex; align-items: center; gap: 8px; }
.nl-name { font-weight: 800; font-size: 15px; }
.nl-sym { color: var(--text-muted); font-size: 12px; }
.nl-day {
  margin-left: auto; font-size: 11px; font-weight: 700;
  color: var(--accent); background: var(--accent-soft);
  padding: 2px 7px; border-radius: 10px;
}
.nl-sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.nl-price { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }

/* 뱃지 */
.bdg {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 4px;
  border: 1px solid var(--border); color: var(--text-dim);
  white-space: nowrap; flex: 0 0 auto;   /* 좁은 행에서 "백/서/✓" 로 쪼개지지 않게 (2026-08-19) */
}
.bdg.wp { color: var(--accent); border-color: rgba(var(--accent-rgb), .45); }

/* 시세 */
.px { font-weight: 700; font-variant-numeric: tabular-nums; }
.px-chg { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.up { color: var(--price-up); }
.down { color: var(--price-down); }
.flat { color: var(--text-muted); }

/* ── 코인 목록 ── */
.searchwrap { position: sticky; top: 52px; z-index: 15; background: var(--bg); padding: 4px 0 8px; }
.search {
  width: 100%; height: 42px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); color: var(--text); font-size: 15px;
}
.search:focus { outline: 2px solid rgba(var(--accent-rgb), .5); border-color: transparent; }
.chips { display: flex; gap: 6px; margin-top: 8px; }
.chip {
  padding: 5px 12px; font-size: 12px; font-weight: 700;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--panel); color: var(--text-muted); cursor: pointer;
}
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.sortsel {
  margin-left: auto; font-size: 12px; font-weight: 700;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--panel); color: var(--text-muted); padding: 5px 8px;
}
.count { font-size: 12px; color: var(--text-muted); margin: 6px 2px; }

.row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-bottom: 1px solid var(--border);
}
.row:active { background: var(--panel-hover); }
.row-main { min-width: 0; flex: 1; }
.row-t { display: flex; align-items: baseline; gap: 6px; }
.row-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sym { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.row-b { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 11px; color: var(--text-muted); min-width: 0; }
.row-b .row-sec { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row-sec { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.row-px { text-align: right; flex-shrink: 0; min-width: 88px; }
.rows { border: 1px solid var(--border); border-radius: var(--card-radius); overflow: hidden; background: var(--panel); }
.rows .row:last-child { border-bottom: 0; }

/* ── 시장 탭 ── */
.mk-item { display: block; padding: 13px 14px; border-bottom: 1px solid var(--border); }
.mk-item:last-child { border-bottom: 0; }
.mk-date { font-size: 11px; color: var(--text-muted); }
.mk-title { font-weight: 700; font-size: 14px; margin: 2px 0; }
.mk-ex { font-size: 12px; color: var(--text-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 큐레이션 4종 그리드 */
.cur-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cur-card { padding: 10px 12px; }
.cur-name { font-weight: 800; font-size: 13px; }
.cur-sym { font-size: 11px; color: var(--text-muted); }
.cur-px { margin-top: 4px; font-size: 13px; }

/* 뉴스레터 홈 카드 */
.nlt-card { display: block; padding: 13px 14px; }
.nlt-label { font-size: 11px; font-weight: 700; color: var(--accent); }
.skel { color: var(--text-muted); }

/* 사이클 분석 통계 (시장 탭) — 연도 코호트 스택 바 대시보드 */
.cyc-hero { padding: 18px 16px; margin-bottom: 12px; }
.cyc-big { font-size: 15px; font-weight: 700; }
.cyc-big b { font-size: 34px; font-weight: 900; color: var(--accent); letter-spacing: -1px; margin-right: 4px; }
.cyc-lede { font-size: 13.5px; color: var(--text-dim); margin-top: 8px; line-height: 1.65; }
.cyc-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.6; }
.cyc-seg button { padding: 6px 10px; font-size: 12px; }
.cyc-card { padding: 14px; }
.cyc-title { font-size: 13px; font-weight: 800; margin-bottom: 8px; }
.cyc-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 10.5px; color: var(--text-muted); margin-bottom: 12px; }
.cyc-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.lg-ok { background: var(--accent); }
.lg-fail { background: var(--price-down); }
.lg-na { background: var(--border); }
.cyc-row {
  display: grid; grid-template-columns: 34px 1fr 40px minmax(96px, auto);
  align-items: center; gap: 8px; padding: 4px 0; font-size: 11.5px;
}
.cyc-y { font-weight: 700; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.cyc-bar { display: flex; height: 14px; border-radius: 3px; overflow: hidden; background: transparent; }
.cyc-bar span { display: block; height: 100%; }
.cyc-ok { background: var(--accent); }
.cyc-fail { background: var(--price-down); }
.cyc-na { background: var(--border); opacity: .55; }
.cyc-n { color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.cyc-r { color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cyc-r b { color: var(--text); }
.cyc-none { color: var(--text-muted); }
/* 세대 분류 3카드 */
.cyc-gen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.gen-card { padding: 12px 10px; text-align: center; }
.gen-e { font-size: 22px; line-height: 1; }
.gen-t { font-size: 12.5px; font-weight: 800; margin-top: 6px; }
.gen-sub { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.gen-n { font-size: 21px; font-weight: 900; color: var(--accent); margin-top: 6px; letter-spacing: -.5px; }
.gen-n i { font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--text-muted); margin-left: 2px; letter-spacing: 0; }

/* 생존자/실패 리스트 */
.cyc-list { padding: 14px; margin-top: 12px; }
.cyc-cols {
  display: grid; grid-template-columns: minmax(90px, 1fr) auto minmax(64px, auto);
  gap: 10px; padding: 4px 0 6px; border-bottom: 1px solid var(--border);
  font-size: 10px; color: var(--text-muted);
}
.cyc-cols span:nth-child(2) { text-align: right; }
.cyc-cols span:nth-child(3) { text-align: right; }
.cyc-item {
  display: grid; grid-template-columns: minmax(90px, 1fr) auto minmax(64px, auto);
  gap: 10px; align-items: center; padding: 8px 0;
  border-bottom: 1px solid var(--border); font-size: 12.5px;
}
.cyc-item:last-of-type { border-bottom: 0; }
.ci-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-name i { font-style: normal; font-size: 10px; color: var(--text-muted); margin-left: 4px; }
.ci-prices { color: var(--text-dim); font-size: 11.5px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ci-rate { text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.cyc-more {
  display: block; width: 100%; margin-top: 10px; padding: 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: transparent; color: var(--text-dim);
  font-size: 12px; font-weight: 700; cursor: pointer;
}

.cyc-cls-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.cyc-cls {
  font-size: 11px; color: var(--text-dim); padding: 5px 10px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--panel);
}
.cyc-cls b { color: var(--accent); }
.cyc-note { font-size: 11px; color: var(--text-muted); margin: 10px 2px 0; line-height: 1.6; }

/* 상장 공지 시각 차트 (홈 하단) */
.lt-card { padding: 14px; }
.lt-seg { margin-bottom: 14px; }
.lt-bars { display: flex; align-items: flex-end; gap: 2px; height: 110px; }
.lt-col {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; gap: 2px; height: 100%; min-width: 0;
}
.lt-cnt { font-size: 8.5px; color: var(--text-muted); line-height: 1; }
.lt-bar { width: 100%; border-radius: 2px 2px 0 0; background: var(--accent-soft); }
.lt-bar.pk { background: var(--accent); }
.lt-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 10px; color: var(--text-muted); }
.lt-note { font-size: 12px; color: var(--text-dim); margin-top: 10px; line-height: 1.6; }
.lt-note b { color: var(--accent); }
.lt-caveat { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* 후원 배너 (홈 하단 → /support/) */
.sb { display: flex; align-items: center; gap: 12px; padding: 14px; }
.sb-txt { flex: 1; min-width: 0; }
.sb-title { font-size: 14px; font-weight: 800; color: var(--accent); }
.sb-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.sb-go { flex: 0 0 auto; padding: 9px 14px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 800; }

/* 상장폐지 코너 (2026-08-19) — 원화 마켓에서 사라진 종목 */
.chip.chip-dl.on { background: var(--bad, #dd3c44); border-color: transparent; color: #fff; }
.row.row-gone .row-name { color: var(--text-muted); }
.bdg.dl {
  background: rgba(221,60,68,.14); color: #dd3c44;
  border: 1px solid rgba(221,60,68,.35);
}
.row-dl { text-align: right; min-width: 96px; }
.row-dl b { display: block; font-size: 13px; font-weight: 700; color: var(--text-dim); }
.row-dl i { display: block; margin-top: 2px; font-size: 10.5px; font-style: normal; color: var(--text-muted); line-height: 1.35; }
.dl-hint {
  margin: 2px 0 12px; padding: 11px 13px; border-radius: 9px;
  background: var(--panel, rgba(127,127,127,.07));
  border: 1px solid var(--border);
  font-size: 12px; line-height: 1.65; color: var(--text-muted);
}
