/* ══════════════════════════════════════════════════════════════
   UPNIXTOOLS — NON-CALCULATOR TOOL MIGRATION STYLESHEET (migrate-tools.css)
   Sirf build/tools/ ki non-calculator pages ke liye
   (Typing Speed Test, WebP Converter). site.css ko edit NAHI kiya gaya.

   RULES (task se):
   - Saari nayi classes YAHI file mein hain.
   - Koi inline <style> nahi, koi Google Fonts link nahi, kahin Syne nahi.
   - Dark theme: koi hard-coded dark text nahi — sirf theme tokens
     (--ink, --ink-soft, --muted, --faint, --accent, --green, --red,
      --surface*, --bg*, --line*). Source ke brand accents (gold #f5c518,
      webp ke soft pastel badge backgrounds) wahi rakhe gaye hain —
      ye text nahi, highlight accents hain.
   - Har non-calc tool page is file ko header ke baad link karta hai:
       <link rel="stylesheet" href="/assets/css/migrate-tools.css?v=1">
   - webp-converter source ka `:root` token override DROP kiya gaya —
     woh poori site ke theme tokens ko poison karta.
   - webp source ke `.btn-primary` / `.btn-secondary` site.css mein pehle
     se maujood hain — unhe yahan dobara define nahi kiya gaya.

   JS-MANDATED EXCEPTIONS (in-page <script> inhe naam se use karta hai,
   rename KARNA MANA hai — sirf yahan restyle kiya gaya hai):
     .tst-mode / .on       — typing mode buttons (querySelectorAll + classList)
     .tst-result / .show   — typing finish() 'show' toggle karta hai
     .tst-words .w/.c/.ok/.bad/.extra/.active — typing render() spans likhta hai
     #tst-line             — typing JS createElement karke #tst-words mein
                             prepend karta hai; render() isi mein likhta hai
     .tst-focus            — id + [hidden] se control hota hai
     .btn / .btn-gold / .btn-ghost — typing action buttons (site.css ka .btn
                             base use hota hai; gold/ghost yahan defined)
     .mode-tab / .active   — webp setMode() classList toggle karta hai
     .upload-area / .drag-over — webp drag events #uploadBox par 'drag-over'
                             toggle karte hain
     .upload-progress-box / .active — webp classList toggle karta hai
     .preview-section / .visible    — webp classList toggle karta hai
     .fmt-pill / .active   — webp querySelectorAll('.fmt-pill') + classList
     .queue-item / .queue-thumb / .queue-meta / .queue-name / .queue-sub /
     .saved / .queue-item-actions / .queue-dl / .queue-rm — webp
                             renderQueue() markup likhta hai aur wapas
                             querySelector se pakarta hai
     .compare-badge / .badge-jpg / .badge-png / .badge-webp / .badge-gif —
                             webp badgeClass() className set karta hai
   Typing ke liye ek documented bug fix hai (source bug — parent handler mein
   Backspace double-process hota tha): #tst-words wale keydown handler ke
   start mein `if (e.target === input) return;` add kiya gaya hai.
   Baqi JS dono pages par source-verbatim hai.
   ══════════════════════════════════════════════════════════════ */

/* centered tool head (typing + webp dono centered head use karte hain) */
.tool-head.center {
  text-align: center;
}
.tool-head.center .tool-sub {
  margin-left: auto;
  margin-right: auto;
}

/* webp JS ke JSZip-fallback inline style mein `var(--success)` use hota hai
   (source ke page-level :root mein defined tha). Naya alias token — theme
   tokens ko override nahi karta. */
:root {
  --success: var(--green);
}

/* ═══════════ TYPING SPEED TEST ═══════════ */

/* ── T1. TYPING MODE GROUPS ──
   JS-MANDATED: .tst-mode + 'active' (querySelectorAll + classList toggle).
   data-mode / data-val attributes source-identical rehte hain. */
/* ── T1b. TYPING ACCENT ──
   Neon green (dark) / deep green (light, contrast ke liye). */
