/* ==========================================================================
   사진대지 생성기 - Responsive Custom Layout Builder Design System 2.0
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  --accent: #4f46e5;
  --accent-light: #eef2ff;

  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-input: #ffffff;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-sub: #94a3b8;

  --border-subtle: #e2e8f0;
  --border-focus: #3b82f6;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 14px 34px rgba(15, 23, 42, 0.1);
  --shadow-sheet: 0 20px 45px -10px rgba(15, 23, 42, 0.15), 0 0 1px 1px rgba(15, 23, 42, 0.05);

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard", "Noto Sans KR", sans-serif;
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.dark-theme {
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: #1e293b;
  --primary-border: #1e3a8a;
  --accent: #6366f1;
  --accent-light: #1e1b4b;

  --bg-page: #090d16;
  --bg-surface: #111827;
  --bg-surface-secondary: #1f2937;
  --bg-card: #111827;
  --bg-input: #1f2937;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #64748b;

  --border-subtle: #1f2937;
  --border-focus: #60a5fa;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.5);
  --shadow-sheet: 0 22px 50px -10px rgba(0, 0, 0, 0.6), 0 0 1px 1px rgba(255, 255, 255, 0.07);
}

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

html {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  transition: background-color 0.3s ease, color 0.3s ease;
}

#app {
  width: 100%;
  overflow-x: hidden;
}

/* Linear & Stripe Style: Tabular numeric alignment for B2B accuracy */
input[type="number"],
input[type="date"],
.inp-amount,
.receipt-total-value,
.receipt-a4-meta-table .meta-val,
.preview-badge,
.time-savings-text strong,
.doc-spec-table td,
.approval-step-input {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.main-nav {
  position: relative;
  width: 100%;
  z-index: 900;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  transition: box-shadow 0.2s ease, background-color 0.3s ease;
}

.dark-theme .main-nav {
  background: rgba(17, 24, 39, 0.94);
}

/* PC 버전 전용: 엑셀 틀고정처럼 마우스 휠 스크롤 시 상단 완벽 고정 */
@media (min-width: 1025px) {
  .main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
  }

  body {
    padding-top: 60px;
  }

  .dark-theme .main-nav {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  }
}

.nav-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.22rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.brand-link:hover {
  opacity: 0.85;
}

.brand-symbol {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  color: var(--text-main);
}

.brand-text {
  font-weight: 800;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", sans-serif;
  letter-spacing: -0.04em;
}

.brand-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── 듀얼 탭 (Photo Sheet / Receipt Organizer 세그먼트 컨트롤) ── */
.dual-tab-nav {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.06);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.dark-theme .dual-tab-nav {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.dual-tab-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.38rem 1rem;
  border-radius: var(--radius-full);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
}

.dual-tab-item:hover {
  color: var(--text-main);
}

.dual-tab-item.active {
  background: var(--bg-surface);
  color: var(--text-main);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.dark-theme .dual-tab-item.active {
  background: #1e293b;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

@media (max-width: 640px) {
  .dual-tab-item {
    padding: 0.32rem 0.65rem;
    font-size: 0.78rem;
  }
  .nav-about-link {
    display: none;
  }
}

.nav-about-link {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.38rem 0.75rem;
  border-radius: var(--radius-full);
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.38rem 0.9rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--text-main);
}

.nav-link.active {
  background: var(--bg-surface);
  color: var(--primary);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.control-btn {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.38rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
}

/* ==========================================================================
   다국어 10개국 드롭다운 메뉴 스타일링
   ========================================================================== */
.lang-dropdown-container {
  position: relative;
  display: inline-block;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.65rem;
  cursor: pointer;
  user-select: none;
}

.lang-btn .lang-icon {
  font-size: 1rem;
  line-height: 1;
}

.lang-btn .lang-current-label {
  font-size: 0.8rem;
  font-weight: 700;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lang-btn .lang-arrow {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  line-height: 1;
}

.lang-dropdown-container.open .lang-btn .lang-arrow {
  transform: rotate(180deg);
  color: var(--primary);
}

.lang-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 175px;
  max-height: 380px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.35rem;
  z-index: 1000;
  animation: langMenuFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  scrollbar-width: thin;
}

@keyframes langMenuFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lang-dropdown-container.open .lang-dropdown-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lang-menu-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.lang-menu-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.lang-menu-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
}

.lang-item-flag {
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
}

.lang-item-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-item-check {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 900;
}

.dark-theme .lang-dropdown-menu {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Google OAuth & User Profile Navigation
   ========================================================================== */
.auth-container {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.auth-btn:hover {
  border-color: #4285F4;
  box-shadow: 0 1px 4px rgba(66, 133, 244, 0.15);
}

.user-profile-menu {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.55rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
}

.user-credits-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(147, 51, 234, 0.12));
  color: #4f46e5;
  border: 1px solid rgba(79, 70, 229, 0.28);
  padding: 0.12rem 0.48rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: -0.2px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.user-credits-badge:hover {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.22), rgba(147, 51, 234, 0.22));
  border-color: #4f46e5;
  transform: translateY(-0.5px);
}

.dark-theme .user-credits-badge {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25));
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.45);
}

.dark-theme .user-credits-badge:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(168, 85, 247, 0.35));
  border-color: #818cf8;
}

.user-credits-badge.unlimited {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(234, 88, 12, 0.2));
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.4);
}

.dark-theme .user-credits-badge.unlimited {
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.55);
}

.user-avatar-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

.user-name-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  transition: var(--transition);
}

.btn-logout:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

/* 모바일 전용 2단 네비게이션 (화면 폭 768px 이하) */
@media (max-width: 768px) {
  .nav-container {
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
  }

  .nav-brand {
    order: 1;
    display: flex;
    align-items: center;
  }

  .brand-link {
    font-size: 1.05rem;
    gap: 0.4rem;
  }

  .nav-controls {
    order: 2;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
  }

  /* 모바일에서 보조적인 북마크/공유 버튼 숨김으로 공간 확보 */
  .control-btn.bookmark-btn,
  .share-dropdown-container {
    display: none !important;
  }

  /* 모바일 다국어 드롭다운: 좌측 0 기준으로 화면 밖 이탈 방지 */
  .lang-dropdown-menu {
    left: 0 !important;
    right: auto !important;
    min-width: 170px;
    max-width: calc(100vw - 20px);
  }

  /* 모바일에서 로그인 컨테이너 및 버튼 */
  .auth-container {
    display: inline-flex;
  }

  .auth-btn {
    display: inline-flex;
    padding: 0.32rem 0.7rem;
    font-size: 0.78rem;
    background: var(--primary);
    color: #ffffff !important;
    border-color: var(--primary);
    font-weight: 700;
    border-radius: var(--radius-full);
  }

  /* 로그인 완료 시 모바일에서도 로그인 버튼 강제 숨김 */
  .auth-btn.hidden,
  .auth-btn[style*="display: none"],
  .auth-btn[style*="display:none"] {
    display: none !important;
  }

  .auth-btn svg {
    stroke: #ffffff;
  }

  .auth-btn:hover {
    background: var(--primary-hover);
    color: #ffffff !important;
  }

  .dark-theme .auth-btn {
    background: var(--primary);
    color: #ffffff !important;
  }

  .control-btn {
    font-size: 0.75rem;
    padding: 0.28rem 0.5rem;
    min-height: 28px;
  }

  /* 2단: 3개 탭 메뉴를 가로 100% 균등 분할 배치 */
  .nav-menu {
    order: 3;
    width: 100%;
    margin-top: 0.2rem;
    padding: 0;
  }

  .dual-tab-nav {
    width: 100%;
    display: flex;
    justify-content: stretch;
    padding: 2px;
  }

  .dual-tab-item {
    flex: 1 1 0;
    text-align: center;
    justify-content: center;
    padding: 0.45rem 0.25rem;
    font-size: 0.78rem;
  }

  .dual-tab-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ==========================================================================
   Workspace Layout (Responsive 2-Column Split)
   ========================================================================== */
.workspace-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.5rem 1rem 3rem;
  width: 100%;
}

@media (max-width: 640px) {
  .workspace-container {
    padding: 1rem 0.65rem 3rem;
  }
}

.text-center {
  text-align: center;
}

.header-section {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  width: 100%;
}

@media (max-width: 640px) {
  .header-section {
    margin-bottom: 1.25rem;
  }
}

.header-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.38rem 1rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0 auto 0.75rem auto;
  text-align: center;
}

.main-title {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin: 0 auto 0.65rem auto;
  text-align: center;
  color: var(--text-main);
}

@media (max-width: 640px) {
  .main-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
  }
}

.subtitle {
  font-size: 0.98rem;
  color: var(--text-muted);
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  line-height: 1.5;
  word-break: keep-all;
}

@media (min-width: 860px) {
  .subtitle {
    white-space: nowrap;
  }
}

@media (max-width: 859px) {
  .subtitle {
    max-width: 680px;
    white-space: normal;
  }
}

@media (max-width: 640px) {
  .subtitle {
    font-size: 0.86rem;
    line-height: 1.45;
    padding: 0 0.5rem;
    white-space: normal;
  }
}

/* ==========================================================================
   Feature Highlights Bar (Mobile & Unlimited Pages & Security & Formats)
   ========================================================================== */
.feature-highlights-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.75rem;
  width: 100%;
}

@media (max-width: 1280px) {
  .feature-highlights-bar {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 860px) {
  .feature-highlights-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }
}

@media (max-width: 540px) {
  .feature-highlights-bar {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

.feature-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.feature-chip:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-chip.highlight-ai {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.08) 100%);
  border: 1.5px solid rgba(139, 92, 246, 0.45);
  position: relative;
  overflow: hidden;
}

.feature-chip.highlight-ai:hover {
  border-color: #8b5cf6;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25);
  transform: translateY(-2px);
}

.feature-chip-title-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.chip-ai-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

.feature-chip-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.feature-chip-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.15rem;
}

.feature-chip-text strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feature-chip-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Mobile Tab Bar (1024px 이하 화면에서 설정 vs 미리보기 전환)
   ========================================================================== */
.mobile-tab-bar {
  display: none;
}

@media (max-width: 1024px) {
  .mobile-tab-bar {
    display: flex;
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 4px;
    margin-bottom: 1.25rem;
    gap: 4px;
    width: 100%;
  }
  .mobile-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    background: none;
    border: none;
    padding: 0.6rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
  }
  .mobile-tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  }
  /* 탭 선택에 따른 노출 제어 */
  .builder-layout[data-mobile-active="settings"] .control-column {
    display: flex;
  }
  .builder-layout[data-mobile-active="settings"] .preview-column {
    display: none;
  }
  .builder-layout[data-mobile-active="preview"] .control-column {
    display: none;
  }
  .builder-layout[data-mobile-active="preview"] .preview-column {
    display: block;
  }
}

@media (max-width: 480px) {
  .mobile-tab-btn {
    padding: 0.52rem 0.25rem;
    font-size: 0.8rem;
    gap: 0.2rem;
  }
}

.builder-layout {
  display: grid;
  grid-template-columns: 335px minmax(440px, 490px) 335px;
  grid-template-areas: "photos preview settings";
  justify-content: center;
  gap: 1.1rem;
  align-items: flex-start;
  width: 100%;
}

.photos-column {
  grid-area: photos;
  min-width: 0;
  width: 100%;
}

.preview-column {
  grid-area: preview;
  min-width: 0;
  width: 100%;
}

.settings-column {
  grid-area: settings;
  min-width: 0;
  width: 100%;
}

@media (max-width: 1280px) and (min-width: 1025px) {
  .builder-layout {
    grid-template-columns: 310px minmax(410px, 460px) 310px;
    gap: 0.8rem;
  }
}

@media (max-width: 1024px) {
  .builder-layout {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 1rem !important;
    margin: 0 auto !important;
  }

  .photos-column,
  .preview-column,
  .settings-column {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    grid-area: auto !important;
  }

  .panel-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
  }

  .builder-layout[data-mobile-active="photos"] .photos-column {
    display: block !important;
  }
  .builder-layout[data-mobile-active="photos"] .preview-column,
  .builder-layout[data-mobile-active="photos"] .settings-column {
    display: none !important;
  }

  .builder-layout[data-mobile-active="preview"] .preview-column {
    display: block !important;
  }
  .builder-layout[data-mobile-active="preview"] .photos-column,
  .builder-layout[data-mobile-active="preview"] .settings-column {
    display: none !important;
  }

  .builder-layout[data-mobile-active="settings"] .settings-column {
    display: flex !important;
    flex-direction: column !important;
  }
  .builder-layout[data-mobile-active="settings"] .photos-column,
  .builder-layout[data-mobile-active="settings"] .preview-column {
    display: none !important;
  }
}

/* ==========================================================================
   Preview Column & Sticky Viewport (공사 사진대지 & 영수증 지출결의서 공통)
   ========================================================================== */
.preview-column {
  min-width: 0;
  width: 100%;
}

@media (min-width: 1025px) {
  .preview-column {
    position: sticky;
    top: 72px;
    max-height: calc(100vh - 84px);
    overflow: visible;
    border-radius: var(--radius-md);
  }
}

.preview-sticky-card {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.preview-panel-header,
.preview-header-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.15rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   Control Column & Accordion Cards
   ========================================================================== */
.control-column {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  min-width: 0;
  width: 100%;
}

.accordion-global-ctrl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.25rem;
  margin-bottom: -0.35rem;
}

.control-summary-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.btn-toggle-all {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-toggle-all:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
}

.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  min-width: 0;
  width: 100%;
}

@media (max-width: 640px) {
  .panel-card {
    border-radius: var(--radius-md);
  }
}

.panel-card:hover {
  box-shadow: var(--shadow-md);
}

/* Accordion Specific Styles */
.panel-card.panel-accordion {
  padding: 0;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.panel-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  cursor: pointer;
  user-select: none;
  background: var(--bg-surface);
  transition: background-color 0.15s ease;
}

@media (max-width: 640px) {
  .panel-accordion-header {
    padding: 0.75rem 0.85rem;
  }
}

.panel-accordion-header:hover {
  background: var(--bg-surface-secondary);
}

.accordion-header-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex: 1;
}

@media (max-width: 640px) {
  .accordion-header-left {
    gap: 0.45rem;
  }
}

.accordion-badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  .accordion-badge {
    max-width: 110px;
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
  }
}

.panel-card.expanded .accordion-badge {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
}

.accordion-arrow {
  font-size: 0.72rem;
  color: var(--text-sub);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.panel-card.expanded .accordion-arrow {
  transform: rotate(180deg);
  color: var(--primary);
}

.accordion-header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.panel-accordion-body {
  padding: 0 1.35rem 1.35rem;
  display: none;
}

@media (max-width: 640px) {
  .panel-accordion-body {
    padding: 0 1rem 1.15rem;
  }
}

.panel-card.expanded .panel-accordion-body {
  display: block;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.15rem;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.panel-header.justify-between {
  justify-content: space-between;
}

@media (max-width: 480px) {
  .panel-header.justify-between {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .panel-title {
    font-size: 1rem;
  }
  .btn-pill-secondary, .btn-pill-primary {
    padding: 0.3rem 0.55rem;
    font-size: 0.75rem;
  }
}

.panel-icon {
  font-size: 1.25rem;
}

.panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  word-break: keep-all;
  white-space: nowrap;
  line-height: 1.3;
}

@media (max-width: 640px) {
  .panel-title {
    font-size: 0.88rem;
    word-break: keep-all;
  }
}

.panel-help {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
  line-height: 1.4;
}

/* Preset Buttons */
.preset-group {
  margin-bottom: 1.25rem;
}

.preset-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.5rem;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  width: 100%;
}

@media (max-width: 480px) {
  .preset-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
  }
}

.btn-preset {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.42rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

@media (max-width: 480px) {
  .btn-preset {
    padding: 0.42rem 0.2rem;
    font-size: 0.76rem;
    text-align: center;
    white-space: nowrap;
    border-radius: var(--radius-sm);
  }
}

.btn-preset:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
}

.btn-preset.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* Grid Stepper Inputs */
.grid-inputs-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  width: 100%;
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  width: 100%;
}

.input-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.stepper-wrapper {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  overflow: hidden;
  min-width: 0;
  width: 100%;
}

.stepper-wrapper input {
  width: 100%;
  min-width: 0;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  background: none;
  color: var(--text-main);
  outline: none;
}

