/* ==========================================================================
   A2Z Converter — Tool screens (hero only)
   Built by tools.js for downloaders, text tools, image and PDF tools.
   Re-uses .hero (peach mesh), .crumbs, .hero-eyebrow, .hero-sub,
   .hero-trust, .url-form and .dl-platform from home.css / page.css.
   ========================================================================== */

.tool-hero [hidden] { display: none !important; }
.tool-hero { padding: 32px 0 72px; }
@media (min-width: 992px) { .tool-hero { padding: 40px 0 88px; } }

.tool-head { max-width: 820px; margin-inline: auto; text-align: center; }
.tool-badge { gap: 10px; padding: 5px 16px 5px 6px; }
.tool-badge-icon {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent, var(--primary)) 14%, #fff); color: var(--accent, var(--primary)); font-size: 13px;
}
.tool-badge-icon.is-youtube   { background: #FF0000; color: #fff; }
.tool-badge-icon.is-facebook  { background: #1877F2; color: #fff; }
.tool-badge-icon.is-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285AEB 90%); color: #fff; }
.tool-badge-icon.is-linkedin  { background: #0A66C2; color: #fff; }
.tool-badge-icon.is-all       { background: var(--primary); color: #fff; }
.tool-title {
  margin-top: 18px;
  font-size: clamp(34px, 4.8vw, 62px); font-weight: 800; letter-spacing: -.035em; line-height: 1.08;
  text-wrap: balance;
}
.tool-sub { margin-top: 16px; }

/* ---------- The working card ---------- */
.tool-hero .tool-card {
  max-width: 860px; margin: 32px auto 0; padding: 16px;
  background: #fff; border: 1px solid var(--border); border-radius: 24px;
  box-shadow: 0 1px 2px rgba(16, 16, 24, .04), 0 30px 60px -30px rgba(200, 60, 30, .28);
  text-align: left;
}
.tool-hero .tool-card--wide { max-width: 1040px; }
@media (min-width: 768px) { .tool-hero .tool-card { padding: 24px; } }
.tool-trust { margin-top: 28px; }
.tool-below { max-width: 860px; margin: 22px auto 0; display: grid; justify-items: center; gap: 16px; }

/* ---------- Shared controls ---------- */
.tl-label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted-2); }
.tl-label output { margin-left: auto; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.tl-help { font-size: 13px; color: var(--muted); }
.tl-meta { font-size: 13.5px; color: var(--muted); }
.tl-meta b { color: var(--text); }
.tl-meta .is-good, .is-good { color: var(--c-emerald); }
.is-error { color: var(--c-red); }
.tl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tl-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-actions--stack { flex-direction: column; align-items: stretch; }
.tl-foot, .tl-bar, .tl-out-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.tl-bar { padding-top: 16px; border-top: 1px solid var(--border); }
.tl-bar .btn--primary { margin-left: auto; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-radius: 12px; background: var(--panel-2); }
.seg button {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 14px; border-radius: 9px;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  transition: background-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { background: #fff; color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.seg button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }

.tl-opts { display: flex; flex-wrap: wrap; gap: 16px 28px; margin-top: 18px; }
.tl-opts--grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); padding: 18px; border-radius: 18px; background: var(--panel); }
.tl-opt { min-width: 0; }
.tl-opt--wide { grid-column: 1 / -1; }
@media (min-width: 720px) { .tl-opt--wide { grid-column: span 2; } }

.tl-range { width: 100%; accent-color: var(--primary); height: 28px; }
.tl-range-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted-2); }
.tl-number { width: 90px; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 15px; font-weight: 600; }
.tl-number:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.tl-color { display: inline-grid; width: 42px; height: 42px; padding: 3px; border: 1px solid var(--border-strong); border-radius: 12px; cursor: pointer; }
.tl-color input { width: 100%; height: 100%; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; }
.tl-color input::-webkit-color-swatch-wrapper { padding: 0; }
.tl-color input::-webkit-color-swatch { border: 0; border-radius: 8px; }
.tl-check { display: inline-flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 500; cursor: pointer; }
.tl-check input { width: 18px; height: 18px; accent-color: var(--primary); }

