:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --border: #e3e6eb;
  --text: #1b1f24;
  --muted: #5d6470;
  --accent: #1f6feb;
  --accent-dark: #1858bc;
  --danger: #c0392b;
  --success: #1f7a4d;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 14px rgba(0, 0, 0, 0.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--text);
  color: #fff;
  padding: 8px 12px;
  z-index: 100;
}
.skip-link:focus { left: 10px; top: 10px; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  height: 60px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  font-size: 18px;
}
.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: var(--accent);
  color: #fff;
  border-radius: 7px;
  font-weight: 800;
  font-size: 16px;
}

/* Hero */
.hero {
  padding: 48px 0 24px;
  text-align: center;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.hero .lead {
  margin: 0 auto;
  max-width: 600px;
  color: var(--muted);
  font-size: 17px;
}

/* Tool */
.tool { padding: 16px 0 48px; }

.drop-zone {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.drop-zone:hover,
.drop-zone:focus,
.drop-zone.is-drag {
  border-color: var(--accent);
  background: #f1f6ff;
  outline: none;
}
.drop-label strong {
  display: block;
  font-size: 18px;
  margin-bottom: 4px;
}
.drop-label span {
  display: block;
  color: var(--muted);
  margin-bottom: 12px;
}
.drop-label small {
  display: inline-block;
  background: #eef3ff;
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.settings {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.file-info strong {
  word-break: break-all;
}
.muted { color: var(--muted); margin-left: 8px; font-weight: 400; }

fieldset {
  border: 0;
  margin: 0 0 16px;
  padding: 0;
}
fieldset legend {
  font-weight: 600;
  margin-bottom: 10px;
  padding: 0;
}
.radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
}
.radio:hover { background: #f4f6f9; }
.radio input { margin: 0; }
.radio span { line-height: 1.4; }

.inline-num, .inline-text {
  font: inherit;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}
.inline-num { width: 64px; text-align: center; }
.inline-text { width: 180px; max-width: 100%; }

.primary-btn {
  display: block;
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: 0;
  font: inherit;
  font-weight: 600;
  font-size: 17px;
  padding: 14px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.primary-btn:hover:not(:disabled) { background: var(--accent-dark); }
.primary-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.link-btn {
  background: none;
  border: 0;
  color: var(--accent);
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.link-btn:hover { color: var(--accent-dark); }

/* Progress */
.progress {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid #dbe3ee;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Results */
.results {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.results h2 { margin: 0 0 12px; font-size: 20px; color: var(--success); }
.results ul { list-style: none; padding: 0; margin: 0 0 16px; }
.results li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.results li:last-child { border-bottom: 0; }
.results li .name { word-break: break-all; }
.results li a {
  background: var(--accent);
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}
.results li a:hover { background: var(--accent-dark); color: #fff; }

.error {
  margin-top: 16px;
  padding: 12px 16px;
  background: #fdecea;
  color: var(--danger);
  border-radius: 8px;
}

/* Info & FAQ */
.info, .faq { padding: 24px 0; }
.prose h2 { margin-top: 32px; font-size: 22px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose code {
  background: #eef0f3;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.92em;
}

details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
}
details[open] { box-shadow: var(--shadow); }
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-size: 20px;
  color: var(--muted);
  margin-left: 12px;
}
details[open] summary::after { content: "–"; }
details p { margin: 12px 0 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 32px 0;
  margin-top: 48px;
  text-align: center;
}
.site-footer nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.site-footer a {
  text-decoration: none;
  font-weight: 500;
}
.site-footer a:hover { text-decoration: underline; }
.site-footer p { margin: 0; font-size: 14px; }

/* Article pages */
.article-meta {
  color: var(--muted);
  font-size: 14px;
  margin: -8px 0 24px;
}
.cta-box {
  background: #f1f6ff;
  border: 1px solid #d3e3ff;
  border-radius: var(--radius);
  padding: 24px;
  margin: 32px 0;
  text-align: center;
}
.cta-box h2 {
  margin-top: 0;
  font-size: 20px;
}
.cta-box p {
  margin: 0 0 12px;
}
.cta-box .primary-btn {
  display: inline-block;
  width: auto;
  padding: 12px 28px;
  text-decoration: none;
}

/* Guide list (homepage) */
.guides { padding: 0 0 24px; }
.guide-list { list-style: none; padding: 0; margin: 0; }
.guide-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.guide-list li:last-child { border-bottom: 0; }
.guide-list li a {
  font-weight: 600;
  font-size: 17px;
  display: block;
  margin-bottom: 4px;
  text-decoration: none;
}
.guide-list li a:hover { text-decoration: underline; }
.guide-list li p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

@media (max-width: 480px) {
  .hero { padding: 32px 0 16px; }
  .settings { padding: 18px; }
  .drop-zone { padding: 36px 18px; }
}