.btn-step {
  background: var(--bg-surface-secondary);
  border: none;
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.btn-step:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.custom-input {
  width: 100%;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-subtle);
  background-color: var(--bg-input);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: var(--transition);
}

.custom-input:focus {
  border-color: var(--border-focus);
}

.mt-3 { margin-top: 0.85rem; }

/* ==========================================================================
   Date Format & Batch Date Settings Box (주석 항목 설정 내)
   ========================================================================== */
.date-settings-card {
  background: var(--bg-hover, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.date-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.date-settings-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main, #1e293b);
  white-space: nowrap;
}

.date-format-select {
  font-size: 0.78rem;
  padding: 0.28rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-card, #ffffff);
  color: var(--text-main, #334155);
  font-weight: 600;
  cursor: pointer;
  max-width: 175px;
}

.batch-date-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px dashed var(--border-subtle, #e2e8f0);
  padding-top: 0.5rem;
}

.batch-date-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

.batch-date-controls {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex: 1;
}

.batch-date-input {
  font-size: 0.78rem;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-card, #ffffff);
  color: var(--text-main, #334155);
  flex: 1;
}

.btn-batch-date-apply {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-batch-date-apply:hover {
  background: #2563eb;
  color: #ffffff;
}

.dark-theme .date-settings-card {
  background: #1e293b;
  border-color: #334155;
}

.dark-theme .date-settings-title {
  color: #f1f5f9;
}

.dark-theme .date-format-select,
.dark-theme .batch-date-input {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

.dark-theme .batch-date-label {
  color: #94a3b8;
}

.dark-theme .batch-date-box {
  border-top-color: #334155;
}

.dark-theme .btn-batch-date-apply {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #93c5fd;
}

.dark-theme .btn-batch-date-apply:hover {
  background: #3b82f6;
  color: #ffffff;
}

/* ==========================================================================
   Field Builder List & Toolbar
   ========================================================================== */
.fields-top-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.fields-action-buttons {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .fields-top-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }
  .fields-action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    width: 100%;
  }
  .fields-action-buttons button {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 0.45rem 0.5rem;
  }
}

.btn-pill-primary {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-pill-primary:hover {
  background: var(--primary);
  color: #ffffff;
}

.btn-pill-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-pill-secondary:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
}

.fields-builder-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

/* ====================================================================
   행(Row) 단위 다중 2열 필드 빌더 스타일
   ==================================================================== */
.field-row-group {
  background: var(--bg-surface-secondary);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.75rem;
  transition: var(--transition);
  width: 100%;
  box-sizing: border-box;
}

.field-row-group:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.field-row-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed var(--border-subtle);
}

.row-num-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.row-header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.badge-2col {
  font-size: 0.68rem;
  font-weight: 800;
  color: #ffffff;
  background: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-add-row-col {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-add-row-col:hover {
  background: var(--primary);
  color: #ffffff;
}

.btn-remove-row {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-remove-row:hover {
  color: #ef4444;
  background: #fee2e2;
}

.field-row-cols-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  width: 100%;
}

.field-row-cols-wrap.is-split {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 580px) {
  .field-row-cols-wrap.is-split {
    grid-template-columns: 1fr;
  }
}

.field-col-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.field-col-card.is-second-col {
  border-color: var(--primary-border);
}

.field-col-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.col-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--bg-surface-secondary);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  flex-shrink: 0;
}

.field-label-input {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
}

.btn-remove-col {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 3px;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-remove-col:hover {
  color: #ef4444;
  background: #fee2e2;
}

.field-col-body {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.field-type-select {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
}

.auto-detect-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==========================================================================
   Upload Zone & Chips
   ========================================================================== */
.upload-zone {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.8rem 1.25rem;
  text-align: center;
  background: var(--bg-surface-secondary);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 1rem;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.file-input-hidden { display: none; }

.upload-icon-wrapper {
  width: 44px;
  height: 44px;
  margin: 0 auto 0.75rem;
  background: var(--bg-surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.upload-icon { width: 22px; height: 22px; }

.upload-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  word-break: keep-all;
  line-height: 1.4;
}

.upload-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.upload-btn-row {
  margin-top: 0.9rem;
}

.btn-browse-file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.35rem;
  background: var(--bg-surface, #ffffff);
  border: 1.5px solid var(--primary, #2563eb);
  color: var(--primary, #2563eb);
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.btn-browse-file:hover {
  background: var(--primary, #2563eb);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.btn-browse-file:active {
  transform: translateY(0);
}

.uploaded-chip-list {
  margin-bottom: 1.25rem;
}

.chip-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.count-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
}

.btn-clear-all {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.chip-scroll-box {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 200px;
  overflow-y: auto;
  padding: 0.2rem;
}

.photo-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 0.82rem;
}

.chip-idx {
  background: var(--primary);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.chip-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-btn-edit {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}

.chip-btn-del {
  background: none;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.1rem 0.3rem;
}

.download-action-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
  margin-top: 1rem;
}

.btn-generate-main {
  width: 100%;
  min-width: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #ffffff;
  border: none;
  padding: 0.95rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: var(--transition);
  white-space: normal;
  text-align: center;
  word-break: keep-all;
  line-height: 1.35;
}

.btn-generate-pdf {
  width: 100%;
  min-width: 0;
  background: linear-gradient(135deg, #059669, #0d9488);
  color: #ffffff;
  border: none;
  padding: 0.95rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  transition: var(--transition);
  white-space: normal;
  text-align: center;
  word-break: keep-all;
  line-height: 1.35;
}

.btn-generate-pdf:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-generate-pdf:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-generate-hwpx {
  width: 100%;
  min-width: 0;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  border: none;
  padding: 0.95rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  transition: var(--transition);
  white-space: normal;
  text-align: center;
  word-break: keep-all;
  line-height: 1.35;
}

.btn-generate-hwpx:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
}

.btn-generate-hwpx:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 480px) {
  .btn-generate-main,
  .btn-generate-pdf,
  .btn-generate-hwpx {
    font-size: 0.92rem;
    padding: 0.85rem 0.9rem;
  }
}

.btn-generate-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.btn-generate-main:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.photo-dropzone-container {
  max-width: 100%;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.btn-generate-main.pro-locked,
.btn-generate-hwpx.pro-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.85rem 1.25rem;
  position: relative;
  cursor: pointer;
  opacity: 0.96;
}

.btn-generate-main.pro-locked:hover,
.btn-generate-hwpx.pro-locked:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

/* ==========================================================================
   Preview Column & A4 Sheet Simulator
   ========================================================================== */
.preview-column {
  min-width: 0;
  width: 100%;
}

.preview-sticky-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

.preview-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  width: 100%;
}

@media (max-width: 640px) {
  .preview-header-bar {
    padding: 0.6rem 0.85rem;
  }
}

.preview-info-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.live-dot {
  width: 9px;
  height: 9px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.preview-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.preview-meta-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.badge-page {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Margin Controls & Segment Buttons
   ========================================================================== */
.btn-segment-group {
  display: flex;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
  width: 100%;
  min-width: 0;
}

.btn-segment {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  padding: 0.45rem 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-align: center;
}

@media (max-width: 480px) {
  .btn-segment {
    padding: 0.4rem 0.2rem;
    font-size: 0.76rem;
  }
}

.btn-segment:hover {
  color: var(--text-main);
}

.btn-segment.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.margin-grid-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.65rem;
  margin-top: 0.5rem;
  width: 100%;
}

.margin-input-box {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  width: 100%;
}

.margin-input-box label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.margin-step-wrapper {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  overflow: hidden;
  min-width: 0;
  width: 100%;
}

.margin-step-wrapper input {
  width: 100%;
  min-width: 0;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  background: none;
  color: var(--text-main);
  outline: none;
}

.margin-unit {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-sub);
  padding-right: 0.5rem;
  flex-shrink: 0;
}

.btn-margin-step {
  background: var(--bg-surface-secondary);
  border: none;
  width: 30px;
  height: 32px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-margin-step:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* ==========================================================================
   Preview Column & Sticky Live A4 Paper Simulator
   ========================================================================== */
.preview-column {
  min-width: 0;
  width: 100%;
  z-index: 20;
}

@media (min-width: 1025px) {
  .preview-column {
    position: sticky;
    top: 72px;
    height: calc(100vh - 84px);
    max-height: calc(100vh - 84px);
    display: flex;
    flex-direction: column;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .preview-column::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
}

@media (max-width: 1024px) {
  .preview-column {
    position: static;
    max-height: none;
    height: auto;
  }
}

.preview-sticky-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: calc(100vh - 84px);
  overflow: hidden;
  transition: var(--transition);
  width: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.preview-sticky-card::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

@media (max-width: 1024px) {
  .preview-sticky-card {
    height: auto;
    max-height: none;
    overflow: visible;
  }
}

/* 중앙 프리뷰 상단 1행 4열 다운로드 툴바 */
.preview-download-toolbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

.preview-download-toolbar button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  width: 100%;
  box-sizing: border-box;
}

.preview-download-toolbar .btn-generate-pdf {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
}

.preview-download-toolbar .btn-generate-pdf:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.preview-download-toolbar .btn-generate-main {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border-color: #047857;
}

.preview-download-toolbar .btn-generate-main:hover {
  background: linear-gradient(135deg, #047857, #059669);
  transform: translateY(-1px);
}

.preview-download-toolbar .btn-generate-docx {
  background: #2b579a;
  color: #ffffff;
  border-color: #1e3f72;
}

.preview-download-toolbar .btn-generate-docx:hover {
  background: #1e3f72;
  transform: translateY(-1px);
}

.preview-download-toolbar .btn-generate-hwpx {
  background: #0284c7;
  color: #ffffff;
  border-color: #0369a1;
}

.preview-download-toolbar .btn-generate-hwpx:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

.preview-download-toolbar .export-pro-badge {
  font-size: 0.65rem;
  padding: 1px 4px;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  font-weight: 800;
  margin-left: 2px;
}

.preview-download-toolbar .pro-locked {
  opacity: 0.9;
}

/* 세션 초기화(새로 만들기) 버튼 */
.btn-session-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.22rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: #64748b;
  background: var(--bg-surface-secondary, #f1f5f9);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-md, 6px);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-session-reset:hover {
  color: #ef4444;
  border-color: #fca5a5;
  background: #fef2f2;
  transform: translateY(-1px);
}

.preview-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.preview-info-box {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: live-dot-pulse 1.8s infinite;
}

@keyframes live-dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.preview-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

/* 프리뷰 상단 툴바에 통합된 다운로드 버튼 그룹 */
.preview-download-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.preview-download-actions .btn-generate-main,
.preview-download-actions .btn-generate-pdf,
.preview-download-actions .btn-generate-hwpx {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0.38rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.preview-download-actions .btn-export-top {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.preview-download-actions .export-main-label {
  font-size: 0.8rem;
  font-weight: 700;
}

.preview-download-actions .btn-generate-pdf {
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #1d4ed8;
}

.preview-download-actions .btn-generate-pdf:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.preview-download-actions .btn-generate-main {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border: 1px solid #047857;
}

.preview-download-actions .btn-generate-main:hover {
  background: linear-gradient(135deg, #047857, #059669);
  transform: translateY(-1px);
}

.preview-download-actions .btn-generate-hwpx {
  background: #0284c7;
  color: #ffffff;
  border: 1px solid #0369a1;
}

.preview-download-actions .btn-generate-hwpx:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

.preview-download-actions .pro-locked {
  opacity: 0.88;
}

.preview-meta-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.badge-page {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.76rem;
}

/* Virtual A4 Sheet Container & Margin Shading Overlay (타이트한 여백 & 정중앙 배치) */
.a4-sheet-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-surface-secondary);
  padding: 0.35rem;
  overflow: hidden; /* 프리뷰 내부 스크롤바 완전 제거 */
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}

.a4-sheet-container::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

@media (max-width: 1024px) {
  .a4-sheet-container {
    padding: 0.4rem;
    overflow: visible;
    max-height: none;
    border-radius: var(--radius-md);
  }
}

/* 프리뷰 내 수동 주석 직접 편집 셀 스타일 */
.editable-cell {
  cursor: text !important;
  outline: none !important;
  transition: background-color 0.15s ease, box-shadow 0.15s ease !important;
  border-radius: 2px !important;
  min-height: 18px !important;
  word-break: break-word !important;
}

.editable-cell:hover {
  background-color: rgba(37, 99, 235, 0.08) !important;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.4) !important;
}

.editable-cell:focus,
.editable-cell.cell-focused {
  background-color: #ffffff !important;
  box-shadow: 0 0 0 2px #2563eb, inset 0 0 0 1px #2563eb !important;
  color: #1e3a8a !important;
  font-weight: 600 !important;
  z-index: 10 !important;
  position: relative !important;
}

.dark-theme .editable-cell:focus,
.dark-theme .editable-cell.cell-focused {
  background-color: #1e293b !important;
  color: #60a5fa !important;
  box-shadow: 0 0 0 2px #3b82f6, inset 0 0 0 1px #3b82f6 !important;
}

.a4-sheet {
  background: #ffffff;
  color: #111827;
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1.414; /* A4 용지 정밀 비율 (1:√2) */
  border-radius: 4px;
  box-shadow: var(--shadow-sheet);
  border: 1px solid #d1d5db;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  .a4-sheet {
    width: 100%;
    height: auto;
  }
}

/* Margin Shading Guide Overlay */
.a4-margin-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 5;
}

.margin-guide-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(37, 99, 235, 0.08);
  border-bottom: 1.5px dashed rgba(37, 99, 235, 0.4);
}

.margin-guide-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(37, 99, 235, 0.08);
  border-top: 1.5px dashed rgba(37, 99, 235, 0.4);
}

.margin-guide-left {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: rgba(37, 99, 235, 0.08);
  border-right: 1.5px dashed rgba(37, 99, 235, 0.4);
}

.margin-guide-right {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  background: rgba(37, 99, 235, 0.08);
  border-left: 1.5px dashed rgba(37, 99, 235, 0.4);
}

.margin-guide-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  background: rgba(37, 99, 235, 0.15);
  color: var(--primary);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  z-index: 6;
}

/* Inner Printable Content */
.a4-sheet-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}

.a4-sheet-header {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  padding-bottom: 0.35rem;
  border-bottom: none;
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.a4-sheet-header.align-left {
  justify-content: flex-start;
  text-align: left;
}

.a4-sheet-header.align-center {
  justify-content: center;
  text-align: center;
}

.a4-sheet-header.align-right {
  justify-content: flex-end;
  text-align: right;
}

.a4-sheet-grid {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  gap: 0.55rem;
  align-content: stretch;
  overflow: hidden;
}

.a4-cut-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #9ca3af;
  border-radius: 0;
  overflow: hidden;
  background: #ffffff;
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
}

.a4-image-box {
  flex: 1 1 0;
  min-height: 0;
  position: relative;
  background: #ffffff;
  padding: 4px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid #9ca3af;
}

.a4-image-box.empty {
  background: #f3f4f6;
  padding: 0;
}

.a4-image-box img {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  object-fit: cover;
  object-position: center center;
  display: block;
  border: 1px solid #d1d5db;
  box-sizing: border-box;
}

.a4-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  color: #9ca3af;
  font-size: 0.75rem;
  font-weight: 600;
}

.a4-num-badge {
  background: #e5e7eb;
  color: #4b5563;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.a4-caption-table {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.a4-caption-row {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  border-bottom: 1px solid #d1d5db;
  font-size: 0.72rem;
  line-height: 1.3;
}

.a4-caption-row:last-child {
  border-bottom: none;
}

.a4-caption-row.two-cols {
  display: flex;
  flex-direction: row;
  width: 100%;
  box-sizing: border-box;
}

.a4-col-pair {
  display: flex;
  width: 50%;
  min-width: 0;
  box-sizing: border-box;
}

.a4-col-pair:first-child {
  border-right: 1px solid #d1d5db;
}

.dark-theme .a4-col-pair:first-child {
  border-right-color: #334155;
}

.a4-col-pair .a4-caption-label {
  width: 35%;
  min-width: 0;
  flex-shrink: 0;
  box-sizing: border-box;
  font-size: 0.68rem;
  letter-spacing: -0.3px;
  padding: 0.2rem 0.2rem;
}

.a4-col-pair .a4-caption-value {
  width: 65%;
  min-width: 0;
  flex: 1;
  box-sizing: border-box;
  justify-content: center;
  text-align: center;
  padding: 0.2rem 0.25rem;
  font-size: 0.68rem;
}

.has-col-layout .a4-caption-row:not(.two-cols) .a4-caption-label {
  width: 17.5%;
  min-width: 0;
  flex-shrink: 0;
  box-sizing: border-box;
  font-size: 0.68rem;
  letter-spacing: -0.3px;
  padding: 0.2rem 0.2rem;
}

.has-col-layout .a4-caption-row:not(.two-cols) .a4-caption-value {
  width: 82.5%;
  min-width: 0;
  flex: 1;
  box-sizing: border-box;
}

.a4-caption-label {
  width: 28%;
  min-width: 0;
  flex-shrink: 0;
  background: #f3f4f6;
  color: #374151;
  font-weight: 700;
  text-align: center;
  padding: 0.25rem 0.3rem;
  border-right: 1px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  letter-spacing: -0.3px;
}

.a4-caption-value {
  width: 72%;
  min-width: 0;
  flex: 1;
  padding: 0.25rem 0.4rem;
  color: #111827;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.a4-sheet-footer {
  font-size: 0.75rem;
  color: #6b7280;
  padding-top: 0.35rem;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.a4-sheet-footer.align-left {
  justify-content: flex-start;
  text-align: left;
}

.a4-sheet-footer.align-center {
  justify-content: center;
  text-align: center;
}

.a4-sheet-footer.align-right {
  justify-content: flex-end;
  text-align: right;
}

.a4-sheet-footer.align-none {
  display: none;
}

/* ==========================================================================
   Modals & User Guide
   ========================================================================== */
.preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}

.preview-modal.active { display: flex; }

.preview-content {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  position: relative;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.preview-image-container {
  width: 100%;
  height: 200px;
  background: var(--bg-surface-secondary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  overflow: hidden;
}

.preview-image-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preview-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  background: var(--bg-surface-secondary);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.preview-metadata {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.metadata-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.metadata-field label {
  font-size: 0.82rem;
  font-weight: 700;
}

.metadata-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
}

.metadata-save-btn {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.75rem;
  transition: var(--transition);
}

.metadata-save-btn:hover { background: var(--primary-hover); }

/* ==========================================================================
   Premium User Guide (/about) Visual Design System
   ========================================================================== */
.about-hero {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 3rem;
}

.about-hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 0.85rem;
  color: var(--text-main);
}

.about-hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 4-Step Visual Process Grid */
.guide-visual-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
  margin-bottom: 3.5rem;
}

@media (max-width: 840px) {
  .guide-visual-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.guide-step-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.guide-step-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md);
}

.guide-step-card.highlight {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.12);
}

