/* ==========================================================================
   Toolerr tool kit: the shared look of the small one-page tools (Word Counter,
   Merge PDF, Image Resizer…). Builds on toolerr.css (colors, header, footer).
   ========================================================================== */

.tool-hero { padding: 40px 0 18px; }
.tool-hero .wrap { max-width: 980px; }
.tool-hero h1 { display: flex; align-items: center; gap: 14px; font-size: clamp(30px, 4.4vw, 44px); }
.tool-hero .lede { margin-top: 10px; }
.crumb { display: inline-flex; gap: 6px; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }
.hero-icon {
  flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px;
  color: var(--c); background: color-mix(in srgb, var(--c) var(--tint), transparent);
}
.tool-main { max-width: 980px; padding-bottom: 24px; }

/* The working area */
.card { padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card h2 { margin: 0 0 12px; font-size: 19px; }
.stack { display: grid; gap: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }

/* Inputs */
.kit label.f { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.kit label.f > small { font-weight: 400; color: var(--muted); }
.kit input[type="text"], .kit input[type="number"], .kit input[type="date"], .kit input[type="time"], .kit input[type="datetime-local"],
.kit input[type="search"], .kit input[type="email"], .kit select, .kit textarea {
  width: 100%; min-width: 0; padding: 11px 13px; border-radius: 12px; font: inherit; font-size: 15px; font-weight: 400; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-strong); transition: border-color 0.15s, box-shadow 0.15s;
}
.kit textarea { min-height: 220px; resize: vertical; line-height: 1.55; }
.kit textarea.mono, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; }
.kit input:focus, .kit select:focus, .kit textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.kit input[type="range"] { width: 100%; accent-color: var(--accent); }
.kit input[type="checkbox"], .kit input[type="radio"] { accent-color: var(--accent); width: 17px; height: 17px; }
.kit input[type="color"] { width: 48px; height: 40px; padding: 2px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; cursor: pointer; }
.unit-input { display: flex; align-items: center; gap: 8px; }
.unit-input span { color: var(--muted); font-size: 14px; }

