/* ═══════════════════════════════════════════════════════════════════════════
   Onfinance 디자인 시스템 — 라이트 모드 · 엔터프라이즈

   Stripe · Linear · Mercury 를 실제로 띄워 계산된 스타일을 측정하고 잡은
   방향이다. 세 서비스 모두 같은 곳을 가리켰다:

     · border-radius 최빈값이 0 / 2 / 4 / 6px — 크게 둥글리지 않는다
     · box-shadow 최빈값이 none — 카드를 띄우지 않고 **선으로 나눈다**
     · 배경은 흰색. 회색 바탕에 흰 카드를 얹는 구조가 아니다

   그래서 이 시스템의 규칙은 이렇다:

   **면이 아니라 선으로 구분한다.** 이전에는 회색 배경 위에 흰 카드를 띄워
   영역을 나눴다. 카드가 늘어날수록 화면이 조각나고, 그림자 때문에 정보
   밀도를 올릴 수 없다. 이제는 흰 바탕에 1px 헤어라인으로 나눈다 — 표·목록·
   폼이 같은 평면에 놓여 스캔이 빨라진다.

   **강조색을 아낀다.** 주 버튼은 파랑이 아니라 잉크(거의 검정)다. 색은
   상태(성공·경고·위험)에만 남긴다. 파란 버튼이 화면마다 있으면 정작 위험한
   동작이 눈에 안 띈다. 금융 화면에서 색은 장식이 아니라 신호여야 한다.

   **숫자를 글자와 다르게 다룬다.** 금액은 tabular-nums 고정폭으로 세로가
   맞아야 표에서 자릿수를 눈으로 비교할 수 있다.

   외부 폰트·CDN 을 쓰지 않는다. Caddy 가 정적 파일로만 서비스하고 네트워크
   의존을 늘리지 않기 위해서다. Pretendard 가 있으면 쓰고 없으면 시스템
   한글 폰트로 떨어진다.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── 브랜드 네이비 — 이 서비스의 구조색 ─────────────────────────────────
     중립 잉크(거의 검정) 대신 짙은 네이비를 쓴다. 검정은 안전하지만 아무
     성격이 없어서, 화면을 다 만들고 나면 "어느 회사 제품인지" 가 남지 않는다.
     네이비는 금융에서 오래 쓰인 색이라 신뢰를 기본값으로 갖고, 빨강·초록
     상태색과도 싸우지 않는다(파랑 계열 중 채도가 낮아서다).

     네비게이션 면 전체를 이 색으로 칠한다. 강조색을 버튼에만 조금씩 뿌리는
     것보다, 큰 면 하나를 브랜드 색으로 두는 편이 정체성이 훨씬 강하게 남는다. */
  --navy-950: #071528;
  --navy-900: #0b1f38;
  --navy-800: #102845;
  --navy-700: #17395f;
  --navy-600: #1d4e89;
  --navy-500: #2a6bb0;
  --navy-200: #b9cee6;
  --navy-100: #dbe7f4;
  --navy-50: #eff4fa;

  /* 이전 이름(잉크)을 참조하는 규칙이 남아 있어도 네이비를 따르게 한다 */
  --ink-900: var(--navy-900);
  --ink-800: var(--navy-800);
  --ink-700: var(--navy-700);

  /* ── 강조 — 링크·포커스·선택. 브랜드와 같은 계열로 둔다.
     보라 강조 + 네이비 구조색처럼 두 색을 쓰면 화면이 어수선해진다. ─────── */
  --accent-50: var(--navy-50);
  --accent-100: var(--navy-100);
  --accent-300: var(--navy-200);
  --accent-500: var(--navy-600);
  --accent-600: var(--navy-700);
  --accent-700: var(--navy-800);

  /* ── 중립 — 정보 위계의 뼈대.
     간격을 좁게 잡아 헤어라인이 배경과 구분되면서도 튀지 않게 한다. ──── */
  --grey-0: #ffffff;
  --grey-50: #fafafa;
  --grey-100: #f4f5f6;
  --grey-200: #e8eaed;
  --grey-300: #dcdfe3;
  --grey-400: #b4b9c0;
  --grey-500: #868d97;
  --grey-600: #5f6672;
  --grey-700: #434952;
  --grey-800: #2b2f37;
  --grey-900: #16181d;

  /* ── 의미색 — 상태에만 쓴다 ─────────────────────────────────────────── */
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-200: #fecaca;
  --red-500: #dc2626;
  --red-600: #b91c1c;
  --green-50: #f0fdf4;
  --green-500: #16a34a;
  --green-600: #15803d;
  --yellow-50: #fffbeb;
  --yellow-500: #d97706;
  --yellow-700: #b45309;
  --violet-50: var(--accent-50);
  --violet-500: var(--accent-500);

  /* 이전 이름으로 참조하는 규칙이 남아 있어도 새 팔레트를 따르도록 별칭을
     남긴다. 값은 전부 위의 accent 를 가리킨다. */
  --blue-50: var(--accent-50);
  --blue-100: var(--accent-100);
  --blue-200: var(--accent-300);
  --blue-300: var(--accent-300);
  --blue-400: var(--accent-500);
  --blue-500: var(--accent-500);
  --blue-600: var(--accent-600);
  --blue-700: var(--accent-700);
  --blue-800: var(--accent-700);
  --blue-900: var(--accent-700);

  /* ── 시맨틱 별칭 ─────────────────────────────────────────────────────── */
  --bg: var(--grey-0);          /* 바탕이 흰색이다 — 회색 아니다 */
  --bg-sunken: var(--grey-50);  /* 안으로 들어간 영역(코드·요약)에만 */
  --bg-elevated: var(--grey-0);
  --border: var(--grey-200);
  --border-strong: var(--grey-300);
  --text: var(--grey-900);
  --text-secondary: var(--grey-600);
  --text-tertiary: var(--grey-500);
  --text-disabled: var(--grey-400);
  --primary: var(--navy-800);
  --link: var(--navy-600);

  /* 네비게이션 면(사이드바) — 짙은 네이비 위 밝은 글자 */
  --nav-bg: var(--navy-900);
  --nav-fg: #e8eef6;
  --nav-fg-dim: #8ba3c0;
  --nav-border: rgba(255, 255, 255, 0.09);
  --nav-hover: rgba(255, 255, 255, 0.07);
  --nav-active: rgba(255, 255, 255, 0.13);

  /* ── 치수 — 레퍼런스 실측 최빈값(0/2/4/6)에 맞춘다 ───────────────────── */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --radius-full: 9999px;

  /* 그림자는 기본적으로 쓰지 않는다. 화면 위에 실제로 떠 있는 것(드롭다운·
     모달·토스트)만 남기고, 카드는 테두리로 구분한다. */
  --shadow-sm: none;
  --shadow: none;
  --shadow-md: 0 1px 2px rgba(16, 24, 40, 0.04), 0 2px 6px -1px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 2px 4px rgba(16, 24, 40, 0.04), 0 8px 20px -6px rgba(16, 24, 40, 0.1);
  --shadow-modal: 0 4px 8px rgba(16, 24, 40, 0.06), 0 20px 48px -12px rgba(16, 24, 40, 0.18);
  --shadow-brand: none;

  /* ── 간격 — 4px 배수 한 벌만 쓴다 ──────────────────────────────────────
     화면마다 눈대중으로 16/18/20 을 섞으면 세로 리듬이 깨진다. 아래 값
     바깥의 숫자를 쓰지 않는 것이 규칙이다. */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* 섹션 사이 — 본문 블록 간격의 기준 */
  --sp-section: 40px;
  /* 페이지 좌우 여백 (데스크탑 / 모바일) */
  --gutter: 32px;
  --gutter-sm: 16px;

  --sidebar-width: 248px;
  --header-height: 60px;

  --font: 'Pretendard', 'Pretendard Variable', -apple-system, BlinkMacSystemFont,
    'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif;
  --font-num: var(--font);
}


/* ═══════════════════════════════════════════════════════════════════════════
   리셋
   ═══════════════════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

/* hidden 속성은 어떤 display 규칙보다 세다 — 컴포넌트가 flex/grid 를
   가져도 hidden 이면 사라져야 한다. 이 가드가 없어서 결제 화면에
   빈 확인 카드가 떠 있었다. */
[hidden] { display: none !important; }

::selection { background: var(--navy-100); color: var(--navy-900); }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

img,
svg {
  display: block;
  max-width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   타이포그래피
   ═══════════════════════════════════════════════════════════════════════════ */

.t-display {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.3;
}
.t-h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.35;
}
.t-h2 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.4;
}
.t-h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.t-body {
  font-size: 15px;
  font-weight: 400;
}
.t-body-strong {
  font-size: 15px;
  font-weight: 600;
}
.t-sm {
  font-size: 13px;
}
.t-xs {
  font-size: 12px;
}

.t-secondary {
  color: var(--text-secondary);
}
.t-tertiary {
  color: var(--text-tertiary);
}
.t-primary {
  color: var(--primary);
}
.t-danger {
  color: var(--red-500);
}
.t-success {
  color: var(--green-600);
}
.t-warn {
  color: var(--yellow-700);
}

/* 금액 — 토스에서 가장 중요한 요소. 크고 굵고 숫자 간격을 고르게. */
.amount {
  font-family: var(--font-num);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
}
.amount-xl {
  font-size: 32px;
}
.amount-lg {
  font-size: 24px;
}
.amount-md {
  font-size: 19px;
}
.amount-sm {
  font-size: 15px;
}
.amount-unit {
  font-size: 0.65em;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-left: 2px;
}
/* 표 안의 숫자는 자릿수를 맞춘다 */
.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   레이아웃
   ═══════════════════════════════════════════════════════════════════════════ */

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
}
.container-wide {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

.stack {
  display: flex;
  flex-direction: column;
}
.stack-2 {
  gap: 8px;
}
.stack-3 {
  gap: 12px;
}
.stack-4 {
  gap: 16px;
}
.stack-6 {
  gap: 24px;
}
.stack-8 {
  gap: 32px;
}

.row {
  display: flex;
  align-items: center;
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.row-gap-2 {
  gap: 8px;
}
.row-gap-3 {
  gap: 12px;
}
.row-gap-4 {
  gap: 16px;
}
.grow {
  flex: 1;
  min-width: 0;
}
.wrap {
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: 16px;
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.hidden {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   카드
   ═══════════════════════════════════════════════════════════════════════════ */

/* 카드는 떠 있지 않다. 흰 바탕 위에 테두리로 영역만 표시한다.
   그림자를 빼면 카드가 여러 개 붙어 있어도 화면이 조각나지 않는다. */
.card {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
}
.card-flat {
  background: var(--bg-sunken);
  border-radius: var(--radius-lg);
  border: none;
  padding: 20px;
}
.card-tight {
  padding: 16px;
}
.card-hover {
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  cursor: pointer;
}
/* 호버는 그림자로 띄우지 않고 테두리를 진하게 + 바탕을 아주 옅게.
   목록에서 커서를 옮길 때 행이 들썩이지 않는다. */
.card-hover:hover {
  border-color: var(--grey-400);
  background: var(--grey-50);
}
.card-hover:active {
  background: var(--grey-100);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   버튼
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.1px;
  transition: background-color 0.15s, opacity 0.15s, transform 0.08s;
  white-space: nowrap;
  user-select: none;
}
.btn:active:not(:disabled) {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 주 버튼은 잉크다. 파란 버튼이 화면마다 있으면 정작 위험한 동작(취소·
   분쟁·소각)이 눈에 안 띈다. 색은 상태에만 남긴다. */
.btn-primary {
  background: var(--navy-800);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--navy-700);
}

/* 보조 버튼은 회색 면이 아니라 테두리다 — 주 버튼과 무게가 확실히 갈린다 */
.btn-secondary {
  background: var(--grey-0);
  color: var(--grey-800);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--grey-200);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--grey-50);
  border-color: var(--border-strong);
}

.btn-danger {
  background: var(--red-500);
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  background: var(--red-600);
}

.btn-text {
  height: auto;
  padding: 4px 6px;
  background: none;
  color: var(--primary);
  font-weight: 600;
}
.btn-text:hover:not(:disabled) {
  text-decoration: underline;
}

.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}
.btn-lg {
  height: 56px;
  font-size: 17px;
  border-radius: var(--radius-lg);
}
.btn-block {
  width: 100%;
}

/* 하단 고정 CTA — 모바일 유저 화면의 주 행동 */
.btn-fixed {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
  z-index: 40;
}
.btn-fixed .btn {
  max-width: 440px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   입력
   ═══════════════════════════════════════════════════════════════════════════ */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.field-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}
.field-error {
  font-size: 12px;
  color: var(--red-500);
  font-weight: 500;
}

.input,
.select,
.textarea {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  font-size: 14.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.6;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px var(--blue-50);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--text-disabled);
}
.input:disabled,
.select:disabled {
  background: var(--grey-100);
  color: var(--text-disabled);
}
.input-error {
  border-color: var(--red-500);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%238B95A1' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}

/* 금액 입력 — 크고 굵게, 오른쪽에 단위 */

.search {
  position: relative;
}
.search .input {
  padding-left: 40px;
}
.search::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Ccircle cx='7' cy='7' r='5.25' stroke='%238B95A1' stroke-width='1.5'/%3E%3Cpath d='M11 11L14.5 14.5' stroke='%238B95A1' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat center;
  pointer-events: none;
}