:root{--tst-accent:#37f2a2;}
:root[data-theme="light"]{--tst-accent:#0a8f5c;}

.tst-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}
.tst-mode-group {
  display: flex;
  gap: 6px;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
}
.tst-mode-group .k {
  font-size: .75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-right: 2px;
}
.tst-mode {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tst-mode:hover {
  color: var(--ink);
}
.tst-mode.on {
  background: linear-gradient(135deg, #57ffb4 0%, #37f2a2 55%, #0ed989 100%);
  color: #04120c;
  box-shadow: 0 4px 18px rgba(55, 242, 162, .35);
}
.tst-soundbtn {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tst-soundbtn:hover {
  color: var(--ink);
}
.tst-soundbtn.on {
  background: linear-gradient(135deg, #57ffb4 0%, #37f2a2 55%, #0ed989 100%);
  color: #04120c;
  box-shadow: 0 4px 18px rgba(55, 242, 162, .35);
}

/* ── T1c. SCORE POPUP (modal) + URGENT TIMER ──
   JS-MANDATED: #tst-modal `hidden` property se control hota hai
   (finish() show karta hai, closeModal()/newTest() chhupate hain).
   .tst-urgent tick() mein aakhri 5 sec par timer par lagta hai. */
.tst-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 6, 12, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.tst-modal[hidden] { display: none; }
.tst-modal-card {
  position: relative;
  width: min(430px, 100%);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 30px 26px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45), 0 0 46px rgba(55, 242, 162, .12);
  animation: tst-pop .28s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes tst-pop {
  from { transform: scale(.88) translateY(12px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.tst-modal-x {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
}
.tst-modal-x:hover { color: var(--ink); }
.tst-modal-kicker {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
}
.tst-modal-score {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--tst-accent);
  margin: 6px 0 2px;
}
.tst-modal-unit {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--muted);
  margin-left: 8px;
}
.tst-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0 6px;
}
.tst-mstat {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 6px;
}
.tst-mstat b { display: block; font-size: 1.1rem; color: var(--ink); }
.tst-mstat span {
  font-size: .68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.tst-modal-best {
  margin: 10px 0 2px;
  color: var(--ink-soft);
  font-size: .9rem;
}
.tst-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}
.tst-urgent {
  color: var(--red) !important;
  animation: tst-blink 1s steps(2, start) infinite;
}
@keyframes tst-blink { 50% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) {
  .tst-modal-card { animation: none; }
  .tst-urgent { animation: none; }
}

/* ── T2. TYPING LIVE STATS ROW ── */
.tst-stats {
  display: flex;
  gap: 26px;
  justify-content: center;
  margin-bottom: 16px;
}
.tst-stat {
  text-align: center;
}
.tst-stat .v {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--tst-accent);
  font-variant-numeric: tabular-nums;
}
.tst-stat .k {
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ── T3. TYPING TIMER — teesra .tst-stat hai (id tst-timer / tst-timer-lbl),
   koi alag bar nahi; T2 ki styles kaafi hain. ── */

/* ── T3b. TYPING PROGRESS BAR (time/words mode) ──
   JS-MANDATED: tick() #tst-prog par transform scaleX set karta hai. */
.tst-progress {
  height: 6px;
  border-radius: 99px;
  background: var(--line-soft, rgba(128, 128, 128, .18));
  overflow: hidden;
  margin: -8px auto 18px;
  max-width: 560px;
}
.tst-progress i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #57ffb4, var(--tst-accent));
  transform: scaleX(0);
  transform-origin: left center;
}

/* ── T4. TYPING AREA ──
   JS-MANDATED: render() .w/.c spans likhta hai; .ok/.bad/.extra/.active
   classList se toggle hote hain. keepVisible() scrollTop set karta hai. */
.tst-words {
  position: relative;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  line-height: 2.1;
  color: var(--faint);
  height: 9.4em;
  overflow: hidden;
  cursor: text;
  user-select: none;
  outline: none;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, .22);
  transition: border-color .2s, box-shadow .2s;
}
.tst-words:focus,
.tst-words:focus-within {
  border-color: var(--tst-accent);
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, .22),
              0 0 0 3px color-mix(in srgb, var(--tst-accent) 22%, transparent);
}
.tst-words .w {
  display: inline-block;
  margin-right: .55em;
  white-space: nowrap;
}
.tst-words .c {
  position: relative;
}
.tst-words .c.ok {
  color: var(--ink);
}
.tst-words .c.bad {
  color: var(--red);
}
.tst-words .c.extra {
  color: var(--red);
  opacity: .85;
}
.tst-words .c.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 2px;
  bottom: 2px;
  width: 3px;
  background: var(--tst-accent);
  box-shadow: 0 0 10px var(--tst-accent);
  animation: tst-blink 1s steps(1) infinite;
  border-radius: 2px;
}
@keyframes tst-blink {
  50% { opacity: 0; }
}
.tst-focus {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: color-mix(in srgb, var(--bg) 68%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 16px;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 5;
  padding: 0 20px;
  text-align: center;
}
.tst-focus[hidden] {
  display: none;
}
.tst-focus-kbd {
  font-size: 1.7rem;
  display: inline-block;
  animation: tst-pulse 1.6s ease-in-out infinite;
}
@keyframes tst-pulse {
  50% { transform: scale(1.18); opacity: .7; }
}
/* BUG FIX: hidden input scroll container ke andar absolute tha — har keystroke
   par browser caret ko view mein lane ke liye wordsEl.scrollTop ko 0 par reset
   kar deta tha (auto-scroll toot jata tha). position:fixed se ye bahar hai. */
.tst-hidden-input {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 640px) {
  .tst-words { font-size: 1.1rem; padding: 16px; }
  .tst-stat .v { font-size: 1.5rem; }
}

/* ── T5. TYPING ACTION BUTTONS ──
   .btn base site.css se aata hai; gold/ghost variants yahan. */
.tst-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.btn-gold {
  background: #f5c518;
  color: #11151c;
}
.btn-gold:hover {
  background: #ffd83d;
  transform: translateY(-2px);
}
.btn-ghost {
  background: var(--surface-2);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ── T6. TYPING RESULT SCREEN ──
   JS-MANDATED: finish() #tst-result par 'show' toggle karta hai. */
.tst-result {
  text-align: center;
  display: none;
}
.tst-result.show {
  display: block;
}
.tst-score {
  font-size: 3.6rem;
  font-weight: 800;
  color: var(--tst-accent);
  line-height: 1;
  margin: 6px 0 2px;
  font-variant-numeric: tabular-nums;
}
.tst-score-sub {
  color: var(--muted);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 18px;
}
.tst-score-sub.top {
  margin: 18px 0 0;
}
.tst-score .unit {
  font-size: 1.2rem;
  color: var(--muted);
}
.tst-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}
.tst-box {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 10px;
}
.tst-box .v {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.tst-box .k {
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 4px;
}
.tst-best {
  margin-top: 14px;
  color: var(--muted);
  font-size: .9rem;
}
.tst-best b {
  color: #f5c518;
}

/* ── T7. TYPING CONTENT SECTIONS ── */
.tst-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
  color: var(--ink-soft);
  line-height: 1.75;
  margin-top: 26px;
}
.tst-content h2 {
  color: var(--ink);
  font-size: 1.3rem;
  margin: 26px 0 10px;
}
.tst-content h2:first-child {
  margin-top: 0;
}
.tst-content p {
  margin: 0 0 12px;
}
.tst-content ul {
  padding-left: 20px;
  margin: 8px 0;
}
.tst-content li {
  margin-bottom: 8px;
}
.tst-formula {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: var(--font-mono);
  color: var(--ink);
}
.faq-item {
  border-top: 1px solid var(--line-soft);
  padding: 14px 0;
}
.faq-item h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  color: var(--ink);
}
.faq-item p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.75;
}