.step-card-header {
  margin-bottom: 1.25rem;
}

.step-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.step-pill {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.step-icon-large {
  font-size: 1.75rem;
  line-height: 1;
}

.step-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.step-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Mini UI Mockup Graphics inside Step Cards */
.card-mockup-wrap {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
}

/* Mockup 1: Drop & Photo Chip */
.mockup-dropzone {
  border: 1.5px dashed var(--primary-border);
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 0.85rem;
  text-align: center;
  margin-bottom: 0.5rem;
}
.mockup-drop-text {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
}
.mockup-chip-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-main);
}
.mockup-date-badge {
  background: #10b981;
  color: #fff;
  font-size: 0.65rem;
  padding: 1px 4px;
  border-radius: 3px;
}

/* Mockup 2: Grid & Caption Fields */
.mockup-grid-chips {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.mockup-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}
.mockup-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}
.mockup-row-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.mockup-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
}
.mockup-row-label {
  font-weight: 700;
  color: var(--primary);
}

/* Mockup 3: Mini A4 Margin Simulator */
.mockup-a4-mini {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 0.6rem;
  position: relative;
  overflow: hidden;
  height: 90px;
  display: flex;
  flex-direction: column;
}
.mockup-a4-shading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 6px solid rgba(37, 99, 235, 0.15);
  pointer-events: none;
}
.mockup-a4-header {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 0.3rem;
}
.mockup-a4-cells {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
}
.mockup-a4-cell {
  background: #f3f4f6;
  border: 1px solid #9ca3af;
  border-radius: 2px;
}

/* Mockup 4: Excel Download Ready */
.mockup-download-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid #10b981;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
}
.mockup-excel-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
}
.mockup-check-badge {
  background: #10b981;
  color: #ffffff;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}

/* Tips Section (3-Column Feature Cards) */
.tips-section-wrap {
  margin-bottom: 3.5rem;
}

.tips-section-title {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.75rem;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 840px) {
  .tips-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.tip-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.tip-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md);
}

.tip-icon-box {
  width: 44px;
  height: 44px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.tip-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.tip-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* CTA Banner */
.about-cta-banner {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #4f46e5 100%);
  border-radius: var(--radius-lg);
  padding: 2.75rem 2rem;
  text-align: center;
  color: #ffffff;
  box-shadow: var(--shadow-lg);
}

.cta-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.cta-subtitle {
  font-size: 1.05rem;
  opacity: 0.9;
  margin-bottom: 1.75rem;
}

.btn-cta-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #ffffff;
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 800;
  padding: 0.95rem 2rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}

.btn-cta-start:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Loading & Toast */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10001;
}
.loading-overlay.active { display: flex; }
.loading-spinner-container {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  text-align: center;
}
.loading-spinner-large {
  width: 42px;
  height: 42px;
  border: 3.5px solid var(--border-subtle);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 0.95rem; font-weight: 700; }

.notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.8rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-lg);
  z-index: 10002;
  transform: translateY(20px);
  opacity: 0;
  transition: var(--transition);
}
.notification.show { transform: translateY(0); opacity: 1; }
.notification.success { border-color: #10b981; }
.notification.error { border-color: #ef4444; }
.notification-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; }

.app-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-sub);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-footer-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  transition: var(--transition);
}

.btn-footer-link:hover {
  color: var(--primary);
}

.footer-sep {
  color: var(--border-subtle);
  font-size: 0.8rem;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ==========================================================================
   Google AdSense Slot Containers (Zero CLS Optimization)
   ========================================================================== */
.adsense-slot-wrap {
  width: 100%;
  max-width: 960px;
  margin: 1.5rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ad-tag-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.adsense-slot {
  width: 100%;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-secondary);
  border: 1px dashed var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition: var(--transition);
}

/* 상단 리더보드 광고 (Desktop: 728x90, Mobile: Responsive) */
.ad-slot-leaderboard {
  min-height: 90px;
  max-width: 728px;
}

@media (max-width: 768px) {
  .ad-slot-leaderboard {
    min-height: 60px;
    max-width: 100%;
  }
}

/* 하단 배너 광고 */
.ad-slot-bottom {
  min-height: 100px;
  max-width: 728px;
}

.ad-placeholder-inner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 0.75rem;
}

.ad-icon-badge {
  background: var(--border-subtle);
  color: var(--text-main);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

/* ==========================================================================
   A4 Document Sheet Architecture (1 : 1.414 Precise Aspect Ratio)
   ========================================================================== */
.about-a4-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
}

.about-a4-sheet {
  background: #ffffff;
  color: #111827;
  width: 100%;
  max-width: 720px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.08);
  padding: 2.2rem 2.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  transition: var(--transition);
}

@media (max-width: 768px) {
  .about-a4-sheet {
    aspect-ratio: auto;
    min-height: auto;
    padding: 1.25rem;
  }
}

/* A4 Document Header */
.doc-header-box {
  border-bottom: 2px solid #111827;
  padding-bottom: 0.85rem;
  margin-bottom: 1.2rem;
  transition: border-color 0.2s ease;
}

.doc-top-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.72rem;
  color: #4b5563;
  font-weight: 700;
}

.doc-badge-pill {
  background: #1e3a8a;
  color: #ffffff;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.doc-main-title {
  font-size: 1.55rem;
  font-weight: 900;
  color: #111827;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
  line-height: 1.25;
}

.doc-main-subtitle {
  font-size: 0.82rem;
  color: #4b5563;
  line-height: 1.4;
}

/* Section Title */
.doc-section-heading {
  font-size: 0.88rem;
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* 1. Specification Table */
.doc-spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.2rem;
  font-size: 0.74rem;
}

.doc-spec-table th,
.doc-spec-table td {
  border: 1px solid #d1d5db;
  padding: 0.35rem 0.6rem;
  line-height: 1.35;
}

.doc-spec-table th {
  background: #f3f4f6;
  color: #1f2937;
  font-weight: 700;
  width: 25%;
  text-align: center;
}

.doc-spec-table td {
  color: #374151;
}

/* 2. 4-Step Flowchart in A4 Sheet */
.doc-flowchart-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

@media (max-width: 640px) {
  .doc-flowchart-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.doc-flow-step {
  border: 1.5px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 4px;
  padding: 0.65rem 0.5rem;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.doc-flow-step.highlight {
  border-color: #2563eb;
  background: #eff6ff;
}

.doc-step-num {
  font-size: 0.65rem;
  font-weight: 800;
  color: #2563eb;
  margin-bottom: 0.2rem;
}

.doc-step-icon {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.doc-step-name {
  font-size: 0.74rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 0.2rem;
  line-height: 1.2;
}

.doc-step-desc {
  font-size: 0.65rem;
  color: #6b7280;
  line-height: 1.3;
}

/* 3. Field Rules Box */
.doc-rules-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0;
}

.doc-rules-list {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.72rem;
  color: #334155;
  line-height: 1.5;
}

.doc-rules-list li {
  margin-bottom: 0.25rem;
}

/* ==========================================================================
   Dark Theme (다크모드 눈부심 방지 - 차콜/슬레이트 그레이 팔레트)
   ========================================================================== */
.dark-theme .about-a4-container {
  background: #0f172a;
  border-color: #1e293b;
}

.dark-theme .about-a4-sheet {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
}

.dark-theme .doc-header-box {
  border-bottom-color: #334155;
}

.dark-theme .doc-top-meta {
  color: #64748b;
}

.dark-theme .doc-badge-pill {
  background: #2563eb;
  color: #ffffff;
}

.dark-theme .doc-main-title {
  color: #f8fafc;
}

.dark-theme .doc-main-subtitle {
  color: #94a3b8;
}

.dark-theme .doc-section-heading {
  color: #60a5fa;
  border-left-color: #3b82f6;
}

.dark-theme .doc-spec-table th {
  background: #0f172a;
  color: #cbd5e1;
  border-color: #334155;
}

.dark-theme .doc-spec-table td {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #334155;
}

.dark-theme .doc-flow-step {
  background: #0f172a;
  border-color: #334155;
}

.dark-theme .doc-flow-step.highlight {
  background: rgba(37, 99, 235, 0.15);
  border-color: #3b82f6;
}

.dark-theme .doc-step-num {
  color: #60a5fa;
}

.dark-theme .doc-step-name {
  color: #f8fafc;
}

.dark-theme .doc-step-desc {
  color: #94a3b8;
}

.dark-theme .doc-rules-box {
  background: #0f172a;
  border-color: #334155;
}

.dark-theme .doc-rules-list {
  color: #cbd5e1;
}

/* 메인페이지 실시간 A4 프리뷰 시트 다크모드 눈부심 방지 (화면 프리뷰에만 한정 적용) */
.dark-theme .a4-sheet-container {
  background: #0f172a;
  border-color: #1e293b;
}

.dark-theme .a4-sheet-container .a4-sheet {
  background: #1e293b;
  color: #f1f5f9;
  border-color: #334155;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.dark-theme .a4-sheet-container .a4-sheet-header {
  color: #f8fafc;
}

.dark-theme .a4-sheet-container .a4-cut-card {
  background: #0f172a;
  border-color: #334155;
}

.dark-theme .a4-sheet-container .a4-image-box {
  background: #1e293b;
  border-bottom-color: #334155;
}

.dark-theme .a4-sheet-container .a4-placeholder {
  color: #64748b;
}

.dark-theme .a4-sheet-container .a4-num-badge {
  background: #334155;
  color: #f1f5f9;
}

.dark-theme .a4-sheet-container .a4-caption-row {
  border-bottom-color: #334155;
}

.dark-theme .a4-sheet-container .a4-col-pair:first-child {
  border-right-color: #334155;
}

.dark-theme .a4-sheet-container .a4-caption-label {
  background: #0f172a;
  color: #94a3b8;
  border-right-color: #334155;
}

.dark-theme .a4-sheet-container .a4-caption-value {
  color: #f1f5f9;
}

.dark-theme .a4-sheet-container .a4-sheet-footer {
  color: #94a3b8;
}

/* ==========================================================================
   PDF 출력용 오프스크린 컨테이너: 다크모드 상속 절대 방지 및 A4 표준 규격 고정
   ========================================================================== */
#pdf-export-container,
#pdf-export-container * {
  color-scheme: light !important;
  box-sizing: border-box !important;
}

.dark-theme #pdf-export-container,
#pdf-export-container {
  background: #ffffff !important;
  color: #111827 !important;
}

.dark-theme #pdf-export-container .a4-sheet,
#pdf-export-container .a4-sheet {
  background: #ffffff !important;
  color: #111827 !important;
  box-shadow: none !important;
  border: none !important;
}

.dark-theme #pdf-export-container .a4-sheet-header,
#pdf-export-container .a4-sheet-header {
  color: #000000 !important;
}

.dark-theme #pdf-export-container .a4-cut-card,
#pdf-export-container .a4-cut-card {
  background: #ffffff !important;
  border: 1px solid #9ca3af !important;
  border-radius: 0 !important;
}

.dark-theme #pdf-export-container .a4-image-box,
#pdf-export-container .a4-image-box {
  background: #ffffff !important;
  border-bottom: 1px solid #9ca3af !important;
  padding: 4px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.dark-theme #pdf-export-container .a4-image-box img,
#pdf-export-container .a4-image-box img {
  position: relative !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border: 1px solid #d1d5db !important;
  border-radius: 0 !important;
  box-sizing: border-box !important;
  display: block !important;
}

.dark-theme #pdf-export-container .a4-caption-table,
#pdf-export-container .a4-caption-table {
  background: #ffffff !important;
  border-top: none !important;
}

.dark-theme #pdf-export-container .a4-caption-row,
#pdf-export-container .a4-caption-row {
  background: #ffffff !important;
  border-bottom: 1px solid #d1d5db !important;
}

.dark-theme #pdf-export-container .a4-col-pair:first-child,
#pdf-export-container .a4-col-pair:first-child {
  border-right: 1px solid #d1d5db !important;
}

.dark-theme #pdf-export-container .a4-caption-label,
#pdf-export-container .a4-caption-label {
  background: #f4f5f7 !important;
  color: #1f2937 !important;
  font-weight: 700 !important;
  border-right: 1px solid #d1d5db !important;
}

.dark-theme #pdf-export-container .a4-caption-value,
#pdf-export-container .a4-caption-value {
  background: #ffffff !important;
  color: #111827 !important;
  font-weight: 500 !important;
}

.dark-theme #pdf-export-container .a4-sheet-footer,
#pdf-export-container .a4-sheet-footer {
  color: #4b5563 !important;
}

/* ==========================================================================
   FAQ Section (Rich Text for AdSense Quality Rating)
   ========================================================================== */
.about-faq-wrap {
  max-width: 840px;
  margin: 0 auto 3.5rem;
}

.faq-title {
  text-align: center;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.faq-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md);
}

.faq-q {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.faq-a {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   Privacy Policy & Terms Modal
   ========================================================================== */
.policy-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.policy-modal-card {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.policy-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
}

.policy-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.policy-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.policy-modal-body {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.policy-modal-body h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 1rem;
  margin-bottom: 0.35rem;
}

.policy-modal-body p,
.policy-modal-body ul {
  margin-bottom: 0.75rem;
}

/* ====================================================================
   [NEW] 스폰서 및 제휴 광고주 모집 안내 배너
   ==================================================================== */
.sponsor-notice-wrap {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto 1.5rem auto;
  position: relative;
}

.sponsor-badge-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-left: 0.5rem;
}

.sponsor-banner-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
  border: 1.5px dashed var(--primary);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.sponsor-banner-card:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(16, 185, 129, 0.08) 100%);
  box-shadow: var(--shadow-md);
}

.sponsor-banner-content {
  flex: 1 1 auto;
}

.sponsor-banner-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sponsor-banner-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.btn-sponsor-inquiry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.1rem;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}

