:root {
  --bg: #0e1116;
  --surface: #161b22;
  --border: #2d333b;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #3fb950;
  --accent-dim: #238636;
  --warn: #d29922;
  --danger: #f85149;
  --violet: #a371f7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(63, 185, 80, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 185, 80, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  padding-left: max(1.25rem, env(safe-area-inset-left, 0));
  padding-right: max(1.25rem, env(safe-area-inset-right, 0));
}

@media (max-width: 768px) {
  .wrap {
    padding-top: max(1.25rem, env(safe-area-inset-top, 0));
    padding-bottom: calc(3rem + env(safe-area-inset-bottom, 0));
  }
}

header.brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
  min-width: 0;
}

/* 관리자: 상단 링크 줄 · 탭(모바일은 가로 스크롤로 한 줄 유지) */
.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

/* 관리자 공통: 우측 상단 메인·톱니·로그아웃 + 하단 메뉴 띠 */
.admin-app-header {
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  min-width: 0;
}

.admin-app-header__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.admin-app-header__lead h1 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
}

.admin-app-header__lead .tag {
  margin: 0;
}

.admin-app-header__corner {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-app-corner-link {
  font-size: 0.85rem;
}

.admin-app-gear {
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.35rem 0.5rem !important;
  min-width: 2.25rem;
}

.admin-app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  align-items: center;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-app-nav__link {
  display: inline-block;
  padding: 0.42rem 0.72rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}

.admin-app-nav__link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.admin-app-nav__link.is-active {
  color: var(--text);
  background: var(--card);
  border-color: var(--border);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
}

@media (max-width: 768px) {
  .admin-app-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.35rem;
    overscroll-behavior-x: contain;
  }

  .admin-app-nav__link {
    flex: 0 0 auto;
  }

  .admin-app-header__corner {
    width: 100%;
    justify-content: flex-end;
  }
}

.admin-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.admin-tabs button {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  flex: 0 0 auto;
  white-space: nowrap;
}

.admin-tabs button[aria-selected="true"] {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--border);
}

.admin-tabs button:hover {
  color: var(--text);
}

@media (max-width: 768px) {
  header.brand {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-header-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    align-self: stretch;
    padding-bottom: 0.35rem;
    overscroll-behavior-x: contain;
  }

  .admin-header-actions .btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .admin-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.35rem;
    overscroll-behavior-x: contain;
  }

  .admin-members-tab-labels {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.65rem;
    overscroll-behavior-x: contain;
  }

  .admin-members-tab-label {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

.brand h1 {
  margin: 0;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  letter-spacing: -0.02em;
}

.brand .tag {
  font-size: 0.85rem;
  color: var(--muted);
}

.pill {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pill-live {
  background: rgba(63, 185, 80, 0.15);
  color: var(--accent);
}

.pill-off {
  background: rgba(248, 81, 73, 0.12);
  color: var(--danger);
}

.pill-warn {
  background: rgba(210, 153, 34, 0.15);
  color: var(--warn);
}

.mono {
  font-family: ui-monospace, "Cascadia Code", "IBM Plex Mono", monospace;
  font-size: 0.88em;
  word-break: break-all;
}

.mono-sm {
  font-family: ui-monospace, "Cascadia Code", "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  word-break: break-all;
}

/* 데시보드: 코인별 봇 + 차트 한 화면 */
.dash-main-split {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
  align-items: stretch;
}

@media (min-width: 1024px) {
  .dash-main-split {
    /* 차트 쪽에 가로 공간을 더 할당 (오른쪽 여백 활용) */
    grid-template-columns: minmax(280px, 0.4fr) minmax(360px, 1fr);
  }

  /* 차트 열과 높이를 맞추고, 왼쪽 봇 패널 빈 공간을 카드가 채움 */
  .dash-main-split:has(.dash-chart-panel) {
    min-height: min(72vh, 720px);
  }
}

@media (max-width: 1023px) {
  .dash-bots-panel {
    height: auto;
  }

  .dash-bot-coin-grid {
    min-height: 0;
  }
}

@media (min-width: 1400px) {
  .dash-main-split {
    grid-template-columns: minmax(300px, 0.36fr) minmax(420px, 1fr);
  }
}

.dash-bots-panel,
.dash-chart-panel {
  min-width: 0;
}

.dash-bots-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
}

.dash-bots-panel > h2 {
  flex-shrink: 0;
}

.dash-chart-panel {
  display: flex;
  flex-direction: column;
}

.dash-chart-panel .dash-chart-host {
  flex: 1;
  min-height: 380px;
  height: auto;
}

.dash-guest-banner {
  margin-bottom: 1rem;
}

.dash-guest-banner .hint {
  margin: 0;
}

.dash-bot-coin-grid {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  align-content: flex-start;
  gap: 0.75rem;
  margin-top: 0.5rem;
  min-height: 0;
  min-width: 0;
}

.dash-bot-coin {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  min-width: 0;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: left;
  background: var(--bg);
  transition: box-shadow 0.2s, border-color 0.2s;
  box-sizing: border-box;
  overflow: hidden;
}

.dash-bot-coin--on {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.45);
}

.dash-bot-coin__top {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
  flex: 0 0 auto;
}

.dash-bots-panel .dash-bot-coin .dash-coin-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.dash-bot-coin__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
}

.dash-bot-coin__pill {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.dash-bot-coin__pill--on {
  color: #3fb950;
  border-color: rgba(63, 185, 80, 0.55);
  background: rgba(63, 185, 80, 0.12);
  box-shadow: 0 0 10px rgba(63, 185, 80, 0.2);
}

.dash-bot-coin__main {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
}

.dash-bot-coin--on .dash-bot-coin__main {
  color: var(--accent);
}

.dash-bot-coin__meta {
  font-size: 0.74rem;
  margin-top: 0.25rem;
  line-height: 1.4;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  min-width: 0;
}

.dash-bot-coin__meta-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: 0.45rem;
  row-gap: 0.1rem;
  width: 100%;
  min-width: 0;
}

