/* =================================================================
   allAbut — 로그인 후 앱 화면 (밝은 테마)
   - 배경 #F7F8FA, 카드 흰색, 글자 네이비, 포인트 골드
   - 본문 16px 이상, 버튼 높이 52px 이상
   - 화면 폭: 모바일 → 1024px 이상 PC(메뉴·3단) → 1280px 이상 헤더 전체 표시
   ================================================================= */

.screen-app {
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ================================================================
   헤더
   ================================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.hdr-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
  min-height: 68px;
}
.hdr-logo { text-decoration: none; display: inline-flex; align-items: center; padding: 8px 0; }

/* 밝은 배경용 로고: all/but 네이비, A·5μm 골드 */
.logo-light { font-size: 26px; }
.logo-light .logo-all,
.logo-light .logo-but { color: var(--navy); font-weight: 400; }
.logo-light .logo-a,
.logo-light .logo-um { color: var(--gold); }

.hdr-nav { display: none; gap: 4px; margin: 0 auto; }
.hdr-link {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 14px;
  font-size: 1.0625rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.hdr-link { white-space: nowrap; }
.hdr-link:hover { color: var(--navy); }
.hdr-right .btn, .hdr-menu-btn { white-space: nowrap; }
.hdr-link.active { color: var(--navy); font-weight: 700; border-bottom-color: var(--gold); }

.hdr-right { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.hdr-nav + .hdr-right { margin-inline-start: 0; }
.hdr-wide { display: none; align-items: center; gap: 10px; }

/* 크레딧 배지 */
.credit-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  background: #FBF6E4;
  border: 1px solid #EAD9A0;
  border-radius: 999px;
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.credit-badge .credit-value { font-size: 1.0625rem; }
.credit-unit { font-size: 0.875rem; font-weight: 500; color: var(--muted); }

/* 세션 타이머 */
.session-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--navy);
  white-space: nowrap;
}
.session-time { min-width: 3.4em; font-size: 1rem; font-weight: 500; }
.session-time.warn { color: #B54708; }
.session-time.danger { color: var(--danger); animation: session-blink 1.6s ease-in-out infinite; }
@keyframes session-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.session-extend {
  min-height: 40px;
  padding: 0 12px;
  background: #fff;
  border: 1.5px solid var(--navy);
  border-radius: 999px;
  color: var(--navy);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}
.session-extend:hover { background: #F0F4FA; }
.session-extend:disabled { cursor: default; opacity: 0.75; }

/* 언어 드롭다운 */
.lang-select { display: inline-flex; align-items: center; gap: 6px; }
.lang-select select {
  min-height: 44px;
  padding: 0 8px;
  background: #fff;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--navy);
  cursor: pointer;
}

/* 글자 크기 A / A+ / A++ */
.font-buttons { display: inline-flex; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.font-btn {
  min-height: 42px;
  min-width: 46px;
  padding: 0 8px;
  background: #fff;
  border: none;
  border-inline-start: 1px solid var(--border);
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
}
.font-btn:first-child { border-inline-start: none; }
.font-btn[data-font="large"] { font-size: 1.1em; }
.font-btn[data-font="xlarge"] { font-size: 1.2em; }
.font-btn.active { background: var(--navy); color: #fff; }

/* 펼치는 메뉴 (좁은 화면) */
.hdr-menu {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 12px 16px 16px;
  display: grid;
  gap: 12px;
  max-width: 560px;
  margin-inline-start: auto;
  box-shadow: var(--shadow);
}
.hdr-menu[hidden] { display: none; }
.hdr-menu-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hdr-menu-label { font-weight: 600; color: var(--muted); }

/* ================================================================
   모바일 하단 탭 (4개, 아이콘 + 글자)
   ================================================================ */
.app-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 64px;
  padding: 6px 2px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  border-top: 3px solid transparent;
}
.tab-icon { font-size: 1.375rem; line-height: 1; }
.tab-label { text-align: center; line-height: 1.2; }
.tab-link.active { color: var(--navy); font-weight: 700; border-top-color: var(--gold); }

/* ================================================================
   본문
   ================================================================ */
.app-main {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 16px 110px;   /* 아래 탭에 가리지 않게 */
  outline: none;
}
.page-title { font-size: 1.75rem; font-weight: 600; color: var(--navy); line-height: 1.3; }
.page-desc { margin-top: 4px; color: var(--muted); font-size: 1.0625rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-title { font-size: 1.25rem; font-weight: 600; color: var(--navy); }
.card-desc { color: var(--muted); margin: 4px 0 16px; }
.muted { color: var(--muted); }
.pre { white-space: pre-wrap; word-break: break-word; }
.nowrap { white-space: nowrap; }
.empty-text { padding: 16px 0; color: var(--muted); font-size: 1.0625rem; }
.error-text { color: var(--danger); }
.section-label { margin: 22px 0 10px; font-weight: 600; color: var(--navy); font-size: 1.0625rem; }

/* ================================================================
   버튼 (높이 52px 이상, 항상 글자 라벨)
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, filter 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #062B66; }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--border-strong); }
.btn-outline:hover:not(:disabled) { border-color: var(--navy); background: #F5F7FB; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover:not(:disabled) { filter: brightness(1.07); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.1); }
.btn-danger-text { color: var(--danger); }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 0.9375rem; }
.btn-lg { min-height: 58px; padding: 0 28px; font-size: 1.125rem; }
.btn-block { width: 100%; }

.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; gap: 10px; padding: 16px 0; color: var(--muted); }

/* ================================================================
   입력칸
   ================================================================ */
.field { margin-bottom: 16px; min-width: 0; }
.field-label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--navy); font-size: 1rem; }
.optional { font-weight: 400; color: var(--muted); }
.required { color: var(--danger); }
.field-help { margin-top: 6px; color: var(--muted); font-size: 0.9375rem; }
.input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  background: #fff;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 1.0625rem;
  color: var(--text);
}
.input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(0, 29, 74, 0.12); }
.input.invalid { border-color: var(--danger); background: var(--danger-bg); }
.input-lg { min-height: 60px; font-size: 1.25rem; }
select.input { cursor: pointer; }
.textarea { min-height: 120px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.field-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
  color: var(--danger);
  font-weight: 500;
  font-size: 0.9375rem;
}
.form-grid { display: grid; gap: 4px 20px; }
.form-grid.two { grid-template-columns: 1fr; }
.span-2 { grid-column: 1 / -1; }
.form-actions { margin-top: 8px; }
.readonly-value { min-height: 52px; display: flex; align-items: center; padding: 0 14px; background: #F1F3F6; border-radius: var(--radius-sm); color: var(--muted); word-break: break-all; }
.checkbox { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; cursor: pointer; font-size: 1.0625rem; }
.checkbox input { width: 24px; height: 24px; accent-color: var(--navy); }

/* 날짜: 상자 어디를 눌러도 달력 */
.date-box { position: relative; cursor: pointer; }
.date-icon { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); font-size: 1.25rem; pointer-events: none; }
.date-input { padding-inline-start: 48px; cursor: pointer; }
.date-input::-webkit-calendar-picker-indicator { cursor: pointer; width: 28px; height: 28px; }