/* 체크박스 */
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.check input {
  appearance: none;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  background: var(--bg-elevated);
  transition: background-color 0.12s, border-color 0.12s;
}
.check input:checked {
  background: var(--blue-500)
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none'%3E%3Cpath d='M3 7.5L6 10.5L11.5 4' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat center;
  border-color: var(--blue-500);
}
.check-label {
  font-size: 14px;
  line-height: 22px;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   뱃지 · 태그
   ═══════════════════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  border-radius: 3px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border);
  /* 테두리를 글자색에서 뽑되 옅게 — 진하면 배지가 버튼처럼 보인다.
     color-mix 를 못 읽는 브라우저는 위의 회색 테두리로 떨어진다. */
  border-color: color-mix(in srgb, currentColor 22%, transparent);
  /* 테두리를 글자색으로 두고 배경만 옅게 — 알약보다 조밀하고, 상태가
     여러 개 나열될 때 서로 구분된다 */
  box-shadow: inset 0 0 0 999px var(--badge-bg, transparent);
}
.badge-blue {
  --badge-bg: var(--blue-50);
  color: var(--blue-700);
}
.badge-grey {
  --badge-bg: var(--grey-100);
  color: var(--grey-700);
}
.badge-green {
  --badge-bg: var(--green-50);
  color: var(--green-600);
}
.badge-red {
  --badge-bg: var(--red-50);
  color: var(--red-600);
}
.badge-yellow {
  --badge-bg: var(--yellow-50);
  color: var(--yellow-700);
}
.badge-violet {
  --badge-bg: var(--violet-50);
  color: var(--violet-500);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-green { background: var(--green-500); }
.dot-red { background: var(--red-500); }
.dot-yellow { background: var(--yellow-500); }
.dot-grey { background: var(--grey-400); }

/* ═══════════════════════════════════════════════════════════════════════════
   목록 · 테이블
   ═══════════════════════════════════════════════════════════════════════════ */

.list {
  display: flex;
  flex-direction: column;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child {
  border-bottom: none;
}
.list-item-clickable {
  cursor: pointer;
  transition: background-color 0.12s;
  margin: 0 -12px;
  padding: 16px 12px;
  border-radius: var(--radius);
}
.list-item-clickable:hover {
  background: var(--grey-50);
}

/* 키-값 행 — 영수증·상세 정보 */
.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}
.kv-key {
  font-size: 14px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.kv-val {
  font-size: 14px;
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}
.kv-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}
.kv-total {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}
.kv-total .kv-key {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* 엔터프라이즈 테이블 */
/* 표를 상자에 가두지 않는다. 위아래 규칙선만 두면 표가 페이지의 일부로
   읽히고, 열이 많아도 상자 모서리와 싸우지 않는다 (Stripe 계열). */
.table-wrap {
  overflow-x: auto;
  background: var(--bg-elevated);
  border-top: 1px solid var(--grey-300);
  border-bottom: 1px solid var(--grey-300);
}
.table {
  min-width: 100%;
  font-size: 13px;
}
.table th {
  position: sticky;
  top: 0;
  background: var(--grey-0);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  white-space: nowrap;
  border-bottom: 1px solid var(--grey-300);
  z-index: 1;
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td {
  border-bottom: none;
}
.table tbody tr:hover {
  background: var(--grey-50);
}
/* 금액·수량은 고정폭 숫자여야 표에서 자릿수가 세로로 맞는다 */
.table .num,
.num,
.metric-value,
.amount {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}
.table-clickable tbody tr {
  cursor: pointer;
}
.table .num {
  font-family: var(--font-num);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   내비게이션 — 엔터프라이즈 사이드바 (어드민 · 파트너)
   ═══════════════════════════════════════════════════════════════════════════ */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  /* 100vh 는 모바일 브라우저의 주소창 영역까지 포함해, 맨 아래(로그아웃)가
     화면 밖으로 잘려 누를 수 없었다. dvh 는 실제 보이는 높이를 따른다. */
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--header-height);
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--blue-500);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.sidebar-nav {
  padding: 12px;
  flex: 1;
}
.nav-section {
  margin-top: 16px;
}
.nav-section:first-child {
  margin-top: 0;
}
.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-disabled);
  letter-spacing: 0.4px;
  padding: 0 12px 6px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background-color 0.12s, color 0.12s;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.nav-item:hover {
  background: var(--grey-50);
  color: var(--text);
}
.nav-item.active {
  background: var(--blue-50);
  color: var(--blue-700);
  font-weight: 600;
}
.nav-count {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--red-500);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.content {
  padding: 24px;
  flex: 1;
}

/* 모바일 하단 탭 (유저 화면) */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(58px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 50;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  transition: color 0.12s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
/* 누르는 순간 반응이 있어야 "눌렸다" 를 안다 — 모바일에는 hover 가 없다 */
.tab:active { transform: translateY(1px); }
.tab.active {
  color: var(--navy-800);
  font-weight: 650;
}
/* 활성 탭의 아이콘 뒤에 알약 배경 — 글자색만으로는 흘끗 봐서 안 잡힌다 */
.tab.active::before {
  content: '';
  position: absolute;
  top: 6px;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--navy-50);
  z-index: -1;
}
.tab-icon {
  font-size: 19px;
  line-height: 1;
}

.appbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 4px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 30;
}
.appbar-back {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  font-size: 20px;
  color: var(--text-secondary);
}
.appbar-back:hover {
  background: var(--grey-100);
}
.appbar-title {
  font-size: 17px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   모달 — 돈이 오가는 행동은 전부 2단계 확인 (SPEC_PAGES 공통 UX 1)
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(25, 31, 40, 0.45);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
  animation: fade 0.15s ease;
}
.modal {
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 400px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  animation: pop 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal-wide {
  max-width: 760px;
}
/* 확인 모달 머리 아이콘 — 파괴적 작업이면 붉게 */
.modal-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--blue-50);
  color: var(--blue-600);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}
.modal-icon-danger {
  background: var(--red-50);
  color: var(--red-500);
}
.modal-title {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}
.modal-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}
.modal-actions .btn {
  flex: 1;
}

@keyframes fade {
  from { opacity: 0; }
}
@keyframes pop {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   토스트
   ═══════════════════════════════════════════════════════════════════════════ */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
  width: calc(100% - 40px);
  max-width: 400px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--grey-900);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  line-height: 1.5;
  /* 토스트를 눌러 즉시 닫을 수 있게 — 호스트는 pointer-events:none 이다 */
  pointer-events: auto;
  cursor: pointer;
}
.toast .icon {
  flex-shrink: 0;
  margin-top: 1px;
}
.toast-error {
  background: var(--red-500);
}
.toast-success {
  background: var(--green-600);
}
.toast-warning {
  background: var(--yellow-700);
}
.toast-out {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   상태 표시
   ═══════════════════════════════════════════════════════════════════════════ */

/* 진행 스테퍼 — 거래룸 상단 */
.stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}
.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.step-dot {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--grey-200);
  transition: background-color 0.3s;
}
.step.done .step-dot,
.step.current .step-dot {
  background: var(--blue-500);
}
.step-label {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.step.current .step-label {
  color: var(--blue-600);
  font-weight: 600;
}

/* 카운트다운 — 타이머가 있는 상태는 항상 노출 (SPEC_PAGES 공통 UX 2) */
.countdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.countdown-urgent {
  background: var(--red-50);
  color: var(--red-600);
  /* 5분 미만 — 색만 바꾸면 이미 보고 있던 사람은 변화를 놓친다.
     느린 맥박 한 번이 "시간이 얼마 없다" 를 시선 밖에서도 알린다. */
  animation: countdown-pulse 1.8s ease-in-out infinite;
}
@keyframes countdown-pulse {
  50% { background: var(--red-100); }
}

/* 빈 상태 */
.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-tertiary);
}
/* 아이콘을 옅은 원 안에 넣는다. 선 아이콘만 두면 허전하고 시선이 안 잡힌다. */
.empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: var(--radius-full);
  background: var(--grey-100);
  color: var(--grey-500);
  display: grid;
  place-items: center;
}
.empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.empty-desc {
  font-size: 13px;
  line-height: 1.6;
  max-width: 280px;
  margin: 0 auto;
}

/* 스켈레톤 */
.skeleton {
  background: linear-gradient(90deg, var(--grey-100) 25%, var(--grey-200) 37%, var(--grey-100) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
.skeleton-line {
  height: 13px;
}
.skeleton-list {
  display: flex;
  flex-direction: column;
}
.skeleton-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.skeleton-row:last-child {
  border-bottom: none;
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* 알림 배너 */
.banner {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.6;
  text-align: left;
}
.banner-body {
  min-width: 0;
}
.banner-title {
  font-weight: 700;
  margin-bottom: 2px;
}
.banner-info {
  background: var(--blue-50);
  color: var(--blue-800);
}
.banner-warn {
  background: var(--yellow-50);
  color: var(--yellow-700);
}
.banner-danger {
  background: var(--red-50);
  color: var(--red-600);
}
.banner-success {
  background: var(--green-50);
  color: var(--green-600);
}
/* 팁 — 정보성이지만 파랑(=진행 안내)과 구분해야 하는 부가 설명 */
.banner-tip {
  background: var(--grey-50);
  color: var(--text-secondary);
}
.banner-icon {
  flex-shrink: 0;
  /* 아이콘 중심을 첫 줄 텍스트 중심에 맞춘다 (line-height 1.6, 13px → 20.8px) */
  height: 20.8px;
  display: grid;
  place-items: center;
  opacity: 0.9;
}

/* 구분선 */
.divider {
  height: 1px;
  background: var(--border);
  border: none;
  margin: 20px 0;
}
.divider-thick {
  height: 8px;
  background: var(--grey-100);
  border: none;
  margin: 24px -20px;
}

/* 필터 바 */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.chip {
  /* 높이만 주고 정렬을 안 하면 텍스트가 위로 붙는다 — button 의 기본
     display 가 inline-block 이라 세로 가운데가 자동으로 잡히지 않는다.
     flex 로 명시해야 글자 크기가 달라져도 계속 가운데에 온다. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.12s;
}
.chip:hover {
  border-color: var(--border-strong);
}
.chip.active {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
  font-weight: 600;
}

/* 로딩 스피너 */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-dark {
  border-color: var(--grey-300);
  border-top-color: var(--grey-700);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.page-loading {
  display: grid;
  place-items: center;
  min-height: 240px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   반응형
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .content,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* 페이지 헤더의 액션 버튼이 제목 아래로 내려가 전체 폭을 쓴다 */
  .page-title {
    align-items: flex-start;
  }
  .page-title .row-gap-2 {
    width: 100%;
  }
  .page-title .btn {
    flex: 1;
  }

  /* 모달을 바텀시트로 — 좁은 화면에서 가운데 뜬 카드는 닫기 버튼이 멀다 */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
    animation: sheet-up 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
  }
  .modal-wide {
    max-width: 100%;
  }
  /* 손가락으로 끌어내릴 수 있음을 암시하는 손잡이 */
  .modal::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--grey-300);
    margin: -6px auto 14px;
  }
  .modal-actions {
    flex-direction: column-reverse;
  }
  .modal-actions .btn {
    width: 100%;
    height: 48px;
  }
}

@keyframes sheet-up {
  from { transform: translateY(100%); }
}

@media (max-width: 480px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    /* `1fr` 만 쓰면 안 된다 — 1fr 의 최소값은 auto 라, 금액 입력처럼
       최소폭이 큰 내용이 있으면 열이 화면보다 넓어져 가로 스크롤이 생긴다.
       minmax(0, 1fr) 이어야 내용이 열에 맞춰 줄어든다. */
    grid-template-columns: minmax(0, 1fr);
  }
  .amount-xl {
    font-size: 28px;
  }
  .t-display {
    font-size: 26px;
  }
  .t-h1 {
    font-size: 20px;
  }
  .card {
    padding: 16px;
  }
  /* 손가락 조작 최소 크기 (WCAG 2.5.5) */
  .btn,
  .chip,
  .tab,
  .nav-item {
    min-height: 44px;
  }
  .btn-sm {
    min-height: 36px;
  }
}

/* 유저 앱은 하단 탭바 높이만큼 여백을 준다 */
.has-tabbar {
  padding-bottom: calc(70px + env(safe-area-inset-bottom));
}
.has-fixed-cta {
  padding-bottom: 88px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   아이콘 (Lucide)

   stroke 가 currentColor 이므로 부모의 color 를 그대로 상속한다. 색을 따로
   지정하지 말고 부모 텍스트 색을 맞추는 쪽으로 쓴다.
   ═══════════════════════════════════════════════════════════════════════════ */

.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* 아이콘 + 텍스트를 나란히 놓는 버튼 (btn 은 이미 inline-flex 라 gap 만 준다) */
.btn .icon {
  margin-right: 6px;
  margin-left: -2px;
}
.btn-icon-only {
  padding: 0;
  width: 40px;
}
.btn-icon-only .icon {
  margin: 0;
}
.btn-sm.btn-icon-only {
  width: 34px;
}

/* 목록 행 오른쪽 꺾쇠 — 눌러서 들어가는 행임을 알린다 */
.chevron {
  color: var(--grey-400);
  flex-shrink: 0;
  transition: transform 0.12s, color 0.12s;
}
.list-item-clickable:hover .chevron {
  color: var(--text-tertiary);
  transform: translateX(2px);
}

/* 원형 아이콘 배지 — 목록 행 왼쪽, 통계 카드 머리 */
.icon-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--grey-100);
  color: var(--grey-600);
}
.icon-badge-blue {
  background: var(--blue-50);
  color: var(--blue-600);
}
.icon-badge-green {
  background: var(--green-50);
  color: var(--green-600);
}
.icon-badge-red {
  background: var(--red-50);
  color: var(--red-500);
}
.icon-badge-yellow {
  background: var(--yellow-50);
  color: var(--yellow-700);
}
.icon-badge-lg {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
}