/* Choice buttons (one of several) */
.choices { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-3); }
.choices label { position: relative; padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices label:has(input:checked) { color: var(--accent); background: var(--surface); box-shadow: var(--shadow-sm); }
.choices label:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-ring); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--border-strong); border-radius: 12px; font-weight: 600; font-size: 15px; text-decoration: none;
  color: var(--text); background: var(--surface-2); transition: border-color 0.15s, color 0.15s, transform 0.15s, opacity 0.15s;
}
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { border: none; color: #fff; background: var(--grad); box-shadow: 0 12px 26px -14px rgba(106, 70, 245, 0.85); }
.btn.primary:hover:not(:disabled) { color: #fff; transform: translateY(-1px); }
.btn.big { min-height: 52px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.danger:hover:not(:disabled) { border-color: #ef4444; color: #ef4444; }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 9px; color: var(--muted); background: none; }
.icon-btn:hover { color: var(--text); background: var(--surface-3); }

/* File drop area */
.drop {
  position: relative; display: grid; place-items: center; gap: 10px; min-height: 210px; padding: 28px 20px; text-align: center;
  border: 2px dashed var(--border-strong); border-radius: 20px; background: var(--surface-2); cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.drop:hover, .drop:focus-visible, .drop.over { outline: none; border-color: var(--accent); background: var(--accent-soft); }
.drop .drop-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; color: #fff; background: var(--grad); }
.drop strong { font-size: 18px; }
.drop p { margin: 0; color: var(--muted); font-size: 14px; }
.drop.compact { min-height: 0; padding: 16px; grid-auto-flow: column; justify-content: center; gap: 12px; }
.drop.compact .drop-icon { width: 40px; height: 40px; border-radius: 12px; }
.drop.compact strong { font-size: 15px; }

/* File lists */
.files { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.files li {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2);
}
.files li.dragging { opacity: 0.4; }
.files li.drop-before { box-shadow: 0 -3px 0 var(--accent); }
.files .thumb { flex: none; width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: var(--surface-3); }
.files .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14.5px; }
.files .meta { color: var(--muted); font-size: 13px; white-space: nowrap; }
.files .grip { cursor: grab; color: var(--muted); }

/* Results */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: 10px; }
.stat { padding: 14px 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.stat b { display: block; font: 800 26px/1.1 var(--font-display); letter-spacing: -0.02em; }
.stat span { font-size: 13px; color: var(--muted); }
.big-answer { padding: 20px 22px; border-radius: 18px; background: var(--accent-soft); }
.big-answer b { display: block; font: 800 clamp(28px, 5vw, 42px)/1.1 var(--font-display); letter-spacing: -0.02em; color: var(--accent); word-break: break-word; }
.big-answer span { color: var(--muted); font-size: 14.5px; }
.result-list { display: grid; gap: 8px; }
.result-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.result-item .grow { font-size: 14.5px; }
.saved { color: var(--live); font-weight: 700; }

/* Messages and progress */
.msg { padding: 12px 16px; border-radius: 12px; font-size: 14.5px; }
.msg.info { color: var(--muted); background: var(--surface-2); }
.msg.ok { color: var(--live); background: rgba(34, 197, 94, 0.12); }
.msg.error { color: #dc2626; background: rgba(239, 68, 68, 0.12); }
:root[data-theme="dark"] .msg.error { color: #f87171; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .msg.error { color: #f87171; } }
.bar { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad); transition: width 0.2s; }
.progress { display: grid; gap: 8px; }
.progress p { margin: 0; font-size: 14px; color: var(--muted); }

/* Media previews */
.preview-box { display: grid; place-items: center; min-height: 200px; padding: 12px; border-radius: 18px; background: repeating-conic-gradient(var(--surface-3) 0 25%, var(--surface-2) 0 50%) 0 0 / 20px 20px; overflow: hidden; }
.preview-box img, .preview-box canvas, .preview-box video { display: block; max-width: 100%; max-height: 62vh; border-radius: 8px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.thumbs figure { position: relative; margin: 0; padding: 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.thumbs figure img, .thumbs figure canvas { display: block; width: 100%; height: 160px; object-fit: contain; border-radius: 6px; background: #fff; }
.thumbs figcaption { margin-top: 6px; font-size: 12.5px; color: var(--muted); text-align: center; }
.thumbs figure.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.kit audio, .kit video { width: 100%; }

/* Tables */
.table-wrap { overflow: auto; max-height: 62vh; border: 1px solid var(--border); border-radius: 14px; }
.kit table { width: 100%; border-collapse: collapse; font-size: 14px; }
.kit th, .kit td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.kit th { position: sticky; top: 0; background: var(--surface-3); font-weight: 700; }
.kit tr:hover td { background: var(--surface-2); }

/* How it works + related tools */
.howto { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; margin-top: 28px; padding: 0; list-style: none; counter-reset: step; }
.howto li { position: relative; padding: 18px 18px 18px 58px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); font-size: 14.5px; color: var(--muted); }
.howto li::before {
  counter-increment: step; content: counter(step); position: absolute; left: 16px; top: 16px;
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; font-weight: 800; color: #fff; background: var(--grad);
}
.howto b { display: block; color: var(--text); margin-bottom: 2px; }
.private-note { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.private-note svg { flex: none; color: var(--live); }
.related { margin-top: 36px; }
.related h2 { margin: 0 0 12px; font-size: 20px; }

@media (max-width: 600px) {
  .card { padding: 16px; border-radius: 18px; }
  .cols-2 { grid-template-columns: 1fr; }
  .tool-hero { padding: 28px 0 12px; }
  .hero-icon { width: 44px; height: 44px; border-radius: 14px; }
  .drop { min-height: 170px; }
}

/* The article under each tool: what it does, a guide, questions */
.seo { margin-top: 44px; max-width: 780px; }
.seo h2 { margin: 34px 0 10px; font-size: 24px; }
.seo h2:first-child { margin-top: 0; }
.seo h3 { margin: 22px 0 6px; font-size: 18px; }
.seo ol, .seo ul { padding-left: 22px; }
.seo li { margin-bottom: 6px; }
.seo details.guide { margin: 24px 0; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.seo details.guide > summary { padding: 16px 20px; cursor: pointer; font: 700 19px var(--font-display); list-style: none; display: flex; align-items: center; gap: 10px; }
.seo details.guide > summary::-webkit-details-marker { display: none; }
.seo details.guide > summary::after { content: "+"; margin-left: auto; font-size: 22px; color: var(--accent); }
.seo details.guide[open] > summary::after { content: "–"; }
.seo details.guide > div { padding: 0 20px 14px; }
.seo details.faq { border-bottom: 1px solid var(--border); }
.seo details.faq > summary { padding: 14px 0; cursor: pointer; font-weight: 700; }
.seo details.faq > p { margin: 0 0 14px; color: var(--muted); }
.seo kbd { padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface-2); font-size: 13px; }
