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

[hidden] {
  display: none !important;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: #1e1e2e;
  color: #cdd6f4;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.privacy-note { color: #aab4cc; font-size: 12px; }
.shift-hint { font-size: 11px; color: #bac2de; margin-left: 4px; }

.editor-drop-zone {
  margin: 12px 16px 0;
  min-height: 180px;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px dashed #65708a;
  border-radius: 10px;
  background: rgba(137, 180, 250, 0.06);
  color: #26343b;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.editor-drop-zone strong {
  color: #26343b;
  font-size: 18px;
  font-weight: 700;
}

.editor-drop-zone span { color: #566873; font-size: 13px; }
.editor-drop-zone .editor-drop-icon {
  color: #287d78;
  font-size: 46px;
  line-height: 1;
}
.editor-drop-zone:hover,
.editor-drop-zone.drag-over {
  border-color: #89b4fa;
  background: rgba(137, 180, 250, 0.14);
}

/* ── HEADER ── */
#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #181825;
  border-bottom: 1px solid #313244;
  padding: 8px 16px;
  height: 48px;
  flex-shrink: 0;
}

#mode-tabs {
  display: flex;
  align-self: stretch;
  gap: 4px;
  margin-left: 28px;
}

.mode-tab {
  position: relative;
  border: 0;
  background: transparent;
  color: #a6adc8;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.mode-tab:hover { color: #cdd6f4; background: rgba(255, 255, 255, 0.03); }
.mode-tab.active { color: #cba6f7; }
.mode-tab.active::after { content: ''; position: absolute; right: 12px; bottom: 0; left: 12px; height: 2px; border-radius: 2px 2px 0 0; background: #cba6f7; }

#app-title {
  font-size: 16px;
  font-weight: 600;
  color: #cba6f7;
}

#header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.language-picker select {
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background-color: #fff;
  color: #172033;
  padding: 6px 9px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color-scheme: light;
}

.language-picker select:hover { background-color: #f1f5f9; }
.language-picker select:focus-visible { outline: 2px solid #78b7ad; outline-offset: 2px; }
.language-picker option { color: #172033; background-color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.header-auth-button {
  min-height: 32px;
  border: 1px solid #78b7ad;
  border-radius: 7px;
  background: #78b7ad;
  color: #172033;
  padding: 5px 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.header-auth-button:hover { background: #91cbc2; }
.auth-user { display: flex; align-items: center; gap: 8px; min-width: 0; }
.plan-button { border: 1px solid #58627a; border-radius: 999px; background: #30364a; color: #cbd5e1; padding: 4px 9px; font-size: 11px; font-weight: 800; cursor: pointer; }
.plan-button.active { border-color: #e7b35c; background: #4b3d25; color: #ffd486; }
.pricing-button { border-color: #78b7ad; color: #eafffb; }
.account-button { display: grid; justify-items: start; min-width: 0; border: 0; background: transparent; color: #fff; padding: 3px 5px; cursor: pointer; }
.account-button span:last-child { color: #b8c2d6; font-size: 10px; }
#auth-user-email { max-width: 180px; overflow: hidden; color: #fff; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.modal-open { overflow: hidden; }
.auth-modal { position: fixed; z-index: 10000; inset: 0; display: grid; place-items: center; padding: 20px; }
.auth-modal[hidden] { display: none; }
.auth-backdrop { position: absolute; inset: 0; background: rgba(8, 12, 22, 0.72); backdrop-filter: blur(5px); }
.auth-panel {
  position: relative;
  width: min(100%, 410px);
  border: 1px solid #41485e;
  border-radius: 16px;
  background: #222738;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  padding: 34px;
  color: #e1e7f5;
}
.auth-close { position: absolute; top: 14px; right: 16px; border: 0; background: transparent; color: #9aa5bd; font-size: 25px; cursor: pointer; }
.auth-brand { margin-bottom: 18px; color: #78b7ad; font-size: 14px; font-weight: 800; letter-spacing: 0.04em; }
.auth-panel h2 { margin: 0; color: #fff; font-size: 26px; }
.auth-panel > p { margin: 8px 0 22px; color: #aeb8cc; line-height: 1.5; }
.auth-google, .auth-submit { width: 100%; min-height: 44px; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer; }
.auth-google { display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid #cbd5e1; background: #fff; color: #172033; }
.auth-google:hover { background: #f1f5f9; }
.google-mark { color: #4285f4; font-size: 18px; font-weight: 900; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: #7e899f; font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #41485e; }
#auth-form { display: grid; gap: 15px; }
#auth-form label { display: grid; gap: 7px; color: #d7deee; font-size: 13px; font-weight: 650; }
#auth-form input { width: 100%; border: 1px solid #4d556d; border-radius: 8px; background: #1b2030; color: #fff; padding: 11px 12px; font: inherit; outline: none; }
#auth-form input:focus { border-color: #78b7ad; box-shadow: 0 0 0 3px rgba(120, 183, 173, 0.14); }
.auth-submit { border: 0; background: #78b7ad; color: #172033; margin-top: 3px; }
.auth-submit:hover { background: #91cbc2; }
.auth-google:disabled, .auth-submit:disabled { cursor: wait; opacity: 0.65; }
.auth-message { margin: 0 !important; border-radius: 7px; background: rgba(120, 183, 173, 0.12); color: #aee0d8 !important; padding: 10px 11px; font-size: 12px; }
.auth-message.error { background: rgba(244, 114, 114, 0.12); color: #fca5a5 !important; }
.auth-switch { margin: 20px 0 0 !important; text-align: center; font-size: 13px; }
.auth-switch button { border: 0; background: transparent; color: #8fd3c8; font: inherit; font-weight: 700; cursor: pointer; }
.auth-config-note { margin: 15px 0 0 !important; color: #f2bf7d !important; text-align: center; font-size: 11px; }
.review-login { margin-top: 18px; border-top: 1px solid #41485e; padding-top: 14px; }
.review-login summary { color: #8f9ab0; text-align: center; font-size: 12px; cursor: pointer; }
#review-login-form { display: grid; gap: 12px; margin-top: 14px; }
#review-login-form label { display: grid; gap: 6px; color: #d7deee; font-size: 12px; font-weight: 650; }
#review-login-form input { width: 100%; border: 1px solid #4d556d; border-radius: 8px; background: #1b2030; color: #fff; padding: 10px 12px; font: inherit; }
.billing-panel { max-width: 430px; }
.billing-price { display: flex; align-items: baseline; gap: 8px; margin: 24px 0; }
.billing-price strong { color: #fff; font-size: 36px; }
.billing-price span { color: #9da8bd; }
.billing-benefits { display: grid; gap: 11px; margin: 0 0 25px; padding: 0; list-style: none; color: #dce4f3; }
.billing-benefits li::before { content: '✓'; margin-right: 9px; color: #78b7ad; font-weight: 900; }
.billing-cancel { width: 100%; margin-top: 12px; border: 0; background: transparent; color: #9da8bd; padding: 8px; cursor: pointer; }
.billing-legal { margin: 13px 0 0 !important; color: #8792a8 !important; text-align: center; font-size: 11px; }
.billing-legal a { color: #9fd8cf; }
.account-panel { max-width: 440px; }
.account-summary { display: grid; gap: 1px; overflow: hidden; margin: 22px 0; border: 1px solid #41485e; border-radius: 12px; background: #41485e; }
.account-summary div { display: grid; gap: 5px; padding: 14px 16px; background: #272d40; }
.account-summary span { color: #aeb8cc; font-size: 12px; }
.account-summary strong { color: #fff; font-size: 14px; overflow-wrap: anywhere; }
.site-footer { display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 54px; border-top: 1px solid #41485e; background: #202536; color: #8f9ab0; font-size: 11px; }
.site-footer a { color: #aeb8cc; text-decoration: none; }.site-footer a:hover { color: #fff; }

.header-btn {
  background: #313244;
  color: #cdd6f4;
  border: 1px solid #45475a;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.header-btn:hover {
  background: #45475a;
}

.header-btn.primary {
  background: #7f49c4;
  border-color: #cba6f7;
  color: #fff;
}

.header-btn.primary:hover {
  background: #9155d8;
}

/* ── MAIN ── */
body > main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#main {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.mode-view {
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

.mode-view.active { display: flex; }

/* ── 사이드바 ── */
#sidebar {
  width: 200px;
  flex-shrink: 0;
  background: #181825;
  border-right: 1px solid #313244;
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  gap: 8px;
}

.sidebar-label {
  font-size: 11px;
  color: #bac2de;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 4px;
}

#pdf-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pdf-list-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 5px;
  background: #313244;
  font-size: 11px;
  color: #cdd6f4;
}

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

.pdf-list-item .pdf-remove {
  background: none;
  border: none;
  color: #f38ba8;
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
  flex-shrink: 0;
}

/* ── 콘텐츠 영역 ── */
#content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#manage-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #181825;
  border-bottom: 1px solid #313244;
  flex-shrink: 0;
  flex-wrap: wrap;
}

#manage-toolbar #manage-hint { margin-left: 4px; }

#manage-hint {
  font-size: 12px;
  color: #bac2de;
}

#manage-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.action-btn {
  background: #313244;
  color: #cdd6f4;
  border: 1px solid #45475a;
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.action-btn.download {
  background: #168a83;
  border-color: #43c6bb;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(22, 138, 131, 0.28);
}

.action-btn.download:hover {
  background: #20a39a;
  border-color: #72ded4;
}

.action-btn:hover {
  background: #45475a;
}

.action-btn.danger {
  border-color: #f38ba8;
  color: #f38ba8;
}

.action-btn.danger:hover {
  background: rgba(243, 139, 168, 0.15);
}

.action-btn.secondary {
  color: #cdd6f4;
  border-color: #313244;
}

.action-btn.edit {
  color: #a6e3a1;
  border-color: #a6e3a1;
}

/* ── 페이지 편집기 ── */
#editor-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(0, 0, 0, 0.78);
  padding: 20px;
}

#editor-panel {
  width: 100%;
  height: 100%;
  background: #181825;
  border: 1px solid #45475a;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#editor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #313244;
  flex-wrap: wrap;
}

#editor-toolbar strong { margin-right: 8px; color: #cba6f7; }
.editor-spacer { flex: 1; }
.editor-control { font-size: 12px; display: flex; align-items: center; gap: 5px; }
.editor-control input[type="number"] { width: 58px; }
.editor-control input { background: #313244; color: #fff; border: 1px solid #45475a; border-radius: 4px; padding: 4px; }
.file-button { display: inline-block; }

#editor-stage-scroll {
  flex: 1;
  overflow: auto;
  padding: 24px;
  background: #11111b;
}

#editor-stage {
  position: relative;
  margin: 0 auto;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.45);
}

.editor-page { display: block; width: 100%; height: 100%; }

.editor-overlay {
  position: absolute;
  cursor: move;
  border: 1px dashed transparent;
  touch-action: none;
}

.editor-overlay img { width: 100%; height: 100%; display: block; pointer-events: none; }
.editor-overlay.selected { border-color: #cba6f7; }

.resize-handle {
  display: none;
  position: absolute;
  width: 12px;
  height: 12px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  background: #cba6f7;
  cursor: nwse-resize;
}

.editor-overlay.selected .resize-handle { display: block; }
#editor-help { padding: 8px 12px; color: #a6adc8; font-size: 11px; border-top: 1px solid #313244; }

/* ── 결과 폴더 설정 ── */
#output-settings-modal {
  position: fixed;
  inset: 0;
  z-index: 7000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
}

#output-settings-panel {
  width: min(520px, 100%);
  padding: 24px;
  border: 1px solid #45475a;
  border-radius: 12px;
  background: #181825;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
}

#output-settings-panel h2 { margin-bottom: 16px; color: #cba6f7; font-size: 18px; }
.output-folder-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid #313244; }
.output-folder-row > div { flex: 1; min-width: 0; }
.output-folder-row strong { display: block; margin-bottom: 5px; color: #cdd6f4; font-size: 12px; }
.output-folder-row span { display: block; overflow: hidden; color: #a6adc8; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.hwp-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ── 썸네일 그리드 ── */
#thumb-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-content: flex-start;
}

.selection-marquee {
  position: fixed;
  z-index: 9998;
  border: 2px solid #168a83;
  border-radius: 5px;
  background: rgba(22, 138, 131, 0.18);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7) inset;
  pointer-events: none;
}

.thumb-item {
  position: relative;
  width: 170px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: crosshair;
  user-select: none;
  border: 2px solid transparent;
  border-radius: 12px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.thumb-item.dragging { opacity: 0.4; }
.thumb-item.drop-before::before,
.thumb-item.drop-after::after {
  content: '';
  position: absolute;
  z-index: 8;
  top: -4px;
  bottom: -4px;
  width: 5px;
  border-radius: 4px;
  background: #15998f;
  box-shadow: 0 0 0 3px rgba(21, 153, 143, 0.18), 0 0 12px rgba(21, 153, 143, 0.6);
}

.thumb-item.drop-before::before { left: -8px; }
.thumb-item.drop-after::after { right: -8px; }

.thumb-rotate-controls {
  display: flex;
  gap: 4px;
}

.thumb-rotate-controls button {
  width: 28px;
  height: 24px;
  border: 1px solid #45475a;
  border-radius: 5px;
  background: #313244;
  color: #cdd6f4;
  cursor: pointer;
}

.thumb-rotate-controls button:hover {
  border-color: #89b4fa;
  color: #89b4fa;
}

.thumb-canvas-wrap {
  position: relative;
  width: 108px;
  height: 153px;
  display: grid;
  place-items: center;
  padding: 4px;
  border: 2px solid #313244;
  border-radius: 4px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.15s;
  cursor: grab;
}

.thumb-canvas-wrap:active { cursor: grabbing; }

.thumb-canvas-wrap.landscape {
  width: 153px;
  height: 108px;
}

.thumb-canvas-wrap canvas { display: block; }

.final-page-number {
  position: absolute;
  z-index: 4;
  top: 6px;
  left: 6px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 7px;
  background: #263f4a;
  box-shadow: 0 2px 6px rgba(24, 40, 48, 0.3);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.thumb-canvas-wrap.thumb-loading {
  background: #313244;
  animation: thumb-pulse 1s ease-in-out infinite;
}

@keyframes thumb-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.thumb-item.selected .thumb-canvas-wrap {
  border-color: #cba6f7;
}

.thumb-item.selected .thumb-canvas-wrap::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 4px;
  background: #cba6f7;
  color: #1e1e2e;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.thumb-label {
  width: 100%;
  font-size: 10px;
  color: #cdd6f4;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

/* ── 분할점 구분자 ── */
.split-divider {
  position: absolute;
  z-index: 3;
  top: 42%;
  right: -17px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 36px;
  cursor: pointer;
  user-select: none;
  border-radius: 4px;
  transition: background 0.15s;
}

.split-divider-icon {
  font-size: 14px;
  color: #45475a;
  transition: color 0.15s, transform 0.15s;
  display: block;
}

.split-divider:hover .split-divider-icon {
  color: #fab387;
  transform: scale(1.2);
}

.split-divider.active {
  background: rgba(250, 179, 135, 0.12);
  border: 1px dashed #fab387;
}

.split-divider.active .split-divider-icon {
  color: #fab387;
}

/* ── 처리 중 오버레이 ── */
#saving-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#saving-box {
  width: min(360px, calc(100vw - 48px));
  background: #313244;
  border-radius: 10px;
  padding: 28px 40px;
  text-align: center;
}

#saving-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #45475a;
  border-top-color: #cba6f7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#saving-text {
  font-size: 14px;
  color: #cdd6f4;
}

#saving-progress {
  width: 100%;
  height: 10px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #45475a;
}

#saving-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f39a62, #d45f2a);
  transition: width 180ms ease;
}

#saving-progress-label {
  margin-top: 7px;
  color: #a6adc8;
  font-size: 11px;
}

#status-toast {
  position: fixed;
  right: 20px;
  top: 68px;
  z-index: 10000;
  padding: 12px 16px;
  border: 1px solid #a6e3a1;
  border-radius: 8px;
  background: #1e1e2e;
  color: #a6e3a1;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}

#unlock-status-panel {
  flex: 0 0 323px;
  width: 100%;
  overflow: hidden;
  border-top: 1px solid #45475a;
  background: #11111b;
}

.status-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  border-bottom: 1px solid #313244;
  color: #cba6f7;
  font-size: 11px;
}

#unlock-status-list { scroll-behavior: smooth; }
.status-row { display: flex; gap: 8px; min-height: 29px; padding: 7px 4px; border-bottom: 1px solid #313244; font-size: 10px; }
.status-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #cdd6f4; }
.status-value { flex-shrink: 0; color: #a6adc8; }
.status-row.processing .status-value { color: #89b4fa; }
.status-row.success .status-value { color: #a6e3a1; }
.status-row.failed .status-value { color: #f38ba8; }

/* ── 독립 도구 화면 ── */
.tool-page {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0;
  overflow-y: auto;
}

.tool-card,
.tool-status-card {
  border: 1px solid #313244;
  border-radius: 14px;
  background: #181825;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.tool-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 28px;
}

.tool-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: rgba(203, 166, 247, 0.12);
  font-size: 28px;
}

.tool-copy h1 { margin-bottom: 7px; color: #f5eafa; font-size: 21px; }
.tool-copy > p { max-width: 570px; color: #a6adc8; font-size: 13px; line-height: 1.55; }

.output-location {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  min-width: 0;
  font-size: 11px;
}

.output-location span { flex-shrink: 0; color: #6c7086; }
.output-location strong { overflow: hidden; color: #89b4fa; text-overflow: ellipsis; white-space: nowrap; }

.hancom-security-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #d97706;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
}

.hancom-security-notice[hidden] { display: none; }

.tool-primary-button {
  border: 1px solid #cba6f7;
  border-radius: 8px;
  background: #7f49c4;
  color: #fff;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.tool-primary-button:hover { background: #9155d8; }

.hwp-drop-zone {
  display: flex;
  grid-column: 1 / -1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 185px;
  padding: 20px;
  border: 2px dashed #d49a67;
  border-radius: 12px;
  background: rgba(255, 247, 237, 0.72);
  color: #7c3d1c;
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms, background 150ms, transform 150ms;
}

.hwp-drop-zone:hover,
.hwp-drop-zone.drag-over {
  border-color: #a94816;
  background: #fff3e6;
  transform: translateY(-2px);
}

.hwp-drop-zone:focus-visible { outline: 3px solid rgba(169, 72, 22, 0.28); outline-offset: 2px; }
.hwp-drop-zone > strong { font-size: 15px; }
.hwp-drop-zone > span:not(.hwp-drop-icon) { color: #946347; font-size: 11px; line-height: 1.4; }
.hwp-drop-icon { color: #c5622d; font-size: 42px; line-height: 1; }
.hwp-drop-zone .tool-primary-button { margin-top: 7px; }
.hwp-drop-zone:has(.tool-primary-button:disabled) { cursor: not-allowed; opacity: 0.55; }

.tool-status-card { margin-top: 18px; overflow: hidden; }
.tool-status-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #313244; }
.tool-status-header h2 { color: #cdd6f4; font-size: 13px; }
.tool-status-header span { color: #6c7086; font-size: 11px; }
.tool-status-list {
  height: 220px;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.tool-status-list .status-row { min-height: 36px; padding: 10px 14px; font-size: 11px; }
.empty-status { padding: 46px 20px; color: #6c7086; text-align: center; font-size: 12px; }

@media (max-width: 760px) {
  #app-title { display: none; }
  .privacy-note { display: none; }
  #auth-user-email { display: none; }
  .auth-panel { padding: 28px 22px; }
  .site-footer { flex-wrap: wrap; gap: 8px 14px; padding: 12px; }
  #mode-tabs { margin-left: 0; }
  .mode-tab { padding: 0 10px; font-size: 12px; }
  .tool-card { grid-template-columns: auto 1fr; }
  .tool-primary-button { grid-column: 1 / -1; width: 100%; }
  .hwp-drop-zone { grid-column: 1 / -1; width: 100%; }
}

/* ── 가독성 개선 테마 ── */
body { background: #272c3d; color: #e1e7f5; font-size: 14px; }
#header { background: #202536; border-bottom-color: #41485e; }
#sidebar,
#manage-toolbar { background: #222738; border-color: #41485e; }
#content { background: #272c3d; }
.tool-card,
.tool-status-card,
#output-settings-panel,
#editor-panel { background: #222738; border-color: #41485e; }
.tool-status-list,
#hwp-selected-list,
#editor-stage-scroll { background: #1d2231; }

.mode-tab { color: #bbc4d9; font-size: 14px; }
.mode-tab.active { color: #d8b4fe; }
.mode-tab.active::after { background: #d8b4fe; }
.header-btn { font-size: 14px; }
.sidebar-label { color: #c2cbe0; font-size: 12px; }
.pdf-list-item { background: #353b50; font-size: 12px; }
#manage-hint { color: #c2cbe0; font-size: 13px; }
#shift-hint { font-size: 12px !important; color: #c2cbe0 !important; }
.action-btn { font-size: 13px; }
.thumb-label { color: #d8deed; font-size: 11px; }
.tool-copy > p { color: #c2cbe0; font-size: 14px; }
.output-location { font-size: 12px; }
.tool-status-header h2 { font-size: 14px; }
.tool-status-header span { color: #9da8c0; font-size: 12px; }
.tool-status-list .status-row { font-size: 12px; }
.empty-status { color: #9da8c0; font-size: 13px; }
.output-folder-row strong { font-size: 13px; }
.output-folder-row span { color: #b2bdd3; font-size: 11px; }
#editor-help { color: #b2bdd3; font-size: 12px; }

/* ── 연한 오렌지 테마 ── */
body { background: #f8e4d2; color: #4b3428; }
#header { background: #f3c79f; border-bottom-color: #dfa979; }
#app-title { color: #a94816; }
#sidebar,
#manage-toolbar { background: #f6d6b8; border-color: #dfa979; }
#content { background: #f8e4d2; }
.tool-card,
.tool-status-card,
#output-settings-panel,
#editor-panel { background: #fff7f0; border-color: #e5b68c; }
.tool-status-list,
#editor-stage-scroll { background: #fbe9da; }

.mode-tab { color: #735346; }
.mode-tab:hover { color: #4b3428; background: rgba(255, 255, 255, 0.25); }
.mode-tab.active { color: #a94816; }
.mode-tab.active::after { background: #e66f24; }
.header-btn,
.action-btn { background: #fff4e9; color: #5a3b2d; border-color: #d9a276; }
.header-btn:hover,
.action-btn:hover { background: #ffe8d3; }
.header-btn.primary,
.action-btn.primary,
.tool-primary-button { background: #e9782d; border-color: #d7621d; color: #fff; }
.header-btn.primary:hover,
.action-btn.primary:hover,
.tool-primary-button:hover { background: #d96520; }

.sidebar-label,
#manage-hint,
#shift-hint { color: #79594b !important; }
.pdf-list-item { background: #f0c59f; color: #4b3428; }
.thumb-canvas-wrap { border-color: #d7a77f; }
.thumb-item.selected .thumb-canvas-wrap { border-color: #e9782d; }
.thumb-label { color: #62473a; }
.split-divider-icon { color: #b38467; }

.tool-icon { background: #ffe0c3; }
.tool-copy h1 { color: #4b3428; }
.tool-copy > p,
.empty-status { color: #79594b; }
.output-location span,
.tool-status-header span { color: #936c58; }
.output-location strong { color: #b8511a; }
.tool-status-header { border-bottom-color: #ead0b9; }
.tool-status-header h2 { color: #5a3b2d; }
.status-row { border-bottom-color: #ead0b9; }
.status-name { color: #5a3b2d; }

.output-folder-row { border-bottom-color: #ead0b9; }
.output-folder-row strong { color: #5a3b2d; }
.output-folder-row span { color: #806052; }
#status-toast { background: #fff7f0; color: #47734a; border-color: #78a57b; }
#saving-box { background: #fff7f0; }
#saving-text { color: #5a3b2d; }
#saving-spinner { border-color: #edc9aa; border-top-color: #e9782d; }

/* ── 차분한 블루그레이 테마 ── */
body { background: #202632; color: #d7dde8; }
#header { background: #1b202b; border-bottom-color: #384252; }
#app-title { color: #8fc7be; }
#sidebar,
#manage-toolbar { background: #242b37; border-color: #384252; }
#content { background: #202632; }
.tool-card,
.tool-status-card,
#output-settings-panel,
#editor-panel { background: #28303d; border-color: #3d4858; }
.tool-status-list,
#editor-stage-scroll { background: #222936; }

.mode-tab { color: #aeb8c7; }
.mode-tab:hover { color: #e0e5ed; background: rgba(255, 255, 255, 0.035); }
.mode-tab.active { color: #8fc7be; }
.mode-tab.active::after { background: #78b7ad; }
.header-btn,
.action-btn { background: #303947; color: #d7dde8; border-color: #465365; }
.header-btn:hover,
.action-btn:hover { background: #3a4555; }
.header-btn.primary,
.action-btn.primary,
.tool-primary-button { background: #4f887f; border-color: #6aa99f; color: #fff; }
.header-btn.primary:hover,
.action-btn.primary:hover,
.tool-primary-button:hover { background: #5a978d; }

.sidebar-label,
#manage-hint,
#shift-hint { color: #aeb8c7 !important; }
.pdf-list-item { background: #303947; color: #d7dde8; }
.thumb-canvas-wrap { border-color: #465365; }
.thumb-item.selected .thumb-canvas-wrap { border-color: #78b7ad; }
.thumb-label { color: #c5cedb; }
.split-divider-icon { color: #7e8a9a; }

.tool-icon { background: rgba(120, 183, 173, 0.13); }
.tool-copy h1 { color: #edf1f6; }
.tool-copy > p,
.empty-status { color: #aeb8c7; }
.output-location span,
.tool-status-header span { color: #8995a6; }
.output-location strong { color: #8fc7be; }
.tool-status-header { border-bottom-color: #3d4858; }
.tool-status-header h2 { color: #d7dde8; }
.status-row { border-bottom-color: #36404f; }
.status-name { color: #d7dde8; }
.output-folder-row { border-bottom-color: #3d4858; }
.output-folder-row strong { color: #d7dde8; }
.output-folder-row span { color: #aeb8c7; }
#status-toast { background: #28303d; color: #9ed6ad; border-color: #659b72; }
#saving-box { background: #28303d; }
#saving-text { color: #d7dde8; }
#saving-spinner { border-color: #465365; border-top-color: #78b7ad; }

/* ── 밝고 편안한 소프트 테마 ── */
body { background: #e9eff2; color: #35424b; }
#header { background: #d9e6e9; border-bottom-color: #bdcfd4; }
#app-title { color: #32756d; }
#sidebar,
#manage-toolbar { background: #e1ebed; border-color: #bdcfd4; }
#content { background: #e9eff2; }
.tool-card,
.tool-status-card,
#output-settings-panel,
#editor-panel { background: #f8fafb; border-color: #c8d5d9; }
.tool-status-list,
#editor-stage-scroll { background: #eef3f5; }

.mode-tab { color: #5f6e77; }
.mode-tab:hover { color: #293840; background: rgba(255, 255, 255, 0.36); }
.mode-tab.active { color: #286c64; }
.mode-tab.active::after { background: #4b9b91; }
.header-btn,
.action-btn { background: #f7fafb; color: #3d4a52; border-color: #b8c9ce; }
.header-btn:hover,
.action-btn:hover { background: #ffffff; }
.header-btn.primary,
.action-btn.primary,
.tool-primary-button { background: #4b9b91; border-color: #3c887f; color: #fff; }
.header-btn.primary:hover,
.action-btn.primary:hover,
.tool-primary-button:hover { background: #3f8d84; }

.sidebar-label,
#manage-hint,
#shift-hint { color: #60717a !important; }
.pdf-list-item { background: #d3e1e4; color: #35424b; }
.thumb-canvas-wrap { border-color: #b7c8cd; }
.thumb-item.selected .thumb-canvas-wrap { border-color: #4b9b91; }
.thumb-label { color: #4b5b64; }
.split-divider-icon { color: #81949c; }
.tool-icon { background: #d9ece8; }
.tool-copy h1 { color: #26353d; }
.tool-copy > p,
.empty-status { color: #667780; }
.output-location span,
.tool-status-header span { color: #7a8b93; }
.output-location strong { color: #32756d; }
.tool-status-header { border-bottom-color: #d4dfe2; }
.tool-status-header h2,
.status-name,
.output-folder-row strong { color: #35424b; }
.status-row,
.output-folder-row { border-bottom-color: #d4dfe2; }
.output-folder-row span { color: #65767e; }
#status-toast { background: #f8fafb; color: #35733f; border-color: #74a77b; }
#saving-box { background: #f8fafb; }
#saving-text { color: #35424b; }
#saving-spinner { border-color: #c8d5d9; border-top-color: #4b9b91; }


/* 스크롤바 */
#thumb-grid::-webkit-scrollbar,
#pdf-list::-webkit-scrollbar {
  width: 6px;
}

#thumb-grid::-webkit-scrollbar-track,
#pdf-list::-webkit-scrollbar-track {
  background: #1e1e2e;
}

#thumb-grid::-webkit-scrollbar-thumb,
#pdf-list::-webkit-scrollbar-thumb {
  background: #45475a;
  border-radius: 3px;
}

.action-btn.strong-action {
  background: #40545f;
  border-color: #31434c;
  color: #ffffff;
  font-weight: 600;
}

.action-btn.strong-action:hover {
  background: #2f424c;
  border-color: #24353d;
}

.thumb-item.selected {
  border-color: #168a83;
  background: #d2ebe8;
  box-shadow: 0 0 0 3px rgba(22, 138, 131, 0.16), 0 6px 16px rgba(31, 78, 75, 0.2);
}

.thumb-item.selected .thumb-canvas-wrap {
  border-color: #168a83;
}

.thumb-item.selected .thumb-canvas-wrap::after {
  z-index: 5;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  background: #168a83;
  color: #ffffff;
  font-size: 15px;
  box-shadow: 0 2px 7px rgba(22, 90, 85, 0.38);
}

.thumb-item.selected .thumb-label {
  color: #173f3c;
  font-weight: 800;
}

.action-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid #b8c9ce;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.48);
}

.action-group-label {
  color: #4e626c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.download-separated {
  margin-left: 10px;
}

#manage-actions {
  width: 100%;
  align-items: stretch;
  padding-top: 8px;
  border-top: 1px solid #bdcfd4;
}

.action-group {
  flex-wrap: wrap;
}

.selection-group { border-color: #d9b9b9; }
.edit-group { border-color: #a8c8c4; }
.document-group { border-color: #b8c2d2; }
.export-group { border-color: #c7b9d5; }