.btn-sponsor-inquiry:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.35);
}

@media (max-width: 640px) {
  .sponsor-banner-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    text-align: center;
  }
  .sponsor-banner-title {
    justify-content: center;
  }
  .btn-sponsor-inquiry {
    width: 100%;
  }
}

/* ====================================================================
   [NEW] 5대 업종별 템플릿(프리셋) 선택 그리드
   ==================================================================== */
.industry-template-card {
  margin-bottom: 1.25rem;
}

.template-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.btn-template-preset {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.75rem 0.5rem;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-main);
  text-align: center;
}

.btn-template-preset .tmpl-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.btn-template-preset .tmpl-name {
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.btn-template-preset:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
}

.btn-template-preset.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.btn-template-preset.active .tmpl-name {
  color: #ffffff;
}

/* ====================================================================
   [NEW] 비전 AI 일괄 내용 작성 및 진행률 컴포넌트
   ==================================================================== */
.ai-batch-action-wrap {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  padding: 0.85rem;
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.05) 0%, rgba(37, 99, 235, 0.05) 100%);
  border: 1.5px solid rgba(147, 51, 234, 0.3);
  border-radius: var(--radius-md);
}

.ai-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #9333ea;
  background: rgba(147, 51, 234, 0.12);
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
}

.btn-ai-key-config {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.btn-ai-key-config:hover {
  color: var(--primary);
  background: var(--bg-hover);
}

.btn-ai-batch {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 800;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-ai-batch:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

.btn-ai-batch:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.ai-progress-wrap {
  margin-top: 0.75rem;
}

.ai-progress-bar {
  width: 100%;
  height: 7px;
  background: var(--border-subtle);
  border-radius: 9999px;
  overflow: hidden;
}

.ai-progress-fill {
  height: 100%;
  background: var(--primary);
  transform-origin: left;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-progress-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.35rem;
  text-align: center;
}

/* 개별 사진 칩 AI 버튼 */
.chip-btn-ai {
  background: rgba(147, 51, 234, 0.1);
  color: #9333ea;
  border: 1px solid rgba(147, 51, 234, 0.3);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  margin-right: 2px;
  transition: all 0.15s ease;
}

.chip-btn-ai:hover {
  background: #9333ea;
  color: #ffffff;
}

/* 모달 내 단일 AI 버튼 */
.modal-ai-action-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

.btn-modal-ai {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-modal-ai:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.modal-ai-status {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ====================================================================
   [BRANDING] 누적 시간 절약 카운터 배너
   ==================================================================== */
.time-savings-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem auto;
  max-width: 720px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(79, 70, 229, 0.12) 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-full);
  padding: 0.6rem 1.4rem;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.08);
  animation: bannerPulse 3s ease-in-out infinite;
}

@keyframes bannerPulse {
  0%, 100% { box-shadow: 0 2px 10px rgba(37, 99, 235, 0.08); }
  50% { box-shadow: 0 4px 18px rgba(37, 99, 235, 0.18); border-color: rgba(59, 130, 246, 0.45); }
}

.time-savings-content {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.92rem;
  color: var(--text-primary);
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}

.time-savings-icon {
  font-size: 1.2rem;
  display: inline-block;
  animation: rotateIcon 4s linear infinite;
}

@keyframes rotateIcon {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(15deg); }
  75% { transform: rotate(-15deg); }
  100% { transform: rotate(0deg); }
}

.time-savings-text strong {
  color: var(--primary);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.time-savings-detail {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-left: 0.35rem;
  background: rgba(255, 255, 255, 0.6);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .time-savings-detail {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

/* ====================================================================
   [NAVBAR] 즐겨찾기 및 공유하기 상단 고정 버튼 & 팝오버
   ==================================================================== */
.bookmark-btn, .share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.bookmark-btn:hover {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
  transform: translateY(-1px);
}

[data-theme="dark"] .bookmark-btn:hover {
  background: #78350f;
  border-color: #f59e0b;
  color: #fde68a;
}

.share-btn:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  transform: translateY(-1px);
}

[data-theme="dark"] .share-btn:hover {
  background: #1e3a8a;
  border-color: #3b82f6;
  color: #bfdbfe;
}

.share-dropdown-container {
  position: relative;
  display: inline-block;
}

.share-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  min-width: 175px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 1000;
  animation: dropdownFadeIn 0.2s ease;
}

.share-dropdown-menu.active {
  display: flex;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.share-menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.share-menu-item:hover {
  background: var(--bg-hover, rgba(0, 0, 0, 0.05));
  color: var(--primary);
}

[data-theme="dark"] .share-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.share-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 0.85rem;
}

.kakao-badge { background: #fee500; color: #181600; }
.band-badge { background: #06c755; color: #ffffff; }
.x-badge { background: #000000; color: #ffffff; }
.fb-badge { background: #1877f2; color: #ffffff; }
.copy-badge { background: #64748b; color: #ffffff; }

/* ====================================================================
   [MODAL] 다운로드 완료 직후 칼퇴 축하 & 동료 공유 모달
   ==================================================================== */
.celebrate-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  animation: fadeInModal 0.25s ease;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.celebrate-modal-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
  max-width: 480px;
  width: 100%;
  padding: 2.25rem 2rem 1.75rem 2rem;
  text-align: center;
  position: relative;
  animation: scaleUpModal 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUpModal {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.celebrate-icon-glow {
  font-size: 3.25rem;
  margin-bottom: 0.75rem;
  display: inline-block;
  animation: subtlePulse 2s ease-in-out infinite alternate;
}

@keyframes subtlePulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(234, 179, 8, 0.3)); }
  100% { transform: scale(1.04); filter: drop-shadow(0 0 14px rgba(234, 179, 8, 0.5)); }
}

.celebrate-modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
}

.celebrate-modal-desc {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

.celebrate-modal-desc strong {
  color: var(--primary);
}

.celebrate-share-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.btn-celebrate-share {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-celebrate-share:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.c-share-icon {
  font-size: 1.3rem;
}

.btn-celebrate-share.btn-kakao:hover { background: #fee500; color: #181600; border-color: #e5cf00; }
.btn-celebrate-share.btn-band:hover { background: #06c755; color: #ffffff; border-color: #05a847; }
.btn-celebrate-share.btn-x:hover { background: #000000; color: #ffffff; border-color: #000000; }
.btn-celebrate-share.btn-fb:hover { background: #1877f2; color: #ffffff; border-color: #1464cc; }
.btn-celebrate-share.btn-copy:hover { background: #475569; color: #ffffff; border-color: #334155; }

.celebrate-modal-actions {
  display: flex;
  justify-content: center;
}

.btn-celebrate-close {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: 0.65rem 2.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-celebrate-close:hover {
  opacity: 0.92;
  transform: scale(1.02);
}

/* ====================================================================
   [TOAST] 브랜드 전용 피드백 알림 (클립보드, 즐겨찾기 안내)
   ==================================================================== */
.brand-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  max-width: 90%;
  text-align: center;
}

.brand-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
  .bookmark-btn .control-text, .share-btn .control-text {
    display: none;
  }
  .bookmark-btn, .share-btn {
    padding: 0.45rem;
  }
  .time-savings-banner {
    border-radius: var(--radius-md);
    padding: 0.6rem 0.8rem;
  }
  .celebrate-share-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ====================================================================
   [REWARD AD] 무료 AI 10장 충전 전면 광고 오버레이 모달
   ==================================================================== */
.ad-reward-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeInModal 0.25s ease;
}

.ad-reward-modal-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  max-width: 580px;
  width: 100%;
  overflow: hidden;
  animation: scaleUpModal 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.ad-reward-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-surface-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.ad-reward-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 0.3rem;
}

.ad-reward-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.ad-reward-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.ad-reward-desc strong {
  color: var(--primary);
}

.btn-ad-close-top {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-ad-close-top:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #dc2626;
  transform: scale(1.03);
}

.ad-reward-body {
  padding: 1.5rem;
  text-align: center;
}

.ad-reward-sponsor-box {
  position: relative;
  border-radius: var(--radius-md);
  background: var(--bg-page);
  border: 1px dashed var(--border-subtle);
  padding: 1.5rem 1rem;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ad-reward-sponsor-tag {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-sub);
  background: var(--bg-surface);
  padding: 1px 6px;
  border-radius: 4px;
}

.ad-reward-fallback {
  text-align: center;
  padding: 0.5rem 1rem;
}

.ad-reward-glow-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  animation: subtlePulse 2s ease-in-out infinite alternate;
}

.ad-reward-fallback h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.ad-reward-fallback p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 400px;
  margin: 0 auto;
}

.ad-reward-footer {
  padding: 0 1.5rem 1.5rem 1.5rem;
  text-align: center;
}

.btn-ad-reward-claim {
  width: 100%;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: 0.95rem 1.5rem;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
  transition: all 0.2s ease;
}

.btn-ad-reward-claim:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
}

/* AI 크레딧 표시 뱃지 */
.ai-credits-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.ai-credits-badge.unlimited {
  color: #059669;
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.25);
}

.ai-provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #0891b2;
  background: rgba(8, 145, 178, 0.1);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(8, 145, 178, 0.3);
  cursor: default;
}

.btn-charge-credits {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  border: none;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
  transition: all 0.2s ease;
}

.btn-charge-credits:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.45);
}

.btn-dev-key {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  border: 1px dashed #94a3b8;
  padding: 0.32rem 0.65rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-dev-key:hover {
  color: #0f172a;
  background: #e2e8f0;
  border-color: #64748b;
}

.btn-ai-batch-compact {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}

.btn-ai-batch-compact:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}

.btn-ai-batch-compact:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ====================================================================
   사진별 인라인 퀵 에디터 카드 리스트 (체류시간 증대 & 편의성 극대화)
   ==================================================================== */
.photo-editor-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 480px;
  overflow-y: auto;
  padding: 0.25rem 0.25rem 0.5rem 0.25rem;
  margin-top: 0.65rem;
}

.photo-editor-card {
  background: var(--card-bg, #ffffff);
  border: 1.5px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.photo-editor-card:hover {
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 3px 8px rgba(59, 130, 246, 0.08);
}

.photo-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.photo-card-info {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  min-width: 0;
  flex: 1;
}

.photo-card-badge {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-muted, #64748b);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.photo-card-thumb {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid var(--border-subtle, #e2e8f0);
  flex-shrink: 0;
}

.photo-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-card-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main, #1e293b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.photo-card-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.card-btn-ai {
  background: rgba(147, 51, 234, 0.1);
  color: #9333ea;
  border: 1px solid rgba(147, 51, 234, 0.3);
  border-radius: var(--radius-sm, 6px);
  padding: 3px 7px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.card-btn-ai:hover {
  background: #9333ea;
  color: #ffffff;
}

.card-btn-drawer-toggle {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-muted, #64748b);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-sm, 6px);
  padding: 3px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  transition: all 0.15s ease;
}

.card-btn-drawer-toggle:hover {
  color: var(--text-main, #1e293b);
  background: #e2e8f0;
}

.drawer-arrow {
  font-size: 0.65rem;
}

.card-btn-del {
  background: none;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.card-btn-del:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.photo-card-desc-wrap {
  width: 100%;
}

.card-desc-input {
  width: 100%;
  border: 1px solid var(--border-subtle, #cbd5e1);
  border-radius: var(--radius-sm, 6px);
  padding: 0.4rem 0.55rem;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--text-main, #1e293b);
  background: var(--input-bg, #f8fafc);
  resize: vertical;
  min-height: 48px;
  max-height: 120px;
  line-height: 1.4;
  transition: border-color 0.15s ease, background 0.15s ease;
  box-sizing: border-box;
}

.card-desc-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.photo-card-drawer {
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border-subtle, #e2e8f0);
}

.photo-drawer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.photo-drawer-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.photo-drawer-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
}

.card-drawer-input {
  width: 100%;
  border: 1px solid var(--border-subtle, #cbd5e1);
  border-radius: var(--radius-sm, 5px);
  padding: 0.3rem 0.45rem;
  font-size: 0.76rem;
  font-family: inherit;
  color: var(--text-main, #1e293b);
  background: var(--input-bg, #ffffff);
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.card-drawer-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

/* 다크모드 대응: 사진별 인라인 퀵 에디터 카드 및 주석 입력창 */
.dark-theme .photo-editor-card {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.dark-theme .photo-editor-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.15);
}

.dark-theme .photo-card-name {
  color: #f1f5f9;
}

.dark-theme .photo-card-badge {
  background: #334155;
  color: #cbd5e1;
}

.dark-theme .photo-card-thumb {
  background: #0f172a;
  border-color: #334155;
}

.dark-theme .card-btn-drawer-toggle {
  background: #334155;
  color: #cbd5e1;
  border-color: #475569;
}

.dark-theme .card-btn-drawer-toggle:hover {
  background: #475569;
  color: #f8fafc;
}

.dark-theme .card-desc-input {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

.dark-theme .card-desc-input:focus {
  background: #0b0f19;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.dark-theme .photo-card-drawer {
  border-top-color: #334155;
}

.dark-theme .photo-drawer-label {
  color: #94a3b8;
}

.dark-theme .card-drawer-input {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

.dark-theme .card-drawer-input:focus {
  background: #0b0f19;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

/* ====================================================================
   우측 A4 실시간 시트 직접 클릭 편집 (Click-to-Edit) 스타일
   ==================================================================== */
.a4-caption-value.editable-cell {
  cursor: text;
  position: relative;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.a4-caption-value.editable-cell:hover {
  background: rgba(59, 130, 246, 0.05);
  outline: 1px dashed rgba(59, 130, 246, 0.4);
  outline-offset: -1px;
}

.a4-caption-value.editable-cell:focus {
  outline: 2px solid #2563eb !important;
  outline-offset: -2px;
  background: rgba(37, 99, 235, 0.08);
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.2);
}

/* ====================================================================
   바닥글 페이지 번호(1 / N) 토글 스위치 및 정렬 그룹 스타일
   ==================================================================== */
.btn-segment-group.disabled-group {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.5);
  transition: opacity 0.2s ease;
}

.toggle-page-no-wrap input[type="checkbox"],
.preview-page-no-toggle input[type="checkbox"] {
  cursor: pointer;
  accent-color: #2563eb;
  width: 14px;
  height: 14px;
  margin: 0;
}

.toggle-page-no-wrap:hover span {
  color: #2563eb;
}

.preview-page-no-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-main, #334155);
  background: var(--bg-hover, #f1f5f9);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.preview-page-no-toggle:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

/* ====================================================================
   [AI COMING SOON] 비전 AI 오픈 준비 중 안내 뱃지 & 안내 모달 스타일
   ==================================================================== */
.ai-coming-soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.08);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(124, 58, 237, 0.25);
  box-shadow: 0 1px 4px rgba(124, 58, 237, 0.1);
}

.btn-ai-batch-compact.is-coming-soon {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.28);
}

.card-btn-ai.is-coming-soon {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.card-btn-ai.is-coming-soon:hover {
  background: #7c3aed;
  color: #ffffff;
}

.ai-coming-soon-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeInModal 0.25s ease;
}

.ai-coming-soon-modal-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1.5px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 25px 50px -12px rgba(124, 58, 237, 0.25);
  max-width: 520px;
  width: 100%;
  overflow: hidden;
  animation: scaleUpModal 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-coming-soon-header {
  padding: 1.5rem 1.5rem 1.2rem 1.5rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.08) 0%, transparent 100%);
  border-bottom: 1px solid var(--border-subtle);
}

.ai-coming-soon-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.ai-coming-soon-pill {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.12);
  padding: 3px 10px;
  border-radius: 999px;
}

.btn-ai-coming-soon-x {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-ai-coming-soon-x:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.ai-coming-soon-glow-icon {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 0.6rem;
  animation: subtlePulse 2s ease-in-out infinite alternate;
}

.ai-coming-soon-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0;
  letter-spacing: -0.01em;
}

.ai-coming-soon-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.ai-coming-soon-text {
  font-size: 0.88rem;
  color: var(--text-sub, #475569);
  line-height: 1.6;
  margin: 0;
  text-align: left;
}

.ai-coming-soon-preview-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.ai-preview-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  text-align: left;
}

.ai-item-icon {
  font-size: 1.2rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.ai-item-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ai-item-content strong {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
}

.ai-item-content span {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.ai-coming-soon-footer {
  padding: 0 1.5rem 1.5rem 1.5rem;
  text-align: center;
}

.btn-ai-coming-soon-close {
  width: 100%;
  background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
  transition: all 0.2s ease;
}

.btn-ai-coming-soon-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.45);
}

.preview-page-no-toggle:has(input:checked) {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.3);
  color: #1d4ed8;
}

/* ==========================================================================
   Receipt & Expense Report Workspace Styles (Phase 1)
   ========================================================================== */
.receipt-workspace {
  max-width: 1360px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem 1rem;
}

.receipt-badge {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.dark-theme .receipt-badge {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}

.receipt-action-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.receipt-action-bar .btn-primary-action {
  flex: 1.5;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.receipt-action-bar .btn-primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.receipt-action-bar .btn-primary-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.receipt-action-bar .btn-secondary-action {
  flex: 1;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.receipt-action-bar .btn-secondary-action:hover {
  border-color: var(--primary-border);
  background: var(--bg-surface-secondary);
}

.receipt-total-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.receipt-total-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.receipt-total-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum";
}

.total-bar-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.total-bar-sub-info {
  font-size: 0.76rem;
  color: #38bdf8;
  font-weight: 600;
}

.receipt-modern-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  background: var(--bg-surface-secondary);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

@media (max-width: 640px) {
  .receipt-modern-form-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding: 0.75rem;
  }
}

.receipt-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.receipt-form-group.full-width {
  grid-column: 1 / -1;
}

.receipt-form-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: -0.01em;
}

.receipt-form-input {
  width: 100%;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.52rem 0.75rem;
  outline: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.receipt-form-input:hover {
  border-color: rgba(37, 99, 235, 0.4);
}

.receipt-form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: var(--bg-surface);
}

.receipt-options-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-top: 0.75rem;
}

.receipt-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}

.receipt-checkbox-label input[type="checkbox"] {
  cursor: pointer;
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  margin: 0;
}

.approval-line-section {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-surface-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.approval-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.approval-header-row .control-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: -0.01em;
}

.btn-add-step {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-surface);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-add-step:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.approval-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.approval-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.45rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.approval-chip:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.approval-step-input {
  border: none;
  background: transparent;
  font-size: 0.84rem;
  font-weight: 700;
  width: 58px;
  text-align: center;
  color: var(--text-main);
  outline: none;
  padding: 0.12rem 0.2rem;
}

.btn-del-step {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.15rem 0.25rem;
  border-radius: var(--radius-full);
  line-height: 1;
  transition: color 0.15s ease, background 0.15s ease;
}

.btn-del-step:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.receipt-field-builder-section {
  margin-top: 1rem;
  padding: 0.85rem;
  background: var(--bg-surface-secondary);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-subtle);
}

.receipt-field-builder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.receipt-field-builder-header .control-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-add-field-row {
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.btn-add-field-row:hover {
  background: var(--primary);
  color: #ffffff;
}

.receipt-field-builder-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.receipt-field-builder-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
}

.field-cell-wrap {
  flex: 1;
  display: flex;
  align-items: center;
}

.inp-field-label {
  width: 100%;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.45rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-main);
  outline: none;
}

