:root {
  --ink: #15171c;
  --ink-2: #4b5058;
  --ink-3: #7c828b;
  --bg: #f6f6f7;
  --surface: #ffffff;
  --line: #e2e3e8;
  --line-strong: #c9cbd3;
  --accent: #4b48d6;
  --accent-dark: #3a37b8;
  --accent-soft: #eeeefc;
  --ok: #0f7a4e;
  --ok-soft: #eaf6f0;
  --warn: #9a5b00;
  --warn-soft: #fdf4e6;
  --err: #bf2b2b;
  --err-soft: #fdeeee;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(21, 23, 28, 0.05), 0 8px 24px rgba(21, 23, 28, 0.04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: 34px; }
h2 { font-size: 22px; margin-top: 0; }
h3 { font-size: 17px; }
p { margin: 0 0 14px; color: var(--ink-2); }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px; }
.wrap--wide { max-width: 1040px; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 246, 247, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap--wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
  font-size: 16px;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: #fff;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
}
.site-nav { display: flex; gap: 22px; align-items: center; }
.site-nav a { color: var(--ink-2); font-size: 14.5px; }
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- hero ---------- */
.hero { padding: 40px 0 22px; }
.hero h1 { max-width: 620px; }
.hero .lede { font-size: 17px; color: var(--ink-2); max-width: 600px; margin-bottom: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 14px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---------- tool card ---------- */
.tool {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 8px 0 34px;
}

.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fcfcfd;
  padding: 34px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  outline: none;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); background: #fbfbff; }
.dropzone.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-icon {
  width: 44px; height: 44px; margin: 0 auto 12px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.dropzone-title { font-weight: 600; font-size: 16px; margin-bottom: 4px; color: var(--ink); }
.dropzone-hint { font-size: 13.5px; color: var(--ink-3); }
.dropzone input[type="file"] { display: none; }

/* ---------- file card ---------- */
.filecard {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  background: #fbfbfc;
}
.filecard-icon {
  width: 38px; height: 38px; flex: none;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.filecard-body { min-width: 0; flex: 1; }
.filecard-name {
  font-weight: 600; font-size: 14.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.filecard-meta { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.icon-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-3);
  width: 30px; height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  flex: none;
}
.icon-btn:hover { color: var(--err); border-color: var(--err); }

/* ---------- controls ---------- */
.controls { display: grid; gap: 14px; margin-top: 16px; }
.control-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--ink-3); font-weight: 400; }

select, input[type="text"], input[type="number"] {
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14.5px;
  padding: 0 11px;
  width: 100%;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237c828b' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
input[type="number"] { background-image: none; padding-right: 11px; }
select:focus, input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
select:disabled { opacity: .55; cursor: not-allowed; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--accent-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn--full { width: 100%; }
.btn--ghost {
  background: var(--surface); color: var(--ink);
  border-color: var(--line-strong);
}
.btn--ghost:hover { background: #f2f2f4; }
.btn--small { height: 36px; font-size: 14px; padding: 0 14px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- progress ---------- */
.progress-wrap { margin-top: 16px; }
.progress-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; color: var(--ink-2); margin-bottom: 7px;
}
.progress-head .pct { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.progress-track {
  height: 7px; border-radius: 999px; background: #ececf0; overflow: hidden;
}
.progress-bar {
  height: 100%; width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .18s linear;
}
.progress-bar.is-indeterminate {
  width: 35% !important;
  animation: slide 1.1s ease-in-out infinite;
}
@keyframes slide {
  0% { margin-left: -35%; }
  100% { margin-left: 100%; }
}

/* ---------- result ---------- */
.result {
  border: 1px solid #cfe9dc;
  background: var(--ok-soft);
  border-radius: var(--radius);
  padding: 15px 16px;
  margin-top: 16px;
}
.result-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 14.5px; color: #0b5c3b; margin-bottom: 4px;
}
.result-meta { font-size: 13px; color: #2c6b52; margin-bottom: 12px; font-variant-numeric: tabular-nums; }

.alert {
  border-radius: var(--radius);
  padding: 13px 15px;
  font-size: 14px;
  margin-top: 14px;
  border: 1px solid;
}
.alert--warn { background: var(--warn-soft); border-color: #f0d6a8; color: #7a4700; }
.alert--err { background: var(--err-soft); border-color: #f3c4c4; color: #8f2020; }
.alert strong { font-weight: 600; }

.note {
  font-size: 13px; color: var(--ink-3); margin-top: 12px;
  display: flex; gap: 7px; align-items: flex-start;
}
.note svg { flex: none; margin-top: 2px; }

/* ---------- content sections ---------- */
.section { padding: 10px 0 26px; }
.section > h2 { margin-bottom: 14px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; counter-reset: s; }
.steps li { display: flex; gap: 12px; align-items: flex-start; counter-increment: s; }
.steps li::before {
  content: counter(s);
  flex: none;
  width: 25px; height: 25px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.steps b { display: block; font-size: 15px; }
.steps span { font-size: 14.5px; color: var(--ink-2); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.tool-card {
  display: block;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 15px 16px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tool-card:hover {
  text-decoration: none;
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.tool-card .t { font-weight: 600; color: var(--ink); font-size: 15px; margin-bottom: 3px; }
.tool-card .d { font-size: 13.5px; color: var(--ink-3); line-height: 1.5; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
th, td { text-align: left; padding: 10px 13px; border-bottom: 1px solid var(--line); }
th { background: #fafafb; font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-transform: none; }
tr:last-child td { border-bottom: none; }
td code { font-family: var(--mono); font-size: 12.5px; background: #f2f2f5; padding: 1px 5px; border-radius: 5px; }

.faq { display: grid; gap: 0; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  display: flex; justify-content: space-between; gap: 14px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--ink-3);
  font-weight: 400;
  font-size: 19px;
  line-height: 1;
  flex: none;
}
.faq details[open] summary::after { content: "\2013"; }
.faq details p { margin: 0 0 14px; font-size: 14.5px; }

.related { padding: 6px 0 40px; }
.related h2 { font-size: 17px; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 26px 0 34px;
  font-size: 13.5px;
  color: var(--ink-3);
}
.site-footer .wrap--wide {
  display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--ink-2); }

/* ---------- home ---------- */
.home-hero { padding: 52px 0 34px; text-align: center; }
.home-hero h1 { font-size: 40px; max-width: 640px; margin: 0 auto 14px; }
.home-hero p { font-size: 17px; max-width: 560px; margin: 0 auto 22px; }
.home-section { padding: 6px 0 30px; }
.home-section h2 { font-size: 19px; margin-bottom: 14px; }
.badge-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.badge {
  font-size: 12.5px; color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
}

/* ---------- misc ---------- */
.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;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(14px);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 9px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 90;
  max-width: calc(100vw - 32px);
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
main { min-height: 50vh; }

@media (max-width: 620px) {
  h1 { font-size: 27px; }
  .home-hero h1 { font-size: 30px; }
  .hero { padding: 26px 0 16px; }
  .tool { padding: 15px; }
  .control-row { grid-template-columns: 1fr; }
  .site-nav { gap: 14px; }
  .site-nav a { font-size: 13.5px; }
  .dropzone { padding: 26px 16px; }
  table { font-size: 13px; }
  th, td { padding: 9px 10px; }
}