/* 하단 탭 — 활성 탭만 stroke 를 굵혀 채워진 느낌을 준다 */
.tab .icon {
  transition: transform 0.14s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.tab.active .icon {
  stroke-width: 2.4;
  transform: translateY(-1px);
}

/* 사이드바 내비 아이콘은 비활성일 때 한 톤 흐리게 */
.nav-item .icon {
  color: var(--grey-500);
  transition: color 0.12s;
}
.nav-item:hover .icon,
.nav-item.active .icon {
  color: inherit;
}

/* ═══════════════════════════════════════════════════════════════════════════
   상호작용 다듬기
   ═══════════════════════════════════════════════════════════════════════════ */

/* 키보드 사용자에게만 포커스 링을 보인다. 마우스 클릭에는 링이 남지 않는다. */
:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.btn:focus-visible {
  outline-offset: 3px;
}

/* 누를 때 살짝 눌리는 느낌 — 토스 특유의 촉각 피드백 */
.btn:not(:disabled):active {
  transform: scale(0.985);
}
.tab:active .icon {
  transform: scale(0.9);
}

/* 로딩 중 버튼은 폭이 고정되므로 스피너만 가운데 정렬 */
.btn[aria-busy='true'] {
  cursor: progress;
}

/* 숫자는 전부 자리 폭을 맞춘다 — 금액이 흔들리면 신뢰가 떨어진다 */
.amount,
.amount-xl,
.kv-val,
.table td,
.stat-value,
.mono {
  font-variant-numeric: tabular-nums;
}
.mono {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  letter-spacing: -0.2px;
}

/* 페이지 전환 시 살짝 떠오르게 — 라우터가 매번 innerHTML 을 갈아끼운다 */
.view-enter {
  animation: view-in 0.18s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
}

/* 움직임을 줄이도록 설정한 사용자에게는 애니메이션을 끈다 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   결제 완료 영수증 · 체크리스트
   ═══════════════════════════════════════════════════════════════════════════ */

.receipt-head {
  text-align: center;
  margin-bottom: 32px;
}
/* 성공 체크 — 원이 먼저 커지고 체크가 그려진다 */
.receipt-check {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: var(--radius-full);
  background: var(--green-50);
  color: var(--green-600);
  display: grid;
  place-items: center;
  animation: pop-in 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.5); }
}

/* 완료된 준비 단계 */
.step-done {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-tertiary);
}
.step-check {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--green-500);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.step-done .t-h3 {
  color: var(--text-secondary);
}

/* 어드민 위험 구역 — 아이콘을 본문 옆에 정렬 */
.danger-zone {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.danger-zone .icon {
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   정보 밀도 다듬기 (엔터프라이즈 화면)
   ═══════════════════════════════════════════════════════════════════════════ */

/* 표 행에 마우스를 올리면 짚어준다 — 가로로 긴 표에서 줄을 놓치지 않게 */
.table tbody tr {
  transition: background-color 0.1s;
}
.table tbody tr:hover {
  background: var(--grey-50);
}
.table-row-clickable {
  cursor: pointer;
}

/* 통계 카드 — 아이콘 + 라벨 + 값 + 증감 */
.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.stat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 10px;
}
.stat-value {
  font-family: var(--font-num);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.2;
}
.stat-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

/* 목록 행 왼쪽 아이콘 + 본문 + 오른쪽 값 */
.row-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
}
.row-item-body {
  flex: 1;
  min-width: 0;
}
.row-item-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-item-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* 여러 줄이 넘칠 때 말줄임 */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 값 옆에 붙는 복사 버튼 — 계좌번호·코드처럼 그대로 옮겨 적어야 하는 값 */
.btn-copy {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-left: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  vertical-align: middle;
  transition: background-color 0.12s, color 0.12s;
}
.btn-copy:hover {
  background: var(--grey-100);
  color: var(--text);
}
.btn-copy:active {
  transform: scale(0.92);
}

/* 지표 카드 머리·목록 행에 쓰는 작은 아이콘 배지 */
.icon-badge-sm {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
   라우트 전환 피드백
   ═══════════════════════════════════════════════════════════════════════════ */

/* 상단 진행 바 — 폭을 90% 까지 밀어두고 완료 시 100% 로 채운 뒤 사라진다.
   실제 진행률을 알 수 없으니 "곧 끝난다"는 느낌만 준다. */
.route-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--blue-500);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  border-radius: 0 2px 2px 0;
}
.route-progress-active {
  opacity: 1;
  width: 90%;
  transition: width 8s cubic-bezier(0.1, 0.9, 0.2, 1), opacity 0.1s;
}
.route-progress-done {
  opacity: 0;
  width: 100%;
  transition: width 0.18s ease-out, opacity 0.3s 0.15s;
}

/* 라우트 로딩 실패 화면 */
.route-error {
  display: grid;
  place-items: center;
  min-height: 60vh;
  padding: 24px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   알림
   ═══════════════════════════════════════════════════════════════════════════ */

/* 홈 상단 — 인사말 + 알림 종 */
.home-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 14px;
}
.bell {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-right: -8px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: background-color 0.12s;
}
.bell:hover {
  background: var(--grey-100);
}
/* 안 읽은 개수 — 종 오른쪽 위에 겹친다 */
.bell-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--red-500);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  /* 배경과 분리해 보이게 흰 테두리를 두른다 */
  box-shadow: 0 0 0 2px var(--bg);
}

.notif {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  margin: 0 -12px;
  border-radius: var(--radius);
  transition: background-color 0.12s;
}
.notif[role='link'] {
  cursor: pointer;
}
.notif[role='link']:hover {
  background: var(--grey-50);
}
/* 안 읽은 알림 — 왼쪽에 파란 막대로 표시한다. 배경만 바꾸면
   읽은 것과의 차이가 흐릿하다. */
.notif-unread {
  background: var(--blue-50);
  box-shadow: inset 3px 0 0 var(--blue-500);
}
.notif-unread:hover {
  background: var(--blue-100);
}
.notif-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}
.notif-unread .notif-title {
  color: var(--blue-800);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Onfinance 브랜드
   ═══════════════════════════════════════════════════════════════════════════ */

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--blue-500);
  min-width: 0;
}
.logo-mark {
  flex-shrink: 0;
}
.logo-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}
/* 워드마크는 로고 색이 아니라 본문 색을 쓴다 — 마크만 파랑이라야
   사이드바·헤더에서 브랜드가 과하게 튀지 않는다 */
.logo-word {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
  white-space: nowrap;
}
.logo-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 어두운 배경(히어로 등) 위에서는 전부 흰색으로 */
.logo-invert,
.logo-invert .logo-word {
  color: #fff;
}
.logo-invert .logo-sub {
  color: rgba(255, 255, 255, 0.72);
}

/* 로그인 화면 상단의 큰 로고 */
.logo-hero {
  flex-direction: column;
  gap: 14px;
  text-align: center;
}
.logo-hero .logo-text {
  align-items: center;
}
.logo-hero .logo-word {
  font-size: 24px;
}
.logo-hero .logo-sub {
  font-size: 13px;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   모바일: 데이터 테이블 → 카드 목록

   좁은 화면에서 가로 스크롤 테이블은 열 제목이 화면 밖으로 나가 어떤 값인지
   알 수 없게 된다. 각 행을 카드로 세우고 셀마다 열 제목을 라벨로 붙인다.
   라벨은 table() 헬퍼가 헤더에서 data-label 로 자동 주입한다.
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .table-wrap {
    border: none;
    background: none;
    overflow: visible;
  }
  .table thead {
    /* 시각적으로 숨기되 스크린리더에는 남긴다 */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: auto;
  }
  .table tr {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-bottom: 10px;
  }
  .table tr:hover {
    background: var(--bg-elevated);
  }
  .table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 7px 0;
    border-bottom: none;
    text-align: right;
  }
  /* 열 제목을 왼쪽 라벨로 */
  .table td::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-align: left;
  }
  /* 라벨이 없는 셀(액션 버튼 등)은 전체 폭을 쓴다 */
  .table td:not([data-label])::before {
    content: none;
  }
  .table td.cell-actions {
    justify-content: stretch;
    padding-top: 12px;
    margin-top: 6px;
    border-top: 1px solid var(--grey-100);
  }
  .table td.cell-actions::before {
    content: none;
  }
  .table td.cell-actions .row-gap-2 {
    width: 100%;
  }
  .table td.cell-actions .btn {
    flex: 1;
  }
  .table .num {
    text-align: right;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   모바일 사이드바 배경막

   사이드바만 밀어 넣으면 바깥을 눌러 닫을 수 없고, 뒤 내용이 계속 스크롤된다.
   ═══════════════════════════════════════════════════════════════════════════ */

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.sidebar-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}
@media (min-width: 769px) {
  /* 데스크톱에서는 사이드바가 항상 보이므로 배경막이 뜰 일이 없다 */
  .sidebar-backdrop {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   엔터프라이즈 화면 밀도
   ═══════════════════════════════════════════════════════════════════════════ */

/* 필터 칩이 많아지면 줄바꿈 대신 가로 스크롤 — 화면 위쪽을 잡아먹지 않게 */
@media (max-width: 768px) {
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-left: -16px;
    margin-right: -16px;
    padding: 0 16px 2px;
  }
  .filters::-webkit-scrollbar {
    display: none;
  }
  .chip {
    flex-shrink: 0;
  }
}

/* 화면 상단 도구 모음 — 제목 아래, 표 위 */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar-spacer {
  flex: 1;
}

/* 검색 입력 — 아이콘을 왼쪽에 겹친다 */
.search-field {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 320px;
}
.search-field .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}
.search-field .input {
  padding-left: 38px;
}

