:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #66726b;
  --line: #dfe5df;
  --paper: #fbfcf9;
  --white: #ffffff;
  --green: #196b45;
  --green-dark: #115338;
  --green-pale: #e9f4ed;
  --mint: #cde7d6;
  --danger: #a23a35;
  --danger-pale: #fff2ef;
  --shadow: 0 18px 50px rgba(26, 50, 36, 0.09);
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 4%, rgba(201, 230, 211, 0.65), transparent 25rem),
    linear-gradient(180deg, #f6faf5 0, var(--paper) 32rem);
}

button, input { font: inherit; }
button { cursor: pointer; }

.shell {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 68px 0 84px;
}

.hero {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 42px;
}

.hero-mark {
  display: grid;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid #b9d3c2;
  border-radius: 19px;
  color: var(--green);
  background: rgba(255,255,255,.7);
  font-size: 32px;
  font-weight: 300;
  box-shadow: 0 12px 35px rgba(36, 91, 59, .09);
}

.eyebrow, .step-label {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .15em;
}

h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 14px;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.16;
  letter-spacing: -.045em;
}
h1 span { color: #7b9a86; font-weight: 400; }
.lead { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.7; }
h2 { margin-bottom: 0; font-size: 24px; letter-spacing: -.025em; }

.card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}

.input-card { padding: clamp(22px, 5vw, 42px); }
.section-heading, .preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.privacy {
  margin: 0;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--green);
  background: var(--green-pale);
  font-size: 12px;
  font-weight: 700;
}

