:root {
  --bg: #f4f1ea;
  --card: #fffdf8;
  --ink: #23272e;
  --muted: #6b7280;
  --accent: #2f4858;
  --accent-strong: #22353f;
  --line: #e3ddd0;
  --danger: #b3392e;
  --ok: #2e7d4f;
  --radius: 14px;
  --serif: "Nanum Myeongjo", "Noto Serif KR", "Apple Myungjo", serif;
  --sans: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 500px at 80% -10%, #ece5d5 0%, transparent 60%), var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
}

button, input, textarea { font: inherit; }

.page { max-width: 860px; margin: 0 auto; padding: 48px 20px 72px; }
.site-header { text-align: center; margin-bottom: 36px; }
.eyebrow { margin: 0 0 6px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.site-header h1 { margin: 0 0 12px; font-family: var(--serif); font-size: 32px; font-weight: 800; letter-spacing: -.01em; }
.lede { margin: 0 auto; max-width: 610px; color: var(--muted); font-size: 14.5px; }
.privacy-badge { display: inline-flex; margin: 16px 0 0; padding: 6px 12px; border: 1px solid #cad8cf; border-radius: 999px; background: #eff7f1; color: #276642; font-size: 12.5px; font-weight: 700; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; margin-bottom: 22px; box-shadow: 0 1px 2px rgba(35,39,46,.04), 0 10px 28px rgba(35,39,46,.05); }
.card h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 17px; font-weight: 700; }
.step { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; flex: none; }

.drop-zone { border: 1.5px dashed #c9c0ac; border-radius: 12px; padding: 34px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop-zone:hover, .drop-zone:focus-visible { border-color: var(--accent); background: #faf7ef; outline: none; }
.drop-zone.dragging { border-color: var(--accent); background: #f2ecdc; }
.drop-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-bottom: 8px; border-radius: 10px; background: #e7e1d3; color: var(--accent); font-size: 13px; font-weight: 800; letter-spacing: .08em; }
.drop-title { margin: 0; font-weight: 600; }
.drop-sub { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.file-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; }
.file-name { margin: 0; display: inline-block; max-width: min(100%, 560px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 14px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 13.5px; font-weight: 600; }
.clear-file { border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; background: #fff; color: var(--muted); cursor: pointer; font-size: 12px; }
.clear-file:hover { color: var(--danger); border-color: #d9b3ae; }

.paste-area { margin-top: 16px; }
.paste-area summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.paste-area summary:hover { color: var(--ink); }
textarea { width: 100%; margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-family: ui-monospace, "D2Coding", Consolas, monospace; font-size: 13px; resize: vertical; background: #fbfaf5; color: var(--ink); }

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: 1fr 1fr .6fr; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 600; }
input[type="text"], input[type="number"] { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font-size: 14px; font-weight: 400; background: #fff; color: var(--ink); }
input:focus, textarea:focus { outline: 2px solid rgba(47,72,88,.25); outline-offset: 1px; border-color: var(--accent); }
.hint { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); }
.hint code { background: #efe9da; border-radius: 5px; padding: 1px 6px; font-size: 12px; }
.checks { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.actions { text-align: center; margin: 6px 0 26px; }
button.primary { min-width: 220px; border: none; border-radius: 999px; padding: 15px 32px; background: var(--accent); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; transition: background .15s, transform .1s; box-shadow: 0 6px 18px rgba(47,72,88,.28); }
button.primary:hover { background: var(--accent-strong); }
button.primary:active { transform: translateY(1px); }
button.primary:disabled { background: #9aa5ad; cursor: wait; box-shadow: none; }

.result { border-left: 4px solid var(--ok); }
.result.error { border-left-color: var(--danger); }
.result h3 { margin: 0 0 8px; font-size: 16px; }
.result p { margin: 4px 0; font-size: 14px; }
.privacy-confirm { color: var(--ok); font-weight: 700; }
.result .download-btn { display: inline-block; margin-top: 14px; padding: 12px 28px; border-radius: 999px; background: var(--ok); color: #fff; font-weight: 700; font-size: 15px; text-decoration: none; }
.result .download-btn:hover { background: #256b43; }
.result ul.warnings { margin: 12px 0 0; padding: 12px 16px; border-radius: 10px; background: #fdf6e3; border: 1px solid #ecdcb0; font-size: 13px; color: #7a6116; list-style: none; }
.result ul.warnings li::before { content: "주의 · "; font-weight: 700; }
.site-footer { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 30px; }
.site-footer p { margin: 4px auto; max-width: 680px; }

@media (max-width: 640px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .site-header h1 { font-size: 25px; }
  .page { padding-top: 32px; }
  .file-row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
