/* SaveAI — Markdown converter tool pages. Scoped to .md-tool / .tool-hero;
   reuses the site's design tokens from style.css (--brand, --surface, …). */

/* ---- hero ---- */
.tool-hero { text-align: center; padding: 40px 0 8px; }
.tool-badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.tool-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 700; line-height: 1;
  padding: 9px 15px; border-radius: 999px; border: 1px solid transparent;
}
.tool-badge svg { width: 16px; height: 16px; }
.tool-badge.is-free { color: #14663a; background: #eafaf0; border-color: #bfe6cd; }
.tool-badge.is-fmt  { color: var(--brand-dark); background: var(--brand-soft); border-color: var(--brand-soft-2); }
.tool-hero h1 { font-size: clamp(40px, 7vw, 76px); line-height: 1.02; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 20px; }
.tool-hero .lead { max-width: 720px; margin: 0 auto; font-size: clamp(16px, 2.2vw, 19px); line-height: 1.6; color: var(--text-muted); }
.tool-pills { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin: 26px 0 4px; }
.tool-pills .pill {
  font-size: 14px; font-weight: 600; color: var(--text-2);
  padding: 9px 17px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card);
}

/* ---- converter ---- */
.md-tool { margin: 26px auto 40px; }

.dropzone {
  position: relative;
  border: 2px dashed var(--border); border-radius: var(--r-xl);
  background: var(--surface);
  padding: 60px 24px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.dropzone:hover { border-color: var(--brand); background: var(--surface-3); }
.dropzone.is-drag { border-color: var(--brand); background: var(--brand-soft); box-shadow: var(--shadow-card-hover); }
.dropzone input[type="file"] { display: none; }
.dropzone .dz-icon {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand);
}
.dropzone .dz-icon svg { width: 32px; height: 32px; }
.dropzone .dz-title { font-size: 19px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.dropzone .dz-sub { font-size: 14px; color: var(--text-muted); }

.paste-toggle { text-align: center; margin-top: 16px; }
.paste-toggle button { background: none; border: 0; color: var(--brand-dark); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.paste-area { display: none; margin-top: 16px; }
.paste-area.open { display: block; }
.paste-area textarea {
  width: 100%; min-height: 200px; resize: vertical; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface);
  padding: 14px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.6; color: var(--text);
}
.paste-area textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.paste-area .paste-actions { display: flex; gap: 10px; margin-top: 12px; }

/* ---- batch list ---- */
.batch { margin-top: 22px; }
.batch-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.batch-bar .count { font-size: 14px; color: var(--text-2); font-weight: 600; }
.batch-bar .spacer { flex: 1 1 auto; }
.btn.sm { padding: 9px 15px; font-size: 14px; }
.btn.link-btn { background: var(--surface); border: 1px solid var(--border); color: var(--text-2); cursor: pointer; }
.btn.link-btn:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn.is-busy { opacity: .7; pointer-events: none; }
.btn:disabled { opacity: .5; pointer-events: none; }

.job-list { display: flex; flex-direction: column; gap: 10px; }
.job {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 12px 16px;
}
.job .job-ic { width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--brand); }
.job .job-ic svg { width: 18px; height: 18px; }
.job .job-main { min-width: 0; flex: 1 1 auto; }
.job .job-name { font-size: 14.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job .job-meta { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.job .job-meta.err { color: var(--danger); }
.job .job-status { font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; flex: 0 0 auto; }
.job .job-status.pending { color: var(--text-muted); background: var(--surface-2); }
.job .job-status.working { color: var(--brand-dark); background: var(--brand-soft); }
.job .job-status.done { color: #14663a; background: #eafaf0; }
.job .job-status.error { color: var(--danger); background: #fdeaea; }
.job .job-dl, .job .job-rm { flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; cursor: pointer; color: var(--text-2); width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; }
.job .job-dl:hover { border-color: var(--brand); color: var(--brand-dark); }
.job .job-dl svg, .job .job-rm svg { width: 16px; height: 16px; }
.job .job-dl[hidden] { display: none; }

.tool-status { display: none; margin-top: 16px; padding: 11px 14px; border-radius: var(--r-sm); font-size: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); }
.tool-status.is-progress { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.tool-status.is-ok { border-color: #b7e2c8; background: #eafaf0; color: #14663a; }
.tool-status.is-error { border-color: #f3c2c2; background: #fdeaea; color: #a12727; }

/* ---- how-it-works ---- */
.tool-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 34px; }
.tool-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; }
.tool-step .num { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; margin-bottom: 10px; }
.tool-step h3 { margin: 0 0 6px; font-size: 16px; }
.tool-step p { margin: 0; font-size: 14px; color: var(--text-2); }

/* ---- /tools/ hub cards ---- */
.tool-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin: 8px auto 40px; }
.tool-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 24px; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; }
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); border-color: var(--brand); }
.tool-card .tool-card-badge { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-dark); background: var(--brand-soft); border-radius: 999px; padding: 3px 10px; margin-bottom: 12px; }
.tool-card h2 { margin: 0 0 8px; font-size: 21px; }
.tool-card p { margin: 0 0 14px; color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
.tool-card .tool-card-cta { font-weight: 700; color: var(--brand-dark); }
.tool-card .tool-card-cta::after { content: " →"; }

@media (max-width: 760px) {
  .tool-steps { grid-template-columns: 1fr; }
  .tool-cards { grid-template-columns: 1fr; }
  .dropzone { padding: 44px 16px; }
}