.dash-bot-coin__meta-k {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
  max-width: 6.8rem;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.dash-bot-coin__meta-v {
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 0.72rem;
  line-height: 1.35;
}

@media (max-width: 380px) {
  .dash-bot-coin__meta-row {
    grid-template-columns: 1fr;
  }
  .dash-bot-coin__meta-k {
    max-width: none;
  }
  .dash-bot-coin__meta-v {
    text-align: left;
  }
}

.dash-chart-panel .dash-lead {
  font-size: 0.82rem;
  margin-bottom: 0.65rem;
}

.dash-card h2 {
  margin: 0 0 0.5rem;
}

.dash-lead {
  margin: 0 0 1rem;
  max-width: none;
}

.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dash-kv {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.5rem 1rem;
  align-items: baseline;
  font-size: 0.9rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.dash-kv:last-of-type {
  border-bottom: none;
}

.dash-k {
  color: var(--muted);
  font-size: 0.82rem;
}

.dash-v {
  color: var(--text);
  word-break: break-word;
}

.dash-timeline-card {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.dash-timeline-card h2 {
  margin: 0 0 0.5rem;
}

/* 최근 신호: 제목 + 연결 상태 배지 */
h2.dash-signals-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.85rem;
  margin: 0 0 0.75rem;
}

.dash-signals-head__title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.dash-link-status {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  line-height: 1.2;
}

.dash-link-status--ok {
  color: #3fb950;
  background: rgba(63, 185, 80, 0.14);
}

.dash-link-status--bad {
  color: #f85149;
  background: rgba(248, 81, 73, 0.12);
}

.dash-link-status--pending {
  color: var(--muted);
  background: rgba(139, 148, 158, 0.12);
}

.dash-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-timeline-item {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 0.5rem 0.85rem;
  align-items: baseline;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

@media (max-width: 520px) {
  .dash-timeline-item {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .dash-kv {
    grid-template-columns: 1fr;
  }
}

.dash-timeline-item:last-child {
  border-bottom: none;
}

.dash-timeline-time {
  color: var(--muted);
  white-space: nowrap;
}

.dash-timeline-kind {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  width: max-content;
}

.dash-timeline-signal .dash-timeline-kind {
  background: rgba(63, 185, 80, 0.12);
  color: var(--accent);
}

.dash-timeline-trade .dash-timeline-kind {
  background: rgba(163, 113, 247, 0.12);
  color: var(--violet);
}

.dash-timeline-setting .dash-timeline-kind {
  background: rgba(210, 153, 34, 0.12);
  color: var(--warn);
}

.dash-timeline-line {
  color: var(--text);
  line-height: 1.45;
}

.dash-signals-subh {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.dash-signal-snapshots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.35rem;
}

@media (min-width: 720px) {
  .dash-signal-snapshots {
    grid-template-columns: repeat(4, 1fr);
  }
}

.dash-snapshot-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.8rem;
  font-size: 0.84rem;
  line-height: 1.4;
  background: var(--surface);
}

.dash-coin-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.dash-coin-icon {
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(139, 148, 158, 0.12);
}

.dash-snapshot-coin {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.dash-snapshot-side {
  font-weight: 600;
}

.dash-snapshot-hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
}

.dash-snapshot-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.dash-snapshot-rsi {
  font-size: 0.78rem;
  margin-top: 0.2rem;
  color: var(--text);
}

.dash-snapshot-card.dash-signal-long {
  border-color: rgba(63, 185, 80, 0.45);
  box-shadow: 0 0 0 1px rgba(63, 185, 80, 0.08) inset;
}

.dash-snapshot-card.dash-signal-short {
  border-color: rgba(248, 81, 73, 0.45);
  box-shadow: 0 0 0 1px rgba(248, 81, 73, 0.08) inset;
}

.dash-snapshot-card.dash-signal-none {
  opacity: 0.92;
}

.dash-signal-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-signal-row {
  display: grid;
  grid-template-columns: auto auto auto 1fr;
  gap: 0.45rem 0.75rem;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.86rem;
}

.dash-signal-row:last-child {
  border-bottom: none;
}

@media (max-width: 640px) {
  .dash-signal-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}

.dash-signal-time {
  color: var(--muted);
  white-space: nowrap;
  font-size: 0.8rem;
}

.dash-signal-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  width: max-content;
  background: rgba(139, 148, 158, 0.12);
  color: var(--muted);
}

.dash-signal-row.dash-signal-long .dash-signal-badge {
  background: rgba(63, 185, 80, 0.15);
  color: #3fb950;
}

.dash-signal-row.dash-signal-short .dash-signal-badge {
  background: rgba(248, 81, 73, 0.15);
  color: #f85149;
}

.dash-signal-coin {
  font-weight: 600;
}

.dash-signal-detail {
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}

/* 최근 신호: 좌측 목록 + 우측 PnL 달력 */
.dash-signals-history-split {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.dash-signals-history-left,
.dash-pnl-calendar-panel {
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 900px) {
  .dash-signals-history-split--with-cal {
    flex-direction: row;
    align-items: stretch;
    gap: 1.35rem;
    width: 100%;
    min-width: 0;
  }

  /* 좌: 고정 폭대 · 우: 남는 가로 전부 달력(카드 안 빈칸 없음 — 달력은 콘텐츠 높이만) */
  .dash-signals-history-split--with-cal .dash-signals-history-left {
    flex: 0 1 28rem;
    min-width: min(24rem, 100%);
    max-width: 34rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    align-self: stretch;
  }

  /* 달력 열 높이에 맞춰 목록 영역이 아래까지 늘어남(하단 정렬감) */
  .dash-signals-history-split--with-cal .dash-signals-history-left .dash-signal-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dash-pnl-calendar-panel {
    flex: 1 1 0%;
    min-width: 0;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-self: stretch;
  }

  .dash-pnl-calendar-panel .dash-pnl-calendar {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
  }
}

.dash-pnl-calendar {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem 1rem;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.dash-pnl-calendar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.dash-pnl-calendar__title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.dash-pnl-calendar__accent {
  width: 3px;
  height: 1.1rem;
  border-radius: 2px;
  background: linear-gradient(180deg, #f0b429, #e67e22);
}

.dash-pnl-calendar__nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.dash-pnl-calendar__nav-label {
  font-size: 0.88rem;
  min-width: 5.5rem;
  text-align: center;
  color: var(--text);
}

.dash-pnl-calendar__nav-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: transparent;
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.dash-pnl-calendar__nav-btn:hover {
  border-color: #38bdf8;
  color: #38bdf8;
}

.dash-pnl-calendar__err {
  margin: 0 0 0.5rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--danger, #f85149);
  background: rgba(248, 81, 73, 0.08);
  border-radius: 8px;
  border: 1px solid rgba(248, 81, 73, 0.25);
}

.dash-pnl-calendar__err[hidden] {
  display: none !important;
}

.dash-pnl-calendar__weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
  margin-bottom: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
}

.dash-pnl-calendar__wd--sun {
  color: #f85149;
}

.dash-pnl-calendar__wd--sat {
  color: #58a6ff;
}

.dash-pnl-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.32rem;
  min-width: 0;
  overflow: visible;
}

.dash-pnl-cal-cell {
  min-height: 4.35rem;
  min-width: 0;
  border-radius: 10px;
  padding: 0.35rem 0.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.12rem;
  border: 1px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
  overflow: visible;
  position: relative;
  z-index: 0;
}

.dash-pnl-cal-cell--pad {
  min-height: 3.4rem;
  visibility: hidden;
}

.dash-pnl-cal-cell--pad.dash-pnl-cal-cell--tail {
  min-height: 0 !important;
  height: 0;
  padding: 0;
  border: none;
  overflow: hidden;
  visibility: hidden;
}

.dash-pnl-cal-cell__dom {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.dash-pnl-cal-cell--sun .dash-pnl-cal-cell__dom {
  color: #f85149;
}

.dash-pnl-cal-cell--sat .dash-pnl-cal-cell__dom {
  color: #58a6ff;
}

.dash-pnl-cal-cell--day {
  cursor: pointer;
}

.dash-pnl-cal-cell--day:hover {
  background: rgba(255, 255, 255, 0.04);
}

.dash-pnl-cal-cell--today {
  border-color: rgba(45, 212, 191, 0.65);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.12) inset;
}

.dash-pnl-cal-cell--selected {
  border-color: rgba(63, 185, 80, 0.88);
  box-shadow: 0 0 0 1px rgba(63, 185, 80, 0.22) inset;
}

.dash-pnl-cal-cell--today.dash-pnl-cal-cell--selected {
  border-color: rgba(63, 185, 80, 0.95);
}

.dash-pnl-cal-cell__pnl {
  font-size: 0.74rem;
  line-height: 1.2;
  text-align: center;
  max-width: 100%;
  /* 정수 $1,234 표기 + 좁은 칸: 말줄임 대신 전체가 보이도록(필요 시 아래 모바일에서 글자만 축소) */
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  font-variant-numeric: tabular-nums;
}

.dash-pnl-cal-cell__pnl--pos {
  color: #3fb950;
}

.dash-pnl-cal-cell__pnl--neg {
  color: #f85149;
}

.dash-pnl-calendar__live {
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}

.dash-pnl-calendar__live-row {
  margin-bottom: 0.28rem;
}

.dash-pnl-calendar__live-row--single {
  margin-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.6rem;
}

.dash-pnl-calendar__live-balance {
  font-size: 0.95rem;
  font-weight: 600;
}

.dash-pnl-calendar__live-row--emph {
  font-weight: 600;
}

.dash-pnl-calendar__delta--pos {
  color: #3fb950;
}

.dash-pnl-calendar__delta--neg {
  color: #f85149;
}

.dash-pnl-calendar__delta--zero {
  color: var(--muted);
}

.dash-pnl-calendar__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}

.dash-pnl-calendar__foot-k {
  color: var(--muted);
  margin-right: 0.35rem;
}

.dash-pnl-calendar__month-total {
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dash-pnl-calendar__month-total--pos {
  color: #3fb950;
}

.dash-pnl-calendar__month-total--neg {
  color: #f85149;
}

.dash-pnl-calendar__month-total--zero {
  color: #3fb950;
}

@media (max-width: 520px) {
  .dash-pnl-calendar {
    padding: 0.65rem 0.45rem 0.8rem;
  }

  .dash-pnl-calendar__head {
    flex-wrap: wrap;
    row-gap: 0.4rem;
  }

  .dash-pnl-calendar__nav-label {
    min-width: 0;
    flex: 1 1 auto;
    font-size: 0.78rem;
  }

  .dash-pnl-calendar__weekdays {
    gap: 0.12rem;
    font-size: 0.68rem;
  }

  .dash-pnl-calendar__grid {
    gap: 0.1rem;
  }

  .dash-pnl-cal-cell {
    min-height: 3.5rem;
    padding: 0.22rem 0.04rem;
  }

  .dash-pnl-cal-cell__dom {
    font-size: 0.78rem;
  }

  .dash-pnl-cal-cell__pnl {
    /* 정수 달러 표기에 맞춰 약간 키워 4~5자리(+기호·콤마 포함)가 칸 안에 들어가기 쉽게 */
    font-size: 0.62rem;
    letter-spacing: -0.02em;
  }

  .dash-pnl-calendar__month-total {
    font-size: 0.92rem;
  }
}

@media (min-width: 1100px) {
  .dash-pnl-cal-cell {
    min-height: 4.85rem;
  }

  .dash-pnl-cal-cell__dom {
    font-size: 1rem;
  }

  .dash-pnl-cal-cell__pnl {
    font-size: 0.8rem;
  }
}

.grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 840px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
}

.card h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.switch {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: 0.2s;
}

.slider::before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: var(--text);
  border-radius: 50%;
  transition: 0.2s;
}

input:checked + .slider {
  background: var(--accent-dim);
}

input:checked + .slider::before {
  transform: translateX(24px);
}

input:disabled + .slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 36rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.metric {
  padding: 0.65rem 0.75rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.metric .k {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.metric .v {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0.15rem;
}

form.calc label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

form.calc input,
form.calc select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

form.calc select {
  cursor: pointer;
}

.direction-legend {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
  padding: 0;
}

.direction-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.direction-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.direction-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.direction-option:hover {
  border-color: var(--violet);
}

.direction-option.is-selected {
  border-color: var(--accent);
  background: rgba(0, 255, 136, 0.08);
  box-shadow: 0 0 0 1px var(--accent);
}

.bot-size-field .bot-size-number {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: inline-block;
  min-width: 3.5rem;
}

.bot-size-field #size-hint-line:empty {
  display: none;
}

form.calc .field {
  margin-bottom: 0.85rem;
}

.btn {
  appearance: none;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--accent);
  color: #041;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  background: transparent;
  color: var(--violet);
  border: 1px solid var(--violet);
}

.calc-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  background: var(--bg);
  border: 1px dashed var(--border);
  font-size: 0.9rem;
}