.file-grid { display: grid; gap: 14px; }
.file-picker {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  background: #fcfdfb;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.file-picker:hover, .file-picker:focus-within {
  border-color: #88b49a;
  box-shadow: 0 0 0 4px rgba(25,107,69,.08);
  transform: translateY(-1px);
}
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-number { color: var(--green); font-size: 24px; font-weight: 700; }
.file-copy { display: grid; gap: 7px; min-width: 0; }
.file-copy strong { font-size: 15px; }
.file-copy > span { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.file-button {
  border: 1px solid #cbd7cf;
  border-radius: 11px;
  padding: 10px 13px;
  color: #314a3b;
  background: var(--white);
  font-size: 13px;
  font-weight: 750;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 20px 0 26px;
  cursor: pointer;
}
.check-row input { position: absolute; opacity: 0; }
.custom-check {
  display: grid;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  place-items: center;
  border: 1px solid #9aaba0;
  border-radius: 6px;
  background: white;
}
.check-row input:checked + .custom-check { border-color: var(--green); background: var(--green); }
.check-row input:checked + .custom-check::after { content: "✓"; color: white; font-size: 14px; font-weight: 900; }
.check-row input:focus-visible + .custom-check { outline: 3px solid rgba(25,107,69,.22); outline-offset: 2px; }
.check-row > span:last-child { display: grid; gap: 4px; }
.check-row strong { font-size: 14px; }
.check-row small { color: var(--muted); font-size: 12px; line-height: 1.45; }

.primary-button {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 15px;
  padding: 0 21px;
  color: white;
  background: var(--green);
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(25,107,69,.2);
  transition: background .18s, transform .18s, box-shadow .18s;
}
.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); box-shadow: 0 13px 28px rgba(25,107,69,.24); }
.primary-button:focus-visible { outline: 3px solid rgba(25,107,69,.25); outline-offset: 3px; }
.primary-button:disabled { cursor: not-allowed; background: #9aaba0; box-shadow: none; transform: none; }

.local-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  color: var(--muted);
  text-align: center;
}
.local-note p { margin: 0; font-size: 12px; line-height: 1.55; }
.local-note strong { color: #3e5145; }
.message { margin-top: 20px; border-radius: 13px; padding: 14px 16px; font-size: 14px; line-height: 1.55; }
.message.error { color: var(--danger); background: var(--danger-pale); border: 1px solid #efc6c0; }
.message.success { color: var(--green-dark); background: var(--green-pale); border: 1px solid var(--mint); }

.results { padding-top: 62px; }
.results-heading { margin-bottom: 22px; }
.result-badge, .preview-total {
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--green);
  background: var(--green-pale);
  font-size: 12px;
  font-weight: 800;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255,255,255,.9);
}
.stat dt { margin-bottom: 18px; color: var(--muted); font-size: 12px; font-weight: 700; }
.stat dd { margin: 0; font-size: 27px; font-weight: 850; letter-spacing: -.04em; }
.stat dd span { margin-left: 2px; color: var(--muted); font-size: 13px; font-weight: 600; }
.stat.emphasis { border-color: #b8d9c3; background: var(--green-pale); }
.stat.emphasis dd { color: var(--green); }
.stat.warning dd { color: var(--danger); }

.preview-card { margin-top: 18px; padding: clamp(22px, 5vw, 38px); }
.preview-list { display: grid; gap: 14px; }
.folder-preview { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.folder-preview summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  background: #f8faf7;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 800;
}
.folder-preview summary::-webkit-details-marker { display: none; }
.folder-preview summary::after { content: "⌄"; margin-left: auto; color: var(--muted); }
.folder-preview:not([open]) summary::after { content: "›"; }
.folder-preview ul { display: grid; gap: 0; margin: 0; padding: 6px 18px 12px 48px; list-style: none; }
.folder-preview li { position: relative; border-bottom: 1px solid #eef1ee; padding: 11px 0; color: #35433a; font-size: 13px; line-height: 1.5; }
.folder-preview li:last-child { border-bottom: 0; }
.folder-preview li::before { content: "↗"; position: absolute; left: -22px; color: #7e9a88; }
.empty-preview { margin: 0; border: 1px dashed #c8d2cb; border-radius: 16px; padding: 30px; color: var(--muted); text-align: center; font-size: 14px; }

.error-panel { margin-top: 18px; padding: 26px; border-color: #efc6c0; background: var(--danger-pale); box-shadow: none; }
.error-panel h2 { color: var(--danger); font-size: 17px; }
.error-panel ul { margin: 14px 0 0; padding-left: 20px; color: #75443f; font-size: 13px; line-height: 1.65; }

.download-card {
  display: grid;
  grid-template-columns: auto 1fr minmax(220px, .7fr);
  align-items: center;
  gap: 24px;
  margin-top: 18px;
  padding: clamp(24px, 5vw, 38px);
  border-color: #b9d6c2;
  background: linear-gradient(135deg, #f4faf5, #fff);
}
.download-icon { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 16px; color: var(--green); background: var(--green-pale); font-size: 27px; }
.download-copy h2 { margin-bottom: 12px; font-size: 20px; }
.download-copy p { margin-bottom: 10px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.download-copy p:last-child { margin-bottom: 0; }
.download-copy strong { color: var(--ink); }
.download-copy .safety-copy { color: #815b30; }
.download-button { align-self: stretch; min-height: 64px; }

footer { border-top: 1px solid var(--line); padding: 25px; color: #7a877f; text-align: center; font-size: 11px; letter-spacing: .08em; }

@media (max-width: 720px) {
  .shell { width: min(100% - 22px, 900px); padding-top: 36px; }
  .hero { gap: 15px; }
  .hero-mark { flex-basis: 48px; width: 48px; height: 48px; border-radius: 14px; font-size: 24px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .download-card { grid-template-columns: auto 1fr; }
  .download-button { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .hero-mark { display: none; }
  .privacy { display: none; }
  .file-picker { grid-template-columns: auto 1fr; }
  .file-button { grid-column: 2; justify-self: start; }
  .stats-grid { gap: 8px; }
  .stat { min-height: 104px; padding: 14px; }
  .stat dd { font-size: 24px; }
  .download-card { grid-template-columns: 1fr; }
  .download-icon { display: none; }
}

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