.inp-field-label:focus {
  border-color: var(--primary);
}

.btn-field-split {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.45rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.btn-field-split:hover {
  border-color: var(--primary-border);
  color: var(--primary);
}

.btn-field-del {
  border: none;
  background: transparent;
  color: #ef4444;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.btn-field-del:hover {
  opacity: 1;
}

.receipt-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.receipt-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.receipt-empty-notice {
  text-align: center;
  padding: 2.2rem 1.2rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  background: var(--bg-surface-secondary);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-subtle);
}

.receipt-card-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.receipt-card-item:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md);
}

.receipt-card-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.receipt-card-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f1f5f9;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
}

.receipt-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.receipt-card-title-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.receipt-card-idx {
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.receipt-card-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-card-del {
  border: none;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-radius: var(--radius-full);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.btn-card-del:hover {
  background: #ef4444;
  color: #ffffff;
}

.receipt-card-fields {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.receipt-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.receipt-field-col {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.receipt-field-col label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}

.receipt-field-col input {
  font-size: 0.8rem;
  padding: 0.38rem 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
}

.receipt-field-col input:focus {
  border-color: var(--primary);
}

.inp-amount {
  font-weight: 700 !important;
  color: var(--primary) !important;
  text-align: right;
}

/* 실시간 미리보기 상단 페이지 네비게이션 */
.preview-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.75rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.preview-page-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.btn-page-nav {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-secondary);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.btn-page-nav:hover:not(:disabled) {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}

.btn-page-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.preview-page-indicator {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  padding: 0 0.25rem;
}

/* A4 실시간 프리뷰 전용 스타일 */
.receipt-a4-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: var(--bg-surface-secondary);
  padding: 1.25rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.photo-page-nav-wrap .btn-page-nav {
  padding: 0.2rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  border-radius: var(--radius-sm);
}

.receipt-a4-sheet {
  background: #ffffff !important;
  color: #0f172a !important;
  padding: 14px 16px !important;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  max-width: 510px !important;
  width: 100%;
  aspect-ratio: 1 / 1.414;
  min-height: 0;
  box-sizing: border-box;
  margin: 0 auto;
  box-shadow: var(--shadow-sheet);
}

/* ==========================================================================
   [1페이지] 정부/기업 표준 지출결의서 본문 집계표 스타일 (참고 이미지 2 양식)
   ========================================================================== */
.gov-resolution-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  height: 100%;
  justify-content: space-between;
}

.gov-doc-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}

.gov-title-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 4px;
}

.gov-doc-main-title {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 6px;
  color: #0f172a;
  margin: 0;
  text-align: center;
}

.gov-approval-area {
  flex-shrink: 0;
}

/* 결재란 (모든 칸 비율 균등 보장) */
.approval-table.fixed-layout {
  border-collapse: collapse;
  table-layout: fixed;
  text-align: center;
  font-size: 9px;
  border: 1px solid #94a3b8;
  min-width: 160px;
}

.approval-table.fixed-layout th,
.approval-table.fixed-layout td {
  border: 1px solid #94a3b8;
  padding: 2px 2px;
  text-align: center;
  word-break: keep-all;
  line-height: 1.15;
}

.approval-table.fixed-layout thead th {
  background: #f8fafc;
  font-weight: 700;
  font-size: 9px;
  color: #334155;
}

.approval-side-header {
  width: 22px !important;
  background: #f8fafc;
  font-weight: 800;
  font-size: 9.5px;
  line-height: 1.25;
  color: #334155;
  text-align: center;
  vertical-align: middle;
  padding: 2px !important;
}

.stamp-cell {
  height: 38px;
  background: #ffffff;
}

/* 작성자 정보 인적사항 & 금액/제목 일체형 서식 테이블 (관공서/기업 표준) */
.gov-meta-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid #94a3b8;
  margin-bottom: 6px;
  font-size: 9.5px;
}

.gov-meta-table th,
.gov-meta-table td {
  border: 1px solid #94a3b8;
  padding: 3px 6px;
  line-height: 1.25;
}

.gov-meta-lbl {
  background: #f8fafc;
  font-weight: 700;
  color: #334155;
  width: 16%;
  text-align: center;
  letter-spacing: 0.5px;
}

.gov-meta-val {
  color: #0f172a;
  width: 34%;
  font-weight: 600;
  text-align: center;
  word-break: keep-all;
  white-space: nowrap;
}

.gov-meta-amount-cell {
  text-align: left !important;
  padding: 4px 10px !important;
  background: #ffffff;
}

.gov-korean-amount {
  font-weight: 800;
  color: #1e3a8a;
  font-size: 10.5px;
  letter-spacing: -0.01em;
  margin-right: 6px;
}

.gov-num-amount {
  font-weight: 700;
  color: #2563eb;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

/* 내역 집계표 */
.gov-table-wrapper {
  flex: 1;
  min-height: 0;
  margin-bottom: 6px;
}

.gov-summary-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #94a3b8;
  font-size: 9px;
}

.gov-summary-table th {
  background: #f8fafc;
  font-weight: 700;
  color: #334155;
  border: 1px solid #94a3b8;
  padding: 3px 4px;
  text-align: center;
}

.gov-summary-table td {
  border: 1px solid #cbd5e1;
  padding: 1.5px 4px;
  height: 18px;
  box-sizing: border-box;
}

.gov-col-date {
  width: 18%;
  text-align: center;
}

.gov-col-usage {
  width: 40%;
}

.gov-col-amount {
  width: 22%;
  font-variant-numeric: tabular-nums;
}

.gov-col-memo {
  width: 20%;
}

.gov-total-row {
  background: #f1f5f9;
  font-weight: 800;
  border-top: 2px solid #94a3b8;
}

.gov-total-row td {
  padding: 2.5px 4px;
  height: 20px;
}

.gov-total-amount {
  color: #1e3a8a;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.gov-empty-row td {
  height: 18px;
  line-height: 18px;
  background-color: #ffffff;
}

/* 인라인 프리뷰 편집 셀 스타일링 */
.editable-receipt-cell,
.editable-meta-cell {
  cursor: text;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.editable-receipt-cell:hover,
.editable-meta-cell:hover {
  background-color: rgba(59, 130, 246, 0.08) !important;
  outline: 1px dashed #3b82f6;
}

.editable-receipt-cell:focus,
.editable-meta-cell:focus {
  background-color: #ffffff !important;
  outline: 2px solid #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  z-index: 10;
  position: relative;
}

/* 4컷 단일 프리셋 뱃지 */
.receipt-single-preset-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-surface-secondary, #f1f5f9);
  border: 1px solid var(--border-subtle, #cbd5e1);
  border-radius: var(--radius-md, 6px);
  font-size: 0.88rem;
  color: var(--text-main, #1e293b);
  width: 100%;
}

.receipt-single-preset-badge .preset-badge-icon {
  font-size: 1.1rem;
}

.receipt-single-preset-badge strong {
  color: var(--primary, #2563eb);
  font-weight: 700;
}

/* 하단 청구 문구 및 영수인 서명란 */
.gov-doc-footer-section {
  margin-top: auto;
  padding-top: 4px;
  text-align: center;
}

.gov-claim-statement {
  font-size: 10.5px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.gov-claim-date {
  font-size: 9.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.gov-signee-box {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  padding-right: 20px;
  font-size: 10.5px;
}

.gov-signee-title {
  font-weight: 700;
  color: #334155;
}

.gov-signee-name {
  font-weight: 800;
  color: #0f172a;
  text-decoration: underline;
  margin-left: 4px;
}

.gov-signee-seal {
  color: #dc2626;
  font-weight: 800;
}

/* ==========================================================================
   [2페이지 이상] 2열 영수증 증빙 시트 스타일 (상단 사진 + 하단 선택 주석표)
   ========================================================================== */
.receipt-proof-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  height: 100%;
}

.receipt-a4-subpage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 4px;
  margin-bottom: 6px;
  border-bottom: 1.5px solid #0f172a;
}

.subpage-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #0f172a;
}

.subpage-meta {
  font-size: 9px;
  font-weight: 600;
  color: #64748b;
}

.receipt-proof-grid {
  display: grid;
  width: 100%;
  flex: 1;
}

.receipt-proof-grid.grid-2x2 {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 8px;
  flex: 1;
  height: calc(100% - 24px);
}

.receipt-proof-grid.grid-2x4 {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 8px;
}

.receipt-proof-slot {
  display: flex;
  flex-direction: column;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
  min-height: 0;
}

.receipt-proof-photo {
  width: 100%;
  flex: 1;
  min-height: 0;
  background: #f8fafc;
  border-right: none;
  border-bottom: 1px solid #94a3b8;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.receipt-proof-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f1f5f9;
}

.proof-placeholder {
  color: #94a3b8;
  font-size: 9.5px;
  font-weight: 600;
  text-align: center;
  padding: 8px;
}

.receipt-proof-info {
  width: 100%;
  flex-shrink: 0;
  background: #ffffff;
}

.receipt-proof-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 9px;
  line-height: 1.3;
}

.receipt-proof-table td {
  border: 1px solid #cbd5e1;
  padding: 3px 6px;
  word-break: break-all;
}

.receipt-proof-table .lbl {
  width: 32%;
  background: #f8fafc;
  font-weight: 700;
  color: #475569;
  text-align: center;
  white-space: nowrap;
}

.receipt-proof-table .val {
  width: 68%;
  color: #0f172a;
}

.grid-2x4 .receipt-proof-table {
  font-size: 8px;
}

.grid-2x4 .receipt-proof-table td {
  padding: 2px 4px;
}

/* 주석 필드 선택 칩 스타일 (5종 항목 넣고 빼기) */
.receipt-fields-selector-group {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border-subtle);
}

.receipt-field-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.field-toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.field-toggle-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.field-toggle-chip.active {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.12);
}

.field-toggle-chip input[type="checkbox"] {
  display: none;
}

.chip-check-icon {
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

.field-chips-desc {
  font-size: 0.74rem;
  color: var(--text-sub);
  margin-top: 0.4rem;
  margin-bottom: 0;
}

/* 바닥글 페이지 번호 */
.receipt-a4-footer-page-no {
  margin-top: auto;
  padding-top: 8px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 2px;
}

/* ==========================================================================
   Receipt Card List & Item Styles
   ========================================================================== */
.receipt-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}

.receipt-empty-card-list {
  padding: 2rem 1rem;
  text-align: center;
  background: var(--bg-surface-secondary);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
}

.receipt-empty-card-list .empty-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.6;
}

.receipt-empty-card-list .empty-text {
  font-size: 0.86rem;
  line-height: 1.4;
  margin: 0;
}

.receipt-card-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.receipt-card-item:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md);
}

.receipt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  background: var(--bg-surface-secondary);
  border-bottom: 1px solid var(--border-subtle);
  gap: 0.5rem;
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.card-seq-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.card-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.btn-card-delete {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.25rem 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
}

.btn-card-delete:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

.receipt-card-body {
  display: flex;
  padding: 0.85rem;
  gap: 0.85rem;
}

.card-thumb-area {
  width: 90px;
  height: 110px;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-thumb-placeholder {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-fields-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.card-field-row {
  display: flex;
  gap: 0.5rem;
}

.card-field-row.full {
  width: 100%;
}

.card-field-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.card-field-group.full {
  width: 100%;
}

.card-field-lbl {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.card-field-input {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.82rem;
  outline: none;
  transition: var(--transition);
}

.card-field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.card-field-input.font-bold {
  font-weight: 700;
  color: #1e3a8a;
}

/* ==========================================================================
   Multi-Crop Modal & Receipt Card Crop Button (Impeccable Craft)
   ========================================================================== */
.btn-card-crop {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-surface-secondary);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-card-crop:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}

.crop-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10005;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeInModal 0.2s ease;
}

.crop-modal-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.45);
  max-width: 920px;
  width: 100%;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleUpModal 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.crop-modal-header {
  padding: 1.15rem 1.4rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface-secondary);
}

.crop-modal-title-group {
  flex: 1;
}

.crop-modal-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 0.3rem;
}

.crop-modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
}

.crop-modal-guide {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.btn-crop-close {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
}

.btn-crop-close:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #dc2626;
}