/* ── T8. TYPING RELATED LINKS ── */
.related {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.related a {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  transition: border-color .15s, color .15s;
}
.related a:hover {
  color: var(--ink);
  border-color: var(--accent);
}

/* ═══════════ WEBP CONVERTER ═══════════ */

/* ── W1. MODE TABS ──
   JS-MANDATED: setMode() 'active' classList se toggle karta hai. */
.mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.mode-tab {
  flex: 1;
  padding: 11px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.mode-tab:hover {
  color: var(--ink);
}
.mode-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

/* ── W1b. TOOL BOX ── */
.tool-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,.4);
}
@media (max-width: 640px) {
  .tool-box { padding: 18px 14px; }
}

/* ── W2. UPLOAD AREA ──
   JS-MANDATED: drag events #uploadBox par 'drag-over' toggle karte hain. */
.upload-area {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color .2s, background .2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.upload-area .upload-icon {
  font-size: 2.4rem;
  line-height: 1;
}
.upload-area h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
}
.upload-area p {
  margin: 0;
  color: var(--muted);
  font-size: .875rem;
}
.upload-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 22px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  border-radius: 6px;
  font-size: .875rem;
}
.upload-area input[hidden] {
  display: none;
}

/* ── W3. OPTIONS ROW ── */
.options-row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 16px;
}
.options-row label {
  font-size: .85rem;
  color: var(--muted);
  white-space: nowrap;
}
.quality-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 220px;
}
.quality-wrap input[type=range] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
}
.quality-val {
  font-weight: 700;
  color: var(--accent);
  min-width: 46px;
  text-align: right;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}