.calc-result pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

table.data th,
table.data td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

table.data th {
  color: var(--muted);
  font-weight: 500;
}

.roadmap {
  border-left: 3px solid var(--violet);
  padding-left: 1rem;
}

.roadmap li {
  margin: 0.35rem 0;
  color: var(--muted);
}

.err {
  color: var(--danger);
  font-size: 0.85rem;
}

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

/* 회원 앱: 화면 왼쪽 고정 사이드바 + 본문 */
.member-app {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: stretch;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  min-width: 0;
  max-width: 100%;
}

.member-sidebar {
  flex: 0 0 240px;
  width: 240px;
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0 1.5rem;
}

.member-sidebar-head {
  padding: 0 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

/* 데스크톱: 로고만 한 줄(모바일용 계정 바는 숨김) */
.member-sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.member-sidebar-brand-row .member-sidebar-logo {
  min-width: 0;
}

.member-auth-bar--mobile-head {
  display: none;
}

/* 모바일에서만 사이드 상단에 표시(회원·Gate·구독 필) */
.member-sidebar-status--mobile-only {
  display: none;
}

.member-auth-name {
  font-size: 0.85rem;
}

.member-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.member-sidebar-brand-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
}

.member-sidebar-brand-text {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--text);
}

.member-sidebar-logo:hover .member-sidebar-brand-text {
  color: var(--accent);
}

.member-sidebar-tag {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.member-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.65rem;
  margin: 0;
}