.tl-textarea {
  display: block; width: 100%; min-height: 280px; padding: 18px; resize: vertical;
  border: 1px solid var(--border-strong); border-radius: 16px; background: #fff;
  font: inherit; font-size: 16px; line-height: 1.65; color: var(--text);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.tl-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }

.tl-spin {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px;
  border: 2px solid currentColor; border-right-color: transparent; animation: tlSpin .7s linear infinite;
}
@keyframes tlSpin { to { transform: rotate(360deg); } }
.tl-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 28px; color: var(--muted); }
.tl-progress { display: block; height: 6px; margin-top: 10px; border-radius: 6px; background: var(--panel-2); overflow: hidden; }
.tl-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--primary); transition: width .2s linear; }
.tl-checker { background: repeating-conic-gradient(#EEEEF2 0 25%, #fff 0 50%) 0 0 / 20px 20px; }

/* Drop zone */
.tl-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center;
  min-height: 200px; padding: 28px 20px; border-radius: 18px; cursor: pointer;
  border: 2px dashed var(--primary-200); background: linear-gradient(180deg, var(--primary-50), #fff);
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
}
.tl-drop:hover, .tl-drop.is-over { border-color: var(--primary); }
.tl-drop.is-over { background: var(--primary-50); }
.tl-drop:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--primary-ring); }
.tl-drop-icon {
  display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; font-size: 24px;
  background: color-mix(in srgb, var(--accent, var(--primary)) 14%, #fff); color: var(--accent, var(--primary));
  transition: transform .2s var(--ease);
}
.tl-drop:hover .tl-drop-icon, .tl-drop.is-over .tl-drop-icon { transform: translateY(-3px); }
.tl-drop-text { display: grid; gap: 4px; }
.tl-drop-title { font-size: 18px; font-weight: 700; }
.tl-drop-title u { color: var(--primary); text-decoration-color: var(--primary-200); text-underline-offset: 4px; }
.tl-drop-hint { font-size: 14px; color: var(--muted); }
.tl-drop-btn { pointer-events: none; }
@media (min-width: 720px) {
  .tl-drop { flex-direction: row; text-align: left; min-height: 140px; padding: 24px 28px; gap: 20px; }
  .tl-drop-text { flex: 1; }
}

/* File rows */
.tl-files { display: grid; gap: 8px; margin-top: 16px; }
.tl-file {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 14px; background: #fff;
}
.tl-file[draggable="true"] { cursor: grab; }
.tl-file.is-dragging { opacity: .45; }
.tl-file.is-target { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.tl-file-thumb { flex: none; width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--panel); }
.tl-file-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; font-size: 18px; }
.tl-file-icon.is-pdf { background: #FEF2F2; color: var(--c-red); }
.tl-file-meta { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tl-file-meta b { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-file-meta small { font-size: 13px; color: var(--muted); }
.tl-file-meta strong { color: var(--text); }
.tl-file-badge { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.tl-file-badge.is-good { padding: 4px 10px; border-radius: var(--radius-pill); background: #ECFDF5; color: #047857; }
.tl-file-badge.is-flat { font-weight: 500; }
.tl-file-actions { flex: none; display: flex; align-items: center; gap: 4px; }
.tl-x { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--muted-2); }
.tl-x:hover:not(:disabled) { background: var(--panel); color: var(--text); }
.tl-x[data-remove]:hover { color: var(--c-red); }
.tl-x:disabled { opacity: .35; cursor: default; }
.tl-grip { flex: none; color: var(--muted-2); font-size: 13px; }
.tl-files--order { counter-reset: n; }
@media (max-width: 559px) {
  .tl-file { flex-wrap: wrap; }
  .tl-file-badge { order: 3; }
}


/* ==========================================================================
   Video downloaders
   ========================================================================== */
.tl-url { margin: 0; }
.url-icon.is-all { background: var(--primary-50); color: var(--primary); }
.tl-opts .seg button i { font-size: 12px; }
.tl-result { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.tl-video { display: grid; gap: 18px; }
@media (min-width: 720px) { .tl-video { grid-template-columns: 260px 1fr; align-items: start; } }
.tl-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--dark); }
.tl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tl-thumb-ph { display: grid; place-items: center; width: 100%; height: 100%; font-size: 40px; color: #fff; }
.tl-thumb-ph.is-youtube { background: linear-gradient(135deg, #FF4E4E, #B40000); }
.tl-thumb-ph.is-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.tl-thumb-ph.is-facebook { background: linear-gradient(135deg, #4C8DF6, #1159C9); }
.tl-thumb-ph.is-linkedin { background: linear-gradient(135deg, #2E86DE, #0A4F94); }
.tl-thumb-ph.is-all { background: linear-gradient(135deg, #FF8A5C, var(--primary-600)); }
.tl-duration { position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .75); color: #fff; font-size: 12px; font-weight: 600; }
.tl-video-title { font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.tl-video-src { margin-top: 4px; font-size: 13.5px; color: var(--muted); }
.tl-formats { display: grid; gap: 6px; margin-top: 14px; }
.tl-formats li {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px;
  padding: 8px 8px 8px 12px; border-radius: 12px; border: 1px solid var(--border);
}
.tl-formats li.is-picked { border-color: var(--primary-200); background: var(--primary-50); }
.tl-fmt-tag { padding: 3px 8px; border-radius: 6px; background: var(--panel-2); font-size: 11.5px; font-weight: 800; letter-spacing: .04em; }
.tl-fmt-q { font-weight: 600; font-size: 14.5px; }
.tl-fmt-q em { margin-left: 6px; font-style: normal; font-size: 12px; font-weight: 600; color: var(--primary-700); }
.tl-fmt-size { font-size: 13px; color: var(--muted-2); }
@media (max-width: 479px) { .tl-fmt-size { display: none; } .tl-formats li { grid-template-columns: auto 1fr auto; } }

.tl-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; font-size: 14px; color: var(--text-2); }
.tl-steps li { display: inline-flex; align-items: center; gap: 8px; }
.tl-steps span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--text); color: #fff; font-size: 12px; font-weight: 700; }
.tl-platforms { justify-content: center; margin-top: 0; }

/* YouTube thumbnails */
.tl-thumbs { display: grid; gap: 12px; margin-top: 18px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tl-thumb-card { margin: 0; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: #fff; }
.tl-thumb-card.is-main { grid-column: 1 / -1; }
@media (min-width: 720px) { .tl-thumb-card.is-main { grid-column: span 2; grid-row: span 2; } }
.tl-thumb-img { aspect-ratio: 16 / 9; background: var(--panel); }
.tl-thumb-img img { width: 100%; height: 100%; object-fit: cover; }
.tl-thumb-card figcaption { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; }
.tl-thumb-card figcaption > span:first-child { display: grid; min-width: 0; }
.tl-thumb-card b { font-size: 14.5px; }
.tl-thumb-card small { font-size: 12.5px; color: var(--muted); }
.tl-thumb-actions { display: flex; gap: 4px; flex: none; }
.tl-thumb-card.is-missing .tl-thumb-img { opacity: .35; }


/* ==========================================================================
   Convert case + word count
   ========================================================================== */
.case-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.case-btn {
  min-height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border);
  background: #fff; font-size: 14px; font-weight: 600; color: var(--text-2);
  transition: border-color .15s var(--ease), background-color .15s var(--ease), color .15s var(--ease);
}
.case-btn:hover { border-color: var(--accent, var(--primary)); color: var(--text); }
.case-btn.is-on { background: var(--accent, var(--primary)); border-color: var(--accent, var(--primary)); color: #fff; }
.case-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }

.tool-hero .tool-card--split { display: grid; gap: 20px; }
@media (min-width: 900px) { .tool-hero .tool-card--split { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.wc-main .tl-textarea { min-height: 340px; }
.tl-foot .tl-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-foot .tl-meta span { padding: 3px 9px; border-radius: var(--radius-pill); background: var(--panel); font-size: 12.5px; }
.tl-foot .tl-meta span.is-over { background: #FEF2F2; color: var(--c-red); }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat { display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--panel); }
.stat b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); }
.stat--hero { grid-column: 1 / -1; background: var(--accent, var(--primary)); color: #fff; }
.stat--hero b { font-size: 40px; }
.stat--hero span { color: rgba(255, 255, 255, .85); }
.kw { margin-top: 16px; }
.kw-list { display: grid; gap: 8px; }
.kw-list li { display: grid; grid-template-columns: minmax(0, 1fr) 80px auto; align-items: center; gap: 10px; font-size: 14px; }
.kw-word { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw-bar { height: 6px; border-radius: 6px; background: var(--panel-2); overflow: hidden; }
.kw-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent, var(--primary)); }
.kw-n { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kw-list .kw-empty { display: block; font-size: 13.5px; color: var(--muted-2); }


/* ==========================================================================
   Unit converter
   ========================================================================== */
.unit-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.unit-tabs button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: #fff; font-size: 14px; font-weight: 600; color: var(--muted);
}
.unit-tabs button i { font-size: 12.5px; }
.unit-tabs button:hover { color: var(--text); border-color: var(--border-strong); }
.unit-tabs button[aria-selected="true"] { background: var(--text); border-color: var(--text); color: #fff; }
.unit-tabs button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }
.unit-row { display: grid; gap: 10px; align-items: center; }
@media (min-width: 720px) { .unit-row { grid-template-columns: 1fr auto 1fr; } }
.unit-box { display: grid; gap: 4px; padding: 16px 18px; border-radius: 18px; background: var(--panel); border: 1px solid transparent; }
.unit-box:focus-within { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.unit-box--to { background: color-mix(in srgb, var(--accent, var(--primary)) 9%, #fff); }
.unit-box .tl-label { margin: 0; }
.unit-input {
  width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; padding: 0;
  font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.unit-input.is-invalid { color: var(--c-red); }
.unit-select {
  height: 42px; padding: 0 36px 0 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: #fff;
  font-size: 14.5px; font-weight: 600; color: var(--text); appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat;
}
.unit-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.unit-swap {
  justify-self: center; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border-strong); color: var(--text); box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), border-color .15s var(--ease);
}
.unit-swap:hover { border-color: var(--text); transform: rotate(180deg); }
@media (max-width: 719px) { .unit-swap i { transform: rotate(90deg); } }
.unit-formula { margin-top: 14px; text-align: center; font-size: 14.5px; color: var(--muted); }
.unit-formula b { color: var(--text); }
.unit-all { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.unit-all-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.unit-all-list button {
  display: grid; gap: 2px; width: 100%; padding: 10px 12px; border-radius: 12px; text-align: left;
  border: 1px solid var(--border); background: #fff;
}
.unit-all-list button:hover { border-color: var(--border-strong); }
.unit-all-list button.is-on { border-color: var(--accent, var(--primary)); background: color-mix(in srgb, var(--accent, var(--primary)) 8%, #fff); }
.unit-all-list b { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.unit-all-list span { font-size: 12.5px; color: var(--muted); }


/* ==========================================================================
   Merge images
   ========================================================================== */
.mi-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 18px; }
.mi-head .tl-label { margin: 0; }
.mi-grid { display: grid; gap: 10px; margin-top: 10px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.mi-item {
  position: relative; display: grid; border-radius: 14px; overflow: hidden; cursor: grab;
  border: 1px solid var(--border); background: var(--panel);
}
.mi-item img { width: 100%; aspect-ratio: 1; object-fit: cover; pointer-events: none; }
.mi-item.is-dragging { opacity: .4; }
.mi-item.is-target { outline: 3px solid var(--primary); outline-offset: -3px; }
.mi-num {
  position: absolute; top: 8px; left: 8px; display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 8px; background: var(--text); color: #fff; font-size: 12px; font-weight: 700;
}
.mi-name { padding: 6px 8px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #fff; }
.mi-tools {
  position: absolute; top: 6px; right: 6px; display: flex; gap: 2px; padding: 2px; border-radius: 10px;
  background: rgba(255, 255, 255, .92); box-shadow: var(--shadow-sm);
  opacity: 0; transition: opacity .15s var(--ease);
}
.mi-item:hover .mi-tools, .mi-item:focus-within .mi-tools { opacity: 1; }
@media (hover: none) { .mi-tools { opacity: 1; } }
.mi-tools button { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-size: 11px; color: var(--text-2); }
.mi-tools button:hover:not(:disabled) { background: var(--panel-2); }
.mi-tools button:disabled { opacity: .3; }
.mi-tools [data-remove]:hover { color: var(--c-red); }
.mi-work .tl-opts--grid { margin-top: 16px; }
.mi-out { margin-top: 18px; }
.tl-preview { display: grid; place-items: center; padding: 16px; border-radius: 16px; border: 1px solid var(--border); }
.tl-preview img { max-width: 100%; max-height: 460px; object-fit: contain; box-shadow: var(--shadow); }


/* ==========================================================================
   Image to text
   ========================================================================== */
.ocr-in, .ocr-out { min-width: 0; }
.ocr-in .tl-drop { min-height: 260px; flex-direction: column; text-align: center; }
.ocr-preview { display: grid; justify-items: center; gap: 10px; padding: 12px; border-radius: 16px; background: var(--panel); }
.ocr-preview img { max-width: 100%; max-height: 300px; border-radius: 10px; object-fit: contain; }
.ocr-controls { margin-top: 14px; }
.ocr-lang { flex: 1; min-width: 160px; height: 46px; }
.ocr-out .tl-textarea { min-height: 300px; }
.ocr-out .tl-actions { justify-content: flex-end; margin-top: 12px; }
.ocr-in .tl-meta { margin-top: 8px; }


/* ==========================================================================
   Background remover — before/after compare
   ========================================================================== */
.bg-work { display: grid; gap: 20px; }
@media (min-width: 900px) { .bg-work { grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); align-items: start; } }
.cmp { --pos: 50%; position: relative; display: grid; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); user-select: none; }
.cmp img { display: block; width: 100%; max-height: 520px; object-fit: contain; }
.cmp-before { background: #fff; clip-path: inset(0 0 0 var(--pos)); }
.cmp-after { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.cmp-after img { width: 100%; height: 100%; }
.cmp-handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; background: #fff; transform: translateX(-1px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); pointer-events: none;
}
.cmp-handle i {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: #fff; color: var(--text); box-shadow: var(--shadow); font-size: 14px;
}
.cmp-tag { position: absolute; top: 10px; padding: 3px 10px; border-radius: var(--radius-pill); background: rgba(10, 10, 10, .7); color: #fff; font-size: 12px; font-weight: 600; pointer-events: none; }
.cmp-tag--a { left: 10px; }
.cmp-tag--b { right: 10px; }
.cmp-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.cmp:has(.cmp-range:focus-visible) { box-shadow: 0 0 0 4px var(--primary-ring); }
.bg-side { display: grid; gap: 18px; padding: 18px; border-radius: 18px; background: var(--panel); }
.bg-side .seg { background: #fff; }
.bg-side .seg button[aria-checked="true"] { background: var(--panel-2); box-shadow: none; }


/* ==========================================================================
   PDF compress — level cards
   ========================================================================== */
.lvl-cards { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; border: 0; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.lvl-cards legend { padding: 0; }
.lvl-card {
  position: relative; display: grid; gap: 4px; padding: 16px; border-radius: 16px; cursor: pointer;
  border: 1.5px solid var(--border); background: #fff;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.lvl-card:hover { border-color: var(--border-strong); }
.lvl-card input { position: absolute; top: 16px; right: 16px; width: 18px; height: 18px; accent-color: var(--accent, var(--primary)); }
.lvl-card:has(input:checked) { border-color: var(--accent, var(--primary)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, var(--primary)) 18%, transparent); }
.lvl-card:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--primary-ring); }
.lvl-icon {
  display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 6px; border-radius: 11px;
  background: color-mix(in srgb, var(--accent, var(--primary)) 12%, #fff); color: var(--accent, var(--primary));
}
.lvl-card b { font-size: 15.5px; }
.lvl-card small { font-size: 13px; color: var(--muted); }
.dl-platform.is-all i { background: var(--primary); }

/* ==========================================================================
   PDF compress — compact layout on phones (below 600px), once PDFs are added
   ========================================================================== */
@media (max-width: 599px) {
  .tool-hero .tool-card[data-tool="pdf-compress"] { padding: 12px; }

  /* Drop zone shrinks to one slim "add more" row after the first upload */
  [data-tool="pdf-compress"]:has([data-work]:not([hidden])) .tl-drop {
    flex-direction: row; justify-content: center; min-height: 0; padding: 10px 12px; gap: 10px; border-radius: 14px;
  }
  [data-tool="pdf-compress"]:has([data-work]:not([hidden])) .tl-drop-icon { width: 32px; height: 32px; border-radius: 10px; font-size: 14px; }
  [data-tool="pdf-compress"]:has([data-work]:not([hidden])) .tl-drop-title { font-size: 14px; }
  [data-tool="pdf-compress"]:has([data-work]:not([hidden])) :is(.tl-drop-hint, .tl-drop-btn) { display: none; }

  /* Compression level: three small tiles in one row (icon + name), descriptions hidden */
  [data-tool="pdf-compress"] .tl-label { margin-bottom: 6px; font-size: 11px; }
  [data-tool="pdf-compress"] .lvl-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
  [data-tool="pdf-compress"] .lvl-card { justify-items: center; gap: 2px; padding: 10px 4px 9px; border-radius: 12px; text-align: center; }
  [data-tool="pdf-compress"] .lvl-card input { inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
  [data-tool="pdf-compress"] .lvl-icon { width: 28px; height: 28px; margin-bottom: 2px; border-radius: 8px; font-size: 13px; }
  [data-tool="pdf-compress"] .lvl-card b { font-size: 12.5px; }
  [data-tool="pdf-compress"] .lvl-card small { display: none; }
  @media (max-width: 379px) { [data-tool="pdf-compress"] .lvl-card b { font-size: 11.5px; } }

  /* File rows */
  [data-tool="pdf-compress"] .tl-files { gap: 6px; margin-top: 12px; }
  [data-tool="pdf-compress"] .tl-file { flex-wrap: nowrap; gap: 10px; padding: 8px 6px 8px 8px; border-radius: 12px; }
  [data-tool="pdf-compress"] .tl-file-icon { width: 32px; height: 32px; border-radius: 9px; font-size: 14px; }
  [data-tool="pdf-compress"] .tl-file-meta b { font-size: 13px; }
  [data-tool="pdf-compress"] .tl-file-meta small { font-size: 11.5px; line-height: 1.35; }
  [data-tool="pdf-compress"] .tl-progress { height: 3px; margin-top: 5px; }
  [data-tool="pdf-compress"] .tl-file-actions [data-get] { width: 30px; min-height: 30px; padding: 0; gap: 0; font-size: 0; }
  [data-tool="pdf-compress"] .tl-file-actions [data-get] i { font-size: 13px; }
  [data-tool="pdf-compress"] .tl-x { width: 28px; height: 28px; font-size: 13px; }

  /* Bar on one row: [🗑] [Compress PDF ……] */
  [data-tool="pdf-compress"] .tl-bar { flex-wrap: nowrap; gap: 8px; margin-top: 12px; padding-top: 12px; }
  [data-tool="pdf-compress"] .tl-bar [data-reset] { flex: none; width: 42px; min-height: 42px; padding: 0; gap: 0; font-size: 0; --btn-bd: var(--border-strong); }
  [data-tool="pdf-compress"] .tl-bar [data-reset] i { font-size: 15px; }
  [data-tool="pdf-compress"] .tl-bar [data-run] { flex: 1; min-height: 42px; margin: 0; padding: 0 16px; font-size: 14.5px; }
}

/* Acceptable-use notice under the video downloaders (sheet tabs 35–38) */
.legal-note { max-width: 860px; margin: 14px auto 0; text-align: center; font-size: 13px; line-height: 1.6; color: var(--muted); }
.legal-note a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.legal-note a:hover { color: var(--primary, #ff4c29); }