.sep {
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 4px;
}
.fmt-pills {
  display: flex;
  gap: 8px;
}
.fmt-pill {
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: .85rem;
  font-weight: 600;
  transition: background .15s, color .15s, border-color .15s;
}
.fmt-pill:hover {
  color: var(--ink);
}
.fmt-pill.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* ── W4. PROGRESS ──
   JS-MANDATED: 'active' classList se toggle hoti hai. */
.upload-progress-box {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 16px;
}
.upload-progress-box.active {
  display: flex;
}
.upload-progress-top {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  color: var(--ink-soft);
}
.upload-progress-top span:last-child {
  color: var(--accent);
  font-weight: 600;
}
.upload-progress-bar {
  height: 6px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 99px;
  transition: width .12s linear;
}

/* ── W5. QUEUE ──
   JS-MANDATED: renderQueue() ye markup likhta hai aur wapas querySelector
   se pakarta hai; .saved saved% badge ke liye. */
.queue-list {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.queue-list.has-items {
  display: flex;
}
.queue-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.queue-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg);
}
.queue-meta {
  min-width: 0;
}
.queue-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-sub {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 3px;
}
.queue-sub .saved {
  color: var(--green);
  font-weight: 600;
}
.queue-item-actions {
  display: flex;
  gap: 8px;
}
.queue-dl,
.queue-rm {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--ink);
  font-family: var(--font-body);
}
.queue-dl {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.queue-dl:hover {
  filter: brightness(1.08);
}
.queue-rm:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ── W6. BEFORE/AFTER PREVIEW ──
   JS-MANDATED: 'visible' classList se toggle hoti hai; badgeClass()
   'compare-badge badge-jpg|badge-png|badge-webp|badge-gif' className set
   karta hai. */
.preview-section {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}
.preview-section.visible {
  display: flex;
}
.preview-label {
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
}
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 520px) {
  .compare-grid { grid-template-columns: 1fr; }
}
.compare-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.compare-card img {
  width: 100%;
  display: block;
  max-height: 240px;
  object-fit: contain;
  background: repeating-conic-gradient(var(--surface-3) 0% 25%, var(--bg) 0% 50%) 0 0 / 16px 16px;
}
.compare-footer {
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8rem;
  color: var(--muted);
  gap: 8px;
}
.compare-footer strong {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compare-badge {
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 7px;
  flex: none;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-jpg {
  background: rgba(255, 100, 100, .15);
  color: #f87171;
}
.badge-png {
  background: rgba(74, 222, 128, .15);
  color: var(--green);
}
.badge-webp {
  background: rgba(49, 206, 255, .15);
  color: var(--accent);
}
.badge-gif {
  background: rgba(150, 150, 255, .15);
  color: #a5b4fc;
}

/* ── W7. STATS ── */
.stats {
  grid-template-columns: repeat(3, 1fr);
}
.stat-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 10px;
  text-align: center;
}
.stat-box h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.stat-box p {
  margin: 0;
  font-size: .78rem;
  color: var(--muted);
}
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; }
}

/* ── W8. STATUS NOTE ── */
.tool-note {
  margin-top: 14px;
  padding: 11px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .875rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

/* ── W9. ACTION BUTTONS ── */
.tool-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.tool-actions button {
  flex: 1;
  min-width: 140px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  background: var(--accent);
  color: var(--bg);
}
.tool-actions button:hover {
  filter: brightness(1.08);
}
.tool-actions button:active {
  transform: scale(.97);
}
.tool-actions button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.tool-actions .btn-secondary {
  background: var(--surface-3);
  color: var(--ink);
  border: 1px solid var(--line);
}
.tool-actions .btn-secondary:hover {
  border-color: var(--accent);
  filter: none;
}
.tool-actions .btn-download-all {
  background: var(--surface-3);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.tool-actions .btn-download-all:hover {
  filter: none;
  background: var(--accent-dim);
}

/* ── W10. SEO CONTENT SECTIONS ── */
.section {
  padding: 40px 16px;
}
.section-narrow {
  max-width: 820px;
  margin: 0 auto;
}
.section h2 {
  font-size: 1.25rem;
  margin: 24px 0 8px;
  color: var(--ink);
}
.section h2:first-child {
  margin-top: 0;
}
.section p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 12px;
}
.section a {
  color: var(--accent);
}