.member-sidebar-nav a {
  display: block;
  padding: 0.65rem 0.85rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  border-left: 3px solid transparent;
  margin-left: -2px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.member-sidebar-nav a:hover {
  color: var(--text);
  background: rgba(63, 185, 80, 0.08);
}

.member-sidebar-nav a.active {
  color: var(--accent);
  font-weight: 600;
  background: rgba(63, 185, 80, 0.12);
  border-left-color: var(--accent);
}

/* 지갑 메뉴 아래: Gate 포지션 요약(좁은 폭용 세로 스택) */
.member-sidebar-pos {
  margin-top: 1rem;
  padding: 0.75rem 0.85rem 0;
  border-top: 1px solid var(--border);
}

.member-sidebar-pos__title {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.member-sidebar-pos__lead {
  margin: 0 0 0.5rem;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--muted);
}

.member-sidebar-pos__label {
  display: block;
  font-size: 0.65rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.member-sidebar-pos__select {
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.35rem 0.4rem;
  font-size: 0.78rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.member-sidebar-pos__mount {
  font-size: 0.72rem;
  line-height: 1.35;
  transition: opacity 0.2s ease;
}

.member-sidebar-pos__mount--polling {
  opacity: 0.88;
}

.member-sidebar-pos__muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.member-sidebar-pos__err {
  margin: 0;
  color: var(--warn, #f85149);
  font-size: 0.72rem;
}

.member-sidebar-pos__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.45rem;
}

.member-sidebar-pos__badge {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  background: rgba(139, 148, 158, 0.15);
  color: var(--text);
}

.member-sidebar-pos__badge.is-long {
  background: rgba(63, 185, 80, 0.2);
  color: #3fb950;
}

.member-sidebar-pos__badge.is-short {
  background: rgba(248, 81, 73, 0.18);
  color: #f85149;
}

.member-sidebar-pos__pnl {
  margin-bottom: 0.35rem;
  padding: 0.35rem 0.4rem;
  border-radius: 6px;
  background: rgba(139, 148, 158, 0.08);
}

.member-sidebar-pos__pnl-label {
  font-size: 0.62rem;
  color: var(--muted);
}

.member-sidebar-pos__pnl-val {
  font-size: 0.95rem;
  font-weight: 700;
}

.member-sidebar-pos__pnl.is-pos .member-sidebar-pos__pnl-val {
  color: #3fb950;
}

.member-sidebar-pos__pnl.is-neg .member-sidebar-pos__pnl-val {
  color: #f85149;
}

.member-sidebar-pos__roi {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
  font-size: 0.72rem;
}

.member-sidebar-pos__roi-label {
  color: var(--muted);
}

.member-sidebar-pos__roi.is-pos strong {
  color: #3fb950;
}

.member-sidebar-pos__roi.is-neg strong {
  color: #f85149;
}

.member-sidebar-pos__kv {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  margin: 0.2rem 0;
  font-size: 0.68rem;
}

.member-sidebar-pos__kv span {
  color: var(--muted);
  flex: 0 1 auto;
}

.member-sidebar-pos__kv strong {
  text-align: right;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.member-app-body {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.member-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
  padding-top: max(1rem, env(safe-area-inset-top, 0));
  padding-left: max(1.5rem, env(safe-area-inset-left, 0));
  padding-right: max(1.5rem, env(safe-area-inset-right, 0));
  border-bottom: 1px solid var(--border);
  background: rgba(14, 17, 22, 0.85);
  backdrop-filter: blur(8px);
}

.member-sub-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.1rem;
  padding: 0.55rem 1.5rem;
  padding-left: max(1.5rem, env(safe-area-inset-left, 0));
  padding-right: max(1.5rem, env(safe-area-inset-right, 0));
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  background: linear-gradient(105deg, rgba(56, 189, 248, 0.14) 0%, rgba(63, 185, 80, 0.06) 100%);
  border-bottom: 1px solid rgba(56, 189, 248, 0.22);
}

.member-sub-strip__until,
.member-sub-strip__remain {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.member-sub-strip__until .member-sub-strip__d,
.member-sub-strip__remain .member-sub-strip__d {
  color: #6ecbff;
  margin-left: 0.2rem;
}

.member-sub-strip__d {
  color: #6ecbff;
  margin-left: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.member-topbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  min-width: 0;
}

.member-topbar-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.member-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.member-pill-ok {
  color: #7ee787;
  border-color: rgba(63, 185, 80, 0.45);
  background: rgba(63, 185, 80, 0.12);
}

.member-pill-warn {
  color: #d4a72c;
  border-color: rgba(212, 167, 44, 0.5);
  background: rgba(212, 167, 44, 0.1);
}

.member-pill-off {
  color: var(--muted);
  border-color: var(--border);
  background: rgba(110, 118, 129, 0.12);
}

.member-pill-sub {
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  max-width: 100%;
}

.member-pill-sub__name-row {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  max-width: min(13rem, 52vw);
}

.member-pill-sub__tier-logo {
  flex-shrink: 0;
  height: 18px;
  width: auto;
  max-width: 58px;
  object-fit: contain;
}

.member-pill-sub__name {
  color: var(--text);
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-pill-sub__sep {
  opacity: 0.55;
  font-weight: 500;
}

.member-pill-sub__d {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.member-pill-sub__d--expired {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(248, 113, 113, 0.5);
}

.member-sub-strip__plan {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-right: 0.35rem;
  color: var(--text);
  max-width: 100%;
  min-width: 0;
}

.member-sub-strip__plan-text {
  font-weight: 600;
}

.member-sub-strip__tier-logo {
  flex-shrink: 0;
  height: 26px;
  width: auto;
  max-width: min(110px, 34vw);
  object-fit: contain;
}

.member-sub-strip__d--trial {
  color: #a7f3c8;
}

/* 관리자 회원 페이지 탭(라디오 + 라벨, JS 없음) */
.admin-members-tabset {
  margin-top: 0.25rem;
}

.admin-members-tab-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin-members-tab-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
  min-width: 0;
  max-width: 100%;
}

.admin-members-tab-label {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--muted);
  background: rgba(110, 118, 129, 0.08);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.admin-members-tab-label:hover {
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.35);
}

#am-sync:checked ~ .admin-members-tab-labels label[for="am-sync"],
#am-members:checked ~ .admin-members-tab-labels label[for="am-members"],
#am-pw:checked ~ .admin-members-tab-labels label[for="am-pw"],
#am-subs:checked ~ .admin-members-tab-labels label[for="am-subs"],
#am-new:checked ~ .admin-members-tab-labels label[for="am-new"] {
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.12);
}

.admin-members-panels {
  position: relative;
}

.admin-members-panel {
  display: none;
  padding-top: 0.35rem;
}

#am-sync:checked ~ .admin-members-panels .am-panel-sync,
#am-members:checked ~ .admin-members-panels .am-panel-members,
#am-pw:checked ~ .admin-members-panels .am-panel-pw,
#am-subs:checked ~ .admin-members-panels .am-panel-subs,
#am-new:checked ~ .admin-members-panels .am-panel-new {
  display: block;
}

.member-topbar-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.member-topbar .member-auth-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.member-settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.member-settings-btn:hover {
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.06);
}

.member-settings-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.member-settings-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.member-app .member-main {
  flex: 1;
  width: 100%;
  min-width: 0;
  max-width: none;
  box-sizing: border-box;
  padding: 1.5rem clamp(1rem, 2vw, 2rem) calc(2.5rem + env(safe-area-inset-bottom, 0px))
    clamp(1rem, 2.5vw, 2.25rem);
}

.dash-chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin: 0.75rem 0 0.5rem;
}