/* 표 위의 결과 요약 */
.result-count {
  font-size: 13px;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.result-count b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* 데스크톱 표: 줄무늬 대신 hover 로 짚는다. 대신 열 구분을 또렷하게 */
@media (min-width: 769px) {
  .table td + td,
  .table th + th {
    border-left: 1px solid transparent;
  }
  .table-compact td {
    padding: 9px 14px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   유저 앱 모바일 마감
   ═══════════════════════════════════════════════════════════════════════════ */

/* 노치·홈바가 있는 기기에서 상단 바가 상태바에 물리지 않게 */
.appbar {
  padding-top: env(safe-area-inset-top);
  height: calc(56px + env(safe-area-inset-top));
  /* 스크롤된 내용이 비쳐 보이지 않게 */
  backdrop-filter: saturate(180%) blur(8px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}
@supports not (backdrop-filter: blur(8px)) {
  .appbar {
    background: var(--bg);
  }
}

.page {
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

/* 고정 CTA — 하단 안전영역까지 배경을 깔아야 홈바 위가 비어 보이지 않는다 */
.has-fixed-cta {
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

/* 아주 좁은 화면(360px 이하)에서 금액이 두 줄로 깨지지 않게 */
@media (max-width: 360px) {
  .amount-xl {
    font-size: 25px;
  }
  .hero {
    padding: 20px;
  }
  .page {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* 가로 모드에서 바텀시트가 화면을 다 덮지 않게 */
@media (max-height: 480px) and (orientation: landscape) {
  .modal {
    max-height: 96vh;
  }
}

/* 인쇄 — 정산서·영수증을 그대로 출력할 수 있게 */
@media print {
  .tabbar,
  .sidebar,
  .topbar,
  .appbar,
  .btn,
  .filters,
  .route-progress {
    display: none !important;
  }
  .content,
  .page {
    padding: 0;
  }
  .card,
  .table-wrap {
    border: 1px solid #ddd;
    box-shadow: none;
    break-inside: avoid;
  }
  body {
    background: #fff;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   유저 앱 데스크톱 상단 내비

   기본은 숨김이다 — 모바일이 기본 골격이고, 1024px 이상에서만 나타난다.
   ═══════════════════════════════════════════════════════════════════════════ */

.topnav {
  display: none;
}

@media (min-width: 1024px) {
  .topnav {
    display: block;
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
  }
  @supports not (backdrop-filter: blur(10px)) {
    .topnav {
      background: var(--bg-elevated);
    }
  }
  .topnav-inner {
    max-width: 1280px;
    margin: 0 auto;
    height: 62px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    gap: 32px;
  }
  .topnav-brand {
    flex-shrink: 0;
  }
  .topnav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
  }
  .topnav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background-color 0.12s, color 0.12s;
  }
  .topnav-link:hover {
    background: var(--grey-100);
    color: var(--text);
  }
  .topnav-link.active {
    background: var(--blue-50);
    color: var(--blue-700);
    font-weight: 600;
  }
  .topnav-link .icon {
    color: var(--grey-500);
  }
  .topnav-link:hover .icon,
  .topnav-link.active .icon {
    color: inherit;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   데스크톱 본문 배치

   모바일에서 세로로 쌓이던 카드를 넓은 화면에서는 나란히 놓는다.
   페이지 코드를 고치지 않고 컨테이너 클래스만으로 배치가 바뀌게 한다.
   ═══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 1024px) {
  /* 좌: 요약/입력  우: 목록 — 홈·지갑처럼 "현황 + 목록" 구조에 쓴다 */
  .split {
    display: grid;
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
  }
  /* 왼쪽 열은 스크롤을 따라 붙어 있는다 */
  .split-sticky {
    position: sticky;
    top: 90px;
  }
  /* 카드 목록을 2열로 — 항목이 짧아 한 줄이 텅 비는 것을 막는다 */
  .cards-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  /* 데스크톱에서 폼은 화면 전체 폭을 쓰지 않는다 — 입력란이 길수록 읽기 어렵다 */
  .form-narrow {
    max-width: 460px;
  }
  /* 로그인·가입 카드 */
  .auth-wrap {
    max-width: 420px;
    margin: 0 auto;
    padding-top: 56px;
  }
}

/* 모바일 전용 / 데스크톱 전용 표시 */
@media (min-width: 1024px) {
  .mobile-only {
    display: none !important;
  }
}
@media (max-width: 1023px) {
  .desktop-only {
    display: none !important;
  }
  /* 좁은 화면에서는 split 이 그냥 세로로 쌓인다 */
  .split > * + * {
    margin-top: 24px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   데이터 시각화 조각
   ═══════════════════════════════════════════════════════════════════════════ */

.bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.bar-label {
  font-size: 13px;
  color: var(--text-secondary);
}
.bar-value {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bar-hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-left: 5px;
}
.bar-track {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--grey-100);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--blue-500);
  /* 화면에 들어올 때 채워지는 느낌 */
  animation: bar-grow 0.5s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.bar-green { background: var(--green-500); }
.bar-red { background: var(--red-500); }
.bar-yellow { background: var(--yellow-500); }
.bar-grey { background: var(--grey-400); }
.bar-violet { background: var(--violet-500); }
@keyframes bar-grow {
  from { width: 0 !important; }
}

/* 진행 단계 */
.stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  position: relative;
  text-align: center;
}
/* 단계 사이를 잇는 선 */
.step:not(:first-child)::before {
  content: '';
  position: absolute;
  top: 13px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--grey-200);
}
.step.done::before,
.step.active::before {
  background: var(--blue-500);
}
.step-dot {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: var(--grey-200);
  color: var(--text-tertiary);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}
.step.done .step-dot {
  background: var(--blue-500);
  color: #fff;
}
.step.active .step-dot {
  background: var(--blue-500);
  color: #fff;
  box-shadow: 0 0 0 4px var(--blue-50);
}
.step-label {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.35;
}
.step.active .step-label {
  color: var(--text);
  font-weight: 600;
}

/* 요약 타일 */
/* 지표를 카드 네 개로 늘어놓지 않는다. 흰 바탕에 세로 규칙선으로만 나누면
   숫자들이 한 덩어리로 읽혀 비교가 쉽다. 모바일에서는 선을 가로로 돌린다. */
.metric {
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  border-radius: 0;
  padding: 2px 0 2px 16px;
}
.metric:first-child { border-left: none; padding-left: 0; }
@media (max-width: 720px) {
  .metric { border-left: none; border-top: 1px solid var(--border); padding: 12px 0 0; }
  .metric:first-child { border-top: none; padding-top: 0; }
}
.metric-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 7px;
}
.metric-value {
  font-family: var(--font-num);
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.metric-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 5px;
}
.metric-green .metric-value { color: var(--green-600); }
.metric-red .metric-value { color: var(--red-600); }
.metric-blue .metric-value { color: var(--accent-600); }
.metric-yellow .metric-value { color: var(--yellow-700); }

/* 닉네임 첫 글자 아바타 — 판매자를 시각적으로 구분한다 */
.avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: var(--blue-50);
  color: var(--blue-700);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   공개 페이지 (랜딩 · 둘러보기 · 안내)

   로그인 뒤 화면과 골격이 다르다. 방문자는 "여기가 뭐 하는 곳인가"를 먼저
   판단하므로, 정보 밀도보다 여백과 문장 길이를 우선한다.
   ═══════════════════════════════════════════════════════════════════════════ */

.pubnav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
@supports not (backdrop-filter: blur(10px)) {
  .pubnav { background: var(--bg-elevated); }
}
.pubnav-inner {
  max-width: 1160px;
  margin: 0 auto;
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.pubnav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.pubnav-link {
  height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background-color 0.12s, color 0.12s;
}
.pubnav-link:hover { background: var(--grey-100); color: var(--text); }
.pubnav-link.active { color: var(--blue-600); font-weight: 600; }

.pubpage { min-height: 60vh; }
.pubsec {
  max-width: 1160px;
  margin: 0 auto;
  /* 상하 모두 64px 를 주면 섹션이 이어질 때 128px 이 된다. 위를 줄인다. */
  padding: 20px 24px 56px;
}
.pubsec:first-of-type {
  padding-top: 56px;
}

/* 히어로 */
/*
   랜딩 히어로 — 로그인·지갑 카드와 같은 브랜드 네이비.

   흰 배경에 검은 글자면 "공사 중" 으로 읽힌다. 방문자가 처음 3초에 보는
   화면이 앱 안(네이비 잔액 카드)과 같은 언어를 써야, 가입 후에도 같은
   서비스에 있다고 느낀다. 브랜드 원호를 크게 깔아 형태만 빌린다.
*/
.hero-pub {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, var(--navy-950) 0%, var(--navy-800) 78%, var(--navy-700) 100%);
  color: #fff;
}
.hero-pub::before {
  content: '';
  position: absolute;
  right: -140px;
  top: -140px;
  width: 480px;
  height: 480px;
  border: 52px solid rgba(255, 255, 255, 0.035);
  border-radius: 50%;
  pointer-events: none;
}
.hero-pub .t-display { color: #fff; }
.hero-pub-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 72px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px;
  align-items: center;
}
.hero-pub-title {
  font-size: 42px;
  line-height: 1.25;
  letter-spacing: -1px;
  margin: 18px 0 16px;
}
.hero-pub-sub {
  font-size: 16px;
  color: var(--navy-200);
  line-height: 1.75;
  max-width: 480px;
}
/* 네이비 위의 버튼 — 흰 면이 주, 유리 느낌이 부 */
.hero-pub .btn-primary {
  background: #fff;
  color: var(--navy-900);
  border-color: #fff;
}
.hero-pub .btn-primary:hover:not(:disabled) { background: var(--navy-50); }
.hero-pub .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}
.hero-pub .btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.14); }

/* 신뢰 스트립 — 약속 세 개를 아이콘과 함께 한 줄로 */
.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 22px;
}
.hero-trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--navy-200);
}
.hero-trust-item svg { color: var(--navy-300, var(--navy-200)); }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

/* 지표 타일 2×2 */
.hero-pub-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.stat-tile {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  padding: 18px;
  backdrop-filter: blur(4px);
}
.stat-tile-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--navy-200);
  margin-bottom: 8px;
}
.stat-tile-value { color: #fff; }
.stat-tile .stat-tile-unit { color: var(--navy-200); }
.stat-tile-value {
  font-family: var(--font-num);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
  font-variant-numeric: tabular-nums;
}
.stat-tile-unit {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-left: 4px;
}

.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

/* 하단 전환 배너 */
.cta-band {
  background: var(--ink-900);
  border-radius: var(--radius);
  padding: 36px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

/* FAQ */
.faq {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-chevron { transition: transform 0.18s; color: var(--text-tertiary); }
.faq[open] .faq-chevron { transform: rotate(180deg); }
.faq-a {
  padding: 0 20px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* 푸터 */
.pubfoot {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  margin-top: 40px;
}
.pubfoot-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 44px 24px;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.pubfoot-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}
.pubfoot-links a:hover { color: var(--blue-600); }
.pubfoot-bottom {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px 32px;
}

/* ── 공개 페이지 반응형 ────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .hero-pub-inner { grid-template-columns: 1fr; gap: 36px; padding: 48px 20px; }
  .hero-pub-title { font-size: 32px; }
  .cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pubsec { padding: 16px 20px 40px; }
  .pubsec:first-of-type { padding-top: 40px; }
  /* 메뉴는 가로 스크롤 — 줄바꿈되면 헤더 높이가 튄다 */
  .pubnav-menu {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .pubnav-menu::-webkit-scrollbar { display: none; }
  .pubnav-link { flex-shrink: 0; }
}
@media (max-width: 640px) {
  .cards-3 { grid-template-columns: 1fr; }
  .hero-pub-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pubnav-inner { gap: 12px; padding: 0 16px; }
  .pubnav-menu { display: none; }
  .cta-band { padding: 28px 24px; }
  .hero-pub-title { font-size: 27px; }
}

/* 코인 아이콘 — 금액·라벨 옆에 붙을 때 세로 정렬을 맞춘다 */
.coin-icon {
  vertical-align: -0.15em;
}
.hero-label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pill {
  gap: 6px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   마켓플레이스 목록

   Binance P2P 의 광고주 행 구조를 라이트모드로 옮겼다. 판매자·수량·조건·액션을
   같은 열에 정렬해 판매자끼리 비교할 수 있게 한다. 카드로 흩어놓으면 "누가 더
   믿을 만한가"를 훑을 수 없다.
   ═══════════════════════════════════════════════════════════════════════════ */

/* 시장은 페이지의 본문이지 카드가 아니다. 상자에 가두면 폭이 넓을수록
   모서리와 여백이 낭비되고, 행이 페이지에서 분리돼 보인다. */
.market {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--grey-300);
}
.market-head,
.market-row {
  display: grid;
  /* 판매자 셀은 3줄이라 세로로 길지 뿐 가로로 넓을 필요가 없다.
     예전 1.5fr 에서는 셀 폭의 절반이 비어 표가 성기게 보였다. */
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr) 104px;
  gap: var(--sp-6);
  align-items: center;
}
.market-head {
  padding: 10px 12px;
  margin: 0 -12px;
  background: transparent;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.market-row {
  padding: 14px 12px;
  margin: 0 -12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 0.12s;
}
.market-row:last-child { border-bottom: none; }
.market-row:hover { background: var(--grey-50); }

/* 광고주 셀 — 닉네임 / 거래·완료율 / 평균 확인 시간 3줄 */
.market-seller {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
}
.market-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.market-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.4;
  /* 좁은 카드에서 지표가 어색한 세로 적층으로 무너졌었다. 한 줄로 두고
     넘치는 뒤쪽 지표(완료율)부터 자연스럽게 잘리게 한다 — 지표 나열
     순서가 곧 중요도 순서다. */
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
  /* 잘릴 때는 뚝 끊기보다 흐려지며 사라지게 — 하드컷은 깨진 것처럼 보인다 */
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent);
}
.market-meta > span { flex: none; }
.market-meta b { color: var(--text-secondary); font-weight: 600; }
.market-meta .icon { color: var(--text-disabled); }

/* 지표 사이 가운뎃점 — 문자로 넣으면 폰트마다 위치가 흔들린다 */
.dot-sep {
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: var(--grey-300);
  display: inline-block;
}

.tag-new {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--blue-50);
  color: var(--blue-600);
  flex-shrink: 0;
}

