﻿
/* ══════════════════════════════════════════════════════
   §1  디자인 토큰 (CSS Variables — 색상·크기·그림자)
══════════════════════════════════════════════════════ */
/* ══════════════════════════════════════
   DESIGN TOKENS — TetherP2P
══════════════════════════════════════ */
:root {
  --green:       #1a6b3c;
  --green-pale:  rgba(26,107,60,.08);
  --green-ring:  rgba(26,107,60,.20);
  --green-t:     #1a6b3c;
  --amber:       #b47800;
  --amber-pale:  rgba(180,120,0,.07);
  --amber-ring:  rgba(180,120,0,.20);
  --red:         #c0392b;
  --red-pale:    rgba(192,57,43,.06);
  --red-ring:    rgba(192,57,43,.18);
  --blue:        #1a4a8a;
  --blue-pale:   rgba(26,74,138,.06);

  --sw:   220px;   /* sidebar width */
  --th:    52px;   /* topbar height */
  --bnh:   60px;   /* bottom nav height */
  --r8:     8px;
  --r12:   12px;
  --r16:   16px;
  --r20:   20px;
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --bg:         #f5f5f7;
  --bg2:        #fff;
  --surface:    #fff;
  --surface2:   #f5f5f7;
  --surface3:   #eeeef0;
  --text:       #1d1d1f;
  --text2:      #3a3a3c;
  --muted:      #86868b;
  --faint:      #aeaeb2;
  --border:     rgba(0,0,0,.06);
  --border2:    rgba(0,0,0,.10);
  --topbar-bg:  rgba(255,255,255,.85);
  --input-bg:   #f5f5f7;
  --row-hover:  rgba(0,0,0,.025);
  --scroll:     rgba(0,0,0,.12);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 20px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg:  0 12px 48px rgba(0,0,0,.11), 0 2px 8px rgba(0,0,0,.05);
  --shadow-xl:  0 24px 80px rgba(0,0,0,.14), 0 4px 16px rgba(0,0,0,.06);
}

/* ── DARK THEME ── */
[data-theme="dark"] {
  --bg:         #000;
  --bg2:        #0a0a0a;
  --surface:    #111;
  --surface2:   #1a1a1a;
  --surface3:   #222;
  --text:       #f5f5f7;
  --text2:      #d1d1d6;
  --muted:      #8e8e93;
  --faint:      #636366;
  --border:     rgba(255,255,255,.07);
  --border2:    rgba(255,255,255,.12);
  --topbar-bg:  rgba(0,0,0,.85);
  --input-bg:   #1a1a1a;
  --row-hover:  rgba(255,255,255,.03);
  --scroll:     rgba(255,255,255,.12);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.5);
  --shadow-md:  0 4px 24px rgba(0,0,0,.55);
  --shadow-lg:  0 12px 56px rgba(0,0,0,.65);
  --shadow-xl:  0 24px 88px rgba(0,0,0,.75);
}
/* ══════════════════════════════════════════════════════
   §2  기본 리셋 & 타이포그래피
══════════════════════════════════════════════════════ */
/* ══════════════════════════════════════
   BASE & TYPOGRAPHY — TetherP2P
══════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Figtree', 'Apple SD Gothic Neo', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .3s, color .3s;
  overflow-x: hidden;
}

::-webkit-scrollbar          { width: 4px; height: 4px; }
::-webkit-scrollbar-track    { background: transparent; }
::-webkit-scrollbar-thumb    { background: var(--scroll); border-radius: 4px; }

button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* Animated view entrance */
.view { animation: slideUp .28s cubic-bezier(.4,0,.2,1) both; }
@keyframes slideUp  { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
@keyframes fadeIn   { from { opacity:0; } to { opacity:1; } }
@keyframes spin          { to { transform: rotate(360deg); } }
@keyframes progressAnim  { 0%{transform:translateX(-100%)} 100%{transform:translateX(200%)} }
/* ══════════════════════════════════════════════════════
   §3  레이아웃 (탑바·사이드바·메인·바텀네비)
══════════════════════════════════════════════════════ */
/* ══════════════════════════════════════
   LAYOUT — TetherP2P
   Topbar / Sidebar / Main / Bottom Nav
══════════════════════════════════════ */

/* ─── TOPBAR ─── */
#topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--th);
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.03em;
  flex-shrink: 0;
  color: var(--text);
  cursor: pointer;
}
.logo-mark {
  display: none; /* replaced by inline SVG */
}