.dash-chart-toolbar--controls {
  align-items: flex-end;
  gap: 0.65rem 1rem;
}

.dash-chart-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1 1 140px;
}

.dash-chart-field .dash-chart-select {
  width: 100%;
  max-width: 100%;
}

.dash-chart-toolbar label {
  margin: 0;
}

.dash-chart-select {
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  min-height: 42px;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .dash-chart-toolbar--controls {
    flex-direction: column;
    align-items: stretch;
  }

  .dash-chart-field {
    flex: 1 1 auto;
  }

  .dash-chart-select {
    min-height: 44px;
    font-size: 1rem;
  }

  .dash-chart-panel .dash-chart-host {
    min-height: 300px;
  }
}

.dash-chart-host {
  width: 100%;
  min-height: 320px;
  margin-top: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: #0d1117;
}

.member-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 768px) {
  .member-app {
    flex-direction: column;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
  }

  .member-sidebar {
    flex: none;
    width: 100%;
    min-width: 0;
    min-height: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: max(0.75rem, env(safe-area-inset-top, 0)) 0 1rem;
  }

  .member-sidebar-head {
    padding: 0 max(1rem, env(safe-area-inset-left, 0)) 0.85rem max(1rem, env(safe-area-inset-right, 0));
    margin-bottom: 0.65rem;
  }

  /* 모바일: 톱니·닉네임·로그아웃을 로고·AI K-Bot 과 같은 줄 오른쪽 */
  .member-auth-bar--mobile-head {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
    max-width: min(52%, calc(100% - 9.5rem));
  }

  .member-auth-bar--mobile-head .member-settings-btn {
    width: 2rem;
    height: 2rem;
  }

  .member-auth-bar--mobile-head .member-auth-name {
    font-size: 0.72rem;
    max-width: 6rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .member-auth-bar--mobile-head .member-auth-logout {
    padding: 0.3rem 0.45rem;
    font-size: 0.68rem;
    min-height: 36px;
    line-height: 1.1;
  }

  .member-auth-bar--mobile-head .btn {
    min-height: 36px;
    font-size: 0.72rem;
    padding: 0.3rem 0.5rem;
  }

  .member-auth-bar--topbar {
    display: none !important;
  }

  /* 회원 / Gate 연결 / 구독 필 — 로고·계정 줄 바로 아래(코인 티커 위) */
  .member-sidebar-status--mobile-only {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.55rem;
    margin-top: 0.45rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    width: 100%;
  }

  .member-sidebar-status--mobile-only .member-topbar-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
    min-width: 0;
  }

  .member-sidebar-status--mobile-only .member-pill {
    font-size: 0.66rem;
    padding: 0.1rem 0.4rem;
  }

  .member-topbar-left--desktop-only {
    display: none !important;
  }

  .member-sidebar-nav {
    flex-direction: row;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0 max(0.75rem, env(safe-area-inset-left, 0)) 0.2rem max(0.75rem, env(safe-area-inset-right, 0));
    gap: 0.2rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    overscroll-behavior-x: contain;
  }

  .member-sidebar-nav::-webkit-scrollbar {
    height: 3px;
  }

  .member-sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
  }

  .member-sidebar-nav a {
    border-left: none;
    margin-left: 0;
    padding: 0.5rem 0.55rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    -webkit-tap-highlight-color: rgba(63, 185, 80, 0.15);
  }

  .member-sidebar-nav a.active {
    border-left: none;
  }

  .member-sidebar-pos {
    margin-top: 0.65rem;
    padding: 0.65rem max(0.85rem, env(safe-area-inset-left, 0)) 0
      max(0.85rem, env(safe-area-inset-right, 0));
    border-top: 1px solid var(--border);
  }

  .member-app .member-main {
    max-width: none;
    padding: 1.25rem max(1rem, env(safe-area-inset-left, 0)) calc(2rem + env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-right, 0));
  }

  /* 계정·상태는 사이드 상단으로 옮김 — 빈 톱바 숨김 */
  .member-topbar {
    display: none;
  }

  .member-sub-strip {
    padding-left: max(1rem, env(safe-area-inset-left, 0));
    padding-right: max(1rem, env(safe-area-inset-right, 0));
  }

  /* 지갑 탭: 라벨은 PC와 동일, 한 줄 유지를 위해 약간만 압축 */
  .wallet-tab {
    padding: 0.4rem 0.55rem;
    font-size: 0.78rem;
  }
}

/* 좁은 화면: 카드 한 열, 가로 스크롤 방지 */
@media (max-width: 520px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 1.1rem 1rem;
  }

  .wallet-bal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .member-sidebar-nav a {
    padding: 0.45rem 0.55rem;
    font-size: 0.78rem;
  }
}

.feature-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.feature-card {
  display: block;
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.12s;
}

.feature-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-1px);
}

.feature-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  color: var(--text);
}

.feature-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.settings-kv {
  list-style: none;
  margin: 0;
  padding: 0;
}

.settings-kv li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.settings-kv li:last-child {
  border-bottom: none;
}

.settings-kv li span {
  color: var(--muted);
}

.settings-kv li strong {
  font-weight: 600;
  text-align: right;
}

.badge-soon {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--warn);
  font-weight: 600;
}

/* 스토어 · 구독 */
.store-card__h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.store-card__lead {
  margin: 0 0 1rem;
  line-height: 1.55;
}

.store-balance-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(63, 185, 80, 0.35);
  background: rgba(63, 185, 80, 0.08);
}

.store-balance-bar__label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.store-balance-bar__val {
  font-size: 1.15rem;
  color: var(--accent);
}