/* 아바타에 온라인 점 — 목록에서 판매자를 구분하는 최소 단서 */
.avatar-dot { position: relative; }
.avatar-dot::after {
  content: '';
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green-500);
  box-shadow: 0 0 0 2px var(--bg-elevated);
}

/* 수량 — 이 화면에서 가장 큰 숫자 */
.market-amount {
  display: block;
  font-family: var(--font-num);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.market-amount em {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-left: 4px;
}
.market-krw {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}
.market-limit-range {
  display: block;
  font-size: 13.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.market-pay {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-tertiary);
}
/* 데스크톱에서는 열 제목이 헤더에 있으므로 셀 라벨을 숨긴다 */
.market-cell-label { display: none; }

/* 구매 버튼 — 파랑은 화면 전체의 강조색이라 목록에서 도드라지지 않는다.
   "살 수 있다"는 신호에 별도 색을 준다. */
/* 구매 버튼을 초록으로 두지 않는다. 초록은 "완료·정상"이라는 상태 신호로
   남겨야, 거래 목록에서 상태 배지와 동작 버튼이 구분된다. */
.btn-buy {
  background: var(--ink-900);
  color: #fff;
  font-weight: 600;
}
.btn-buy:hover:not(:disabled) { background: var(--ink-700); }

/* 금액 필터 (Binance 의 Transaction amount) */
.market-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.filter-field {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 12px;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.filter-field:focus-within {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px var(--blue-50);
}
.filter-label {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.filter-input {
  border: none;
  outline: none;
  background: none;
  width: 110px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.filter-unit {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
}

/* 더 보기 — 첫 화면에는 10건만 펼치고 나머지는 눌러서 편다.
   전부 펼쳐두면 목록 끝의 다른 섹션까지 한참을 스크롤해야 한다. */
.market-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  margin-top: 2px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.market-more:hover { background: var(--grey-50); color: var(--text); }

/* ── 좁은 화면: 행 → 컴팩트 카드 ──────────────────────────────────────────
   예전에는 셀 3개를 세로로 쌓아 카드 하나가 화면 절반을 차지했다 — 판매글을
   비교하려면 한 장씩 스크롤해야 했다. 이제 한 카드가 2×2 격자다:
   왼쪽 위 판매자 / 오른쪽 위 수량 / 왼쪽 아래 구매 범위 / 오른쪽 아래 버튼.
   한 화면에 서너 장이 들어와 훑으며 비교할 수 있다. */
@media (max-width: 860px) {
  .market-head { display: none; }
  .market {
    border: none;
    background: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: visible;
  }
  .market-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    align-items: center;
    padding: 12px 14px;
    margin: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
  }
  .market-row:hover { background: var(--bg-elevated); }

  .market-seller { grid-column: 1; grid-row: 1; }
  .market-cell-amount { grid-column: 2; grid-row: 1; text-align: right; }
  .market-limit { grid-column: 1; grid-row: 2; }
  .market-cell-action { grid-column: 2; grid-row: 2; }

  /* 컴팩트 카드에서는 원화 병기·이체 뱃지를 줄인다 — 1:1 고정이라
     수량이 곧 원화고, 결제 수단은 전부 계좌이체다 */
  .market-krw,
  .market-pay { display: none; }
  .market-cell-label {
    display: block;
    font-size: 10.5px;
    color: var(--text-disabled);
    margin-bottom: 1px;
  }
  .market-amount { font-size: 16px; }
  .market-limit-range { font-size: 12.5px; }
  .market-cell-action .btn { width: 84px; height: 36px; }

  .market-filter .filter-field { flex: 1; }
  .filter-input { width: 100%; }
  /* 툴바가 좁은 화면에서는 두 줄로 접힌다 */
  .market-toolbar { align-items: stretch; }
  .market-toolbar .segmented { align-self: flex-start; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   잔액 카드

   기존 히어로는 파란 면에 숫자만 얹은 형태라 "카드"라기보다 배너였다.
   Revolut·Wise 처럼 카드 자체가 하나의 물체로 보이게 층을 준다.
   ═══════════════════════════════════════════════════════════════════════════ */

.balance-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 22px;
  color: #fff;
  /* 잉크 단색이다. 그라데이션 카드는 화면에서 가장 큰 색면이 되어, 정작
     눌러야 할 버튼과 위험한 동작보다 먼저 눈에 들어온다. 잔액은 크기와
     위치로 이미 충분히 강조된다 — 색까지 쓸 자리가 아니다. */
  background: var(--ink-900);
  box-shadow: none;
}
.balance-card > * { position: relative; }

.balance-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 8px;
}
.balance-amount {
  font-family: var(--font-num);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.balance-unit {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  margin-left: 6px;
  letter-spacing: 0;
}
.balance-krw {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
.balance-locked {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.16);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92);
}

/* 카드 하단 액션 3분할 */
.balance-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.balance-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: var(--radius);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  transition: background-color 0.14s, transform 0.1s;
}
.balance-btn:hover { background: rgba(255, 255, 255, 0.16); }
.balance-btn:active { transform: scale(0.96); }

.quick-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   세그먼티드 컨트롤 (정렬 전환)
   ═══════════════════════════════════════════════════════════════════════════ */

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--grey-100);
  border-radius: var(--radius);
  gap: 2px;
}
.segmented-item {
  padding: 7px 14px;
  border-radius: calc(var(--radius) - 3px);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background-color 0.14s, color 0.14s, box-shadow 0.14s;
}
.segmented-item:hover { color: var(--text); }
.segmented-item.active {
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.market-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .balance-amount { font-size: 30px; }
  .segmented-item { padding: 7px 11px; font-size: 12.5px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   폼 화면 (구매 · 결제)

   입력이 중심인 화면은 폭을 좁게 잡는다. 넓은 화면에서 입력란이 1,400px 로
   늘어나면 커서와 단위 표시가 멀어져 무엇을 넣는 칸인지 흐려진다 (Wise 방식).
   ═══════════════════════════════════════════════════════════════════════════ */

.form-page {
  max-width: 520px;
  margin: 0 auto;
}
.form-head {
  margin-bottom: 24px;
}

/* 판매자 요약 — 구매 대상을 다시 확인시킨다 */
.seller-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}
.seller-card-limit {
  text-align: right;
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.seller-card .market-cell-label { display: block; }

/* 금액 입력 — 화면에서 가장 큰 요소 */
/* ═══════════════════════════════════════════════════════════════════════════
   금액 입력 — 이 시스템의 유일한 금액 입력 컴포넌트

   예전에는 두 벌이 있었다(.input-amount-wrap / .amount-field). 하는 일이
   같은데 하나는 오른쪽 정렬, 하나는 왼쪽 정렬이라 화면마다 숫자 위치가
   달랐다. 하나로 합치고 크기만 변형으로 둔다.

   구조: [기호] [숫자 ......] [단위]
                ₩ 환산 · 오류

   기호를 값 앞에 두는 건 통화 입력 필드의 관습이다(₩10,000) — 비어 있을
   때도 이 칸이 무엇을 받는지 알 수 있다.

   숫자는 **왼쪽 정렬**이다. 오른쪽 정렬은 표에서 자릿수를 비교할 때 쓰는
   것이고, 입력란에서는 타이핑하는 커서가 좌우로 튀어 불편하다.
   ═══════════════════════════════════════════════════════════════════════════ */

.amount-field {
  /* 도구 모음 같은 플렉스 안에 놓일 때도 줄어들 수 있어야 한다 (위와 같은 이유) */
  min-width: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.amount-field:focus-within {
  border-color: var(--accent-500);
  box-shadow: 0 0 0 3px var(--accent-50);
}
.amount-field-label {
  display: block;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}
.amount-field-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  /* 플렉스 항목의 기본 min-width 는 auto(=min-content) 라, 안에 <input> 이
     있으면 브라우저 기본 size 만큼을 최소폭으로 잡고 줄어들지 않는다.
     그래서 좁은 칸에서 단위(ONC)가 테두리 밖으로 밀려 잘렸다. */
  min-width: 0;
}
.amount-field-sym {
  flex: none;
  align-self: center;
  color: var(--text-tertiary);
}
.amount-field:focus-within .amount-field-sym { color: var(--text-secondary); }
.amount-field-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  font-family: var(--font-num);
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  padding: 0;
}
.amount-field-input::placeholder { color: var(--grey-300); }
.amount-field-unit {
  flex: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-tertiary);
}
.amount-field-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  min-height: 17px;
}

/* 도구 모음 안에 들어갈 때 — 라벨·환산 줄이 없고 한 줄 높이다 */
.amount-field-inline {
  padding: 0 12px;
  height: 44px;
  display: flex;
  align-items: center;
}
.amount-field-inline .amount-field-row { flex: 1; align-items: center; }
.amount-field-inline .amount-field-input { font-size: 18px; }
.amount-field-inline .amount-field-unit { font-size: 13px; }


/* CTA — 모바일은 화면 하단 고정, 데스크톱은 폼 흐름 안에 둔다.
   넓은 화면에서 뷰포트에 고정하면 폼과 멀어져 어디에 붙은 버튼인지 모른다. */
.form-cta { margin-top: 24px; }

@media (max-width: 1023px) {
  .form-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--bg) 72%, transparent);
    z-index: 40;
  }
  .form-page { padding-bottom: 84px; }
}
@media (max-width: 480px) {
  .amount-field-input { font-size: 28px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   거래 채팅 (WebSocket)
   ═══════════════════════════════════════════════════════════════════════════ */

.msg-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
  scroll-behavior: smooth;
}
.msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 80%;
}
.msg-mine {
  align-self: flex-end;
  align-items: flex-end;
}
.msg-body {
  padding: 10px 14px;
  border-radius: 14px 14px 14px 4px;
  background: var(--grey-100);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}
.msg-mine .msg-body {
  border-radius: 14px 14px 4px 14px;
  background: var(--blue-500);
  color: #fff;
}
.msg-time {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 3px;
}
/* 새 메시지가 밀려 들어올 때 튀지 않게 */
.msg { animation: msg-in 0.16s ease-out; }
@keyframes msg-in {
  from { opacity: 0; transform: translateY(4px); }
}

/* 연결 상태 배지 — 끊겼는데 계속 쓰고 있으면 메시지가 안 간 줄 모른다 */
.chat-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-full);
}
.chat-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.chat-status-on {
  background: var(--green-50);
  color: var(--green-600);
}
.chat-status-off {
  background: var(--grey-100);
  color: var(--text-tertiary);
}
/* 연결 중일 때 점을 깜빡여 "시도 중"임을 알린다 */
.chat-status-off::before { animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }


/* ═══════════════════════════════════════════════════════════════════════════
   간격 디테일

   금액 표기는 "숫자 + 단위 + 보조설명" 세 조각이 한 줄에 붙는다. 셋을 같은
   간격으로 띄우면 어디까지가 금액인지 안 읽힌다. 단위는 숫자에 가깝게(4px),
   보조설명은 멀게(10px) 둬서 덩어리가 갈리게 한다.
   ═══════════════════════════════════════════════════════════════════════════ */

.amount {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  letter-spacing: -0.02em; /* 큰 숫자는 기본 자간이 성기게 보인다 */
}
.amount-unit {
  margin-left: var(--sp-1);
  font-size: 0.62em;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0;
}
/* 금액 뒤에 붙는 원화 환산·건수 같은 보조값 */
.amount-aside {
  margin-left: var(--sp-3);
  font-size: 13px;
  color: var(--text-tertiary);
}

/* 라벨 ↔ 값. 라벨은 왼쪽 고정, 값은 오른쪽 정렬이라 사이가 벌어져도
   시선이 흐르도록 최소 간격을 준다. */