/* Topbar nav button */
.nb {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: var(--r8);
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
}
.nb:hover { background: var(--surface2); color: var(--text); }

/* Theme pill */
.theme-pill { display: flex; background: var(--surface2); border-radius: 100px; padding: 3px; gap: 2px; }
.tp-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 100px; border: none;
  cursor: pointer; font-size: 12px; font-weight: 700;
  transition: all .2s; background: transparent; color: var(--muted);
}
.tp-btn.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Login button */
.btn-login-top {
  padding: 7px 14px;
  border-radius: var(--r8);
  border: none;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,122,255,.3);
}
.btn-login-top:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ─── SIDEBAR ─── */
#sidebar {
  position: fixed;
  left: 0;
  top: var(--th);
  bottom: 0;
  width: var(--sw);
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform .28s cubic-bezier(.4,0,.2,1), background .3s;
}
.sb-user { padding: 16px 14px 12px; border-bottom: 1px solid var(--border); }
.sb-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(145deg, #1a6b3c, #0f4d2a);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 800; margin-bottom: 8px;
  box-shadow: 0 2px 6px rgba(26,107,60,.3), inset 0 1px 0 rgba(255,255,255,.12);
}
.sb-name { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.sb-bal { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.sb-nav { padding: 8px; flex: 1; }
.sb-lbl {
  font-size: 10px; font-weight: 700; color: var(--faint);
  letter-spacing: .08em; text-transform: uppercase; padding: 10px 8px 4px;
}
.sbi {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: var(--r8); border: none;
  background: transparent; color: var(--muted); font-size: 13px; font-weight: 500;
  cursor: pointer; width: 100%; text-align: left; transition: all .18s;
  letter-spacing: -.01em;
}
.sbi:hover { background: var(--surface2); color: var(--text); }
.sbi.on { background: linear-gradient(135deg, rgba(26,107,60,.08), rgba(26,107,60,.03)); color: var(--green-t); font-weight: 700; border-left: 2.5px solid var(--green-t); }
.sbi svg { flex-shrink: 0; opacity: .55; transition: opacity .18s; }
.sbi.on svg { opacity: 1; color: var(--green-t); }
.sbd { border: none; border-top: 1px solid var(--border); margin: 5px 8px; }

/* Sidebar overlay */
#sbo { position: fixed; inset: 0; top: var(--th); background: rgba(0,0,0,.35); backdrop-filter: blur(4px); z-index: 99; display: none; }
#sbo.show { display: block; animation: fadeIn .2s; }

/* ─── MAIN WRAPPER ─── */
#mw {
  margin-left: var(--sw);
  min-height: calc(100vh - var(--th));
  transition: margin .28s;
}
#ct {
  padding: 24px 28px;
}
#ct.n {
  max-width: 680px;
  margin: 0 auto;
}

