/* ==========================================================================
   사진대지 생성기 - 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-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: "Plus Jakarta Sans", "Noto Sans KR", -apple-system, BlinkMacSystemFont, 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-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;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

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

.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.45rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

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

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-surface-secondary);
  padding: 0.25rem 0.35rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
}

.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);
}

/* 모바일 전용 네비게이션 보정 (화면 폭 640px 이하) */
@media (max-width: 640px) {
  .nav-container {
    padding: 0.45rem 0.65rem;
    gap: 0.35rem;
  }
  .brand-link {
    font-size: 0.95rem;
    gap: 0.3rem;
  }
  .brand-icon {
    font-size: 1.15rem;
  }
  .brand-text {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    font-size: 0.92rem;
  }
  .nav-menu {
    padding: 0.2rem 0.25rem;
    gap: 0.15rem;
  }
  .nav-link {
    font-size: 0.78rem;
    padding: 0.3rem 0.55rem;
  }
  .control-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.45rem;
    min-height: 28px;
  }
}

@media (max-width: 380px) {
  .nav-container {
    padding: 0.4rem 0.45rem;
    gap: 0.2rem;
  }
  .brand-text {
    font-size: 0.82rem;
  }
  .nav-link {
    font-size: 0.72rem;
    padding: 0.25rem 0.4rem;
  }
  .control-btn {
    font-size: 0.7rem;
    padding: 0.2rem 0.35rem;
  }
}

/* ==========================================================================
   Workspace Layout (Responsive 2-Column Split)
   ========================================================================== */
.workspace-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  width: 100%;
}

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

.header-section {
  margin-bottom: 2rem;
}

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

.header-badge {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.main-title {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

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

.subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .subtitle {
    font-size: 0.9rem;
    line-height: 1.45;
  }
}

/* ==========================================================================
   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: 480px 1fr;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

@media (max-width: 1024px) {
  .builder-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }
}

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

.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 {
    padding: 0.95rem 0.8rem;
    border-radius: var(--radius-md);
  }
}

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

.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: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.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.5rem;
  width: 100%;
}

@media (max-width: 480px) {
  .preset-buttons {
    display: grid;
    grid-template-columns: repeat(3, 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.45rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  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; }

/* ==========================================================================
   Field Builder List
   ========================================================================== */
.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;
}

.field-row-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  transition: var(--transition);
  min-width: 0;
  width: 100%;
}

.field-row-card.is-col-field {
  border-left: 3.5px solid var(--primary);
  background: var(--primary-light);
}

.field-row-main,
.field-row-sub {
  display: contents;
}

.field-col-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: #ffffff;
  background: var(--primary);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.field-row-card:hover {
  border-color: var(--primary-border);
}

.field-drag-handle {
  color: var(--text-sub);
  font-size: 0.9rem;
  cursor: grab;
  flex-shrink: 0;
}

.field-label-input {
  width: 100px;
  min-width: 0;
  padding: 0.45rem 0.65rem;
  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;
}

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

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

.btn-remove-field {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: var(--transition);
  flex-shrink: 0;
}

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

/* 모바일 540px 이하: 정보 칸 행을 시원한 2줄 카드 구조로 변환 */
@media (max-width: 540px) {
  .field-row-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    padding: 0.6rem 0.65rem;
  }

  .field-row-main {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
  }

  .field-row-main .field-label-input {
    flex: 1;
    min-width: 0;
    width: auto;
  }

  .field-row-sub {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
  }

  .field-row-sub .field-type-select {
    flex: 1;
    min-width: 0;
    width: 100%;
  }
}

/* ==========================================================================
   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;
}

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

.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;
}

.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;
}

@media (max-width: 480px) {
  .btn-generate-main {
    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;
}

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

.preview-sticky-card {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  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);
}

/* ==========================================================================
   Virtual A4 Sheet Container & Margin Shading Overlay
   ========================================================================== */
.a4-sheet-container {
  display: flex;
  justify-content: center;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  overflow: hidden;
  width: 100%;
  min-width: 0;
}

@media (max-width: 640px) {
  .a4-sheet-container {
    padding: 0.6rem;
    border-radius: var(--radius-md);
  }
}

.a4-sheet {
  background: #ffffff;
  color: #111827;
  width: 100%;
  max-width: 540px;
  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);
}

/* 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);
  transition: height 0.15s ease;
}

.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);
  transition: height 0.15s ease;
}

.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);
  transition: width 0.15s ease;
}

.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);
  transition: width 0.15s ease;
}

.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;
  transition: padding 0.15s ease;
  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: 2px;
  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;
  display: block;
  border: 1px solid #9ca3af;
  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;
}

.a4-caption-row {
  display: flex;
  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;
}

.a4-col-pair {
  display: flex;
  width: 50%;
}

.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%;
}

.a4-col-pair .a4-caption-value {
  width: 65%;
  justify-content: center;
  text-align: center;
  padding: 0.2rem 0.25rem;
}

.has-col-layout .a4-caption-row:not(.two-cols) .a4-caption-label {
  width: 17.5%;
}

.has-col-layout .a4-caption-row:not(.two-cols) .a4-caption-value {
  width: 82.5%;
}

.a4-caption-label {
  width: 28%;
  background: #f3f4f6;
  color: #374151;
  font-weight: 700;
  text-align: center;
  padding: 0.25rem 0.35rem;
  border-right: 1px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.a4-caption-value {
  width: 72%;
  padding: 0.25rem 0.45rem;
  color: #111827;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.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;
  background: linear-gradient(135deg, var(--text-main) 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.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: 200;
}
.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: 150;
  transform: translateY(20px);
  opacity: 0;
  transition: var(--transition);
}
.notification.show { transform: translateY(0); opacity: 1; }
.notification.success { border-left: 4px solid #10b981; }
.notification.error { border-left: 4px solid #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;
  border-left: 3px solid #2563eb;
  padding-left: 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 {
  background: #1e293b;
  color: #f1f5f9;
  border-color: #334155;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

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

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

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

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

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

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

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

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

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

/* ==========================================================================
   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;
}

/*# sourceMappingURL=styles.eb80874285a16bc9d403.css.map*/