.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-6);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
}
.kv:last-child { border-bottom: none; }
.kv-key {
  flex: none;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.kv-val {
  text-align: right;
  font-size: 14px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}

/* 아이콘 + 글자. 아이콘은 글자보다 시각 무게가 커서 같은 간격이면
   붙어 보인다. 6px 이 기준이다. */
.with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 섹션 리듬 — 제목과 본문은 가깝게, 섹션끼리는 멀게 */
.section + .section { margin-top: var(--sp-section); }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--grey-300);
}
.section-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.2px;
}
.section-desc {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-tertiary);
}


/* ═══ 페이지 헤더 — pageTitle() 이 만든다. 세 앱이 함께 쓴다. ═══ */

/* ── 페이지 헤더 ────────────────────────────────────────────────────────── */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-6);
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-6);
  border-bottom: 1px solid var(--grey-300);
}
.page-head-title {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.5px;
  line-height: 1.25;
}
.page-head-desc {
  margin-top: 5px;
  font-size: 13px;
  color: var(--text-tertiary);
}
.page-head-side {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex: none;
}

/* 헤더 안의 잔액. 카드가 아니라 읽는 값이라 테두리를 왼쪽 한 줄만 둔다. */
.head-balance {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 2px 0 2px var(--sp-4);
  border-left: 1px solid var(--border);
}
.head-balance-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.head-balance-value {
  font-size: 19px;
  font-weight: 650;
  color: var(--text);
}
.head-balance:hover .head-balance-value { color: var(--link); }


/* 사이드바 발치의 작은 아바타 */
.avatar-sm {
  width: 22px;
  height: 22px;
  font-size: 11px;
  flex: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   설정 스위치

   체크박스를 그대로 두지 않고 스위치 모양으로 그린다. 다만 요소 자체는
   진짜 <input type="checkbox"> 다 — 키보드 포커스·스페이스바 토글·스크린
   리더가 전부 공짜로 따라온다. div 로 흉내 내면 그걸 전부 다시 만들어야 한다.
   ═══════════════════════════════════════════════════════════════════════════ */

.switch-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-6);
  padding: var(--sp-4) 0;
  cursor: pointer;
}
.switch-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.switch-label { font-size: 14px; font-weight: 600; }
.switch-desc { font-size: 12.5px; color: var(--text-tertiary); line-height: 1.5; }

.switch {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 42px;
  height: 24px;
  margin: 2px 0 0;
  border-radius: var(--radius-full);
  background: var(--grey-300);
  cursor: pointer;
  transition: background-color 0.16s;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.16s;
}
.switch:checked { background: var(--ink-900); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible {
  outline: 2px solid var(--accent-500);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   결제 QR

   매장에 인쇄해 붙이는 물건이라 화면용 스타일과 인쇄용 스타일이 둘 다
   필요하다. 인쇄할 때는 포스터만 남기고 나머지를 지운다 — 사이드바와
   설명까지 종이에 나가면 정작 QR 이 작아진다.
   ═══════════════════════════════════════════════════════════════════════════ */

.qr-layout {
  display: grid;
  gap: var(--sp-8);
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 860px) {
  .qr-layout { grid-template-columns: minmax(0, 1fr); }
}

.qr-poster {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 24px 20px 20px;
  text-align: center;
  background: #fff;
}
.qr-poster-biz {
  font-size: 15px;
  font-weight: 650;
  margin-bottom: 14px;
}
/* SVG 는 원본 크기를 무시하고 칸을 채운다 — 인쇄 크기를 미리 못 정하므로 */
.qr-poster-img svg,
.qr-mini-img svg {
  display: block;
  width: 100%;
  height: auto;
}
.qr-poster-img { margin: 0 auto; max-width: 240px; }
.qr-poster-code {
  margin-top: 14px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
}
.qr-poster-help {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.qr-side { display: flex; flex-direction: column; gap: var(--sp-8); }

.qr-mini {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
}
.qr-mini-img { flex: none; width: 108px; }
.qr-mini-body { flex: 1; min-width: 0; }

.steps {
  margin: 0;
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media print {
  /* 포스터만 종이에 나간다 */
  .sidebar,
  .sidenav,
  .topbar,
  .qr-side,
  .page-head,
  .tabbar { display: none !important; }
  .qr-layout { display: block; }
  .qr-poster {
    border: none;
    max-width: 420px;
    margin: 0 auto;
  }
  .qr-poster-img { max-width: 340px; }
}

/* 칩 격자 — 개수가 3의 배수가 아닐 때 마지막 하나가 혼자 떨어지지 않도록
   줄바꿈 대신 균등 분할한다. 모바일에서 5개가 4+1 로 어긋나 보였다. */
.chip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
/* 금액 입력 바로 아래 붙는 경우 — 딱 붙어 있으면 입력의 일부처럼 보여서
   "이걸 눌러야 하나" 헷갈린다. 숨을 한 번 쉬게 띄운다. */
.amount-field + .chip-grid,
.field + .chip-grid {
  margin-top: 14px;
}
.chip-grid .chip {
  width: 100%;
  justify-content: center;
  padding: 0 8px;
}
.chip-quiet { color: var(--text-tertiary); }
@media (min-width: 640px) {
  .chip-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* 하단 고정 CTA — 홈 인디케이터(아이폰)에 가리지 않게 안전 영역을 더한다.
   기기 하단 스와이프 바 위에 버튼이 걸리면 누를 때마다 홈으로 나간다. */
@media (max-width: 1023px) {
  .form-cta {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .tabbar {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

/* 페이지 이동 */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-5) 0 var(--sp-2);
}
.pager-page {
  min-width: 2.2em;
  text-align: center;
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}
.pager .btn[disabled] { opacity: 0.35; }


/* ── 아바타를 없앤 뒤의 정렬 ────────────────────────────────────────────
   이니셜 동그라미는 커뮤니티 프로필처럼 읽혀서 뺐다. 거래 상대를 알아보는
   단서는 닉네임과 실적 지표이지 얼굴 자리가 아니다.

   대신 판매자 셀 앞에 **상태 점**만 남긴다 — 정지·신규 여부는 거래 전에
   알아야 하는 정보라 지울 수 없다. */
.market-seller {
  position: relative;
  padding-left: 14px;
}
.market-seller::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-500);
}
.listing-seller { padding-left: 0; }

/* 코드 편집 — 입력과 저장 버튼을 한 줄로 */
.code-edit {
  display: flex;
  gap: var(--sp-2);
}
.code-edit .input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-num);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* 금액 입력 아래 칩.

   입력 상자에 딱 붙어 있으면 칩이 상자의 일부처럼 보여서, 누르면 값이
   바뀐다는 게 잘 안 읽힌다. 위아래로 띄워 별개의 조작으로 보이게 한다. */
.amount-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: var(--sp-5) 0 var(--sp-6);
}

/* ── 최근 결제한 곳 ──────────────────────────────────────────────────────
   가맹점은 결제 수단이라 같은 곳을 반복해서 쓴다. 매번 코드를 다시 치는
   것이 이 서비스에서 가장 자주 반복되는 마찰이었다. */
.recent-pay { margin-bottom: var(--sp-5); }
.recent-pay-label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--sp-2);
}
.recent-pay-list {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  scrollbar-width: none;
  /* 좌우 여백만큼 넘겨 스크롤 끝이 화면 가장자리에 닿게 한다 —
     잘린 카드가 보여야 옆에 더 있다는 걸 안다 */
  margin: 0 calc(var(--gutter-sm) * -1);
  padding: 2px var(--gutter-sm);
}
.recent-pay-list::-webkit-scrollbar { display: none; }
.recent-pay-item {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 132px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  text-align: left;
}
.recent-pay-item:hover { border-color: var(--grey-400); background: var(--grey-50); }
.recent-pay-item:active { background: var(--grey-100); }
.recent-pay-name {
  font-size: 13.5px;
  font-weight: 600;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-pay-meta {
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* 하단 고정 CTA 와 탭바가 겹치던 문제.

   둘 다 `bottom: 0` 이라 탭이 있는 화면(결제·시장)에서 결제 버튼이 탭바
   뒤로 깔렸다. 탭바 높이만큼 올린다. 탭이 없는 화면(빠른 구매)은 그대로
   화면 맨 아래에 붙는다. */
@media (max-width: 1023px) {
  .has-tabbar .form-cta,
  .has-tabbar + .form-cta {
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }
  /* 버튼이 올라간 만큼 본문 아래 여백도 늘린다 — 마지막 항목이 가리면
     스크롤을 끝까지 내려도 안 보인다 */
  .has-tabbar .form-page { padding-bottom: 148px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   좁은 화면의 핵심 지표

   grid-3/4 는 아주 좁은 폭에서 1열로 떨어진다. 폼이나 카드에는 맞지만
   **KPI 는 다르다** — 숫자 4개를 세로로 쌓으면 화면 하나를 다 쓰고, 정작
   비교하려던 값들이 같이 안 보인다. 2열을 유지하고 글자만 줄인다.
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 560px) {
  .grid.grid-kpi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .grid-kpi .stat-card { padding: 12px; }
  .grid-kpi .stat-value { font-size: 19px; }
  .grid-kpi .stat-head { font-size: 11px; }
  .grid-kpi .stat-sub { font-size: 10.5px; }
}

/* 판매자 평점 — 거래 행동에서 계산한 5점 척도 */
.seller-rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--navy-50);
  color: var(--navy-700);
  font-variant-numeric: tabular-nums;
}
.seller-rating b { font-weight: 700; }

/* ═══════════════════════════════════════════════════════════════════════════
   거래 모니터

   운영자가 흐르는 목록에서 **이상한 줄만 골라내야** 하는 화면이다. 색으로
   구분하되 배경을 진하게 칠하지 않는다 — 경고가 절반을 넘으면 화면 전체가
   빨개져서 오히려 아무것도 안 보인다. 왼쪽 띠 하나면 눈이 따라간다.
   ═══════════════════════════════════════════════════════════════════════════ */
.row-warn > td:first-child {
  box-shadow: inset 3px 0 0 var(--yellow-500);
}
.row-warn > td {
  background: var(--yellow-50);
}

.warn-line {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  line-height: 1.45;
  font-size: 12px;
  color: var(--yellow-700);
}
.warn-line + .warn-line { margin-top: 3px; }
.warn-line svg { flex: none; margin-top: 2px; }

/*
   자동 갱신 중임을 알리는 배지. 깜빡이는 것만으로 "멈추지 않았다"가 전달된다.

   이름이 `.live-dot` 이 아닌 이유: 회원 앱이 진행 중 거래 표시에 그 이름을
   이미 쓰고 있다. 같은 이름을 쓰면 여기 ::before 가 그쪽에도 붙어서, 거래
   항목마다 정체불명의 점이 하나씩 더 생긴다.
*/
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-tertiary);
}
.live-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-500);
  animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
/* 애니메이션을 줄여달라고 설정한 사람에게는 점만 보여준다 */
@media (prefers-reduced-motion: reduce) {
  .live-badge::before { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   라디오 카드 — 선택지마다 설명이 필요할 때

   기본 라디오 + 라벨은 설명을 붙일 자리가 없다. 운영자가 "어뷰징 의심" 과
   "입금 없음" 중 무엇을 골라야 하는지는 이름만으로 알 수 없어서, 한 줄
   설명이 선택지 안에 있어야 한다.
   ═══════════════════════════════════════════════════════════════════════════ */
.radio-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.radio-card:hover { background: var(--grey-50); }
.radio-card:has(input:checked) {
  border-color: var(--navy-600);
  background: var(--navy-50);
}
.radio-card input {
  flex: none;
  margin-top: 2px;
  accent-color: var(--navy-700);
}
.radio-card > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.radio-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.radio-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-tertiary);
}

/* 위험한 동작이지만 표 안에 있어 크게 만들 수 없는 버튼 */
.btn-danger-ghost {
  background: transparent;
  border: 1px solid var(--red-100);
  color: var(--red-600);
}
.btn-danger-ghost:hover:not(:disabled) {
  background: var(--red-50);
  border-color: var(--red-200);
}

/*
   확인창 안의 짧은 경고 한 줄.

   banner 는 페이지 레벨이라 모달 안에서는 너무 크다. 그렇다고 그냥 문단으로
   두면 읽히지 않는다 — 확인창에서 사용자는 이미 버튼을 누르기로 마음먹고
   들어온다.
*/
.callout-line {
  padding: 9px 11px;
  border-left: 3px solid var(--yellow-500);
  background: var(--yellow-50);
  border-radius: 0 6px 6px 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--yellow-700);
  text-align: left;
}