/* ─── BOTTOM NAV (mobile only) — Premium Fintech ─── */
#bnav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--topbar-bg);
  backdrop-filter: saturate(200%) blur(24px);
  -webkit-backdrop-filter: saturate(200%) blur(24px);
  border-top: 1px solid var(--border);
  padding: 2px 0 max(6px, env(safe-area-inset-bottom));
}
.bn-tabs { display: flex; }
.bnt {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0 2px;
  border: none; background: transparent;
  color: var(--faint); font-size: 10px; font-weight: 600;
  cursor: pointer; transition: all .22s cubic-bezier(.4,0,.2,1);
  position: relative;
  letter-spacing: -.01em;
}
.bnt svg {
  width: 22px; height: 22px;
  opacity: .5;
  transition: all .22s cubic-bezier(.4,0,.2,1);
  filter: drop-shadow(0 0 0 transparent);
}
.bnt.on {
  color: #1a6b3c;
}
.bnt.on svg {
  opacity: 1;
  color: #1a6b3c;
  filter: drop-shadow(0 1px 3px rgba(26,107,60,.25));
}
.bnt::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 0; height: 2.5px; border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, #1a6b3c, #2d9d5c);
  transition: width .22s cubic-bezier(.4,0,.2,1);
}
.bnt.on::before { width: 20px; }
.bnt:active svg { transform: scale(.88); }
[data-theme="dark"] .bnt.on { color: #4adf8a; }
[data-theme="dark"] .bnt.on svg { color: #4adf8a; filter: drop-shadow(0 1px 4px rgba(74,223,138,.3)); }

/* ══════════════════════════════════════
   RESPONSIVE BREAKPOINTS
══════════════════════════════════════ */
/* ─── MOBILE (≤ 768px) ─── */
@media (max-width: 768px) {
  #sidebar           { transform: translateX(-100%); }
  #sidebar.show      { transform: translateX(0); }
  #mw                { margin-left: 0; padding-bottom: var(--bnh); }
  #bnav              { display: block; }
  #ct                { padding: 10px 10px; }
  .pc-only           { display: none !important; }
  /* ★ 모바일 가독성 개선 */
  h1 { font-size: 20px !important; }
  .view { padding: 0 !important; }
  .card { padding: 12px !important; border-radius: 12px !important; }
  .sg { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .sc { padding: 10px !important; border-radius: 10px !important; }
  .sc .sv { font-size: 15px !important; }
  .sc .sl { font-size: 10px !important; }
  /* 마켓 테이블 */
  .mkt-wrap table th, .mkt-wrap table td { padding: 8px 6px !important; font-size: 12px !important; }
  /* 구매/판매 팁 */
  .tgrid { grid-template-columns: 1fr !important; }
  /* 매물 카드 */
  .mkt-cards > div { padding: 12px !important; }
  /* 입력폼 */
  input, select { font-size: 16px !important; } /* iOS 줌 방지 */
  /* 버튼 */
  button { font-size: 13px !important; }
}

/* ─── DESKTOP (> 768px) ─── */
@media (min-width: 769px) {
  .mob-only { display: none !important; }
  #bnav     { display: none !important; }
}
/* ══════════════════════════════════════════════════════
   §4  컴포넌트 (버튼·카드·인풋·뱃지·모달·토스트)
══════════════════════════════════════════════════════ */
/* ══════════════════════════════════════
   COMPONENTS — TetherP2P
   Buttons / Cards / Inputs / Badges /
   Modal / Toast / Toggle / Tips / Stats
══════════════════════════════════════ */

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; font-weight: 700; font-size: 14px;
  transition: all .18s; border: none; white-space: nowrap; font-family: inherit;
}
.bp { background: var(--blue);    color: #fff; box-shadow: 0 2px 8px rgba(26,74,138,.28);  border-radius: var(--r12); }
.bg { background: linear-gradient(135deg, #1a6b3c, #0f4d2a); color: #fff; box-shadow: 0 2px 8px rgba(26,107,60,.30);  border-radius: var(--r12); }
.bw { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm);         border-radius: var(--r12); }
.bk { background: var(--text);    color: var(--bg);                                         border-radius: var(--r12); }
.bgh {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border2) !important;
  border-radius: var(--r8) !important;
}
.bp:hover,
.bg:hover  { filter: brightness(1.08); transform: translateY(-1px); }
.bw:hover  { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.bk:hover  { opacity: .88; transform: translateY(-1px); }
.bgh:hover { background: var(--surface2); color: var(--text); }

/* Button sizes */
.bsm { padding: 7px 14px;  border-radius: var(--r8)  !important; font-size: 12px; }
.bmd { padding: 10px 18px; border-radius: var(--r12) !important; font-size: 14px; }
.blg { padding: 13px 20px; border-radius: var(--r12) !important; font-size: 15px; width: 100%; }

/* ─── CARDS ─── */
.card {
  background: var(--surface);
  border-radius: var(--r20);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: box-shadow .22s, transform .22s, background .3s;
}
.cf {
  background: var(--surface);
  border-radius: var(--r16);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background .3s;
}
.cp   { padding: 20px 22px; }
.ch:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

/* ─── INPUTS ─── */
input {
  background: var(--input-bg);
  border: 1.5px solid transparent;
  color: var(--text);
  border-radius: var(--r12);
  font-size: 15px;
  padding: 11px 14px;
  width: 100%;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .3s;
  font-family: inherit;
}
input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,122,255,.12);
  background: var(--surface);
}
input::placeholder { color: var(--faint); }

/* Select wrapper */
.sw2 { position: relative; display: inline-flex; }
.sw2::after {
  content: ''; pointer-events: none;
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
}
select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--r8);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 32px 8px 12px;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: all .18s;
  font-family: inherit;
}
select:focus { border-color: var(--blue); }