.crop-modal-toolbar {
  padding: 0.65rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.crop-preset-shortcuts {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.crop-preset-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.btn-crop-shortcut {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.btn-crop-shortcut:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}

.btn-crop-reset {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.btn-crop-reset:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.crop-stage-container {
  flex: 1;
  min-height: 380px;
  max-height: 60vh;
  background: #090d16;
  padding: 1rem;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crop-image-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crop-stage-inner {
  position: relative;
  display: inline-block;
  user-select: none;
  touch-action: none;
}

.crop-base-image {
  display: block;
  max-width: 100%;
  max-height: 56vh;
  object-fit: contain;
  border-radius: 4px;
  pointer-events: none;
}

.crop-boxes-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  cursor: crosshair;
}

.crop-drag-preview {
  position: absolute;
  border: 2px dashed #38bdf8;
  background: rgba(56, 189, 248, 0.2);
  border-radius: 3px;
  pointer-events: none;
}

.crop-box-item {
  position: absolute;
  border: 2px solid #2563eb;
  background: rgba(37, 99, 235, 0.15);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5), 0 4px 14px rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  cursor: crosshair;
  pointer-events: none; /* 새 영역 드래그가 기존 박스에 의해 가로막히지 않도록 none 설정 */
}

.crop-box-badge {
  position: absolute;
  top: -22px;
  left: 0;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn-del-crop-box {
  position: absolute;
  top: -22px;
  right: 0;
  background: #ef4444;
  color: #ffffff;
  border: none;
  border-radius: 3px;
  width: 19px;
  height: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  cursor: pointer;
  pointer-events: auto; /* 삭제 버튼만 독립 클릭 가능 */
  transition: var(--transition);
}

.btn-del-crop-box:hover {
  background: #dc2626;
  transform: scale(1.08);
}

.crop-modal-footer {
  padding: 0.95rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-secondary);
}

.crop-box-count-badge {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.crop-box-count-badge strong {
  color: var(--primary);
  font-size: 1.05rem;
}

.crop-footer-buttons {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn-crop-cancel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 1.1rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.btn-crop-cancel:hover {
  background: var(--bg-surface-secondary);
  color: var(--text-main);
}

.btn-crop-apply {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.65rem 1.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: var(--transition);
}

.btn-crop-apply:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.crop-loading-spinner,
.crop-error-msg {
  color: #94a3b8;
  font-size: 0.9rem;
  padding: 2rem;
  text-align: center;
}

/* ==========================================================================
   Receipt Vision AI Automation Styles
   ========================================================================== */
.receipt-ai-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.08) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
}

.btn-receipt-ai-batch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1rem;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  transition: var(--transition);
}

.btn-receipt-ai-batch:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.45);
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.btn-receipt-ai-batch:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-receipt-api-key {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.btn-receipt-api-key:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg-surface-secondary);
}

.btn-card-ai {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #6366f1;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-card-ai:hover:not(:disabled) {
  background: #6366f1;
  color: #ffffff;
  border-color: #6366f1;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
}

.btn-card-ai:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.rotating {
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   지출 내역 및 집계서 (Executive Expense & Aggregation Summary) Styles
   ========================================================================== */
.aggregation-selector-section {
  margin-bottom: 1.2rem;
}

.aggregation-chips-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.btn-agg-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-subtle, #cbd5e1);
  border-radius: var(--radius-md, 6px);
  color: var(--text-main, #334155);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition, all 0.2s ease);
}

.btn-agg-chip:hover {
  border-color: var(--primary, #2563eb);
  background: var(--bg-surface-secondary, #f8fafc);
}

.btn-agg-chip.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.expense-summary-page {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 12px 16px;
  box-sizing: border-box;
  font-family: "Malgun Gothic", "맑은 고딕", -apple-system, sans-serif;
  color: #0f172a;
}

.expense-header-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 8px;
  border-bottom: 2px solid #1e293b;
  margin-bottom: 10px;
}

.expense-doc-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
  margin: 0;
}

.expense-doc-meta {
  text-align: right;
  font-size: 9.5px;
  color: #475569;
  line-height: 1.45;
}

.expense-kpi-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.expense-kpi-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
}

.expense-kpi-card.primary {
  background: #eff6ff;
  border-color: #93c5fd;
}

.kpi-card-lbl {
  font-size: 8.5px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 2px;
}

.expense-kpi-card.primary .kpi-card-lbl {
  color: #1d4ed8;
}

.kpi-card-val {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.expense-kpi-card.primary .kpi-card-val {
  color: #1e40af;
}

.kpi-card-sub {
  font-size: 8px;
  color: #64748b;
  margin-top: 1px;
}

.expense-agg-section {
  margin-bottom: 10px;
}

.expense-section-title {
  font-size: 10px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.expense-agg-table,
.expense-items-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 9px;
  line-height: 1.25;
}

.expense-agg-table th,
.expense-items-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  padding: 4px 5px;
  text-align: center;
}

.expense-agg-table td,
.expense-items-table td {
  border: 1px solid #cbd5e1;
  padding: 3.5px 5px;
  color: #1e293b;
}

.expense-items-wrapper {
  flex: 1;
  min-height: 0;
  margin-bottom: 8px;
}

.expense-footer-section {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

/* ==========================================================================
   영수증 정리 전용 완벽 A4 인쇄 & PDF 출력 스타일 (@media print)
   ========================================================================== */
#receipt-print-area {
  display: none !important;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 일반 웹페이지 요소(헤더, 네비, 좌측 컨트롤 패널, 모달, 광고 등) 모두 숨김 */
  body > *:not(#receipt-print-area) {
    display: none !important;
  }

  header, nav, footer, .navbar, .app-header, .site-header,
  .control-column, .preview-column, .receipt-action-bar,
  .mobile-tab-nav, .receipt-floating-controls, .preview-panel-header,
  .a4-sheet-container {
    display: none !important;
  }

  /* 인쇄 전용 컨테이너만 A4 크기로 정확히 노출 */
  #receipt-print-area {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    z-index: 9999999 !important;
  }

  .receipt-print-sheet {
    width: 210mm !important;
    height: 297mm !important;
    min-height: 297mm !important;
    max-height: 297mm !important;
    box-sizing: border-box !important;
    padding: 14mm 16mm !important;
    margin: 0 auto !important;
    background: #ffffff !important;
    color: #0f172a !important;
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    box-shadow: none !important;
    border: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .receipt-print-sheet:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }

  /* 인쇄 시 1페이지(본문 집계) 레이아웃 최적화 */
  .receipt-print-sheet .expense-summary-page {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    height: 100% !important;
    min-height: 0 !important;
  }

  .receipt-print-sheet .expense-doc-title {
    font-size: 24px !important;
  }

  .receipt-print-sheet .expense-section-title {
    font-size: 11px !important;
  }

  .receipt-print-sheet .expense-items-table,
  .receipt-print-sheet .expense-agg-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 10px !important;
    line-height: 1.35 !important;
  }

  .receipt-print-sheet .expense-items-table th,
  .receipt-print-sheet .expense-agg-table th {
    padding: 6px 4px !important;
    font-size: 10px !important;
    background: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 700 !important;
    text-align: center !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .receipt-print-sheet .expense-items-table td,
  .receipt-print-sheet .expense-agg-table td {
    padding: 5px 4px !important;
    font-size: 9.5px !important;
    border: 1px solid #cbd5e1 !important;
  }

  .receipt-print-sheet .expense-items-table tr.total-row td {
    background: #f1f5f9 !important;
    font-weight: 700 !important;
    border: 1px solid #cbd5e1 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 인쇄 시 2페이지~(증빙 4컷) 레이아웃 최적화 */
  .receipt-print-sheet .receipt-proof-page {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    height: 100% !important;
    min-height: 0 !important;
  }

  .receipt-print-sheet .receipt-proof-grid.grid-2x2 {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
    gap: 12px !important;
    flex: 1 !important;
    min-height: 0 !important;
    height: calc(100% - 46px) !important;
    margin-top: 6px !important;
    margin-bottom: 6px !important;
  }

  .receipt-proof-card {
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    padding: 6px 8px !important;
    display: flex !important;
    flex-direction: column !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
    min-height: 0 !important;
    height: 100% !important;
  }

  .receipt-proof-card-header {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    margin-bottom: 4px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding-bottom: 3px !important;
    flex-shrink: 0 !important;
  }

  .receipt-proof-img-box {
    flex: 1 !important;
    min-height: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 3px !important;
    overflow: hidden !important;
    margin-bottom: 4px !important;
    padding: 4px !important;
    box-sizing: border-box !important;
  }

  .receipt-proof-img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
  }

  .receipt-print-sheet .receipt-proof-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 9.5px !important;
    border: 1px solid #cbd5e1 !important;
    flex-shrink: 0 !important;
    margin-top: auto !important;
  }

  .receipt-print-sheet .receipt-proof-table td {
    padding: 3.5px 6px !important;
    border: 1px solid #cbd5e1 !important;
    font-size: 9.5px !important;
  }

  .receipt-print-sheet .receipt-proof-table td.label-cell {
    width: 28% !important;
    background: #f8fafc !important;
    color: #475569 !important;
    font-weight: 700 !important;
    text-align: center !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .receipt-print-sheet .receipt-proof-table td.val-cell {
    width: 72% !important;
    background: #ffffff !important;
    color: #334155 !important;
  }

  .receipt-print-sheet .receipt-a4-footer-page-no {
    margin-top: auto !important;
    padding-top: 8px !important;
    font-size: 10px !important;
    color: #94a3b8 !important;
    text-align: center !important;
    flex-shrink: 0 !important;
  }
}

/* ==========================================================================
   Static Content Pages (Privacy Policy, Terms of Service, Refund Policy)
   ========================================================================== */
.content-page-wrap {
  width: 100%;
  max-width: 860px;
  margin: 2.5rem auto 4rem;
  padding: 0 1.25rem;
}

.content-page-card {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.content-page-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary, #2563eb);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.content-page-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0f172a; /* 명시적 검은색 보장 */
  margin: 0 0 0.5rem;
}

.content-page-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle, #e2e8f0);
}

.content-page-body h2,
.content-page-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a; /* 명시적 검은색 보장 */
  margin: 1.8rem 0 0.6rem;
}

.content-page-body p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #334155;
  margin-bottom: 1rem;
}

.content-page-body ul,
.content-page-body ol {
  margin: 0.5rem 0 1rem 1.4rem;
  font-size: 0.95rem;
  line-height: 1.75;
  color: #334155;
}

.content-page-body li {
  margin-bottom: 0.35rem;
}

.content-page-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
  display: flex;
  justify-content: center;
}