/* 회원 앱 — 승인 전에는 지갑을 흐리게. 잔액은 보이되 "지금은 쓸 수 없다" 를 전한다 */
.wallet-hero-muted { opacity: 0.62; }
.wallet-action[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  /* button 은 a 와 기본 스타일이 달라 같은 모양을 명시해줘야 한다 */
  font: inherit;
  border: none;
  background: none;
  width: 100%;
}

/* 상대방 이력을 한눈에 — 확인 버튼을 누르기 직전에 보는 값들 */
.trust-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.trust-chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 11px;
  border-radius: 7px;
  background: var(--bg-sunken);
  min-width: 78px;
}
.trust-chip-k {
  font-size: 11px;
  color: var(--text-tertiary);
}
.trust-chip-v {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════════════════
   고객센터 위젯

   화면 오른쪽 아래에 떠 있다. 문의는 대개 "지금 보고 있는 이 화면" 때문에
   생기므로, 보던 것을 그대로 두고 물어볼 수 있어야 한다.
   ═══════════════════════════════════════════════════════════════════════════ */
.support-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: var(--navy-800);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(11, 31, 56, 0.28);
  transition: transform 0.12s, background 0.12s;
}
.support-fab:hover { background: var(--navy-900, var(--navy-800)); transform: translateY(-1px); }
.support-fab:active { transform: translateY(0); }

.support-fab-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red-500);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid var(--navy-800);
}

.support-panel {
  position: fixed;
  right: 18px;
  bottom: 80px;
  z-index: 61;
  width: min(360px, calc(100vw - 36px));
  /* 화면이 짧아도 입력창은 보여야 한다 */
  height: min(520px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(11, 31, 56, 0.18);
  overflow: hidden;
}

.support-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: var(--navy-800);
  color: #fff;
}
.support-title { font-size: 15px; font-weight: 700; }
.support-sub { font-size: 11.5px; opacity: 0.75; margin-top: 2px; }
.support-x {
  border: none;
  background: transparent;
  color: #fff;
  opacity: 0.8;
  cursor: pointer;
  padding: 2px;
  display: flex;
}
.support-x:hover { opacity: 1; }

.support-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-sunken);
}

.support-msg { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.support-msg.is-me { align-items: flex-end; }

.support-bubble {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 12px 12px 12px 3px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-primary);
  /* 붙여넣은 긴 주소·계좌번호가 창을 밀어내지 않게 */
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.support-msg.is-me .support-bubble {
  border-radius: 12px 12px 3px 12px;
  background: var(--navy-700);
  border-color: var(--navy-700);
  color: #fff;
}
.support-time { font-size: 10.5px; color: var(--text-tertiary); }

.support-empty { margin: auto; text-align: center; padding: 20px; }
.support-empty-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.support-empty-desc {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-tertiary);
  margin-top: 6px;
}