/* ─── BADGES — Premium Fintech ─── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 100px;
  font-size: 11px; font-weight: 700;
  letter-spacing: -.01em;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.06);
}
.bok  { background: linear-gradient(135deg, rgba(26,107,60,.12), rgba(45,157,92,.08)); color: #1a6b3c; border: 1px solid rgba(26,107,60,.15); }
.btrd { background: linear-gradient(135deg, rgba(180,120,0,.1), rgba(255,159,10,.06)); color: #b47800; border: 1px solid rgba(180,120,0,.15); }
.boff { background: linear-gradient(135deg, rgba(180,30,20,.08), rgba(255,59,48,.05)); color: #b41e14; border: 1px solid rgba(180,30,20,.12); }
.dot  { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 2px rgba(255,255,255,.6), inset 0 1px 2px rgba(0,0,0,.15); }
.dok  { background: linear-gradient(135deg, #1a6b3c, #2d9d5c); }
.dtrd { background: linear-gradient(135deg, #b47800, #ff9f0a); }
.doff { background: linear-gradient(135deg, #b41e14, #ff3b30); }
[data-theme="dark"] .bok { background: linear-gradient(135deg, rgba(74,223,138,.12), rgba(45,157,92,.08)); color: #4adf8a; border-color: rgba(74,223,138,.2); }
[data-theme="dark"] .btrd { background: linear-gradient(135deg, rgba(255,200,60,.1), rgba(255,159,10,.06)); color: #ffc83c; border-color: rgba(255,200,60,.18); }
[data-theme="dark"] .boff { background: linear-gradient(135deg, rgba(255,90,80,.1), rgba(255,59,48,.06)); color: #ff6b60; border-color: rgba(255,90,80,.15); }
.ftag {
  background: linear-gradient(135deg, rgba(26,107,60,.1), rgba(45,157,92,.06)); color: #1a6b3c;
  border-radius: 100px; padding: 2px 8px;
  font-size: 10px; font-weight: 700;
  border: 1px solid rgba(26,107,60,.12);
}

/* ─── TABLE ROWS (detail views) ─── */
.tr {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.tr:last-child { border-bottom: none; }

/* ─── STAT CARDS GRID ─── */
.sg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.sc {
  background: var(--surface); border-radius: var(--r16);
  border: 1px solid var(--border); padding: 16px 18px;
  box-shadow: var(--shadow-sm); transition: background .3s;
}
.sl { font-size: 11px; font-weight: 600; color: var(--faint); letter-spacing: .05em; text-transform: uppercase; margin-bottom: 5px; }
.sv { font-size: 19px; font-weight: 800; letter-spacing: -.03em; }
.ss { font-size: 11px; font-weight: 600; margin-top: 3px; color: var(--muted); }

/* ─── UPBIT PILL ─── */
.upbit-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--r12);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.upbit-val { font-size: 17px; font-weight: 900; color: var(--text); letter-spacing: -.025em; }