.card-inner {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.store-section-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.store-memo {
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(212, 167, 44, 0.12);
  color: var(--warn);
}

.store-chain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.store-chain-list li {
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.store-chain-list li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.store-chain-name {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.store-addr {
  font-size: 0.82rem;
  word-break: break-all;
  color: var(--text);
}

/* 카드 좌우 패딩까지 그리드가 닿도록 */
.store-plan-grid-bleed {
  margin-inline: -1.35rem;
  padding-inline: 1.35rem;
  width: calc(100% + 2.7rem);
  max-width: none;
  box-sizing: border-box;
}

@media (max-width: 520px) {
  .store-plan-grid-bleed {
    margin-inline: -1rem;
    padding-inline: 1rem;
    width: calc(100% + 2rem);
  }
}

.store-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

/* 데스크톱에서 5열로 가로 폭 전부 사용 */
.store-plan-grid--five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  align-items: stretch;
}

@media (max-width: 1180px) {
  .store-plan-grid--five {
    grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  }
}

.store-plan {
  position: relative;
  padding: 1rem 0.75rem 1rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  height: 100%;
}

.store-plan__tier {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.12rem;
  width: 100%;
  line-height: 1.3;
}

/* 등급명과 티어 로고는 한 줄(베이직 보조문구는 아래 줄) — flex-wrap 으로 로고가 카드 오른쪽 끝으로 밀리지 않음 */
.store-plan__tier-head {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem 0.42rem;
  min-width: 0;
}

/*
 * 스토어·상단 구독 티어 영어 로고 PNG: 원본 적색 → 순수 블루에 가깝게(168°대는 청록·녹청으로 보일 수 있음).
 * hue-rotate ~222° 로 블루(~240°) 쪽으로 당김 + 그림자도 파란 계열만 사용.
 */
.store-plan__tier-icon,
.member-pill-sub__tier-logo,
.member-sub-strip__tier-logo {
  filter: drop-shadow(0.85px -0.4px 0 rgba(147, 197, 253, 0.72))
    drop-shadow(-0.5px 0.7px 0 rgba(30, 64, 175, 0.58))
    drop-shadow(0 1px 2px rgba(15, 23, 42, 0.42))
    hue-rotate(222deg) saturate(1.1) brightness(1.05) contrast(1.04);
}

/* 영어 워드마크 PNG — basic/pro 는 높이 유지, 상위 티어는 세로만 살짝 키움 */
.store-plan__tier-icon {
  height: 1.85rem;
  width: auto;
  max-width: min(100%, 5.75rem);
  flex-shrink: 0;
  object-fit: contain;
  object-position: left center;
}

.store-plan--tier-standard .store-plan__tier-icon {
  height: 2.2rem;
  max-width: min(100%, 6.5rem);
}

.store-plan--tier-premium .store-plan__tier-icon {
  height: 2.35rem;
  max-width: min(100%, 6.75rem);
}

.store-plan--tier-platinum .store-plan__tier-icon {
  height: 2.45rem;
  max-width: min(100%, 7rem);
}

.store-plan__basic-cap {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.38;
  color: var(--warn);
  word-break: keep-all;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.store-prose-one-line {
  display: block;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  line-height: 1.55;
  -webkit-overflow-scrolling: touch;
}

/* 봇 설정 등 안내: 짧은 문장은 한 줄로 유지되고, 긴 설명은 컨테이너 너비에서 자동 줄바꿈(가로 스크롤바 방지) */
.member-settings-lead {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
  line-height: 1.55;
}

.store-plan__tier-name {
  font-size: calc(0.74rem + 4pt);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.store-plan__tier-note {
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--warn);
}

.store-plan__period {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.3;
  padding-right: 2.5rem;
}

.store-plan--tier-basic {
  border-left: 3px solid #7c8fa3;
}

.store-plan--tier-pro {
  border-left: 3px solid #3fb950;
}

.store-plan--tier-standard {
  border-left: 3px solid #58a6ff;
}

.store-plan--tier-premium {
  border-left: 3px solid #d4a72c;
}

.store-plan--tier-platinum {
  border-left: 3px solid #a371f7;
}

.store-plan__label {
  font-weight: 600;
  font-size: 0.92rem;
}

.store-plan__disc {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(63, 185, 80, 0.15);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

.store-plan__price {
  font-size: 1rem;
  color: var(--text);
}

.store-plan__days {
  margin: 0;
  font-size: 0.78rem;
}

.store-buy-btn {
  margin-top: auto;
  width: 100%;
  justify-content: center;
}

.store-msg {
  margin-top: 0.75rem;
  min-height: 1.25rem;
}

.store-neg {
  color: var(--danger);
}

.store-pos {
  color: var(--accent);
}

.store-pay-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.35rem;
  align-items: center;
  width: 100%;
}

.store-uid-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  background: rgba(22, 27, 34, 0.65);
  margin-top: 1.25rem;
}

.store-uid-panel__title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.store-uid-steps {
  margin: 0.5rem 0 0;
  padding-left: 1.15rem;
  line-height: 1.65;
  color: var(--text);
}

.store-uid-steps li {
  margin: 0.4rem 0;
}

.store-plan--picked {
  box-shadow: 0 0 0 2px var(--accent);
  border-radius: 12px;
}

/* 회원 Wallet (Gate 연동) */
.wallet-page__head {
  margin-bottom: 1rem;
}

.wallet-page__title {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.wallet-page__sub {
  margin: 0;
}

/* 지갑 — 입금 주소 탭 (QR · 네트워크 · 복사) */
.wallet-panel--storedep {
  margin-top: 0;
}

.wallet-storedep-root {
  max-width: 52rem;
}

.wallet-storedep-empty {
  padding: 1rem 1.15rem;
  border-radius: 12px;
  border: 1px solid rgba(212, 167, 44, 0.35);
  background: rgba(212, 167, 44, 0.08);
}

.wallet-storedep-card {
  padding: 1.25rem 1.35rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, rgba(22, 27, 34, 0.95) 0%, rgba(13, 17, 23, 0.98) 100%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.wallet-storedep-admin-pill {
  display: inline-block;
  margin: 0 0 0.85rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #5eead4;
  border: 1px solid rgba(45, 212, 191, 0.45);
  background: rgba(45, 212, 191, 0.1);
}

.wallet-storedep-network-block {
  margin-bottom: 1.15rem;
}

.wallet-storedep-network-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.wallet-storedep-network-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}

.wallet-storedep-network-select {
  width: 100%;
  max-width: 28rem;
  margin-top: 0.25rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
}

.wallet-storedep-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem 1.5rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
  .wallet-storedep-main {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .wallet-storedep-addr-block {
    width: 100%;
  }
}

.wallet-storedep-qr-wrap {
  padding: 0.5rem;
  border-radius: 12px;
  background: #fff;
  line-height: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.wallet-storedep-qr {
  display: block;
  width: 220px;
  height: 220px;
  max-width: 100%;
}

.wallet-storedep-addr-block {
  min-width: 0;
}

.wallet-storedep-addr-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.wallet-storedep-addr-row {
  display: flex;
  gap: 0.35rem;
  align-items: stretch;
}

.wallet-storedep-addr-input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(13, 17, 23, 0.6);
  color: var(--text);
  font-size: 0.82rem;
}

.wallet-storedep-copy-btn {
  flex-shrink: 0;
  width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(45, 212, 191, 0.45);
  background: rgba(45, 212, 191, 0.12);
  color: #5eead4;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.wallet-storedep-copy-btn:hover {
  background: rgba(45, 212, 191, 0.2);
  border-color: rgba(45, 212, 191, 0.65);
}

.wallet-storedep-copy-btn--ok {
  border-color: rgba(63, 185, 80, 0.6);
  background: rgba(63, 185, 80, 0.2);
  color: #7ee787;
}

.wallet-storedep-chain-tag {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
}

.wallet-storedep-warnings {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(212, 167, 44, 0.08);
  border: 1px solid rgba(212, 167, 44, 0.28);
  margin-bottom: 1rem;
}

.wallet-storedep-warn-line {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #e3b341;
}

.wallet-storedep-warn-line + .wallet-storedep-warn-line {
  margin-top: 0.5rem;
}

.wallet-storedep-warn-icon {
  margin-right: 0.35rem;
}

.wallet-storedep-foot {
  margin: 0;
  line-height: 1.55;
  font-size: 0.82rem;
}

/* 스토어 페이지 — Gate UID로 운영 계정 충전 */
.store-uid-charge {
  margin-top: 1.35rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.store-uid-charge__title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.store-uid-charge__uid {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(63, 185, 80, 0.45);
  background: rgba(63, 185, 80, 0.08);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.store-uid-charge__label {
  display: block;
  margin: 0.65rem 0 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.store-uid-charge__avail {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
}

/* 금액만 짧은 폭 — 전체 카드 너비로 늘어나지 않게 */
.store-uid-charge__amt-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  align-items: center;
  width: fit-content;
  max-width: 100%;
}

.store-uid-charge__input {
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.store-uid-charge__input--amt {
  width: 11rem;
  max-width: calc(100vw - 8rem);
  box-sizing: border-box;
}

.store-uid-charge__submit {
  margin-top: 0.85rem;
}

/* 스토어 — UID 이체 확인 모달 */
.store-uid-dlg {
  padding: 0;
  border: none;
  background: transparent;
  max-width: calc(100vw - 1.5rem);
}

.store-uid-dlg::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.store-uid-dlg__panel {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  min-width: min(20rem, calc(100vw - 2rem));
  max-width: 22rem;
  box-sizing: border-box;
}

.store-uid-dlg__panel h4 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
}

.store-uid-dlg__lead {
  margin: 0 0 0.85rem;
  font-size: 0.84rem;
  line-height: 1.5;
}

.store-uid-dlg__field {
  margin-bottom: 0.55rem;
}

.store-uid-dlg__field label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.store-uid-dlg__field input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

.store-uid-dlg__err {
  margin: 0.35rem 0 0.5rem;
  min-height: 1.1rem;
  font-size: 0.82rem;
  color: var(--danger, #f85149);
}

.store-uid-dlg__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.store-uid-charge__msg {
  margin-top: 0.65rem;
  min-height: 1.2rem;
}

.wallet-page--cyan .wallet-tab--active {
  color: #5eead4;
  border-color: rgba(45, 212, 191, 0.55);
  background: rgba(45, 212, 191, 0.1);
}

.wallet-banner {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.wallet-banner--err {
  background: rgba(248, 81, 73, 0.12);
  border: 1px solid rgba(248, 81, 73, 0.35);
  color: #f0a8a4;
}

.wallet-tabs {
  display: flex;
  flex-wrap: nowrap !important;
  gap: 0.3rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
  padding-bottom: 0.2rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.wallet-tabs::-webkit-scrollbar {
  height: 3px;
}

.wallet-tabs::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.wallet-tab {
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  box-sizing: border-box;
}

.wallet-tab:hover {
  color: var(--text);
  border-color: var(--muted);
}

.wallet-tab--active {
  color: var(--accent);
  border-color: rgba(63, 185, 80, 0.45);
  background: rgba(63, 185, 80, 0.08);
}

.wallet-panel {
  margin-top: 0.5rem;
}

.wallet-bal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.wallet-bal-card {
  padding: 1rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.wallet-bal-card__label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.wallet-bal-card__main {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.wallet-bal-card__meta {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
}

.wallet-refresh-top {
  margin-bottom: 1.25rem;
}

.wallet-transfer-block {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.wallet-section-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.wallet-dir-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.wallet-dir-btn {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.wallet-dir-btn--active {
  color: #6ecbff;
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.08);
}

.wallet-field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.wallet-avail-hint {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
}

.wallet-amt-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.75rem;
  max-width: 22rem;
}

.wallet-input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

.wallet-select {
  width: 100%;
  max-width: 28rem;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.wallet-copy-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  max-width: 36rem;
}

.wallet-dep-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 640px) {
  .wallet-dep-layout {
    grid-template-columns: 1fr;
  }
}

.wallet-dep-qr-wrap {
  text-align: center;
}

.wallet-dep-qr {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}

.wallet-hist-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.wallet-hist-table td {
  vertical-align: top;
}

.wallet-amt-pos {
  color: var(--accent);
}

.wallet-amt-neg {
  color: var(--danger);
}

.wallet-xfer-submit {
  margin-top: 0.25rem;
}

.wallet-inline-msg {
  margin-top: 0.65rem;
  min-height: 1.2rem;
}

.wallet-warn {
  border-left: 3px solid var(--warn);
  padding-left: 0.65rem;
}

/* 회원 연동 — Gate API 등록 상태 카드 */
.gate-cred-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
  max-width: 36rem;
}

.gate-cred-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.gate-cred-status-card--ok {
  border-color: rgba(63, 185, 80, 0.4);
  background: rgba(63, 185, 80, 0.07);
}

.gate-cred-status-card__main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.gate-cred-status-card__label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.gate-cred-status-card__state {
  font-size: 0.95rem;
  font-weight: 600;
  color: #7ee787;
}

.gate-cred-status-card__preview {
  font-size: 0.78rem;
  margin-top: 0.1rem;
}

.gate-cred-status-card__sub {
  font-size: 0.75rem;
  margin-top: 0.05rem;
}

.gate-cred-status-card__icon {
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(63, 185, 80, 0.2);
  color: #7ee787;
}

.gate-cred-status-card__icon svg {
  width: 1rem;
  height: 1rem;
}

.gate-cred-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.25rem;
}

.gate-cred-btn-change {
  border: 1px solid rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.08);
  color: #6ecbff;
}

.gate-cred-btn-change:hover {
  border-color: rgba(56, 189, 248, 0.85);
  background: rgba(56, 189, 248, 0.14);
  color: #9fdcff;
}

.gate-cred-form-wrap {
  max-width: 36rem;
}

/* —— 연동 설정(톱니): 메인 폭 활용, 넓은 화면 3열(API | UID | 텔레그램) —— */
.integ-hub {
  width: 100%;
  max-width: min(72rem, 100%);
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
}

.integ-hub__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  font-weight: 600;
}

.integ-hub__lead {
  margin: 0 0 1.1rem;
  font-size: 0.84rem;
  line-height: 1.55;
  max-width: 48rem;
}

.integ-hub__body {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .integ-hub__body {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .integ-tg {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .integ-hub__body {
    /* 세 번째 열(텔레그램) 최소 폭 확보 — ON/OFF 토글이 찌그러지지 않게 */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(18.5rem, 1.25fr);
    gap: 1rem 1.25rem;
    align-items: stretch;
  }

  .integ-tg {
    grid-column: auto;
    min-width: 0;
    overflow: visible;
  }
}

.integ-tile {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 1rem 1.15rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  min-height: 5.75rem;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.12s;
  font: inherit;
  min-width: 0;
}

.integ-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.62;
  background: url("/static/integ-card-mesh.svg") center / cover no-repeat;
  pointer-events: none;
}

.integ-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    160deg,
    rgba(63, 185, 80, 0.12) 0%,
    transparent 52%
  );
  mix-blend-mode: screen;
}

.integ-tile > * {
  position: relative;
  z-index: 1;
}

.integ-tile--api::after {
  background: linear-gradient(
    155deg,
    rgba(88, 166, 255, 0.2) 0%,
    transparent 55%
  );
}

.integ-tile--uid::after {
  background: linear-gradient(
    155deg,
    rgba(163, 113, 247, 0.18) 0%,
    transparent 55%
  );
}

.integ-tile:hover {
  border-color: rgba(63, 185, 80, 0.5);
  box-shadow: 0 0 0 1px rgba(63, 185, 80, 0.12), 0 8px 28px rgba(0, 0, 0, 0.35);
}

.integ-tile:active {
  transform: scale(0.992);
}

.integ-tile__label {
  font-weight: 600;
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
}

.integ-tile__sub {
  font-size: 0.75rem;
  margin-top: 0.2rem;
}

.integ-tile__status {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}

.integ-hub__foot {
  margin: 1.15rem 0 0;
  font-size: 0.78rem;
  max-width: 48rem;
}

/* 연동 페이지 하단: 회원정보(비번·이체비번·탈퇴) */
.integ-account {
  margin-top: 1.65rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
}

.integ-account__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 600;
}

.integ-account__lead {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  line-height: 1.55;
  max-width: 52rem;
}

.integ-account__grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .integ-account__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }
}

.integ-account__panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-sizing: border-box;
  min-width: 0;
}