/* ================================================================
   배지 · 진행 막대
   ================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  background: #EEF2F7;
  color: var(--navy);
}
.stage-submitted { background: #EEF2F7; color: #1F3A68; }
.stage-confirmed { background: #E0EAFF; color: #1E3A8A; }
.stage-design_ready { background: #FFF1C2; color: #7A4F01; }
.stage-design_revision { background: #FFE4D5; color: #9A3412; }
.stage-approved { background: #DCFCE7; color: #166534; }
.stage-milling { background: #E0F2FE; color: #075985; }
.stage-shipped { background: #EDE9FE; color: #5B21B6; }
.stage-done { background: #D1FAE5; color: #065F46; }
.stage-cancelled { background: #F2F4F7; color: #475467; }
.credit-charge { background: var(--success-bg); color: var(--success); }
.credit-use { background: #EEF2F7; color: var(--navy); }
.credit-refund { background: #E0F2FE; color: #075985; }
.credit-adjust { background: #F2F4F7; color: #475467; }

.stagebar { display: flex; list-style: none; margin: 14px 0 4px; gap: 0; }
.stagebar-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; min-width: 0; }
.stagebar-step::before {
  content: '';
  position: absolute;
  top: 15px;
  inset-inline-start: -50%;
  width: 100%;
  height: 3px;
  background: var(--border);
  z-index: 0;
}
.stagebar-step:first-child::before { display: none; }
.stagebar-step.done::before,
.stagebar-step.current::before { background: var(--navy); }
.stagebar-dot {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid var(--border-strong);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
}
.stagebar-step.done .stagebar-dot { background: var(--navy); border-color: var(--navy); color: #fff; }
.stagebar-step.current .stagebar-dot { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.stagebar-label { font-size: 0.75rem; color: var(--muted); text-align: center; line-height: 1.2; display: none; overflow-wrap: anywhere; }
.stagebar-step.current .stagebar-label { color: var(--navy); font-weight: 600; display: block; }

/* ================================================================
   홈
   ================================================================ */