.support-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}
.support-form textarea {
  flex: 1;
  /* flex 자식의 기본 min-width 는 auto 라, 긴 내용이 들어오면 줄지 않고
     버튼을 밀어낸다 */
  min-width: 0;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 11px;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.45;
  max-height: 120px;
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.support-form textarea:focus {
  outline: none;
  border-color: var(--navy-600);
}
.support-send {
  flex: none;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 9px;
  background: var(--navy-700);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.support-send:hover { background: var(--navy-800); }

/* 모바일에서는 하단 탭바를 피해 조금 위로 */
@media (max-width: 720px) {
  .support-fab { bottom: 76px; right: 14px; }
  .support-panel {
    right: 10px;
    left: 10px;
    width: auto;
    bottom: 136px;
    height: min(460px, calc(100vh - 200px));
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   고객센터 — 운영자 콘솔

   목록과 대화를 한 화면에 둔다. 눌러 들어갔다 나오는 구조면 다음 문의로
   넘어갈 때마다 왕복해야 하는데, 응대는 연달아 하는 일이다.
   ═══════════════════════════════════════════════════════════════════════════ */
.support-split {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
  /* 두 칸이 같은 높이를 갖고 각자 스크롤해야 한다 */
  height: calc(100vh - 260px);
  min-height: 420px;
}

.support-list {
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
}

.support-item {
  display: block;
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.support-item:hover { background: var(--grey-50); }
.support-item.active {
  background: var(--navy-50);
  box-shadow: inset 3px 0 0 var(--navy-700);
}
.support-item-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 3px;
  /* 제목이 길어도 목록이 흔들리지 않게 한 줄로 자른다 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 5px;
}
.support-item-dot {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red-500);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.support-list-empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
}

.support-thread {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  overflow: hidden;
}
.support-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.support-thread-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-sunken);
}

/* 좁은 화면에서는 위아래로 쌓는다 — 300px 목록을 옆에 두면 대화가 못 읽힌다 */
@media (max-width: 860px) {
  .support-split {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }
  .support-list { max-height: 240px; }
  .support-thread { min-height: 420px; }
}

/* 파트너 콘솔 상단의 조직 이름 — 모바일에서 사이드바가 접히면 유일한 이름표다 */
.topbar-org {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   촉감 — 누르는 맛과 초점

   모바일에는 hover 가 없다. 누르는 순간의 반응(눌림)과 초점 링이 없으면
   화면이 "죽어 있다" 고 느낀다. 트랜지션은 0.12s 로 짧게 — 길면 굼뜨다.
   ═══════════════════════════════════════════════════════════════════════════ */
.btn {
  transition: background 0.12s, border-color 0.12s, transform 0.06s, box-shadow 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: translateY(1px); }

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-100);
}

.input {
  transition: border-color 0.14s, box-shadow 0.14s;
}
.input:focus {
  border-color: var(--accent-500);
  box-shadow: 0 0 0 3px var(--accent-50);
}

.card { transition: box-shadow 0.15s; }

/* 목록 행도 눌림 반응 — 행 전체가 링크인 화면이 많다 */
.ledger-row,
.trade-row,
.support-item {
  -webkit-tap-highlight-color: transparent;
}
.ledger-row:active,
.trade-row:active { background: var(--grey-100); }

/* 금액 빠른 버튼 — 칩과 구분되는 조용한 사각. 주인공은 입력창이다 */
.amount-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.amount-chips .chip { flex: 1 1 auto; justify-content: center; }

/* ═══════════════════════════════════════════════════════════════════════════
   모바일 지표 압축

   지표 카드 3장을 세로로 쌓으면 300px 를 먹어서, 정작 할 일(출금 신청)이
   화면 밖으로 밀린다. 좁은 화면에서는 한 줄짜리 요약으로 접는다 —
   "라벨 왼쪽 · 숫자 오른쪽" 은 은행 앱이 수십 년 검증한 형태다.
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .grid-3 > .metric,
  .grid-4 > .metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: 12px 14px;
  }
  .grid-3 > .metric .metric-label,
  .grid-4 > .metric .metric-label { margin-bottom: 0; }
  .grid-3 > .metric .metric-value,
  .grid-4 > .metric .metric-value { font-size: 17px; }
  /* 부연은 접는다 — 한 줄에 셋을 다 넣으면 어느 것도 안 읽힌다 */
  .grid-3 > .metric .metric-sub,
  .grid-4 > .metric .metric-sub { display: none; }
  .grid-3, .grid-4 { gap: 8px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   운영 콘솔 로그인 — 회원 앱과 같은 언어 (위 .auth-wrap 과 짝)

   콘솔이라고 첫 화면이 초라할 이유가 없다. 위쪽 브랜드 네이비 + 카드.
   ═══════════════════════════════════════════════════════════════════════════ */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    linear-gradient(180deg, var(--navy-950) 0%, var(--navy-800) 46%, transparent 46.01%),
    var(--bg-sunken);
}
.login-card { width: min(400px, 100%); }
.login-card .logo-word { color: #fff; }
.login-card .logo-sub { color: var(--navy-200); }
.login-card > .card {
  border-radius: 16px;
  padding: 26px 22px;
  box-shadow: 0 10px 34px rgba(11, 31, 56, 0.16);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ONC 단위 심볼

   숫자 옆의 "ONC" 글자를 심볼로 바꿨다. em 크기라 어떤 글자 크기 옆에서도
   저절로 맞는다. 베이스라인보다 살짝 내려야 숫자와 광학적으로 나란해
   보인다 — 수학적 중앙은 시각적으로 떠 보인다.
   ═══════════════════════════════════════════════════════════════════════════ */
.onc-unit {
  display: inline-block;
  /* 1.45em — 목록 크기(13px 안팎)에서도 구름 모양이 식별되는 하한. 커진
     만큼 베이스라인을 더 내리고, 늘어난 키가 행 높이를 밀지 않게 세로
     여백을 음수로 상쇄한다. */
  vertical-align: -0.33em;
  margin-left: 0.14em;
  margin-top: -0.25em;
  margin-bottom: -0.2em;
}
/* 단위 자리(amount-unit)의 흐린 색을 그대로 따른다 — currentColor */
.amount-unit .onc-unit { margin-left: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   필드 오류 표시

   서버가 "비밀번호는 12자 이상" 까지 말해줘도 토스트 하나로 흘리면
   사용자는 어느 칸이 문제인지 모른 채 무관한 필드를 의심한다.
   문제의 칸에 테두리와 이유를 붙인다.
   ═══════════════════════════════════════════════════════════════════════════ */
.field-invalid .input {
  border-color: var(--red-500);
  box-shadow: 0 0 0 3px var(--red-50);
}
.field-msg {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--red-600);
}
/* 오류가 붙으면 기존 힌트는 숨긴다 — 안내와 오류가 겹쳐 있으면 둘 다 안 읽힌다 */
.field-invalid .field-hint { display: none; }


/* 랜딩 3단계 — 번호가 순서를 말한다. 제목의 ①②③ 을 떼고 배지로 옮겼다 */
.step-card { position: relative; }
.step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.step-num {
  font-family: var(--font-num);
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  color: var(--grey-200);
  user-select: none;
}
.step-card:hover {
  border-color: var(--navy-200);
  box-shadow: 0 4px 18px rgba(11, 31, 56, 0.08);
}

/* ═══════════════════════════════════════════════════════════════════════════
   가입 폼 — 중복 확인·통신사·단계 게이트
   ═══════════════════════════════════════════════════════════════════════════ */
/* 입력 오른쪽 체크 마크 — "확인됐다" 는 초록 하나면 충분하다 */
.input-check { position: relative; }
.input-check .input { padding-right: 40px; }
.input-check-mark {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--green-500);
  display: flex;
  pointer-events: none;
}
/* display:flex 가 hidden 속성(UA 의 display:none)을 이겨서 체크가 입력
   전부터 보였다 — hidden 이 항상 이기게 명시한다 */
.input-check-mark[hidden] { display: none; }

/* 아이디·닉네임 확인 전에는 나머지가 닫혀 있다 — 흐려서 "아직" 임을 말한다 */
.signup-rest {
  border: none;
  padding: 0;
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  transition: opacity 0.18s;
}
.signup-rest:disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* 통신사 4택 — 라디오보다 버튼이 엄지에 맞다 */
.carrier-grid {
  display: grid;
  /* 6개 (통신 3사 + 망별 알뜰 3) — 3×2 */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.carrier-btn {
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--bg-elevated);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.carrier-btn:hover { border-color: var(--navy-300, var(--grey-400)); }
.carrier-btn.active {
  border-color: var(--navy-700);
  background: var(--navy-50);
  color: var(--navy-800);
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════════════════
   모바일 최하단 보장

   마지막 컨텐츠가 탭바·홈 인디케이터·고객센터 버튼에 가려 "짤린 채" 끝나는
   화면이 있었다. 스크롤 끝에는 항상 숨 쉴 여백이 있어야 한다.
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .has-tabbar {
    /* 탭바 58px + 고객센터 버튼 지름 + 안전 영역 */
    padding-bottom: calc(132px + env(safe-area-inset-bottom)) !important;
  }
  /* 콘솔(탭바 없음)은 컨텐츠 영역에 여백을 준다 */
  .content {
    padding-bottom: calc(56px + env(safe-area-inset-bottom));
  }
  /* 비로그인 랜딩·폼 화면 */
  .auth-wrap,
  .pubsec:last-of-type {
    padding-bottom: calc(48px + env(safe-area-inset-bottom));
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   API 문서 (가맹점 콘솔)

   별도 사이트를 두지 않고 콘솔 안에 둔다 — 키를 발급한 자리에서 예제를
   바로 복사할 수 있어야 연동이 한 번에 끝난다.
   ═══════════════════════════════════════════════════════════════════════════ */
.doc-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-elevated);
}
.doc-block + .doc-block { margin-top: 12px; }
.doc-title {
  padding: 12px 14px 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
}
.doc-desc {
  padding: 4px 14px 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-tertiary);
}
.doc-code {
  margin: 0;
  padding: 14px;
  background: var(--navy-950);
  color: #d7e3f4;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  line-height: 1.65;
  /* 긴 curl 한 줄이 화면을 밀지 않게 자기 안에서 스크롤한다 */
  overflow-x: auto;
  white-space: pre;
}
.doc-code code { font: inherit; color: inherit; }
.doc-desc code,
.section-desc code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--grey-100);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.92em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   요율 흐름

   자율 마진(§3.10)에서 요율은 **아래로 갈수록 높아진다.** 숫자만 나열하면
   그 방향이 안 읽히므로 원가 → 내 요율 → 내 몫을 흐름으로 보여준다.
   ═══════════════════════════════════════════════════════════════════════════ */
.rate-flow {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}
.rate-step {
  flex: 1 1 120px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
}
.rate-step-k { font-size: 11.5px; color: var(--text-tertiary); }
.rate-step-v {
  font-size: 19px;
  font-weight: 750;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
/* 원가는 나가는 돈, 내 몫은 남는 돈 — 색으로 방향을 말한다 */
.rate-step.is-cost .rate-step-v { color: var(--text-secondary); }
.rate-step.is-offer { border-color: var(--navy-300, var(--border-strong)); }
.rate-step.is-mine {
  background: var(--green-50);
  border-color: var(--green-500);
}
.rate-step.is-mine .rate-step-v { color: var(--green-600); }
.rate-arrow {
  align-self: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--grey-400);
  flex: none;
}

.rate-range {
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--bg-sunken);
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* 변경 모달 — 슬라이더로 허용 범위 자체를 보여준다 */
.rate-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rate-num { flex: 1; min-width: 0; text-align: right; font-size: 20px; font-weight: 700; }
.rate-unit { font-size: 16px; font-weight: 700; color: var(--text-tertiary); }
.rate-slider {
  width: 100%;
  margin-top: 12px;
  accent-color: var(--navy-700);
}
.rate-slider-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.rate-preview {
  margin-top: var(--sp-4);
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-sunken);
  text-align: left;
}

/* ── 분쟁 증빙 목록 (§3.7) ─────────────────────────────────────────────── */
.evd-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s;
  font: inherit;
  color: inherit;
}
.evd-row:hover { border-color: var(--blue-400, #60a5fa); }
.evd-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-2, rgba(0, 0, 0, 0.04));
  color: var(--text-tertiary);
  flex: none;
}
.d-block { display: block; }
.t-link { color: var(--blue-600, #2563eb); font-weight: 600; }

/* ── 계좌 워터마크 (§3.5) — 열람자 식별을 계좌 카드 위에 깐다 ─────────── */
.pii-card { position: relative; overflow: hidden; }
/*
 * 비가시 워터마크 (포렌식 방식 — 웹툰 뷰어와 같은 원리).
 *
 * 눈에는 안 보이지만 스크린샷 픽셀에는 배경과 약 5/255 차이로 남는다.
 * 캡처가 유출되면 어드민 '캡처 판독' 도구가 레벨을 증폭해 열람자를 읽어낸다.
 *
 * **보이면 안 되는 이유**: 보이는 워터마크는 유출자가 잘라내거나 지운다.
 * 있는 줄 모르면 지울 생각도 못 한다. 화면 고지는 "열람이 기록된다" 까지만
 * 말하고 이 층의 존재는 말하지 않는다.
 *
 * 불투명도를 더 낮추면(≤0.01) 메신저 재압축(JPEG)에서 소실되고, 높이면
 * (≥0.04) 밝은 화면에서 희미하게 보인다. 0.02 는 그 사이의 값이다.
 */
.pii-watermark {
  position: absolute;
  inset: -30%;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 22px;
  align-content: space-around;
  justify-content: space-around;
  transform: rotate(-18deg);
  pointer-events: none;
  user-select: none;
  z-index: 1;
}
.pii-watermark span {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  color: currentColor;
  opacity: 0.02;
}
/* 내용은 워터마크 위에 — 읽기와 복사 버튼이 방해받으면 안 된다 */
.pii-card > :not(.pii-watermark) { position: relative; z-index: 2; }

/* ── 약관·방침 (마일스톤 11) ──────────────────────────────────────────── */
.legal-page { max-width: 640px; }
.legal-body h2 { font-size: 15px; font-weight: 700; margin: 24px 0 8px; }
.legal-body p, .legal-body li { font-size: 13.5px; line-height: 1.7; color: var(--text-secondary); }
.legal-body ul { padding-left: 18px; margin: 6px 0 14px; }
.legal-body li { margin-bottom: 4px; }
.doc-table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: 12.5px; }
.doc-table th, .doc-table td { border: 1px solid var(--border); padding: 7px 9px; text-align: left; vertical-align: top; }
.doc-table th { background: var(--surface-2, rgba(0,0,0,0.03)); font-weight: 600; }

/* ── 스크롤바 (데스크탑) — 콘텐츠를 가리지 않는 얇은 막대 ─────────────── */
@media (min-width: 1024px) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-thumb {
    background: var(--grey-300);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
  }
  ::-webkit-scrollbar-thumb:hover { background-color: var(--grey-400); }
  ::-webkit-scrollbar-track { background: transparent; }
}

/* 판매 자격 체크리스트의 "아직" 상태 — 빈 원은 흐리게 */
.check-todo { color: var(--grey-300); }

/* ── 유통 관제 (§3.13) — 경고선이 색으로 보이는 지표 카드 ─────────────── */
.control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1100px) {
  .control-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .control-grid { grid-template-columns: 1fr; }
}
.control-card {
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--bg-elevated);
}
.control-green { border-left-color: var(--green-500); }
.control-yellow { border-left-color: var(--yellow-500); background: var(--yellow-50); }
.control-red { border-left-color: var(--red-500); background: var(--red-50); }
.control-grey { border-left-color: var(--grey-300); }
.control-title { font-size: 12.5px; font-weight: 650; color: var(--text-tertiary); }
.control-value {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.control-sub { margin-top: 4px; font-size: 12px; color: var(--text-tertiary); }
.control-sub .btn-text { font-size: 12px; padding: 0 2px; }
.control-action {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 12.5px;
  font-weight: 600;
}
.control-yellow .control-action { color: var(--yellow-700); }
.control-red .control-action { color: var(--red-600); }

/* 콘솔 전역 경고 — 장부 불일치처럼 화면과 무관하게 알아야 하는 것 */
.shell-alert {
  grid-column: 1 / -1;
  padding: 10px 16px;
  background: var(--red-50);
  color: var(--red-600);
  border-bottom: 1px solid var(--red-200);
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
}
.shell-alert a { color: inherit; text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════════════════
   콘솔 폴리시 — 표·배지·행동의 위계를 또렷하게

   운영 화면의 신뢰감은 장식이 아니라 판독성이다: 헤더는 데이터와 즉시
   구분되고, 행은 따라 읽히고, 누를 수 있는 것은 눌러 보이기 전에 알 수 있다.
   ═══════════════════════════════════════════════════════════════════════════ */

/* 표 — 헤더 대비를 올리고 행 추적을 돕는다 */
.data-table th {
  font-weight: 650;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  border-bottom: 2px solid var(--grey-200);
  white-space: nowrap;
}
.data-table tbody tr { transition: background-color 0.1s ease; }
.data-table tbody tr:hover { background: var(--grey-50); }
.data-table td { vertical-align: middle; }
/* 숫자는 항상 등폭 — 열이 자로 잰 듯 맞아야 훑어 내려갈 수 있다 */
.data-table .num, .stat-value, .kv-val { font-variant-numeric: tabular-nums; }

/* 긴 텍스트 셀 — 한 줄로 자르고 전체는 title 로 */
.cell-clip {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 이름/제목 셀의 행 전체 링크 — 파란 밑줄 없이, 호버에서만 드러난다 */
.link-plain { color: inherit; text-decoration: none; display: block; }
.link-plain:hover .t-body-strong { color: var(--blue-600); text-decoration: underline; }

/* 배지 — 톤별 대비 통일 (연한 바탕 + 진한 글자) */
.badge { font-weight: 650; letter-spacing: 0.01em; }

/* 위험 조치 버튼은 호버에서 색이 먼저 경고한다 */
.btn-ghost:hover { background: var(--grey-100); }
.danger-zone .btn:hover, .btn-danger:hover { filter: brightness(0.96); }

/* 페이지 제목 밑 설명과 본문 사이 리듬 */
.page-title + * { margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════════════════
   가맹점 콘솔 — 결제 QR · API 연동 리디자인
   ═══════════════════════════════════════════════════════════════════════════ */

/* 좌측 포스터 열 */
.qr-col-left { position: sticky; top: 76px; align-self: start; }
.qr-share { display: flex; gap: 8px; margin-top: 12px; justify-content: center; }
.qr-poster-sm { max-width: 240px; }

/* 흐름 한 줄 스텝 */
.flow-strip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 16px;
  background: var(--blue-50); border-radius: 12px;
  font-size: 13px; color: var(--text-secondary);
}
.flow-strip .icon { color: var(--text-tertiary); flex: none; }
.flow-step b {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--blue-500); color: #fff; font-size: 11.5px; margin-right: 5px;
}

/* 도구 카드 */
.tool-card { margin-bottom: 16px; }
.tool-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tool-ico {
  display: grid; place-items: center; flex: none;
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--blue-50); color: var(--blue-600);
}
.tool-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.tool-cell {
  padding: 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg-sunken, var(--grey-50));
}
.tool-cell-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 700;
}
.tool-list-head {
  margin: 18px 0 8px; font-size: 13.5px; font-weight: 700;
  display: flex; gap: 8px; align-items: baseline;
}
.tool-danger summary::-webkit-details-marker { display: none; }
.tool-danger[open] .doc-chevron { transform: rotate(180deg); }
@media (max-width: 900px) {
  .tool-grid { grid-template-columns: 1fr; }
  .qr-col-left { position: static; }
}

/* 연동 상태 스트립 */
.integration-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.integration-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 999px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-secondary);
}
.integration-chip b { color: var(--text-primary); }
.integration-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grey-300); }
.integration-dot.is-on { background: var(--green-500); }
.integration-dot.is-bad { background: var(--red-500); }

/* 접이식 API 문서 */
.doc-base {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px;
}
.doc-summary {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; cursor: pointer; user-select: none;
  list-style: none;
}
.doc-summary::-webkit-details-marker { display: none; }
.doc-summary:hover { background: var(--grey-50); }
.doc-path { font-family: var(--font-mono, monospace); font-size: 12.5px; color: var(--text-secondary); }
.doc-summary-title { font-size: 13.5px; font-weight: 650; margin-left: auto; }
.doc-chevron { color: var(--text-tertiary); transition: transform 0.15s ease; flex: none; }
.doc-block[open] > .doc-summary .doc-chevron { transform: rotate(180deg); }
.doc-block[open] > .doc-summary { border-bottom: 1px solid var(--border); }

.method-badge {
  flex: none; font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 6px; font-family: var(--font-mono, monospace);
}
.method-get { background: var(--blue-50); color: var(--blue-600); }
.method-post { background: var(--green-50); color: var(--green-600); }

.doc-code-wrap { position: relative; }
.doc-copy {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  padding: 4px 10px; font-size: 11.5px; font-weight: 650;
  border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 7px;
  background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}
.doc-copy:hover { background: rgba(255, 255, 255, 0.16); }

/* ═══════════════════════════════════════════════════════════════════════════
   리포트 — 델타 배지 · 바 차트
   ═══════════════════════════════════════════════════════════════════════════ */
.delta {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.delta-up { background: var(--green-50); color: var(--green-600); }
.delta-down { background: var(--red-50); color: var(--red-600); }
.delta-flat { background: var(--grey-100); color: var(--text-tertiary); }
.bar-chart { margin-top: 6px; }
.chart-empty {
  padding: 28px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* 재무 카드 그리드 — 없으면 카드가 세로로 한 줄씩 쌓인다 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 16px 18px;
}
.stat-head { font-size: 12.5px; color: var(--text-tertiary); margin-bottom: 6px; }
.stat-sub { margin-top: 6px; font-size: 12px; color: var(--text-tertiary); }

/* 오프라인 배너 — 회선이 끊기면 모든 앱 상단에 뜬다 (core.js 가 관리) */
.net-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 14px 7px;
  background: #3c454a;
  color: #fff;
  font-size: 12.5px;
  font-weight: 650;
  text-align: center;
}
