:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #14181f;
  --ink-2: #4a5464;
  --ink-3: #6b7686;
  --line: #e3e7ee;
  --brand: #1f6feb;
  --brand-dark: #1758c4;
  --brand-soft: #eaf2ff;
  --ok: #0f7b46;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

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

/* ---------- top bar ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 58px;
  flex-wrap: wrap;
}
.logo {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.02em;
}
.logo span { color: var(--brand); }
.badge {
  font-size: 12.5px;
  color: var(--ok);
  background: #e8f6ee;
  border: 1px solid #c9e9d7;
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}

/* ---------- hero ---------- */
main { padding-bottom: 64px; }
h1 {
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -.025em;
  margin: 34px 0 10px;
}
.lede {
  margin: 0 0 24px;
  color: var(--ink-2);
  font-size: 17px;
  max-width: 720px;
}

.steps {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0 0 18px;
  padding: 0;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px 5px 6px;
}
.steps li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

/* ---------- tool ---------- */
.tool {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 26px;
}

.drop {
  border: 2px dashed #cdd6e4;
  border-radius: 12px;
  background: #fbfcfe;
  padding: 34px 18px;
  text-align: center;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.drop:hover { border-color: var(--brand); background: var(--brand-soft); }
.drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop svg { display: block; margin: 0 auto 10px; }
.drop-title { margin: 0 0 4px; font-weight: 650; font-size: 17px; }
.drop-sub { margin: 0; color: var(--ink-3); font-size: 14px; }
.linkbtn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--brand);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.queue { margin-top: 16px; }
.queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.queue-head strong { font-size: 14.5px; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb {
  position: relative;
  width: 96px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #f2f4f8;
}
.thumb img {
  display: block;
  width: 100%;
  height: 66px;
  object-fit: cover;
}
.thumb .tname {
  font-size: 11px;
  padding: 4px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-2);
}
.thumb .tmeta {
  font-size: 10.5px;
  padding: 0 6px 5px;
  color: var(--ink-3);
}
.thumb button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 0;
  background: rgba(20, 24, 31, .68);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.thumb .add {
  top: auto;
  bottom: 46px;
  background: rgba(20, 24, 31, .5);
  font-size: 15px;
}

/* ---------- controls ---------- */
.controls {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: grid;
  gap: 16px;
}
.field-group > .label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-2);
  margin-bottom: 7px;
}
.seg {
  display: inline-flex;
  background: #f1f3f7;
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  flex-wrap: wrap;
}
.seg label {
  position: relative;
  cursor: pointer;
}
.seg input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span {
  display: block;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink-2);
  white-space: nowrap;
}
.seg input:checked + span {
  background: var(--surface);
  color: var(--brand);
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .12);
}
.seg input:focus-visible + span { outline: 2px solid var(--brand); }

.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.numfield label {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 5px;
}
.numfield input[type="number"],
.numfield select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
}
.numfield input:focus, .numfield select:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }

.quality { display: flex; align-items: center; gap: 10px; }
.quality input[type="range"] { flex: 1; accent-color: var(--brand); }
.quality output { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--ink-2); min-width: 44px; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-2);
}
.check input { margin-top: 3px; accent-color: var(--brand); }

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 20px;
  font: inherit;
  font-weight: 650;
  font-size: 15px;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
}
.btn:hover { background: var(--brand-dark); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.ghost {
  background: #fff;
  color: var(--ink-2);
  border-color: var(--line);
}
.btn.ghost:hover { background: #f4f6fa; }
.status { font-size: 14px; color: var(--ink-3); }

/* ---------- results ---------- */
.results { margin-bottom: 30px; }
.rcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.rcard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.rcard-head h3 {
  margin: 0;
  font-size: 16px;
  word-break: break-all;
}
.rcard-head .meta { font-size: 13px; color: var(--ink-3); margin: 2px 0 0; }
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}
.tile {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fafbfd;
  display: flex;
  flex-direction: column;
}
.tile .pic {
  height: 104px;
  background: #eef1f6 repeating-conic-gradient(#e7ebf2 0% 25%, #f4f6fa 0% 50%) 50% / 16px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.tile .pic img { max-width: 100%; max-height: 100%; display: block; object-fit: contain; }
.tile .info {
  padding: 6px 8px;
  font-size: 11.5px;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.tile a {
  display: block;
  text-align: center;
  padding: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  border-top: 1px solid var(--line);
  background: #fff;
}
.tile a:hover { background: var(--brand-soft); }

/* ---------- content sections ---------- */
section.info, section.uses, section.faq {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}
h2 {
  font-size: 21px;
  letter-spacing: -.015em;
  margin: 0 0 14px;
}
h3.use {
  font-size: 16px;
  margin: 0 0 4px;
}
.cols3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.cols3 h3 { font-size: 15.5px; margin: 0 0 6px; }
.cols3 p, .uses p { margin: 0; color: var(--ink-2); font-size: 15px; }
.cols3 ul { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 15px; }
.cols3 li { margin-bottom: 4px; }
.use-list { display: grid; gap: 16px; }
.use-item { border-left: 3px solid var(--brand); padding-left: 14px; }
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.faq details:last-child { border-bottom: 0; }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15.5px;
}
.faq p { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; }

footer.site {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 20px 0;
  color: var(--ink-3);
  font-size: 13.5px;
}
footer.site .wrap { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

@media (max-width: 640px) {
  h1 { font-size: 27px; margin-top: 24px; }
  .lede { font-size: 16px; }
  .tool { padding: 14px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
  .btn { width: 100%; }
  .actions .btn { flex: 1 1 100%; }
  .status { width: 100%; text-align: center; }
}