/* 제목+안내 블록 높이 통일 → 첫 입력 줄이 3열에서 같은 높이에 맞춤 */
.integ-account__panel-intro {
  flex: 0 0 auto;
  min-height: 5.85rem;
  margin-bottom: 0.55rem;
}

.integ-account__panel-intro h3 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.integ-account__panel-desc {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  min-height: 2.95rem;
}

.integ-account__field-slots {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

/* 한 줄(라벨+입력) 높이 통일 — 빈 슬롯·숨김 필드도 같은 줄 위치 유지 */
.integ-account__field-slot {
  flex: 0 0 auto;
  min-height: 4.45rem;
  box-sizing: border-box;
}

.integ-account__field-slot .field {
  margin-bottom: 0;
}

.integ-account__field-slot--spacer {
  visibility: hidden;
  pointer-events: none;
}

.integ-account__panel-actions {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 0.35rem;
}

.integ-account__btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.integ-account__panel .field {
  margin-bottom: 0;
}

.integ-account__panel label.hint {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
}

.integ-account__panel input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.88rem;
}

.integ-account__msg {
  margin: 0.45rem 0 0;
  min-height: 1.1rem;
  font-size: 0.78rem;
}

.integ-account__panel--danger {
  border-color: rgba(248, 81, 73, 0.35);
}

