:root {
  --paper: #EDF1ED;
  --card: #FFFFFF;
  --ink: #1B2A41;
  --ink-soft: #52607A;
  --line: #C9D2C9;
  --stamp: #A23B2E;
  --stamp-soft: #F3E3E0;
  --success: #2F6F5E;
  --success-soft: #E1EEE9;
  --radius: 4px;
  --font: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --content-width: 640px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #171D1A;
    --card: #20271F;
    --ink: #EAEEE9;
    --ink-soft: #A9B4A6;
    --line: #37413A;
    --stamp: #E08D7E;
    --stamp-soft: #3A2622;
    --success: #7FBFA8;
    --success-soft: #1E3129;
  }
}

:root[data-theme="dark"] {
  --paper: #171D1A;
  --card: #20271F;
  --ink: #EAEEE9;
  --ink-soft: #A9B4A6;
  --line: #37413A;
  --stamp: #E08D7E;
  --stamp-soft: #3A2622;
  --success: #7FBFA8;
  --success-soft: #1E3129;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 48px 20px 80px;
}

@media (min-width: 701px) {
  .wrap {
    width: var(--content-width);
  }
}

header.intro {
  margin-bottom: 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.lang-select {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
}

.lang-select:focus {
  outline: none;
  border-color: var(--stamp);
  color: var(--ink);
}

.mark svg { width: 26px; height: 26px; color: var(--stamp); flex-shrink: 0; }

.mark span {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

h1 {
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

header.intro p {
  color: var(--ink-soft);
  font-size: 16px;
  max-width: 46ch;
  margin: 0;
}

.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 28px 30px;
  margin-bottom: 0;
  position: relative;
}

.step + .step { margin-top: 0; }

.perforation {
  height: 24px;
  display: flex;
  align-items: center;
  margin: 0 8px;
}

.perforation::before {
  content: "";
  flex: 1;
  border-top: 2px dashed var(--line);
}

.step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step.disabled .step-num { background: var(--line); color: var(--ink-soft); }
.step.disabled .step-title { color: var(--ink-soft); }
.step.disabled .step-body { opacity: 0.45; pointer-events: none; }

.step-title {
  font-size: 17px;
  font-weight: 600;
}

.step-sub {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: -12px 0 18px 38px;
}

/* --- Step 1: upload --- */

.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover, .dropzone.drag-over {
  border-color: var(--stamp);
  background: var(--stamp-soft);
}

.dropzone svg { width: 30px; height: 30px; color: var(--ink-soft); margin-bottom: 10px; }
.dropzone.drag-over svg { color: var(--stamp); }

.dropzone-text { font-size: 14.5px; color: var(--ink-soft); }
.dropzone-text strong { color: var(--ink); font-weight: 600; }

.file-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--success-soft);
  border-radius: var(--radius);
  font-size: 14px;
  margin-top: 4px;
}

.file-chip svg { width: 18px; height: 18px; color: var(--success); flex-shrink: 0; }
.file-chip span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.file-chip button {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  font-family: var(--font);
  padding: 0;
}

.status-msg {
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 12px;
}

.status-msg.error { color: var(--stamp); }

/* --- Step 2: form --- */

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }

.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--ink);
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14.5px;
  color: var(--ink);
  background: var(--card);
}

.field input:focus {
  outline: none;
  border-color: var(--stamp);
}

.empty-note {
  font-size: 14px;
  color: var(--ink-soft);
  font-style: italic;
}

/* --- buttons --- */

.btn {
  font-family: var(--font);
  font-size: 14.5px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary { background: var(--stamp); color: #fff; margin-top: 22px; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { background: var(--line); color: var(--ink-soft); cursor: not-allowed; }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-outline:hover { border-color: var(--ink); }

.download-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.done-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--success);
  margin-bottom: 18px;
}

.done-note svg { width: 18px; height: 18px; flex-shrink: 0; }

.restart {
  text-align: center;
  margin-top: 28px;
}

.restart button {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-family: var(--font);
  font-size: 13.5px;
  text-decoration: underline;
  cursor: pointer;
}

footer.privacy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 36px;
  padding: 16px 18px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--ink-soft);
}

footer.privacy svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: var(--success); }

.about, .faq {
  margin-top: 40px;
}

.about h2, .faq h2 {
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 12px;
}

.about p {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

.faq-item {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.faq-item:last-child { padding-bottom: 0; }

.faq-item h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
}

.faq-item p {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0;
}

/* --- site-wide header (logo, projects dropdown, FAQ link) --- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 18px 20px 0;
}

@media (min-width: 701px) {
  .site-header {
    width: var(--content-width);
  }
}

.site-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-decoration: none;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a, .nav-dropdown summary {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  list-style: none;
}

.site-nav a:hover, .nav-dropdown summary:hover { color: var(--ink); background: var(--card); }

.nav-dropdown summary::-webkit-details-marker { display: none; }

.nav-dropdown summary::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-left: 6px;
  transition: transform 0.15s ease;
}

.nav-dropdown[open] summary::after { transform: rotate(-135deg); }

.nav-dropdown {
  position: relative;
}

.nav-dropdown ul {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
  margin: 0;
  list-style: none;
  min-width: 190px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  z-index: 20;
}

.nav-dropdown li { margin: 0; }

.nav-dropdown li a {
  display: block;
  padding: 8px 10px;
  font-size: 14px;
  color: var(--ink);
  border-radius: var(--radius);
}

.nav-dropdown li a:hover { background: var(--paper); }

@media (max-width: 480px) {
  .step { padding: 22px 18px 24px; }
  .step-sub { margin-left: 38px; }
  .download-row { flex-direction: column; }
  .download-row .btn { width: 100%; justify-content: center; }
}