/* 다크 모드에서의 이용약관 / 개인정보처리방침 / 환불정책 가독성 완벽 보장 */
.dark-theme .content-page-card {
  background: var(--bg-surface, #111827);
  border-color: var(--border-subtle, #1f2937);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.dark-theme .content-page-title {
  color: var(--text-main, #f8fafc);
}

.dark-theme .content-page-subtitle {
  color: var(--text-muted, #94a3b8);
  border-bottom-color: var(--border-subtle, #1f2937);
}

.dark-theme .content-page-body h2,
.dark-theme .content-page-body h3 {
  color: var(--text-main, #f8fafc);
}

.dark-theme .content-page-body p,
.dark-theme .content-page-body ul,
.dark-theme .content-page-body ol,
.dark-theme .content-page-body li {
  color: #cbd5e1;
}

.dark-theme .content-page-footer {
  border-top-color: var(--border-subtle, #1f2937);
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: var(--primary, #2563eb);
  color: #ffffff !important;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary-action:hover {
  background: var(--primary-hover, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

/* ==========================================================================
   ConversionModal (요금제 전환 팝업)
   ========================================================================== */
.conversion-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.conversion-modal-card {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-lg, 20px);
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.3);
  position: relative;
  display: flex;
  flex-direction: column;
}

.dark-theme .conversion-modal-card {
  background: #0f172a;
  border-color: #334155;
}

.conversion-modal-header {
  padding: 1.75rem 2rem 1.25rem;
  text-align: center;
  position: relative;
  border-bottom: 1px solid var(--border-subtle, #f1f5f9);
}

.conversion-badge-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.conversion-pill-badge {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  letter-spacing: 0.04em;
}

.conversion-watermark-badge {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
}

.dark-theme .conversion-pill-badge {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.dark-theme .conversion-watermark-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.conversion-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  margin-bottom: 0.5rem;
}

.conversion-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted, #64748b);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.55;
}

.btn-conversion-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 0.4rem;
  line-height: 1;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-conversion-close:hover {
  color: var(--text-main, #0f172a);
  background: rgba(15, 23, 42, 0.05);
}

.conversion-plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1.5rem 2rem;
}

@media (max-width: 768px) {
  .conversion-plans-grid {
    grid-template-columns: 1fr;
  }
}

.conversion-plan-card {
  background: var(--bg-surface, #ffffff);
  border: 2px solid var(--border-subtle, #e2e8f0);
  border-radius: 14px;
  padding: 1.25rem 1.15rem;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.dark-theme .conversion-plan-card {
  background: #1e293b;
  border-color: #334155;
}

.conversion-plan-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus, #3b82f6);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.conversion-plan-card.selected {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.02);
  box-shadow: 0 0 0 1px #2563eb;
}

.dark-theme .conversion-plan-card.selected {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
  box-shadow: 0 0 0 1px #3b82f6;
}

.conversion-plan-card.popular {
  border-color: #2563eb;
}

.plan-card-tag {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: #2563eb;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.65rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.plan-card-header {
  margin-bottom: 0.75rem;
}

.plan-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  margin-bottom: 0.25rem;
}

.plan-desc {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  line-height: 1.4;
}

.plan-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  margin-bottom: 0.75rem;
}

.plan-price {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--text-main, #0f172a);
}

.plan-period {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}

.plan-limit-badge {
  background: rgba(15, 23, 42, 0.06);
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  margin-bottom: 1rem;
}

.dark-theme .plan-limit-badge {
  background: rgba(255, 255, 255, 0.08);
}

.plan-feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-sub, #475569);
  flex-grow: 1;
}

.dark-theme .plan-feature-list {
  color: #cbd5e1;
}

.plan-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  line-height: 1.4;
}

.chk-icon {
  color: #10b981;
  font-weight: 800;
}

.plan-card-select-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem;
  border-radius: 8px;
  background: var(--bg-surface-secondary, #f1f5f9);
  color: var(--text-main, #0f172a);
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.conversion-plan-card.selected .plan-card-select-btn {
  background: #2563eb;
  color: #ffffff;
}

.radio-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: inline-block;
}

/* 비활성화 플랜 카드 (현재 이용 중인 플랜 또는 하위 플랜) */
.conversion-plan-card.plan-card-disabled {
  opacity: 0.62;
  cursor: not-allowed !important;
  background: var(--bg-surface-secondary, #f8fafc) !important;
  border-color: #cbd5e1 !important;
  box-shadow: none !important;
  transform: none !important;
}

.dark-theme .conversion-plan-card.plan-card-disabled {
  background: #0f172a !important;
  border-color: #334155 !important;
}

.plan-card-tag.tag-current {
  background: #16a34a !important;
  color: #ffffff !important;
}

.plan-card-tag.tag-lower {
  background: #64748b !important;
  color: #ffffff !important;
}

.plan-card-tag.tag-upgrade {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.plan-credit-box {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.plan-bonus-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.76rem;
  font-weight: 700;
}

.dark-theme .plan-bonus-pill {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.plan-total-credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 0.74rem;
  font-weight: 700;
}

.dark-theme .plan-total-credit-pill {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.plan-card-select-btn.btn-disabled {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
  color: #94a3b8 !important;
  cursor: not-allowed !important;
}

.conversion-plan-change-notice {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

.conversion-footer {
  padding: 1.25rem 2rem 1.75rem;
  border-top: 1px solid var(--border-subtle, #f1f5f9);
  background: var(--bg-surface-secondary, #f8fafc);
  border-bottom-left-radius: var(--radius-lg, 20px);
  border-bottom-right-radius: var(--radius-lg, 20px);
}

.dark-theme .conversion-footer {
  background: #090d16;
  border-color: #1e293b;
}

.conversion-legal-box {
  margin-bottom: 1.15rem;
}

.conversion-legal-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
}

.conversion-legal-chk {
  margin-top: 0.2rem;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #2563eb;
}

.conversion-legal-text {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
}

.conversion-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.btn-checkout-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-checkout-primary:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.btn-checkout-primary:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.6;
}

.btn-continue-manual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.65rem 1.25rem;
  background: transparent;
  color: var(--text-muted, #64748b);
  border: 1px solid var(--border-subtle, #cbd5e1);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-continue-manual:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text-main, #0f172a);
}

.conversion-free-guarantee {
  text-align: center;
  font-size: 0.74rem;
  color: var(--text-sub, #94a3b8);
  line-height: 1.4;
}

/* ==========================================================================
   MyPageModal (마이페이지 & Stripe 포털 모달)
   ========================================================================== */
.mypage-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.mypage-modal-card {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-lg, 20px);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  position: relative;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dark-theme .mypage-modal-card {
  background: #0f172a;
  border-color: #334155;
}

.mypage-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mypage-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
}

.btn-mypage-close {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 0.25rem;
}

.mypage-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  margin-top: 0.25rem;
}

.mypage-profile-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-surface-secondary, #f8fafc);
  border-radius: 12px;
  border: 1px solid var(--border-subtle, #e2e8f0);
}

.dark-theme .mypage-profile-section {
  background: #1e293b;
  border-color: #334155;
}

.mypage-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #2563eb;
  background: #e2e8f0;
}

.mypage-user-info {
  display: flex;
  flex-direction: column;
}

.mypage-user-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
}

.mypage-user-email {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}

.mypage-plan-box {
  padding: 1.15rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  background: var(--bg-surface, #ffffff);
}

.dark-theme .mypage-plan-box {
  background: #1e293b;
  border-color: #334155;
}

.mypage-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.mypage-plan-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
}

.mypage-plan-badge {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
}

.mypage-plan-desc {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
  margin-bottom: 0.85rem;
}

.mypage-usage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle, #f1f5f9);
}

.dark-theme .mypage-usage-row {
  border-color: #334155;
}

.usage-label {
  color: var(--text-muted, #64748b);
}

.usage-value {
  color: #2563eb;
  font-weight: 800;
}

.mypage-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn-mypage-portal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-surface-secondary, #f1f5f9);
  border: 1px solid var(--border-subtle, #cbd5e1);
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-mypage-portal:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.btn-mypage-upgrade {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.25rem;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-mypage-upgrade:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.mypage-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
}

.btn-mypage-logout {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.mypage-policy-note {
  font-size: 0.7rem;
  color: var(--text-sub, #94a3b8);
  text-align: center;
  line-height: 1.35;
}

/* ==========================================================================
   SubscriptionModal (독립 구독 및 결제 관리 모달)
   ========================================================================== */
.subscription-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.subscription-modal-card {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-lg, 20px);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dark-theme .subscription-modal-card {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

.subscription-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.sub-header-title-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sub-header-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: #2563eb;
  letter-spacing: 0.05em;
}

.sub-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  margin: 0;
}

.sub-modal-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  margin: 0;
}

.btn-sub-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  line-height: 1;
}

.btn-sub-close:hover {
  color: var(--text-main, #0f172a);
}

.sub-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* 요약 카드 */
.sub-summary-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dark-theme .sub-summary-card {
  background: #1e293b;
  border-color: #334155;
}

.sub-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  padding-bottom: 0.75rem;
}

.sub-plan-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sub-plan-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
}

.sub-price-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #2563eb;
}

.sub-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
}

.sub-badge-active {
  background: #dcfce7;
  color: #166534;
}

.sub-badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.sub-badge-free {
  background: #f1f5f9;
  color: #475569;
}

.sub-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 1rem;
}

.sub-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.detail-label {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
}

.detail-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
}

.text-green {
  color: #16a34a !important;
}

.sub-status-notice {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.78rem;
  line-height: 1.45;
}

/* 주요 기능 버튼 */
.sub-action-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn-sub-feature {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
}

.dark-theme .btn-sub-feature {
  background: #1e293b;
  border-color: #334155;
}

.btn-sub-feature:hover {
  border-color: #3b82f6;
  background: #f8fafc;
  transform: translateY(-1px);
}

.sub-feature-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
}

.sub-feature-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sub-feature-text strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
}

.sub-feature-text span {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
}

.sub-feature-arrow {
  color: var(--text-muted, #94a3b8);
  font-size: 1.1rem;
  font-weight: 700;
}

/* 영수증 프리뷰 */
.sub-invoices-preview {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.9rem 1rem;
}

.dark-theme .sub-invoices-preview {
  background: #1e293b;
  border-color: #334155;
}

.sub-invoices-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.sub-invoices-header h4 {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0;
}

.btn-invoices-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 1rem;
}

.sub-invoice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 0.4rem;
}

.dark-theme .sub-invoice-item {
  background: #0f172a;
  border-color: #334155;
}

.invoice-date-col {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.invoice-date-col strong {
  font-size: 0.82rem;
}

.invoice-date-col span {
  font-size: 0.72rem;
  color: #64748b;
}

.invoice-amt-col {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.invoice-amt-col strong {
  font-size: 0.9rem;
  color: #0f172a;
}

.invoice-status-paid {
  font-size: 0.7rem;
  font-weight: 700;
  color: #16a34a;
}

.invoice-note {
  font-size: 0.7rem;
  color: #64748b;
  margin: 0.4rem 0 0;
}

/* 위험 구역 */
.sub-danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 12px;
}

.dark-theme .sub-danger-zone {
  background: rgba(225, 29, 72, 0.1);
  border-color: rgba(225, 29, 72, 0.3);
}

.sub-danger-info strong {
  display: block;
  font-size: 0.82rem;
  color: #9f1239;
}

.sub-danger-info p {
  font-size: 0.72rem;
  color: #be123c;
  margin: 0.15rem 0 0;
}

.btn-sub-action {
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-sub-cancel {
  background: #ffffff;
  border: 1px solid #f43f5e;
  color: #e11d48;
}

.btn-sub-cancel:hover {
  background: #e11d48;
  color: #ffffff;
}

.btn-sub-resume {
  background: #2563eb;
  border: 1px solid #2563eb;
  color: #ffffff;
}

.btn-sub-resume:hover {
  background: #1d4ed8;
}

.btn-sub-disabled {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
}

/* 푸터 */
.subscription-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #e2e8f0;
  padding-top: 1rem;
}

.dark-theme .subscription-modal-footer {
  border-color: #334155;
}

.btn-sub-back {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #475569;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-sub-back:hover {
  background: #f1f5f9;
}

.btn-sub-close-footer {
  background: #0f172a;
  border: none;
  color: #ffffff;
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-sub-close-footer:hover {
  background: #1e293b;
}

/* ==========================================================================
   Receipt Organizer UI (Matching ui샘플 Screenshots)
   ========================================================================== */
.receipt-workspace-ui {
  max-width: 1260px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.receipt-header-hero {
  margin-bottom: 2rem;
}

.receipt-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.dark-theme .receipt-hero-badge {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.receipt-hero-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text-main, #0f172a);
  margin-bottom: 0.65rem;
  letter-spacing: -0.02em;
}

.receipt-hero-subtitle {
  font-size: 0.96rem;
  color: var(--text-muted, #64748b);
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── 드롭존 컨테이너 ── */
.receipt-dropzone-container {
  background: var(--bg-surface, #ffffff);
  border: 2px dashed #cbd5e1;
  border-radius: 20px;
  padding: 2.5rem 1.5rem 1.25rem;
  text-align: center;
  margin-bottom: 2rem;
  transition: all 0.2s ease;
  position: relative;
}

.dark-theme .receipt-dropzone-container {
  background: #111827;
  border-color: #374151;
}

.receipt-dropzone-container.drag-over {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.03);
}

.receipt-dropzone-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.receipt-dropzone-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.4rem;
}

.receipt-dropzone-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
}

.receipt-dropzone-desc {
  font-size: 0.88rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.75rem;
}

.btn-choose-receipts {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: #4f46e5;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.btn-choose-receipts:hover {
  background: #4338ca;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.4);
}

.receipt-dropzone-hint {
  font-size: 0.78rem;
  color: var(--text-sub, #94a3b8);
  margin-top: 0.75rem;
}

.receipt-sub-chips-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle, #f1f5f9);
}

.dark-theme .receipt-sub-chips-bar {
  border-color: #1e293b;
}

.sub-chip {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.chip-sparkle {
  color: #2563eb;
}

.sub-chip.count-chip {
  color: var(--text-main, #0f172a);
  font-weight: 700;
}

/* ── 4대 요약 KPI 지표 카드 ── */
.receipt-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 900px) {
  .receipt-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.receipt-kpi-card {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dark-theme .receipt-kpi-card {
  background: #111827;
  border-color: #1f2937;
}

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.kpi-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

.kpi-icon {
  font-size: 0.95rem;
  opacity: 0.7;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--text-main, #0f172a);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.kpi-value.primary-val {
  color: var(--text-main, #0f172a);
}

.kpi-subtext {
  font-size: 0.75rem;
  color: var(--text-sub, #94a3b8);
}

/* ── 카테고리 필터 필스 & 추가 액션 바 ── */
.receipt-filter-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.receipt-category-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-pill {
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle, #cbd5e1);
  background: var(--bg-surface, #ffffff);
  color: var(--text-main, #0f172a);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.dark-theme .filter-pill {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

.filter-pill:hover {
  border-color: #4f46e5;
  color: #4f46e5;
}

.filter-pill.active {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.receipt-bar-right-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-add-manual-receipt {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1.15rem;
  background: #4f46e5;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-manual-receipt:hover {
  background: #4338ca;
}

/* ── 2컬럼 스플릿 작업 공간 (영수증 & 사진대지 공통) ── */
.receipt-dashboard-split,
.photo-dashboard-split {
  display: grid;
  grid-template-columns: minmax(480px, 600px) 1fr;
  gap: 1.5rem;
  align-items: start;
}

.photo-left-panel {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  min-width: 0;
}

.photo-right-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.photo-live-preview-card {
  position: sticky;
  top: 1rem;
  overflow: visible;
}

.photo-export-actions {
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

.photo-live-preview-card .a4-sheet-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f8fafc;
  border-radius: 14px;
  padding: 1rem 0.85rem;
  border: 1px solid var(--border-subtle, #e2e8f0);
  box-sizing: border-box;
  width: 100%;
  overflow: visible;
  min-height: auto;
}

.dark-theme .photo-live-preview-card .a4-sheet-container {
  background: #0b0f19;
  border-color: #1e293b;
}

.photo-live-preview-card .a4-sheet {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1.414 !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.photo-live-preview-card .a4-sheet-header {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.photo-live-preview-card .a4-caption-label {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.28rem 0.35rem;
}

.photo-live-preview-card .a4-caption-value {
  font-size: 0.76rem;
  padding: 0.28rem 0.35rem;
}

.photo-live-preview-card .a4-num-badge {
  width: 24px;
  height: 24px;
  font-size: 0.8rem;
}

@media (max-width: 1200px) {
  .receipt-dashboard-split,
  .photo-dashboard-split {
    grid-template-columns: 1fr;
  }
  .photo-live-preview-card {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

@media (max-width: 768px) {
  .receipt-workspace-ui,
  .photo-workspace-ui {
    padding: 0.75rem 0.65rem 2.5rem !important;
    max-width: 100% !important;
  }

  .receipt-dashboard-split,
  .photo-dashboard-split {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 1rem !important;
    margin: 0 auto !important;
  }

  .receipt-list-panel,
  .receipt-analytics-panel,
  .photo-left-panel,
  .photo-right-panel {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 auto !important;
  }

  .receipt-filter-action-bar,
  .photo-filter-action-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
  }

  .receipt-category-pills,
  .photo-preset-pills {
    width: 100% !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    padding-bottom: 4px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .receipt-bar-right-actions {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    gap: 0.4rem !important;
  }

  .btn-ai-extract-all {
    flex: 1 1 100% !important;
    justify-content: center !important;
  }

  .expense-sheet-a4-paper {
    padding: 0.6rem !important;
    border-radius: 12px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .sheet-paper-inner {
    padding: 1rem 0.75rem !important;
    min-height: auto !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .sheet-table-wrap {
    overflow-x: auto !important;
    width: 100% !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

/* ── 좌측 영수증 리스트 ── */
.receipt-cards-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.receipt-item-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.18s ease;
  min-width: 0;
}

.dark-theme .receipt-item-row {
  background: #111827;
  border-color: #1f2937;
}

.receipt-item-row:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.receipt-row-thumb {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  background: var(--bg-surface-secondary, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-placeholder {
  font-size: 1.1rem;
}

.thumb-crop-badge {
  position: absolute;
  right: 2px;
  bottom: 2px;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  border-radius: 4px;
  font-size: 0.65rem;
  padding: 1px 3px;
  line-height: 1;
  pointer-events: none;
}

.thumb-crop-hint {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.receipt-row-thumb:hover .thumb-crop-hint {
  opacity: 1;
}

.receipt-row-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow: hidden;
}

.input-receipt-merchant {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  padding: 0;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dark-theme .input-receipt-merchant {
  color: #f8fafc;
}

.input-receipt-merchant:focus {
  border-bottom: 1px solid #4f46e5;
}

.receipt-meta-subrow {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  flex-wrap: nowrap;
  overflow: hidden;
}

.receipt-date-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.cal-icon {
  font-size: 0.75rem;
  opacity: 0.7;
}

.input-receipt-date {
  border: none;
  background: transparent;
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  padding: 0;
  outline: none;
  font-family: inherit;
}

.meta-dot {
  opacity: 0.5;
}

.select-receipt-payment {
  border: none;
  background: transparent;
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  outline: none;
  font-family: inherit;
}

.btn-receipt-recrop {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 0.72rem;
  color: #4f46e5;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
  margin-top: 1px;
  text-align: left;
}

.btn-receipt-recrop:hover {
  color: #3730a3;
}

.receipt-row-category {
  flex-shrink: 0;
}

.select-receipt-cat {
  padding: 0.22rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.receipt-row-amount {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  width: auto;
  min-width: 115px;
  justify-content: flex-end;
  white-space: nowrap;
}

.amount-cur {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  flex-shrink: 0;
}

.input-receipt-amount {
  width: 95px;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  text-align: right;
  outline: none;
  padding: 0 4px 0 0;
  box-sizing: border-box;
  letter-spacing: -0.01em;
}

.dark-theme .input-receipt-amount {
  color: #f8fafc;
}

.input-receipt-amount:focus {
  border-bottom: 1px solid #4f46e5;
}

.receipt-row-delete {
  flex-shrink: 0;
}

.btn-delete-receipt {
  background: transparent;
  border: none;
  color: var(--text-sub, #94a3b8);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
  transition: all 0.18s ease;
}

.btn-delete-receipt:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.receipt-empty-state {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
}

.dark-theme .receipt-empty-state {
  background: #111827;
  border-color: #1f2937;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
}

.receipt-empty-state h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  margin-bottom: 0.4rem;
}

.receipt-empty-state p {
  font-size: 0.86rem;
  color: var(--text-muted, #64748b);
  max-width: 480px;
  margin: 0 auto;
}

/* ── 우측 분석 & 실시간 A4 패널 ── */
.receipt-analytics-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.analytics-card {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dark-theme .analytics-card {
  background: #111827;
  border-color: #1f2937;
}

.analytics-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  margin-bottom: 1rem;
}

.category-bars-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.category-bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cat-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

.cat-bar-label {
  font-weight: 700;
  color: var(--text-main, #0f172a);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.cat-bar-amount {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  font-weight: 600;
}

.cat-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(15, 23, 42, 0.06);
  border-radius: 9999px;
  overflow: hidden;
}

.dark-theme .cat-progress-track {
  background: rgba(255, 255, 255, 0.08);
}

.cat-progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.category-empty-hint {
  font-size: 0.8rem;
  color: var(--text-sub, #94a3b8);
  text-align: center;
  padding: 1rem 0;
}

/* ── Live A4 미리보기 카드 ── */
.live-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.live-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

.live-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
}

.expense-sheet-a4-paper {
  background: #f8fafc;
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--border-subtle, #e2e8f0);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.dark-theme .expense-sheet-a4-paper {
  background: #0b0f19;
  border-color: #1e293b;
}

.sheet-paper-inner {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 2.25rem 2.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  color: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 520px;
}

.sheet-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 2.5px solid #0f172a;
  padding-bottom: 0.85rem;
}

.sheet-main-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.sheet-subhead {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 0.2rem;
}

.sheet-total-block {
  text-align: right;
}

.sheet-total-label {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
  display: block;
  margin-bottom: 0.15rem;
}

.sheet-total-num {
  font-size: 1.5rem;
  font-weight: 900;
  color: #4f46e5;
  letter-spacing: -0.02em;
}

.sheet-table-wrap {
  overflow-x: auto;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.sheet-table th {
  text-align: left;
  padding: 0.45rem 0.35rem;
  border-bottom: 1.5px solid #cbd5e1;
  color: #475569;
  font-weight: 700;
  white-space: nowrap;
}

.sheet-table td {
  padding: 0.35rem 0.35rem;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
  font-size: 0.72rem;
}

.cell-merchant {
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.cell-amount {
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
}

.sheet-subtotal-block {
  border-top: 1.5px solid #0f172a;
  padding-top: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
}

.subtotal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subtotal-item.sub-tax {
  color: #64748b;
}

.sheet-paper-footer {
  text-align: center;
  font-size: 0.65rem;
  color: #94a3b8;
  padding-top: 0.4rem;
  border-top: 1px solid #f1f5f9;
}

/* ── 내보내기 4대 포맷 액션 버튼 (XLSX, DOCX, HWPX, PDF) ── */
.sheet-export-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-top: 1rem;
}

@media (max-width: 640px) {
  .sheet-export-actions {
    grid-template-columns: 1fr;
  }
}

.sheet-export-actions button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
  padding: 0.65rem 0.6rem;
  border: none;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  text-decoration: none;
  position: relative;
  min-height: 52px;
}

.btn-export-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  line-height: 1.2;
}

.export-pro-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  background: #f59e0b;
  color: #1e1b4b;
  font-size: 0.65rem;
  font-weight: 900;
  border-radius: 4px;
  letter-spacing: 0.5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  margin-left: 2px;
}

.export-sub-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.9;
  letter-spacing: -0.2px;
  line-height: 1.1;
}

.sheet-export-actions button.pro-locked {
  position: relative;
  opacity: 0.93;
}

.sheet-export-actions button.pro-locked:hover {
  filter: brightness(1.08);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.btn-export-xlsx {
  background: #4f46e5;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-export-xlsx:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

.btn-export-docx {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-export-docx:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.btn-export-hwpx {
  background: #ea580c;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
}

.btn-export-hwpx:hover {
  background: #c2410c;
  transform: translateY(-1px);
}

.btn-export-pdf {
  background: #059669;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.btn-export-pdf:hover {
  background: #047857;
  transform: translateY(-1px);
}

.btn-submit-approval {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.65rem 1rem;
  background: transparent;
  color: var(--text-main, #0f172a);
  border: 1px solid var(--border-subtle, #cbd5e1);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-submit-approval:hover {
  background: var(--bg-surface-secondary, #f8fafc);
  border-color: #94a3b8;
}

/* ── 하단 사용 방법 (How receipt organizing works) ── */
.receipt-how-it-works {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
  text-align: center;
}

.how-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  margin-bottom: 0.4rem;
}

.how-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 2rem;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  text-align: left;
}

@media (max-width: 768px) {
  .how-grid {
    grid-template-columns: 1fr;
  }
}

.how-card {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.dark-theme .how-card {
  background: #111827;
  border-color: #1f2937;
}

.how-step-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #4f46e5;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.how-step-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  margin-bottom: 0.4rem;
}

.how-step-desc {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  line-height: 1.5;
}

/* ── 하단 푸터 바 ── */
.receipt-footer-bar {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-sub, #94a3b8);
}

.receipt-footer-bar .footer-links {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.receipt-footer-bar a {
  color: var(--text-muted, #64748b);
  text-decoration: none;
}

.receipt-footer-bar a:hover {
  color: #4f46e5;
}

/* ══════════════════════════════════════════════════════════
   AI 자동 분할 로딩 & Pro 결제 유도 모달
══════════════════════════════════════════════════════════ */
.ai-processing-modal-overlay,
.partial-consent-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.ai-processing-card,
.partial-consent-card {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.3);
  padding: 2rem 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: modalScaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.dark-theme .ai-processing-card,
.dark-theme .partial-consent-card {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.ai-processing-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.ai-spinner-wrap {
  position: relative;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.ai-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid #6366f1;
  border-top-color: transparent;
  animation: spinRing 0.9s linear infinite;
}

@keyframes spinRing {
  to { transform: rotate(360deg); }
}

.ai-spinner-icon {
  font-size: 1.7rem;
}

.ai-proc-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.dark-theme .ai-proc-title {
  color: #f8fafc;
}

.ai-proc-subtitle {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.45;
  margin: 0;
}

.ai-proc-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.ai-proc-progress-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #4f46e5, #06b6d4, #6366f1);
  border-radius: 9999px;
  animation: progressPulse 1.8s ease-in-out infinite;
}

@keyframes progressPulse {
  0% { left: 0%; width: 25%; }
  50% { left: 40%; width: 55%; }
  100% { left: 100%; width: 25%; }
}

.ai-proc-steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: #f8fafc;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  font-size: 0.82rem;
  color: #475569;
  border: 1px solid #f1f5f9;
}

.dark-theme .ai-proc-steps {
  background: #0f172a;
  border-color: #1e293b;
  color: #94a3b8;
}

.ai-proc-step {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.step-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #dbeafe;
  color: #2563eb;
  font-size: 0.68rem;
  font-weight: 800;
}

.ai-proc-promo-card {
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  border: 1px solid #c7d2fe;
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dark-theme .ai-proc-promo-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  border-color: #4338ca;
}

.promo-badge-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.promo-badge {
  font-size: 0.7rem;
  font-weight: 800;
  background: #4f46e5;
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 9999px;
}

.promo-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: #4338ca;
}

.dark-theme .promo-tag {
  color: #a5b4fc;
}

.promo-heading {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1e1b4b;
  margin: 0;
}

.dark-theme .promo-heading {
  color: #f8fafc;
}

.promo-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8rem;
  color: #4338ca;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dark-theme .promo-list {
  color: #c7d2fe;
}

.btn-proc-upgrade {
  margin-top: 0.35rem;
  background: #4f46e5;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-proc-upgrade:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════════
   부분 출력 동의 & 크레딧 소멸 체크 모달
══════════════════════════════════════════════════════════ */
.partial-consent-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.warn-icon-wrap {
  font-size: 2.2rem;
}

.partial-consent-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.dark-theme .partial-consent-title {
  color: #f8fafc;
}

.partial-consent-desc {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0;
}

.partial-consent-notice-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dark-theme .partial-consent-notice-box {
  background: #451a03;
  border-color: #78350f;
}

.notice-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #92400e;
}

.dark-theme .notice-title {
  color: #fde68a;
}

.notice-text {
  font-size: 0.82rem;
  color: #78350f;
  line-height: 1.45;
  margin: 0;
}

.dark-theme .notice-text {
  color: #fed7aa;
}

.notice-subtext {
  font-size: 0.75rem;
  color: #b45309;
  margin: 0;
}

.partial-consent-check-row {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.dark-theme .partial-consent-check-row {
  background: #0f172a;
  border-color: #334155;
}

.consent-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
}

.consent-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: #4f46e5;
  flex-shrink: 0;
}

.consent-label-text {
  font-size: 0.82rem;
  color: #1e293b;
  line-height: 1.45;
}

.dark-theme .consent-label-text {
  color: #f1f5f9;
}

.partial-consent-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.btn-partial-upgrade {
  background: #4f46e5;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-partial-upgrade:hover {
  background: #4338ca;
}

.btn-partial-proceed {
  background: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-partial-proceed.enabled {
  opacity: 1;
  cursor: pointer;
}

.btn-partial-proceed.enabled:hover {
  background: #0369a1;
}

.btn-partial-cancel {
  background: transparent;
  color: #64748b;
  border: none;
  padding: 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

.btn-partial-cancel:hover {
  color: #334155;
}

/* AI 일괄 자동인식 버튼 스타일 */
.btn-ai-extract-all {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.48rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.btn-ai-extract-all:hover {
  background: linear-gradient(135deg, #4338ca 0%, #2563eb 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.btn-ai-extract-all:active {
  transform: translateY(0);
}

/* 실시간 A4 미리보기 페이지 네비게이션 컨트롤 */
.preview-page-navigator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f1f5f9;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.dark-theme .preview-page-navigator {
  background: #1e293b;
  border-color: #334155;
}

.btn-preview-page {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preview-page:hover:not(:disabled) {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.btn-preview-page:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.preview-page-indicator {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  min-width: 60px;
  text-align: center;
}

.dark-theme .preview-page-indicator {
  color: #cbd5e1;
}

/* 실시간 A4 미리보기 시트 내부 4컷 증빙 뷰 */
.live-preview-proof-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  height: 480px;
  margin-top: 10px;
}

.live-preview-proof-card {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  padding: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.live-preview-proof-thumb-box {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.live-preview-proof-thumb-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.live-preview-proof-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #475569;
  border-top: 1px solid #f1f5f9;
  padding-top: 2px;
}

/* ==========================================================================
   AI 영수증 자동인식 핵심 CTA 버튼 강조 스타일 (유료화 핵심 기능 부각)
   ========================================================================== */
.btn-ai-extract-all {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.38), 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.btn-ai-glow {
  animation: aiButtonGlowPulse 2.8s infinite ease-in-out;
}

@keyframes aiButtonGlowPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.5), 0 4px 14px rgba(99, 102, 241, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(219, 39, 119, 0), 0 6px 22px rgba(219, 39, 119, 0.55);
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0), 0 4px 14px rgba(99, 102, 241, 0.4);
    transform: scale(1);
  }
}

.btn-ai-extract-all:hover {
  background: linear-gradient(135deg, #4338ca 0%, #6d28d9 50%, #be185d 100%);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.6);
  border-color: rgba(255, 255, 255, 0.6);
}

.btn-ai-extract-all:active {
  transform: translateY(0) scale(0.98);
}

.btn-ai-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  background: #fef08a;
  color: #854d0e;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.btn-ai-label {
  letter-spacing: -0.01em;
}

/* ====================================================================
   로그인 유도 & 30크레딧 혜택 안내 모달 스타일
   ==================================================================== */
.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  padding: 1rem;
}

.auth-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.auth-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.auth-modal-dialog {
  position: relative;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 18px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.25), 0 0 1px 1px rgba(0, 0, 0, 0.05);
  max-width: 440px;
  width: 100%;
  padding: 2rem 1.75rem 1.5rem;
  box-sizing: border-box;
  text-align: center;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

.auth-modal-overlay.active .auth-modal-dialog {
  transform: translateY(0) scale(1);
}

.dark-theme .auth-modal-dialog {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.6);
}

.auth-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.15rem;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 50%;
  transition: all 0.15s ease;
  line-height: 1;
}

.auth-modal-close:hover {
  color: var(--text-main, #0f172a);
  background: rgba(0, 0, 0, 0.05);
}

.dark-theme .auth-modal-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.auth-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.dark-theme .auth-modal-badge {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.auth-modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  margin: 0 0 0.65rem 0;
  letter-spacing: -0.02em;
}

.dark-theme .auth-modal-title {
  color: #f8fafc;
}

.auth-modal-desc {
  font-size: 0.92rem;
  color: var(--text-muted, #64748b);
  line-height: 1.55;
  margin: 0 0 1.25rem 0;
}

.dark-theme .auth-modal-desc {
  color: #94a3b8;
}

.highlight-credit {
  color: #2563eb;
  font-weight: 800;
}

.dark-theme .highlight-credit {
  color: #38bdf8;
}

.auth-benefit-box {
  background: var(--bg-surface-secondary, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.dark-theme .auth-benefit-box {
  background: #0f172a;
  border-color: #334155;
}

.auth-benefit-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.benefit-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
}

.benefit-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.benefit-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
}

.dark-theme .benefit-title {
  color: #f1f5f9;
}

.benefit-sub {
  font-size: 0.76rem;
  color: var(--text-muted, #64748b);
}

.benefit-divider {
  height: 1px;
  background: var(--border-subtle, #e2e8f0);
  margin: 0.6rem 0;
}

.dark-theme .benefit-divider {
  background: #334155;
}

.auth-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.btn-auth-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 0.85rem 1.25rem;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-auth-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.btn-auth-secondary {
  background: transparent;
  color: var(--text-muted, #64748b);
  border: none;
  font-size: 0.85rem;
  padding: 0.45rem;
  cursor: pointer;
  font-weight: 600;
  transition: color 0.15s ease;
}

.btn-auth-secondary:hover {
  color: var(--text-main, #0f172a);
}

.dark-theme .btn-auth-secondary:hover {
  color: #f1f5f9;
}

/* ==========================================================================
   Linear-Inspired Landing Page (https://linear.app/ style)
   ========================================================================== */
.linear-landing-root {
  width: 100%;
  min-height: calc(100vh - 65px);
  background-color: #08090a;
  color: #f7f8f8;
  position: relative;
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.5rem;
  box-sizing: border-box;
}

@media (min-width: 1025px) {
  .linear-landing-root {
    height: calc(100vh - 65px);
    max-height: calc(100vh - 65px);
    overflow-y: auto;
    padding: 1.25rem 2rem;
  }
}

.linear-bg-glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 480px;
  background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.18) 0%, rgba(59, 130, 246, 0.08) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.linear-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.linear-hero-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.linear-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d0d6e0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.linear-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

.linear-pill-sparkle {
  color: #818cf8;
  font-size: 0.8rem;
}

.linear-pill-arrow {
  color: #8a8f98;
  font-size: 0.72rem;
  transition: transform 0.15s ease;
}

.linear-pill:hover .linear-pill-arrow {
  transform: translateX(2px);
  color: #ffffff;
}

.linear-hero-title {
  font-size: clamp(1.85rem, 3.2vw, 2.85rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: #ffffff;
  margin: 0;
  text-wrap: balance;
}

.linear-hero-shine {
  background: linear-gradient(180deg, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.linear-hero-sub {
  font-size: clamp(0.9rem, 1.1vw, 1.02rem);
  color: #8a8f98;
  line-height: 1.55;
  max-width: 680px;
  margin: 0 auto;
  text-wrap: balance;
}

.desktop-br {
  display: inline;
}

@media (max-width: 640px) {
  .desktop-br {
    display: none;
  }
}

.linear-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.linear-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #ffffff;
  color: #08090a !important;
  font-weight: 650;
  font-size: 0.88rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.linear-btn-primary:hover {
  background: #f1f2f4;
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 8px 20px rgba(0, 0, 0, 0.6);
}

.linear-btn-kbd {
  font-family: monospace;
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: #555;
  font-weight: 700;
}

.linear-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  color: #f7f8f8 !important;
  font-weight: 650;
  font-size: 0.88rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  backdrop-filter: blur(8px);
}

.linear-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.linear-btn-secondary .linear-btn-kbd {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
}

.linear-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: #d0d6e0;
  font-weight: 600;
  font-size: 0.86rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.linear-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.linear-spec-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.15rem;
  margin-top: 0.15rem;
}

.linear-spec-item {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: #626770;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.spec-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #464b53;
}

/* 4-Card Bento Grid */
.linear-bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

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

@media (max-width: 600px) {
  .linear-bento-grid {
    grid-template-columns: 1fr;
  }
}

.linear-bento-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  position: relative;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.linear-bento-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.linear-card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.linear-bento-card:hover .linear-card-glow {
  opacity: 1;
}

.linear-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.linear-card-tag {
  font-family: monospace;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #818cf8;
}

.linear-card-icon {
  font-size: 1rem;
  opacity: 0.75;
}

.linear-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 0;
}

.linear-card-desc {
  font-size: 0.78rem;
  color: #8a8f98;
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

.linear-card-metric {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.55rem;
  margin-top: 0.15rem;
}

.metric-num {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #f7f8f8;
  font-variant-numeric: tabular-nums;
}

.metric-sub {
  font-size: 0.7rem;
  color: #626770;
  font-weight: 500;
}

/* Linear Bottom 30 Credits Onboarding Callout */
.linear-credit-banner {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.9rem 1.35rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.linear-credit-banner:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.credit-banner-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(129, 140, 248, 0.35), transparent);
}

.credit-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.credit-banner-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 260px;
}

.credit-badge {
  font-family: monospace;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: #818cf8;
  font-weight: 600;
}

.credit-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 0;
}

.credit-sub {
  font-size: 0.78rem;
  color: #8a8f98;
  margin: 0;
  line-height: 1.45;
}

.linear-btn-credit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(129, 140, 248, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.28);
  color: #c7d2fe;
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.linear-btn-credit:hover {
  background: rgba(129, 140, 248, 0.22);
  border-color: rgba(129, 140, 248, 0.45);
  color: #ffffff;
  transform: translateY(-1px);
}

@media (max-width: 992px) {
  .linear-landing-root {
    height: auto;
    max-height: none;
    padding: 1.5rem 1rem 3rem;
    overflow-y: visible;
  }
}

@media (max-width: 768px) {
  .linear-cta-row {
    flex-direction: column !important;
    width: 100% !important;
    max-width: 340px !important;
    margin: 0.5rem auto 0 !important;
    gap: 0.65rem !important;
  }

  .linear-btn-primary,
  .linear-btn-secondary,
  .linear-btn-ghost {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    box-sizing: border-box !important;
    padding: 0.75rem 1.25rem !important;
  }
}


/*# sourceMappingURL=styles.360be40466668fe0286c.css.map*/