@media (max-width: 959px) {
  .integ-account__panel {
    height: auto;
    min-height: 0;
  }

  .integ-account__panel-intro {
    min-height: 0;
  }

  .integ-account__panel-desc {
    min-height: 0;
  }

  .integ-account__field-slot,
  .integ-account__field-slot--spacer {
    min-height: 0;
  }

  .integ-account__field-slot--spacer {
    display: none;
  }

  .integ-account__panel-actions {
    margin-top: 0.25rem;
  }
}

.integ-tg {
  position: relative;
  isolation: isolate;
  overflow: visible;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-sizing: border-box;
  min-width: 0;
}

.integ-tg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  opacity: 0.55;
  background: url("/static/integ-card-mesh.svg") center / cover no-repeat;
  pointer-events: none;
}

.integ-tg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    200deg,
    rgba(240, 136, 62, 0.14) 0%,
    transparent 58%
  );
  mix-blend-mode: screen;
}

.integ-tg__head,
.integ-tg__row,
.integ-tg__msg,
.integ-tg__hint {
  position: relative;
  z-index: 1;
}

.integ-tg__head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.5rem;
}

.integ-tg__howto-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #e53935;
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(229, 57, 53, 0.25);
}

.integ-tg__howto-btn:hover {
  border-color: #ff5252;
  color: #ffcdd2;
  background: rgba(229, 57, 53, 0.12);
}

.integ-tg__head-warn {
  font-size: 0.68rem !important;
  color: var(--warn, #fbbf24) !important;
}

@media (min-width: 1024px) {
  .integ-tg {
    display: flex;
    flex-direction: column;
  }
}

.integ-tg__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.integ-tg__title {
  font-weight: 600;
  font-size: 0.95rem;
}

.integ-tg__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
}

/* 한 줄 강제(notify) 제거: 좁은 3열에서 토글이 0폭으로 찌그러짐 방지 → 줄바꿈 허용 */

.integ-tg__input {
  flex: 1 1 12rem;
  min-width: 8rem;
  max-width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.88rem;
}

.integ-tg__save {
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  flex: 0 0 auto;
}

.integ-tg__test {
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  flex: 0 0 auto;
}

/* OFF/ON: 절대 줄어들지 않게 — 클릭 영역 유지 */
.integ-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  flex-shrink: 0;
  min-width: 6.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.integ-toggle__btn {
  flex: 1 1 50%;
  min-width: 2.75rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}

.integ-toggle__btn--active {
  background: rgba(63, 185, 80, 0.22);
  color: var(--accent);
}

.integ-tg__msg {
  margin: 0.45rem 0 0;
  min-height: 1.15rem;
  font-size: 0.8rem;
}

.integ-tg__hint {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
}

.integ-dlg {
  padding: 0;
  border: none;
  background: transparent;
  max-width: calc(100vw - 1.5rem);
}

.integ-dlg::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.integ-dlg__panel {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.15rem 1.15rem;
  max-width: 28rem;
  width: min(28rem, 94vw);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.integ-dlg__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.integ-dlg__h {
  margin: 0;
  font-size: 1.05rem;
}

.integ-dlg__close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.integ-dlg__close:hover {
  color: var(--text);
}

.integ-dlg__lead {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  line-height: 1.5;
}

.integ-dlg__okgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  font-size: 0.85rem;
}

/* 텔레그램 알림 — 설정방법 소형 모달 */
.integ-dlg--tg-howto .integ-dlg__panel--tg-howto {
  max-width: 24rem;
  width: min(24rem, 94vw);
  padding: 0.95rem 1.1rem 1.1rem;
}

.integ-dlg--tg-howto .integ-dlg__h {
  font-size: 1.08rem;
  line-height: 1.35;
}

.integ-tg-howto-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.58;
  color: var(--muted);
}

.integ-tg-howto-list > li {
  margin: 0.5rem 0;
}

.integ-tg-howto-list > li::marker {
  color: var(--text);
  font-weight: 600;
}

.integ-tg-howto-li-text {
  margin: 0 0 0.4rem;
}

.integ-tg-howto-avatar {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0.35rem 0 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.integ-tg-howto code {
  font-size: 0.92em;
  padding: 0.08rem 0.25rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

/* 어두운 배경에서도 링크가 잘 보이게 (기본 파랑 대비) */
.integ-tg-howto a.integ-tg-howto-link {
  color: #7dd3fc;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.integ-tg-howto a.integ-tg-howto-link:hover {
  color: #bae6fd;
}

.integ-tg-howto-note {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.82rem;
  opacity: 0.95;
}

.integ-tg-howto-foot {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
}