/* ─── TIPS PANEL ─── */
.tip { border-radius: var(--r16); padding: 16px 18px; transition: background .3s, border .3s; }
.tbuy { background: var(--blue-pale);  border: 1px solid rgba(0,122,255,.12); }
.tsell { background: var(--amber-pale); border: 1px solid rgba(255,159,10,.15); }
.ttl { font-size: 13px; font-weight: 800; margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.tbuy .ttl  { color: var(--blue); }
.tsell .ttl { color: var(--amber); }
.trow { display: flex; gap: 8px; font-size: 12px; color: var(--muted); line-height: 1.7; padding: 3px 0; }
.thl  { color: var(--red);    font-weight: 700; }
.tham { color: #b86e00;       font-weight: 700; }
.tgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ─── TOGGLE SWITCH ─── */
.tog {
  width: 42px; height: 24px; border-radius: 100px;
  cursor: pointer; position: relative; flex-shrink: 0;
  transition: background .2s; border: none;
}
.togd {
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; position: absolute; top: 3px;
  transition: left .2s cubic-bezier(.4,0,.2,1);
  pointer-events: none; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

/* ─── MODAL / OVERLAY ─── */
.ov {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.4); backdrop-filter: blur(8px);
  display: none; align-items: flex-start; justify-content: center;
  padding: 16px; overflow-y: auto;
}
.ov.show { display: flex; animation: fadeIn .18s; }
.modal {
  position: relative; background: var(--surface);
  border-radius: var(--r20); border: 1px solid var(--border);
  box-shadow: var(--shadow-xl); padding: 26px;
  width: 100%; max-width: 460px;
  margin: auto 0;
  animation: slideUp .22s cubic-bezier(.4,0,.2,1);
}
@media (min-width: 600px) {
  .ov { align-items: center; overflow-y: hidden; }
  .modal { max-height: 92vh; overflow-y: auto; margin: 0; }
}

/* ─── TOAST ─── */
#toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 10px 22px; border-radius: 100px;
  font-size: 13px; font-weight: 700; z-index: 999;
  opacity: 0; transition: opacity .25s;
  pointer-events: none; white-space: nowrap;
  box-shadow: var(--shadow-lg);
}
#toast.show { opacity: 1; }

/* ─── PRESET BUTTONS (buy/sell amounts) ─── */
.preset-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.preset-btn {
  padding: 9px 4px;
  border-radius: var(--r8);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
  font-family: inherit;
}
.preset-btn:hover  { background: var(--surface3); color: var(--text); }
.preset-btn:active { transform: scale(.95); }

/* ─── METHOD BUTTONS ─── */
.mth-btn {
  padding: 9px 16px; border-radius: var(--r8);
  border: 1.5px solid var(--border);
  background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.mth-btn.on {
  border-color: var(--blue);
  background: var(--blue-pale);
  color: var(--blue);
}

/* ─── RESPONSIVE COMPONENTS ─── */
@media (max-width: 768px) {
  .sg          { grid-template-columns: 1fr 1fr; }
  .tgrid       { grid-template-columns: 1fr !important; }
  .preset-row  { grid-template-columns: repeat(3, 1fr); }
  .cp          { padding: 16px; }
  .modal       { padding: 20px; }
}
/* ══════════════════════════════════════════════════════
   §5  마켓 테이블 (PC 그리드 + 모바일 카드뷰)
══════════════════════════════════════════════════════ */
/* ══════════════════════════════════════
   MARKET TABLE — TetherP2P
   Desktop grid table + Mobile card view
══════════════════════════════════════ */

/* ─── WRAPPER ─── */
.mkt-wrap {
  width: 100%;
  border-radius: var(--r20);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* ─── DESKTOP TABLE ─── */
.mkt-table { width: 100%; overflow: hidden; }

.mkt-h {
  display: grid;
  grid-template-columns: 1.6fr 1.4fr 2fr 1.1fr 0.9fr 100px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 700;
  color: var(--faint); letter-spacing: .06em; text-transform: uppercase;
  background: var(--surface2);
}
.mkt-r {
  display: grid;
  grid-template-columns: 1.6fr 1.4fr 2fr 1.1fr 0.9fr 100px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  cursor: pointer;
  transition: background .14s;
}
.mkt-r:last-child { border-bottom: none; }
.mkt-r:hover      { background: var(--row-hover); }

/* Seller column */
.sn  { font-size: 14px; font-weight: 700; color: var(--text); }
.sm  { font-size: 11px; color: var(--faint); margin-top: 2px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

/* Price column */
.pm  { font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.pp  { font-size: 11px; font-weight: 600; color: var(--red); margin-top: 2px; }

/* Limit/Remain column */
.rt  { font-size: 12px; color: var(--text2); margin-bottom: 2px; }
.rem { font-size: 12px; font-weight: 600; color: var(--green-t); display: flex; align-items: center; gap: 4px; }

/* ─── MOBILE CARD VIEW ─── */
.mkt-cards { display: none; }

.mkt-card {
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
  cursor: pointer;
  transition: background .14s;
}
.mkt-card:last-child { border-bottom: none; }
.mkt-card:active     { background: var(--row-hover); }

.mc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.mc-seller   { font-size: 15px; font-weight: 800; }
.mc-meta     { display: flex; align-items: center; gap: 5px; margin-top: 3px; flex-wrap: wrap; }
.mc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.mc-field-label {
  font-size: 10px; font-weight: 700; color: var(--faint);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px;
}
.mc-field-val  { font-size: 14px; font-weight: 800; letter-spacing: -.015em; }
.mc-field-sub  { font-size: 11px; color: var(--muted); margin-top: 1px; }
.mc-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mc-range { font-size: 11px; color: var(--faint); }

/* ─── RESPONSIVE SWITCH ─── */
@media (max-width: 768px) {
  .mkt-table  { display: none; }
  .mkt-cards  { display: block; }
}
@media (min-width: 769px) {
  .mkt-table  { display: block; }
  .mkt-cards  { display: none; }
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* ══════════════════════════════════════
   실시간 체결 피드 티커 (Trade Feed Ticker)
   — 즉시구매 버튼 아래에 좌→우 스크롤 애니메이션
══════════════════════════════════════ */
/* 피드 전체 래퍼 — overflow hidden으로 흐르는 영역 마스킹 */
.trade-feed-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--r12);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  height: 42px;
  display: flex;
  align-items: center;
}
/* 좌측 "체결" 라벨 고정 영역 */
.trade-feed-label {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: linear-gradient(135deg, var(--green), #0f4d2a);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  z-index: 2;
  letter-spacing: .03em;
  border-radius: var(--r12) 0 0 var(--r12);
}
/* 라벨→트랙 경계에 자연스러운 페이드 그라데이션 */
.trade-feed-label::after {
  content: '';
  position: absolute;
  right: -18px; top: 0; bottom: 0;
  width: 18px;
  background: linear-gradient(to right, var(--surface), transparent);
  z-index: 1;
}
/* 우측 끝 페이드 그라데이션 */
.trade-feed-wrap::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 30px;
  background: linear-gradient(to left, var(--surface), transparent);
  z-index: 1;
  pointer-events: none;
  border-radius: 0 var(--r12) var(--r12) 0;
}
/* 스크롤 트랙 — 아이템들이 좌방향으로 흐름 */
.trade-feed-track {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-left: 66px;
  animation: none; /* JS에서 제어 */
  white-space: nowrap;
  will-change: transform;
}
/* 호버 시 일시정지 */
.trade-feed-wrap:hover .trade-feed-track {
  animation-play-state: paused;
}
/* 개별 체결 아이템 */
.tf-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text2);
  white-space: nowrap;
  flex-shrink: 0;
}
.tf-time { font-size: 10px; color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums; }
.tf-buyer { color: var(--blue); font-weight: 700; font-size: 11px; }
.tf-seller { color: var(--green-t); font-weight: 700; font-size: 11px; }
.tf-arrow { color: var(--faint); font-size: 10px; }
.tf-amount { font-weight: 800; font-size: 11.5px; color: var(--text); }
.tf-usdt { font-size: 10px; color: var(--green-t); font-weight: 700; }
/* 아이템 사이 구분 점 */
.tf-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--faint);
  opacity: .4;
  flex-shrink: 0;
}
/* 스크롤 키프레임 — translateX(-50%)로 복제된 절반만큼 이동하여 무한루프 */
@keyframes tradeFeedScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.field-label { font-size:11px;font-weight:700;color:var(--faint);text-transform:uppercase;letter-spacing:.07em;margin-bottom:7px; }
.input-field { width:100%;padding:10px 14px;border-radius:10px;border:1px solid var(--border);background:var(--input-bg);font-size:14px;font-family:inherit;color:var(--text);outline:none; }
.input-field:focus { border-color:var(--green);box-shadow:0 0 0 3px rgba(26,107,60,.1); }
.tr { display:flex;align-items:center;justify-content:space-between;padding:11px 0;border-bottom:1px solid var(--border); }
.tr:last-child { border-bottom:none; }
.card { background:var(--surface);border:1px solid var(--border);border-radius:14px;box-shadow:var(--shadow-sm); }
.card.cp { padding:18px; }
.alert-box { padding:12px 16px;border-radius:10px;margin-bottom:14px;font-size:13px;font-weight:600; }