.draft-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 14px 18px;
  background: var(--warn-bg);
  border: 1.5px solid var(--warn-border);
  border-radius: var(--radius);
  font-size: 1.0625rem;
  font-weight: 500;
}
.draft-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.home-cards { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 20px 0; }
.home-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 150px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--navy);
  transition: transform 0.15s, box-shadow 0.15s;
}
.home-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 29, 74, 0.1); }
.home-card-label { font-size: 1.125rem; font-weight: 600; }
.home-card-number { font-size: 2.75rem; font-weight: 600; line-height: 1.1; }
.home-card-desc { color: var(--muted); }
.home-card-new { background: var(--navy); border-color: var(--navy); color: #fff; min-height: 170px; justify-content: center; }
.home-card-new .home-card-label { font-size: 1.75rem; }
.home-card-new .home-card-desc { color: #C9D6EA; font-size: 1.0625rem; }
.home-card-arrow { position: absolute; inset-inline-end: 22px; bottom: 16px; font-size: 2.5rem; color: var(--gold); line-height: 1; }

.order-list { list-style: none; }
.order-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  padding: 14px 4px;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: var(--navy);
  min-height: 64px;
}
.order-list li:first-child .order-row { border-top: none; }
.order-row:hover { background: #F8FAFC; }
.order-row-id { font-weight: 600; font-size: 1.0625rem; }
.order-row-meta { grid-column: 1 / 2; color: var(--muted); font-size: 0.9375rem; }
.order-row .badge { grid-row: 1 / 3; grid-column: 2; }

/* ================================================================
   새 주문 — 3단 배치
   ================================================================ */
.wiz-page-title { margin-bottom: 14px; }
.wizard { display: block; }
.wiz-steps { display: none; }
.wiz-summary { display: none; }
.wiz-main { padding: 20px 16px; }

/* 모바일 가로 진행 표시 */
.wiz-mobile-progress { margin-bottom: 14px; }
.wiz-dots { display: flex; align-items: center; list-style: none; }
.wiz-dots li { display: flex; align-items: center; }
.wiz-dots .wiz-dot-line { flex: 1; height: 3px; background: var(--border); margin: 0 4px; }
.wiz-dot {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: #fff;
  color: var(--muted);
  font-weight: 600;
}
.wiz-dots li.done .wiz-dot { background: var(--navy); border-color: var(--navy); color: #fff; }
.wiz-dots li.current .wiz-dot { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.wiz-dot-btn { background: none; border: none; padding: 4px; cursor: pointer; border-radius: 50%; }
.wiz-dots-label { margin-top: 8px; color: var(--muted); font-size: 1rem; }
.wiz-dots-label b { color: var(--navy); }

.wiz-head { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.wiz-step-label { color: var(--gold-dark); font-size: 0.875rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.wiz-title { font-size: 1.625rem; font-weight: 600; color: var(--navy); line-height: 1.3; margin-top: 2px; outline: none; }
.wiz-desc { color: var(--muted); font-size: 1.0625rem; margin-top: 4px; }

/* 아래 버튼: PC 는 카드 안, 모바일은 화면 아래 고정 */
.wiz-nav { display: none; }
.wiz-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(64px + env(safe-area-inset-bottom));   /* 하단 탭 위 */
  z-index: 55;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0, 29, 74, 0.06);
}
.wiz-bottom-bar .btn { width: 100%; padding: 0 10px; }
.page-new { padding-bottom: 90px; }

/* ===== Step 2 치아 차트 ===== */
.tooth-chart { container-type: inline-size; direction: ltr; }
.jaw { margin: 6px 0; }
.jaw-title { font-weight: 600; color: var(--navy); margin-bottom: 8px; text-align: center; }
.jaw-halves { display: flex; flex-direction: column; gap: 10px; }
.jaw-mid { display: none; }
.tooth-half { display: flex; align-items: center; gap: 8px; }
.tooth-side {
  flex: 0 0 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #F1F3F6;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.875rem;
}
.tooth-half.left { flex-direction: row-reverse; }
.tooth-row { flex: 1; display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.tooth-btn {
  min-height: 56px;
  min-width: 0;
  padding: 0;
  background: #fff;
  border: 2px solid var(--border-strong);
  border-radius: 12px;
  color: var(--navy);
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
.tooth-btn:hover { border-color: var(--navy); }
.tooth-btn.selected { background: var(--navy); border-color: var(--navy); color: #fff; }
.jaw-divider { border: none; border-top: 2px dashed var(--border-strong); margin: 16px 0; }

/* 넓으면 좌우 나란히 + 가운데 세로선 */
@container (min-width: 600px) {
  .jaw-halves { flex-direction: row; align-items: stretch; gap: 0; }
  .tooth-half { flex: 1; gap: 6px; }
  .tooth-half.right { padding-right: 8px; }
  .tooth-half.left { padding-left: 8px; }
  .tooth-row { gap: 4px; }
  .tooth-side { flex-basis: 22px; }
  .jaw-mid { display: block; width: 3px; background: var(--navy); border-radius: 2px; }
}

.tooth-legend { margin-top: 10px; color: var(--muted); font-size: 0.9375rem; text-align: center; }
.tooth-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 14px 16px;
  background: #F1F5FB;
  border-radius: var(--radius-sm);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--navy);
}
.tooth-info.warn { background: var(--danger-bg); }
.selected-teeth { margin-top: 10px; color: var(--muted); }

/* ===== Step 3 치아별 정보 ===== */
.bulk-box { padding: 16px; background: #F8F9FB; border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.bulk-title { font-weight: 600; margin-bottom: 10px; }
.bulk-grid { display: grid; gap: 14px; }
.bulk-row { display: flex; gap: 8px; flex-wrap: wrap; }
.bulk-row .input { flex: 1 1 180px; }
.bulk-row .btn { flex: 0 0 auto; }

.tooth-cards { display: grid; gap: 12px; margin-bottom: 20px; }
.tooth-card { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 14px 16px 2px; background: #fff; }
.tooth-card.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.08); }
.tooth-card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.tooth-card-num { font-size: 1.375rem; font-weight: 600; color: var(--navy); }
.tooth-card-name { color: var(--muted); font-size: 1.0625rem; }
.tooth-card-fields { display: grid; grid-template-columns: 1fr; gap: 0 14px; }

.shade-btn { display: flex; align-items: center; gap: 10px; text-align: start; cursor: pointer; }
.shade-chip { display: inline-block; flex: 0 0 auto; width: 26px; height: 26px; border-radius: 6px; border: 1.5px solid rgba(0, 29, 74, 0.25); vertical-align: middle; }
.shade-chip.empty { background: repeating-linear-gradient(45deg, #fff, #fff 4px, #E5E7EB 4px, #E5E7EB 8px); }
.shade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.shade-option {
  position: relative;
  min-height: 72px;
  border: 2px solid rgba(0, 29, 74, 0.15);
  border-radius: 12px;
  color: var(--navy);
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
}
.shade-option:hover { border-color: var(--navy); }
.shade-option.selected { border: 3px solid var(--navy); }
.shade-check { position: absolute; top: 4px; inset-inline-end: 8px; font-size: 1rem; }

/* ===== Step 4 파일 ===== */
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 16px;
  border: 2.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: #FAFBFC;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.drop-zone.dragging { border-color: var(--navy); background: #EEF3FB; }
.drop-icon { font-size: 2.5rem; color: var(--navy); line-height: 1; }
.drop-title { font-size: 1.25rem; font-weight: 600; }
.drop-hint { color: var(--muted); font-size: 0.9375rem; }
.file-notices { list-style: none; margin-top: 12px; }
.file-list { list-style: none; display: grid; gap: 8px; }
.file-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}
.file-row.old { opacity: 0.6; }
.file-icon { font-size: 1.75rem; }
.file-info { display: flex; flex-direction: column; min-width: 0; }
.file-name { font-weight: 600; word-break: break-all; }
.file-size { color: var(--muted); font-size: 0.9375rem; }
.file-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }

.notice { padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; display: grid; gap: 8px; justify-items: start; }
.notice-warn { background: var(--warn-bg); border: 1.5px solid var(--warn-border); }
.notice-error { background: var(--danger-bg); border: 1.5px solid #F4B4AE; color: var(--danger); font-weight: 500; margin-top: 16px; }
.notice-files { color: var(--muted); word-break: break-all; }

/* ===== Step 5 확인 ===== */
.review-group { padding: 16px 0; border-top: 1px solid var(--border); }
.review-group:first-child { border-top: none; padding-top: 0; }
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.review-title { font-size: 1.1875rem; font-weight: 600; color: var(--navy); }
.review-row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.review-label { color: var(--muted); flex-shrink: 0; }
.review-value { font-weight: 600; text-align: end; word-break: break-word; }
.review-files { list-style: none; display: grid; gap: 6px; }
.credit-box { background: #FBF8EC; border: 1.5px solid #EAD9A0; border-radius: var(--radius); padding: 16px; margin-top: 8px; }
.credit-box.short { background: var(--danger-bg); border-color: #F4B4AE; }
.credit-box .review-row:last-of-type { border-bottom: none; }
.progress-box { margin-top: 16px; padding: 14px 16px; background: #F1F5FB; border-radius: var(--radius-sm); font-weight: 500; }
.progress { height: 12px; background: #DCE3EE; border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress-fill { height: 100%; background: var(--navy); transition: width 0.3s; }
.submit-note { margin-top: 14px; color: var(--muted); font-size: 0.9375rem; }
.btn-submit { font-size: 1.25rem; }

/* 표 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.table th { text-align: start; padding: 10px 12px; background: #F4F6F9; color: var(--muted); font-weight: 600; font-size: 0.9375rem; white-space: nowrap; }
.table td { padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: middle; }
.table td .shade-chip { width: 20px; height: 20px; margin-inline-end: 4px; }
.plus { color: var(--success); font-weight: 600; }
.minus { color: var(--navy); font-weight: 600; }

/* 오른쪽 요약 */
.sum-title { font-size: 1.1875rem; font-weight: 600; color: var(--navy); padding-bottom: 10px; border-bottom: 2px solid var(--gold); margin-bottom: 12px; }
.sum-list dt { color: var(--muted); font-size: 0.9375rem; margin-top: 10px; }
.sum-list dd { font-weight: 600; word-break: break-word; }
.sum-teeth { list-style: none; display: grid; gap: 4px; margin-top: 4px; }
.sum-teeth li { display: grid; grid-template-columns: 3.2em 1fr auto; gap: 6px; align-items: center; font-size: 0.9375rem; }
.sum-brand { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.sum-shade { display: inline-flex; align-items: center; gap: 4px; }
.sum-shade .shade-chip { width: 18px; height: 18px; }
.sum-credits { margin-top: 16px; padding: 12px; background: #FBF8EC; border-radius: var(--radius-sm); display: grid; gap: 4px; }
.sum-credits div { display: flex; justify-content: space-between; gap: 8px; }
.sum-credits.short { background: var(--danger-bg); color: var(--danger); }

/* 성공 화면 */
.page-success { display: flex; justify-content: center; padding-top: 10px; }
.success-card { max-width: 620px; width: 100%; text-align: center; padding: 40px 24px; }
.success-check {
  width: 96px;
  height: 96px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  font-size: 3.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--success);
}
.success-title { font-size: 1.75rem; font-weight: 600; }
.success-label { margin-top: 18px; color: var(--muted); }
.success-id { font-size: 2.25rem; font-weight: 600; color: var(--navy); letter-spacing: 1px; word-break: break-all; }
.success-text { margin-top: 10px; color: var(--muted); font-size: 1.0625rem; }
.success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }

/* ================================================================
   내 주문
   ================================================================ */
.orders-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.seg { display: inline-flex; background: #E9EDF3; padding: 4px; border-radius: 12px; }
.seg-btn {
  min-height: 48px;
  padding: 0 20px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
}
.seg-btn.active { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0, 29, 74, 0.15); }
.search-box { position: relative; flex: 1 1 260px; }
.search-box .input { padding-inline-start: 44px; }
.search-icon { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }

.order-cards { list-style: none; display: grid; gap: 12px; }
.order-card { padding: 0; overflow: hidden; }
.order-card + .order-card { margin-top: 0; }
.order-card.cancelled { background: #F7F7F8; }
.order-card.cancelled .order-id { color: var(--muted); text-decoration: line-through; }
.order-summary {
  display: block;
  width: 100%;
  padding: 16px 18px 12px;
  background: none;
  border: none;
  text-align: start;
  cursor: pointer;
  color: inherit;
}
.order-summary:hover { background: #FAFBFD; }
.order-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.order-id { font-size: 1.1875rem; font-weight: 600; color: var(--navy); }
.order-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; font-size: 1rem; }
.order-toggle { display: block; margin-top: 6px; color: var(--navy); font-weight: 600; font-size: 0.9375rem; text-align: end; }
.order-detail { padding: 4px 18px 18px; border-top: 1px solid var(--border); }
.detail-title { font-size: 1.0625rem; font-weight: 600; color: var(--navy); margin: 18px 0 8px; }
.action-box { margin-top: 14px; padding: 14px 16px; background: #F4F6F9; border-radius: var(--radius-sm); display: grid; gap: 10px; }
.action-box.highlight { background: #FBF6E4; border: 1.5px solid #EAD9A0; }
.action-box .detail-title { margin: 0; }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; }
.memo-box { padding: 12px 14px; background: #F8F9FB; border-radius: var(--radius-sm); }
.history-list { list-style: none; display: grid; gap: 8px; }
.history-list li { padding: 10px 12px; background: #F8F9FB; border-radius: var(--radius-sm); }
.load-more { display: flex; justify-content: center; margin-top: 18px; }

/* ================================================================
   내 정보
   ================================================================ */
.profile-grid { display: grid; gap: 16px; margin-top: 16px; }
.profile-grid .card + .card { margin-top: 0; }
.big-number { font-size: 3rem; font-weight: 600; color: var(--navy); line-height: 1.1; margin-top: 8px; }
.big-number-unit { font-size: 1.125rem; color: var(--muted); font-family: var(--font-sans); }
.credit-table td { font-size: 0.9375rem; }

/* ================================================================
   토스트 · 모달
   ================================================================ */
.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(150px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 400;
  display: grid;
  gap: 8px;
  width: min(560px, calc(100% - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  background: var(--navy);
  color: #fff;
  border-radius: 10px;
  font-size: 1.0625rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast-icon { font-weight: 700; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 350;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 16, 40, 0.45);
  opacity: 0;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; }
.modal-box {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  color: var(--text);
}
.modal-box.wide { max-width: 760px; }
.modal-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  z-index: 1;
}
.modal-title { font-size: 1.25rem; font-weight: 600; color: var(--navy); }
.modal-body { padding: 20px; }
.modal-text { font-size: 1.0625rem; line-height: 1.6; margin-bottom: 8px; }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 14px 20px 20px;
}
.modal-actions .btn { flex: 1 1 140px; }

/* 파일 뷰어 */
.viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 380;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 16, 40, 0.55);
}
.viewer-overlay.open { display: flex; }
.viewer-box {
  width: 100%;
  max-width: 960px;
  height: min(780px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  color: var(--text);
}
.viewer-head, .viewer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.viewer-head { border-bottom: 1px solid var(--border); }
.viewer-foot { border-top: 1px solid var(--border); }
.viewer-title { font-weight: 600; word-break: break-all; }
.viewer-hint { color: var(--muted); font-size: 0.9375rem; }
.viewer-body { flex: 1; min-height: 0; position: relative; background: #F1F3F6; }
.viewer-panel { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.viewer-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-pdf { width: 100%; height: 100%; border: none; background: #fff; }
.viewer-msg { padding: 24px; text-align: center; color: var(--muted); font-size: 1.125rem; }

/* ================================================================
   관리자 화면
   ================================================================ */
.admin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.9375rem;
}
.admin-badge-lg { font-size: 1rem; vertical-align: middle; }
.hdr-link-admin.active .admin-badge { box-shadow: 0 0 0 2px var(--navy); }
.page-admin { max-width: 1280px; margin: 0 auto; }
.admin-tabs { margin-bottom: 18px; flex-wrap: wrap; }

/* 대시보드 */
.admin-stage-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.admin-stage-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 96px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-inline-start: 5px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--navy);
  text-align: start;
  cursor: pointer;
}
.admin-stage-card:hover { border-color: var(--navy); }
.admin-stage-count { font-size: 2rem; font-weight: 600; line-height: 1.1; }
.admin-stage-name { font-weight: 600; color: var(--muted); }
.stage-card-submitted { border-inline-start-color: #1F3A68; }
.stage-card-confirmed { border-inline-start-color: #3B5BDB; }
.stage-card-design_ready { border-inline-start-color: #E0A800; }
.stage-card-design_revision { border-inline-start-color: #E8590C; }
.stage-card-approved { border-inline-start-color: #2F9E44; }
.stage-card-milling { border-inline-start-color: #1C7ED6; }
.stage-card-shipped { border-inline-start-color: #7048E8; }
.admin-stats { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 16px; }
.admin-stats .card + .card { margin-top: 0; }
.admin-stat { display: flex; flex-direction: column; gap: 4px; }
.admin-stat-label { color: var(--muted); font-weight: 600; }
.admin-stat-num { font-size: 2.25rem; font-weight: 600; color: var(--navy); line-height: 1.1; }
.order-row { width: 100%; background: none; border-left: none; border-right: none; border-bottom: none; text-align: start; cursor: pointer; font: inherit; }
.admin-due-row.overdue { background: var(--danger-bg); }
.admin-due-row.soon { background: #FFF4E5; }

/* 납기 색 */
.due.overdue { color: var(--danger); font-weight: 700; }
.due.soon { color: #B54708; font-weight: 700; }

/* 주문 목록 */
.admin-tools { align-items: flex-end; }
.admin-tools .field { margin-bottom: 0; flex: 0 1 220px; }
.admin-tools .admin-search { flex: 1 1 280px; }
.admin-table-wrap { display: none; background: #fff; }
.admin-table tr.clickable { cursor: pointer; }
.admin-table tr.clickable:hover td { background: #F5F8FC; }
.admin-table td { padding: 12px; }
.admin-order-cards { list-style: none; display: grid; gap: 10px; }
.admin-order-card { display: block; width: 100%; text-align: start; cursor: pointer; font: inherit; color: inherit; }
.admin-card-clinic { display: block; margin-top: 6px; font-weight: 600; font-size: 1.0625rem; }
.credit-badge-sm { padding: 2px 10px; border-radius: 999px; background: #FBF6E4; font-weight: 600; }
.admin-count { margin-bottom: 8px; }

/* 주문 상세 */
.admin-detail-status { display: grid; gap: 4px; margin-bottom: 8px; }
.admin-detail-status .badge { justify-self: start; }
.admin-actions .btn-lg { justify-self: start; }
.admin-waiting { font-size: 1.0625rem; font-weight: 600; color: var(--navy); }
.admin-detail-grid { display: grid; grid-template-columns: 1fr; gap: 8px 28px; }
.revision-box { padding: 14px 16px; background: var(--warn-bg); border: 2px solid var(--warn-border); border-radius: var(--radius-sm); }
.revision-title { font-weight: 700; color: #7A4F01; margin-bottom: 6px; }
.revision-text { font-size: 1.125rem; font-weight: 600; color: var(--navy); }
.admin-extra { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.admin-extra summary { min-height: 48px; display: flex; align-items: center; padding: 0 14px; cursor: pointer; font-weight: 600; color: var(--muted); }
.admin-extra-body { padding: 4px 14px 14px; display: grid; gap: 10px; justify-items: start; }
.admin-extra-body .field { width: 100%; margin-bottom: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
}
.chip:hover { border-color: var(--navy); background: #F5F7FB; }

/* 디자인 버전 */
.design-versions { list-style: none; display: grid; gap: 10px; }
.design-version { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; opacity: 0.75; }
.design-version.latest { opacity: 1; border: 2px solid var(--gold); }
.design-version-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.design-version-tag { font-weight: 700; font-size: 1.0625rem; color: var(--navy); }

/* 처리 이력 타임라인 */
.timeline { list-style: none; position: relative; padding-inline-start: 22px; }
.timeline::before { content: ''; position: absolute; top: 6px; bottom: 6px; inset-inline-start: 7px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding: 6px 0 12px; }
.timeline-dot { position: absolute; inset-inline-start: -20px; top: 12px; width: 12px; height: 12px; border-radius: 50%; background: var(--navy); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border-strong); }
.timeline-item.action-rejected .timeline-dot { background: #E8590C; }
.timeline-item.action-cancelled .timeline-dot { background: var(--danger); }
.timeline-item.action-approved .timeline-dot,
.timeline-item.action-received .timeline-dot,
.timeline-item.action-marked_done .timeline-dot { background: var(--success); }
.timeline-head { line-height: 1.5; }
.timeline-note { margin-top: 4px; padding: 8px 12px; background: #F8F9FB; border-radius: var(--radius-sm); }

/* ================================================================
   자체 달력 (ui/datepicker.js)
   ================================================================ */
.date-field {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: start;
  cursor: pointer;
  font-weight: 600;
}
.date-field.empty .date-field-text { color: var(--muted); font-weight: 400; }
.date-field-icon { font-size: 1.375rem; }
.date-field:hover { border-color: var(--navy); }
.datepicker {
  position: fixed;
  z-index: 420;
  width: 340px;
  max-width: calc(100vw - 16px);
  padding: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 29, 74, 0.2);
  color: var(--text);
}
.datepicker.sheet {
  left: 0 !important;
  right: 0;
  bottom: 0;
  top: auto !important;
  width: 100%;
  max-width: none;
  border-radius: 18px 18px 0 0;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
  animation: sheet-up 0.2s ease;
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.datepicker-backdrop { position: fixed; inset: 0; z-index: 410; background: rgba(0, 16, 40, 0.45); }
.dp-grab { width: 48px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 0 auto 10px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.dp-title { font-size: 1.125rem; font-weight: 600; color: var(--navy); text-align: center; flex: 1; }
.dp-nav {
  min-width: 48px;
  min-height: 48px;
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  font-size: 1rem;
  cursor: pointer;
}
.dp-nav:hover:not(:disabled) { border-color: var(--navy); }
.dp-nav:disabled { opacity: 0.35; cursor: not-allowed; }
.dp-week, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dp-week span { text-align: center; font-size: 0.8125rem; font-weight: 600; color: var(--muted); padding: 4px 0; }
.dp-day {
  min-height: 44px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #F6F7F9;
  color: var(--navy);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.dp-day:hover:not(:disabled) { border-color: var(--navy); background: #fff; }
.dp-day.today { border-color: var(--gold); }
.dp-day.selected { background: var(--navy); border-color: var(--navy); color: #fff; }
.dp-day.disabled { background: transparent; color: #B8BEC8; cursor: not-allowed; text-decoration: line-through; }
.dp-day:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.dp-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.dp-foot .btn { flex: 1; }

/* ===== 팝오버 ("? Help") ===== */
.wiz-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.help-btn { gap: 6px; }
.help-q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
}
.popover {
  position: absolute;
  z-index: 300;
  padding: 16px;
  background: #fff;
  border: 1.5px solid var(--gold);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 29, 74, 0.18);
  color: var(--text);
  display: grid;
  gap: 12px;
}
.popover-body { display: grid; gap: 8px; font-size: 1.0625rem; line-height: 1.6; }
.popover-title { font-weight: 700; color: var(--navy); }
.popover-link { color: var(--navy); font-weight: 600; }
.popover-close { justify-self: end; }

/* ===== 작성 중인 주문 고르기 ===== */
.draft-choice {
  margin-bottom: 16px;
  padding: 18px 20px;
  background: var(--warn-bg);
  border: 2px solid var(--warn-border);
  border-radius: var(--radius);
  display: grid;
  gap: 8px;
}
.draft-choice-title { font-size: 1.25rem; font-weight: 700; color: var(--navy); }
.draft-choice-info { font-size: 1.0625rem; font-weight: 500; }
.draft-choice-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.btn-discard { color: var(--danger); border-color: #E8A39C; }
.btn-discard:hover:not(:disabled) { border-color: var(--danger); background: var(--danger-bg); }
.wiz-locked { opacity: 0.4; pointer-events: none; user-select: none; filter: grayscale(0.3); }

/* ===== 가이드 ===== */
.guide-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 16px 20px;
  background: #fff;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.guide-banner-icon { font-size: 2rem; }
.guide-banner-text { flex: 1 1 260px; }
.guide-banner-title { font-size: 1.1875rem; font-weight: 700; color: var(--navy); }
.guide-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.guide-banner-small { margin-bottom: 14px; font-weight: 600; }
.guide-banner-small a { color: var(--navy); }
.page-guide { max-width: 860px; margin: 0 auto; font-size: 1.0625rem; }
.guide-toc { margin: 18px 0; }
.guide-toc-title { font-weight: 700; margin-bottom: 8px; }
.guide-toc ol { list-style: none; display: grid; gap: 6px; }
.guide-toc-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  font-size: 1.0625rem;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
}
.guide-toc-link:hover { border-color: var(--navy); }
.guide-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}
.guide-section { margin-top: 16px; }
.guide-h2 { display: flex; align-items: center; gap: 10px; font-size: 1.5rem; font-weight: 600; color: var(--navy); margin-bottom: 12px; outline: none; }
.guide-icon { font-size: 1.5rem; }
.guide-body { display: grid; gap: 10px; line-height: 1.7; }
.guide-body .btn { justify-self: start; }
.guide-big { font-size: 1.375rem; font-weight: 700; color: var(--navy); }
.guide-steps, .guide-flow { list-style: none; display: grid; gap: 12px; }
.guide-steps li, .guide-flow li { display: flex; gap: 14px; align-items: flex-start; padding: 12px; background: #F8F9FB; border-radius: 10px; }
.guide-step-num, .guide-flow-num {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
}
.guide-h3 { font-size: 1.1875rem; font-weight: 600; color: var(--navy); }
.guide-flow li.action { background: #FBF6E4; border: 1.5px solid #EAD9A0; }
.guide-flow-num { background: #fff; border: 2px solid var(--navy); }
.guide-warn { padding: 12px 14px; background: var(--danger-bg); color: var(--danger); font-weight: 600; border-radius: 10px; }
.guide-faq { display: grid; gap: 8px; }
.guide-faq-item { border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.guide-faq-item summary { min-height: 52px; display: flex; align-items: center; padding: 8px 14px; font-weight: 600; cursor: pointer; color: var(--navy); }
.guide-faq-item p { padding: 0 14px 14px; }
.guide-cta { display: flex; justify-content: center; margin: 28px 0 8px; }

/* ===== 관리자 월별 대시보드 ===== */
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 0 14px; padding-top: 18px; border-top: 2px solid var(--border); }
.month-title { font-size: 1.375rem; font-weight: 600; color: var(--navy); text-align: center; }
.admin-stats.five { grid-template-columns: repeat(2, 1fr); }
.stat-done .admin-stat-num { color: var(--success); }
.stat-cancelled .admin-stat-num { color: #667085; }
.bars { display: flex; align-items: stretch; gap: 3px; height: 200px; padding-top: 8px; }
.bar-col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; }
.bar { display: block; width: 100%; background: var(--navy); border-radius: 4px 4px 0 0; }
.bar-val { font-size: 0.6875rem; color: var(--muted); line-height: 1; min-height: 0.7rem; }
.bar-label { font-size: 0.75rem; color: var(--muted); min-height: 1rem; white-space: nowrap; }
.bars.trend { gap: 6px; height: 240px; }
.bar-group {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}
.bar-group:hover { background: #F5F7FB; }
.bar-group.selected { border-color: var(--gold); background: #FBF6E4; }
.bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; gap: 2px; }
.bar-pair .bar { flex: 1; }
.bar.teeth { background: var(--gold); }
.legend { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.9375rem; }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--navy); }
.legend-dot.teeth { background: var(--gold); margin-inline-start: 8px; }
.cancel-locked { font-weight: 600; }

/* ================================================================
   LINE 알림 연결
   ================================================================ */
/* LINE 초록 (흰 글씨가 잘 보이게 공식 색보다 조금 진하게) */
.btn-line { background: #05893C; color: #fff; border-color: #05893C; }
.btn-line:hover:not(:disabled) { background: #047233; }
.line-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 26px;
  padding: 0 6px;
  border-radius: 7px;
  background: #06C755;
  color: #fff;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  vertical-align: middle;
}
.line-card { margin-top: 16px; }
.line-layout { display: grid; gap: 20px; }
.line-steps { list-style: none; display: grid; gap: 14px; }
.line-steps li { display: flex; gap: 14px; align-items: flex-start; padding: 14px; background: #F6FBF7; border: 1px solid #CDEBD6; border-radius: 12px; }
.line-steps li > div { display: grid; gap: 10px; justify-items: start; min-width: 0; }
.line-step-num {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05893C;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
}
.line-step-text { font-size: 1.0625rem; font-weight: 600; color: var(--navy); }
.line-code-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.line-code {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--navy);
  padding: 6px 16px;
  background: #fff;
  border: 2px dashed #05893C;
  border-radius: 10px;
  direction: ltr;
  unicode-bidi: isolate;
  user-select: all;
}
.line-qr-box { display: none; }
.line-qr { width: 184px; height: 184px; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.line-qr img, .line-qr canvas { display: block; }
.line-connected { display: grid; gap: 10px; justify-items: start; }
.line-connected-text { font-size: 1.25rem; font-weight: 700; color: var(--success); }
.line-home-card {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: #F6FBF7;
  border: 1px solid #CDEBD6;
  border-radius: var(--radius);
}
.line-home-text { flex: 1 1 220px; font-weight: 600; }

/* ================================================================
   크레딧 충전 (Top up) · 크레딧 묶음
   ================================================================ */
.credit-badge { position: relative; }
.expiry-dot {
  position: absolute;
  top: 4px;
  inset-inline-end: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #F79009;
  border: 2px solid #fff;
}
.expiry-dot[hidden] { display: none; }
.topup-btn { display: none; }
.hdr-menu-topup { justify-content: center; }
.topup-balance { color: var(--muted); font-size: 1.0625rem; }
.topup-balance b { color: var(--navy); font-size: 1.25rem; }
.topup-desc { margin: 0 0 6px; }
.topup-expiry-note { margin-bottom: 16px; color: var(--muted); }
.package-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 18px; }
.package-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 22px 18px 18px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: var(--navy);
  text-align: center;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s, transform 0.15s;
}
.package-card:hover { border-color: var(--navy); transform: translateY(-2px); }
.package-card.featured { border-color: var(--gold); }
.pkg-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
}
.pkg-badge.popular { background: var(--navy); color: #fff; }
.pkg-badge.best { background: var(--gold); color: var(--navy); }
.pkg-credits { font-size: 2.75rem; font-weight: 700; line-height: 1.1; }
.pkg-unit { color: var(--muted); font-weight: 600; }
.pkg-each { margin-top: 6px; font-weight: 600; }
.pkg-discount { align-self: center; min-height: 26px; padding: 2px 10px; border-radius: 999px; background: var(--success-bg); color: var(--success); font-weight: 700; font-size: 0.875rem; }
.pkg-discount.none { background: none; }
.pkg-lines { display: grid; gap: 4px; margin: 10px 0 12px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 0.9375rem; }
.pkg-lines > span { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); }
.pkg-lines .pkg-total { color: var(--navy); font-weight: 700; font-size: 1.0625rem; }
.pkg-choose { width: 100%; }
.topup-back { margin-bottom: 14px; }
.topup-pay { display: grid; gap: 16px; }
.topup-pay .card + .card { margin-top: 0; }
.pay-pkg { font-size: 1.125rem; font-weight: 600; }
.pay-total-label { margin-top: 8px; color: var(--muted); }
.pay-total { font-size: 2.5rem; font-weight: 700; color: var(--navy); line-height: 1.15; }
.pp-box { display: grid; justify-items: center; gap: 8px; padding: 16px; background: #F4F7FB; border: 2px solid #1B3B6F; border-radius: 14px; text-align: center; }
.pp-title { font-weight: 800; color: #1B3B6F; letter-spacing: 1px; }
.pp-qr { width: 236px; min-height: 236px; padding: 8px; background: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.pp-qr img, .pp-qr canvas { display: block; }
.pp-amount { font-size: 1.375rem; font-weight: 700; }
.pp-hint { font-weight: 600; }
.pay-bank { margin-top: 16px; display: grid; gap: 6px; }
.pay-bank-title { font-weight: 700; color: var(--navy); }
.pay-row { display: grid; grid-template-columns: 1fr; gap: 4px 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.pay-label { color: var(--muted); }
.pay-value { font-weight: 700; font-size: 1.125rem; word-break: break-all; }
.pay-row .btn { justify-self: start; }
.pay-note { margin-top: 12px; padding: 10px 12px; background: #F8F9FB; border-radius: var(--radius-sm); }
.pay-slip { display: grid; gap: 12px; }
.slip-drop { padding: 22px 16px; }
.slip-preview { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.slip-preview img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.slip-pdf { font-size: 2.5rem; }
.slip-preview .file-info { flex: 1 1 160px; }
.topup-history { margin-top: 18px; }
.topup-reason { margin-top: 4px; color: var(--danger); font-size: 0.875rem; }
.topup-hint { margin: 6px 0; color: var(--muted); }
.topup-pending { background: #FFF1C2; color: #7A4F01; }
.topup-approved { background: var(--success-bg); color: var(--success); }
.topup-rejected { background: var(--danger-bg); color: var(--danger); }
.topup-cancelled { background: #F2F4F7; color: #475467; }
.credit-expire { background: #FFF4E5; color: #B54708; }
.credit-refund_cash { background: #FEF3F2; color: var(--danger); }
.home-card-credits { padding: 0; }
.home-card-link { display: flex; flex-direction: column; gap: 6px; padding: 22px 22px 8px; color: inherit; text-decoration: none; flex: 1; }
.home-card-warn { color: #B54708; font-weight: 700; }
.home-topup-btn { margin: 0 22px 18px; align-self: flex-start; }
.lots-table tr.lot-warn td { background: #FFF8EB; }
.lots-table tr.lot-warn .lot-exp { color: #B54708; font-weight: 700; }
.lots-table tr.lot-danger td { background: var(--danger-bg); }
.lots-table tr.lot-danger .lot-exp { color: var(--danger); font-weight: 700; }
.lot-days { font-size: 0.8125rem; }
.lot-src { min-height: 22px; padding: 1px 8px; font-size: 0.75rem; }

/* 관리자: 충전 · 설정 · 환불 */
.admin-topup-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-bottom: 16px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-inline-start: 5px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--navy);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.admin-topup-card.has { border-inline-start-color: var(--gold); background: #FFFBEB; }
.admin-topup-card .admin-stage-name { flex: 1; }
.slip-big img { display: block; max-width: 100%; max-height: 70vh; border: 1px solid var(--border); border-radius: 8px; }
.pkg-table .input { min-height: 44px; min-width: 90px; }
.pkg-table tr.pkg-off td { opacity: 0.55; }
.admin-settings { display: grid; gap: 16px; }
.admin-settings .card + .card { margin-top: 0; }
.refund-box { margin-top: 18px; padding: 14px 16px; background: #F8F9FB; border: 1px dashed var(--border-strong); border-radius: var(--radius); display: grid; gap: 10px; }
.refund-box .card-head { margin-bottom: 0; }
.refund-box .detail-title { margin: 0; }
.refund-rule.full, .refund-rule.recalculated { background: var(--success-bg); color: var(--success); }
.refund-rule.bonus, .refund-rule.expired, .refund-rule.over_14_days { background: #F2F4F7; color: #475467; }
.refund-box .btn-danger { justify-self: start; }

/* ================================================================
   법적 문서 · 푸터 · 동의 창 · 계정 삭제
   ================================================================ */
.screen-legal .legal-header .hdr-inner { gap: 12px; }
.public-lang-light select { min-height: 44px; }
.app-footer {
  padding: 18px 16px 90px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9375rem;
  border-top: 1px solid var(--border);
  background: #fff;
}
.screen-legal .app-footer { padding-bottom: 24px; }
.app-footer a { color: var(--navy); text-decoration: none; padding: 6px 4px; display: inline-block; }
.app-footer a:hover { text-decoration: underline; }

.page-legal { max-width: 1120px; margin: 0 auto; }
.legal-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.legal-tab {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}
.legal-tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.legal-layout { display: grid; gap: 16px; }
.legal-toc { padding: 16px; }
.legal-toc-title { font-weight: 700; margin-bottom: 8px; }
.legal-toc ol { list-style: none; display: grid; gap: 2px; }
.legal-toc a { display: block; padding: 8px 6px; border-radius: 6px; color: var(--navy); text-decoration: none; font-size: 0.9375rem; line-height: 1.4; }
.legal-toc a:hover { background: #F1F5FB; }
.legal-doc { max-width: 760px; width: 100%; padding: 28px 24px; line-height: 1.75; font-size: 1.0625rem; }
.legal-doc .card + .card { margin-top: 0; }
.legal-draft { padding: 10px 14px; margin-bottom: 16px; background: var(--warn-bg); border: 1.5px solid var(--warn-border); border-radius: var(--radius-sm); font-weight: 700; color: #7A4F01; }
.legal-title { font-size: 2rem; line-height: 1.25; color: var(--navy); }
.legal-meta { margin-top: 6px; color: var(--muted); }
.legal-notice { margin: 16px 0; padding: 12px 14px; background: #F1F5FB; border-inline-start: 4px solid var(--navy); border-radius: 6px; font-size: 0.9375rem; display: grid; gap: 4px; }
.legal-intro { margin: 12px 0 8px; }
.legal-section { margin-top: 26px; }
.legal-section h2 { font-size: 1.3125rem; color: var(--navy); margin-bottom: 8px; line-height: 1.35; outline: none; }
.legal-section h2 .mono { color: var(--gold-dark); margin-inline-end: 4px; }
.legal-section p { margin: 8px 0; }
.legal-section ul { margin: 8px 0; padding-inline-start: 1.4em; display: grid; gap: 6px; }
.legal-ph { padding: 0 4px; background: #FFF4E5; border-radius: 4px; color: #B54708; font-weight: 600; }
.legal-table { margin: 10px 0; }
.legal-example { margin: 10px 0; padding: 12px 14px; background: #F8F9FB; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); font-family: var(--font-sans); }
.legal-example p { margin: 4px 0; }
.legal-ex-result { font-weight: 700; color: var(--navy); }
.legal-contact-row { display: grid; grid-template-columns: 1fr; gap: 0 12px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.legal-contact-label { color: var(--muted); }
.legal-actions { margin-top: 24px; }

.consent-gate {
  position: fixed;
  inset: 0;
  z-index: 340;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 16, 40, 0.75);
}
.consent-gate[hidden] { display: none; }
body.consent-open { overflow: hidden; }
.consent-box { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 28px 24px; background: #fff; border-radius: 16px; border-top: 5px solid var(--gold); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); color: var(--text); }
.consent-title { font-size: 1.5rem; color: var(--navy); }
.consent-text { margin-top: 10px; font-size: 1.0625rem; }
.consent-links { list-style: none; margin: 16px 0; display: grid; gap: 8px; }
.consent-links a { font-size: 1.125rem; font-weight: 700; color: var(--navy); }
.consent-note { color: var(--muted); font-size: 0.9375rem; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.consent-actions .btn { flex: 1 1 180px; }

.privacy-hint { color: #475467; font-weight: 500; }
.drop-hint.privacy-hint { font-weight: 600; }
.policy-check { align-items: flex-start; font-size: 1rem; }
.policy-check a { color: var(--navy); font-weight: 700; }
.delete-card { margin-top: 16px; }
.delete-pending { font-weight: 700; color: #B54708; }
.delete-links { margin-top: 10px; }
.admin-deletions { margin-bottom: 16px; }
.admin-deletion-filter { width: auto; min-width: 160px; }
.deletion-pending { background: #FFF1C2; color: #7A4F01; }
.deletion-done { background: var(--success-bg); color: var(--success); }
.deletion-rejected { background: #F2F4F7; color: #475467; }
.legal-version-form { margin-top: 14px; align-items: end; }

/* 인쇄: 문서만 깔끔하게 */
@media print {
  .app-header, .app-tabbar, .site-footer, .legal-tabs, .legal-toc, .no-print, .toast-root, .consent-gate, #modal-root { display: none !important; }
  body, body.in-app, .screen-app { background: #fff !important; }
  .app-main { padding: 0 !important; max-width: none; }
  .legal-doc { box-shadow: none; border: none; padding: 0; max-width: none; font-size: 11pt; }
  .legal-layout { display: block; }
  .legal-section { break-inside: avoid-page; }
  .legal-section h2 { break-after: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* ================================================================
   Admin → Dashboard: Orders / Revenue 두 구역 + 매출 카드·그래프
   ================================================================ */
.dash-zone { margin-top: 26px; padding-top: 6px; scroll-margin-top: 90px; }
.zone-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; padding: 12px 16px; background: var(--navy); color: #fff; border-radius: var(--radius); font-size: 1.375rem; }
.zone-month { color: var(--gold); font-weight: 600; font-size: 1.0625rem; }
.zone-note { margin: 4px 0 14px; }
.zone-jump { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.zone-jump .btn { flex: 1 1 160px; }
#zone-orders .month-nav { margin-top: 0; }

.fin-bigs { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
.fin-bigs .card + .card, .fin-smalls .card + .card { margin-top: 0; }
.fin-big { display: flex; flex-direction: column; gap: 6px; border-top: 5px solid var(--navy); }
.fin-big.fin-total { border-top-color: var(--gold); }
.fin-big.fin-net { border-top-color: var(--success); }
.fin-big.fin-outstanding { border-top-color: #7C3AED; background: #FAF8FF; }
.fin-card-head { display: flex; align-items: center; gap: 8px; }
.fin-card-head .admin-stat-label { flex: 1; }
.fin-amount { font-size: 1.875rem; font-weight: 600; color: var(--navy); line-height: 1.15; direction: ltr; unicode-bidi: isolate; overflow-wrap: anywhere; }
.fin-sub { color: var(--muted); font-size: 0.9375rem; line-height: 1.45; }
.fin-badge { padding: 2px 10px; border-radius: 999px; background: #7C3AED; color: #fff; font-size: 0.8125rem; font-weight: 700; white-space: nowrap; }
.fin-help {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--navy); background: #fff; color: var(--navy);
  font-weight: 700; font-size: 1rem; cursor: pointer;
}
.fin-help:hover, .fin-help[aria-expanded="true"] { background: var(--navy); color: #fff; }
.fin-help:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.fin-smalls { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.fin-small { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fin-small-num { font-size: 1.375rem; font-weight: 600; color: var(--navy); direction: ltr; unicode-bidi: isolate; overflow-wrap: anywhere; }
.fin-small.clickable { cursor: pointer; border: 2px solid var(--border-strong); }
.fin-small.clickable:hover { border-color: var(--navy); }
.fin-small.clickable:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.fin-small.fin-has-pending { border-color: var(--gold); background: #FFFBEB; }
.fin-go { margin-top: 4px; color: var(--navy); font-weight: 600; font-size: 0.9375rem; }

.fin-table .num { text-align: end; white-space: nowrap; }
.fin-table tfoot th, .fin-table tfoot td { border-top: 2px solid var(--border-strong); background: var(--bg); font-weight: 700; }
.fin-top { list-style: none; margin: 0; padding: 0; }
.fin-top li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.fin-top li:last-child { border-bottom: 0; }
.fin-rank { flex: 0 0 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--bg); font-weight: 700; color: var(--navy); }
.fin-top li:first-child .fin-rank { background: var(--gold); color: var(--navy); }
.fin-top-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fin-top-total { font-weight: 600; white-space: nowrap; direction: ltr; unicode-bidi: isolate; }

.fin-chart-hint { margin: 0 0 8px; }
.fin-chart-wrap { width: 100%; }
.fin-chart { display: block; width: 100%; height: auto; overflow: visible; }
.fin-base { stroke: var(--border-strong); stroke-width: 1.5; }
.fin-hit { fill: transparent; }
.fin-bar { fill: var(--gold); }
.fin-bar-g { cursor: pointer; outline: none; }
.fin-bar-g:hover .fin-hit, .fin-bar-g:focus-visible .fin-hit { fill: #F1F5FB; }
.fin-bar-g.selected .fin-hit { fill: #E8EEF8; }
.fin-bar-g.selected .fin-bar { fill: #B8921F; }
.fin-line { fill: none; stroke: var(--navy); stroke-width: 2.5; stroke-linejoin: round; pointer-events: none; }
.fin-dot { fill: #fff; stroke: var(--navy); stroke-width: 2.5; pointer-events: none; }
.fin-axis { font-size: 13px; fill: var(--muted); font-family: var(--font-sans); pointer-events: none; }
.fin-axis.selected { fill: var(--navy); font-weight: 700; }
.fin-val { font-size: 12px; fill: var(--navy); font-family: var(--font-mono); font-weight: 600; pointer-events: none; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.legend-dot.fin-legend-bar { background: var(--gold); }
.legend-line { display: inline-block; width: 18px; height: 3px; background: var(--navy); border-radius: 2px; margin-inline-start: 8px; }

.fin-export { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.fin-export .muted { margin: 4px 0 0; }
.fin-export .btn { min-width: 220px; }
.notice-card { border-inline-start: 5px solid var(--gold); background: var(--warn-bg); }
.notice-card p { margin: 0 0 12px; }

@media (min-width: 640px) {
  .fin-bigs { grid-template-columns: repeat(2, 1fr); }
  .fin-smalls { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
  .fin-bigs { grid-template-columns: repeat(4, 1fr); }
  .fin-amount { font-size: 1.625rem; }
}

/* ================================================================
   넓은 화면
   ================================================================ */
@media (min-width: 640px) {
  .form-grid.two { grid-template-columns: 1fr 1fr; }
  .file-row { grid-template-columns: auto 1fr auto; }
  .file-actions { grid-column: auto; }
  .bulk-grid { grid-template-columns: 1fr 1fr; }
  .tooth-card-fields { grid-template-columns: 1.3fr 1fr 1.2fr; }
  .stagebar-label { display: block; }
  .admin-stage-cards { grid-template-columns: repeat(4, 1fr); }
  .admin-stats { grid-template-columns: repeat(3, 1fr); }
  .admin-stats.five { grid-template-columns: repeat(5, 1fr); }
  .legal-contact-row { grid-template-columns: 13em 1fr; }
  .admin-detail-grid { grid-template-columns: 1fr 1fr; }
  .modal-actions .btn { flex: 0 0 auto; }
  .topup-btn { display: inline-flex; }
  .hdr-menu-topup { display: none; }
  .package-grid { grid-template-columns: repeat(2, 1fr); }
  .pay-row { grid-template-columns: 9em 1fr auto; }
}

@media (min-width: 1024px) {
  /* 헤더 메뉴 보이기, 하단 탭 숨기기 */
  .hdr-nav { display: flex; }
  .app-tabbar { display: none; }
  .app-main { padding: 28px 24px 60px; }
  .home-cards { grid-template-columns: 1.4fr 1fr 1fr; }
  .profile-grid { grid-template-columns: 1.2fr 1fr; align-items: start; }
  .admin-stage-cards { grid-template-columns: repeat(7, 1fr); }
  .admin-table-wrap { display: block; }
  .legal-layout { grid-template-columns: 260px minmax(0, 760px); align-items: start; justify-content: center; }
  .legal-toc { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow-y: auto; }
  .app-footer { padding-bottom: 24px; }
  .package-grid { grid-template-columns: repeat(5, 1fr); }
  .topup-pay { grid-template-columns: 1fr 1fr; align-items: start; }
  .topup-pay .pay-summary { grid-column: 1 / -1; }
  .line-layout { grid-template-columns: 1fr auto; align-items: start; }
  .line-qr-box { display: grid; gap: 8px; justify-items: center; text-align: center; max-width: 220px; }
  .line-qr-box[hidden] { display: none; }
  .admin-order-cards { display: none; }

  /* 새 주문 3단: 단계 목록 220px | 입력 | 요약 300px */
  .wizard { display: grid; grid-template-columns: 220px minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
  .wiz-mobile-progress { display: none; }
  .wiz-steps { display: block; position: sticky; top: 92px; }
  .wiz-summary { display: block; position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow-y: auto; }
  .wiz-main { padding: 32px; }
  .wiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
  .wiz-bottom-bar { display: none; }
  .page-new { padding-bottom: 0; }
  .toast-root { bottom: 32px; }

  .wiz-step-list { list-style: none; display: grid; gap: 6px; }
  .wiz-step-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 60px;
    padding: 8px 12px;
    border: 1.5px solid transparent;
    border-radius: 12px;
    background: none;
    color: var(--muted);
    text-align: start;
    font-size: 1.0625rem;
  }
  button.wiz-step-btn { cursor: pointer; }
  button.wiz-step-btn:hover { background: #fff; border-color: var(--border); }
  .wiz-step-num {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-strong);
    background: #fff;
    font-weight: 600;
  }
  .wiz-step.done .wiz-step-btn { color: var(--navy); }
  .wiz-step.done .wiz-step-num { background: var(--success-bg); border-color: var(--success); color: var(--success); }
  .wiz-step.current .wiz-step-btn { background: var(--navy); color: #fff; font-weight: 600; }
  .wiz-step.current .wiz-step-num { background: var(--gold); border-color: var(--gold); color: var(--navy); }
}

@media (min-width: 1440px) {
  /* 헤더 오른쪽 전체 보이기 (타이머, 언어, 글자 크기, 로그아웃) — 메뉴가 6개라 1440px 부터 */
  .hdr-wide { display: flex; }
  .hdr-menu-btn { display: none; }
  .hdr-menu { display: none !important; }
}

/* 아주 좁은 화면 (치아 버튼 글자 조금 작게) */
@media (max-width: 380px) {
  .tooth-btn { font-size: 0.9375rem; min-height: 52px; border-radius: 10px; }
  .tooth-row { gap: 4px; }
  .tooth-side { flex-basis: 22px; }
}

/* RTL (아랍어·페르시아어): 숫자·기호 버튼은 항상 왼쪽→오른쪽 (+1h, A+, 날짜) */
.session-extend, .font-btn, .session-time, .credit-value, .date-box { direction: ltr; unicode-bidi: isolate; }

/* RTL (아랍어·페르시아어): 화살표 방향 뒤집기 (→ 가 ← 로 보여요) */
.arrow { display: inline-block; }
[dir="rtl"] .arrow { transform: scaleX(-1); }
