
.intro-wide {
  max-width: 90%;
  width: 90%;
  text-align: left;
  margin-left: 0;
  margin-right: 0;
  display: block;
}
/* Centered homepage intro bar (H1 centered, paragraph left-aligned) */
.intro-bar--center h1 {
  text-align: center;
}
.intro-bar--center .container-aligned {
  margin-left: auto;
  margin-right: auto;
  max-width: 70ch;
}
.intro-bar--center p {
  text-align: left;
  margin-left: 0;
}
/* Aspect-ratio backstops and fixed boxes */
.thumbs img, .thumbs canvas {
  width: 96px;
  height: 64px;
  aspect-ratio: 3/2;
}

.res-head img,
.res-thumb.skeleton,
.res-thumb.error {
  width: 54px;
  height: 54px;
  aspect-ratio: 1;
}

.ui-icon-28 {
  width: 28px;
  height: 28px;
  aspect-ratio: 1;
}

.result-card__thumb {
  width: 96px;
  height: 64px;
  aspect-ratio: 3/2;
  /* existing border/background preserved below */
}
@media (max-width: 640px) {
  .result-card__thumb {
    width: 44px;
    height: 44px;
    aspect-ratio: 1;
  }
}

.embed-16x9 {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
}

img:not([width]):not([height]) {
  max-width: 100%;
  height: auto;
}
.ui-icon-28 {
  width: 28px !important;
  height: 28px !important;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}
.icon-24{ inline-size:24px; block-size:24px; flex:0 0 24px }
.result-card__thumb[src$="pdf.svg"] {
  width: 48px !important;
  height: 48px !important;
  background: #e0f0ff !important;
  border: 2px solid #b30b00 !important;
  /* Try to force SVG fill to red for visibility */
  filter: none !important;
  /* If the SVG is using currentColor, force color */
  color: #b30b00 !important;
}
/* /css/tool-pages.css (readable) */

/* ——— Tool containers ——— */

/* UI tokens migrated from /js/tools/shared/ui-tokens.css */
:root{
  --ui-gap-1: 6px;
  --ui-gap-2: 10px;
  --ui-gap-3: 14px;
  --ui-radius-1: 6px;
  --ui-radius-2: 8px;
  --ui-border: 1px solid rgba(0,0,0,0.12);
  --ui-muted: #6b7280;
  --ui-card-bg: #fff;
  --ui-progress-bg: #eef2f7;
  --ui-progress-fg: #2563eb;
}

.ui-row{ display:flex; align-items:center; gap: var(--ui-gap-2); }
.ui-card{ background: var(--ui-card-bg); border: var(--ui-border); border-radius: var(--ui-radius-2); padding: 10px; }
.ui-muted{ color: var(--ui-muted); }
.ui-hidden{ display: none !important; }

.ui-progress{ width: 120px; height: 6px; border-radius: 999px; background: var(--ui-progress-bg); position: relative; overflow: hidden; }
.ui-progress__bar{ position:absolute; left:0; top:0; bottom:0; width:0%; background: var(--ui-progress-fg); transition: width 160ms linear; }

.results-zipbar{ display:none; align-items:center; gap: var(--ui-gap-2); }
.results-zipbar.is-visible{ display:flex; }

.ui-icon-28{ width:28px; height:28px; flex: 0 0 28px; }
.ui-thumb-48{ width:48px; height:48px; object-fit: cover; border-radius: var(--ui-radius-2); border: var(--ui-border); }

.ui-focusable:focus{ outline: 2px solid #2563eb; outline-offset: 2px; }

main > .tool-card {
  max-width: 728px;
  margin: 14px auto;
  padding: 0 12px;
}

.tool-inner {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel--tool {
  max-width: 1000px;
  margin: 16px auto;
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

/* ——— How-it-works / steps ——— */

.hiw-steps {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  counter-reset: hiwstep;
}

@media (max-width: 700px) {
  .hiw-steps { grid-template-columns: 1fr; }
}

@media (min-width: 1024px) {
  .hiw-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.hiw-step {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px 16px 56px;
  box-shadow: 0 4px 10px rgba(10, 16, 28, .06);
}

.hiw-step::before {
  counter-increment: hiwstep;
  content: counter(hiwstep);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-600);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(22, 163, 74, .35);
}

.hiw-step h3 { margin: 0 0 6px; font-weight: 700; color: #0b1020; }
.hiw-step p  { margin: 0; color: var(--muted); }

.faqs .hiw-steps { gap: 14px; margin-top: 6px; }
.faqs .hiw-step  {
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(10, 16, 28, .06);
  background: var(--faq-card, #fff);
  border: 1px solid var(--faq-border, var(--border));
}

/* ——— How-to panel ——— */

.howto-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(10, 16, 28, .06);
  padding: 14px 16px 16px;
}

.howto-panel > h2 {
  margin: 0 0 10px;
  font-weight: 700;
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  color: var(--text, #0b1020);
}

.howto-panel .hiw-steps { gap: 18px; margin-top: 6px; }
.howto-panel .hiw-step  { padding: 16px 20px 20px 56px; }
.howto-panel .hiw-step p { margin: 4px 0 0; }
.howto-panel .hiw-steps { margin-bottom: 4px; }

/* Notes panel spacing (unified notes rendered from pages.notes_html) */
.tool-notes { margin-top: 16px; }
.cards.results-list + .tool-notes { margin-top: 16px; }

/* Notes summary styling: add info icon, typography, and alignment */
.tool-notes summary {
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.tool-notes summary::before {
  content: "ℹ️";
  margin-right: 6px;
  font-size: 1rem;
  opacity: 0.8;
}

/* Category SEO block */
.tool-seo h2 {
  margin-top: 1rem;
  margin-bottom: .5rem;
  font-size: 1.25rem;
}
.tool-seo p { margin: 16px 0; }

/* ——— Drop area ——— */

.drop-area {
  border: 2px dashed var(--accent);
  border-radius: 12px;
  padding: 36px;
  text-align: center;
  background: #f3f6fb;
  outline: none;
}

.drop-area.highlight,
.drop-area.is-dragover { background: #eef3fb; }

.drop-area p { margin: 0; color: var(--muted); }

.drop-area .browse {
  color: #0a66c2;
  font-weight: 700;
  cursor: pointer;
}

/* ——— Controls ——— */

.controls {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.controls label { font-weight: 600; }

.muted { color: var(--muted); }

.quality-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.quality-group .chips { display: flex; gap: 8px; margin: 0 6px 0 0; }
.chips { display: flex; gap: 8px; margin-bottom: 6px; }

.chip {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f7f9fc;
  color: #0b1020;
  cursor: pointer;
  transition: background-color .15s ease, outline-color .15s ease;
}
.chip:hover    { background: #eef3fb; }
.chip.is-active{
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  background: #eef9f1;
}

/* ——— Rows & thumbs ——— */

.row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-top: 10px;
  background: #fff;
}

.thumbs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.thumbs img,
.thumbs canvas {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

/* Legacy zipMount visibility (some tools still toggle this) */
#zipMount:not(.is-visible) { display: none !important; }
#zipMount.is-visible       { display: flex !important; }

/* Below-the-fold containers: avoid main thread work before visible */
.panel--tool, .results { content-visibility: auto; contain-intrinsic-size: 800px 600px }

/* ——— Recommended tools grid ——— */

.rec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 900px) { .rec-grid { grid-template-columns: 1fr; } }

.rec-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 16px;
  min-height: 170px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.rec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.rec-icon { width: 22px; height: 22px; flex: 0 0 22px; }
.rec-title { font-size: 1.05rem; line-height: 1.2; margin: 0; }
.rec-title a { text-decoration: none; color: inherit; }
.rec-title a:hover { text-decoration: underline; }
.rec-desc { margin: .25rem 0 .75rem; color: #374151; }
.rec-actions { margin-top: auto; }
/* Related tools block */
.tool-related{margin-top:24px}
.related-list{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:8px 12px}
.related-list a{text-decoration:none;color:#0a66c2;font-weight:600}

/* ——— Responsive tweaks ——— */

@media (max-width: 1024px) {
  .controls, .controls-row { gap: 10px; }
  .quality-group { flex: 1 1 100%; }
  .quality-group input[type="range"] { width: 100%; min-width: 0; }
}

@media (max-width: 640px) {
  .actions { width: 100%; flex-wrap: wrap; gap: 6px; }
  .actions .btn { flex: 1 1 auto; }
  .results-zipbar, #results .zipbar, #results .zip-area { flex-wrap: wrap; }
}

/* Allow large inner content without horizontal scrollbars */
.panel--tool, .tool-inner { max-width: 100%; overflow-x: hidden; }

/* Enable sticky topbar only after armed (paired with header script) */
html.arm-sticky-topbar .ad-topbar{ position: sticky; top: 0; z-index: 20 }

/* ——— Formats accordion ——— */

.formats-panel > h2 {
  margin: 0 0 10px;
  font-weight: 700;
  font-size: clamp(1.1rem, 2.1vw, 1.45rem);
  color: var(--faq-text);
}

.formats-list { gap: 10px; }
.formats-panel .faq-summary { align-items: center; }

.fmt-ext {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .85em;
  font-weight: 600;
  color: #334155;
  background: #eef2ff;
  border: 1px solid #e6eaf2;
}

.format-body p { margin: 8px 0; }
.format-body p:first-child { margin-top: 0; }
.format-body p:last-child  { margin-bottom: 0; }

.accordion { font-family: var(--faq-font); }
.accordion-list { display: grid; gap: 10px; }

/* ——— Compact intros (home/category/tool) ——— */
 .intro-bar {
  max-width: 1100px;
  margin: 16px auto 18px;
  padding: 32px 32px 28px 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.intro-text h1 { margin: 0 0 6px; font-weight: 800; font-size: clamp(1.35rem, 3vw, 1.9rem); }
.intro-text p  { margin: 0 0 10px; color: var(--muted); }
.intro-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.intro-actions .btn { padding: 8px 12px; }
.intro-actions .btn.btn--ghost { background: transparent; border: 1px solid var(--border); }
.intro-accent { inline-size: 140px; block-size: 120px; opacity: .9; }
@media (max-width: 640px){
  .intro-bar { grid-template-columns: 1fr; }
  .intro-accent { display: none; }
}

.page-intro.is-compact { max-width: 1100px; margin: 8px auto 8px; padding: 0 16px; }
.page-intro.is-compact h1 { margin: 0 0 4px; font-weight: 800; font-size: clamp(1.25rem, 3vw, 1.75rem); }
.page-intro.is-compact p { margin: 0; color: var(--muted); }

/* Decorative hero accent (AVIF/WebP picture) — homepage only
 * Keeps intrinsic size to avoid CLS; scaled via CSS. Not LCP (loading=lazy, fetchpriority=low).
 */
.intro-accent { display:block; margin-left: 12px; }
.intro-accent img { display:block; width: clamp(140px, 28vw, 320px); height: auto; max-width:100%; }
@media (max-width: 640px) {
  .intro-accent { order: -1; margin-bottom: 12px; }
  .intro-accent img { width: 60vw; }
}

/* Cap intro text width to align with the first card row/grid */
.container-aligned { max-width: 728px; margin: 0 auto; }

/* Add breathing room between intro and card grid */
.intro-bar + .tools-grid { margin-top: 12px; }

/* Category/Tool compact intros */
.page-intro { max-width: 1100px; margin: 16px auto 0; padding: 32px 32px 28px 32px; }
.page-intro h1 { margin: 0 0 6px; font-weight: 800; font-size: clamp(1.25rem, 3vw, 1.75rem); }
.page-intro p  { margin: 0; color: var(--muted); }
.page-intro--slim    { margin-bottom: 14px; }
.page-intro--compact { margin-bottom: 14px; }

/* Body width cap and readable measures for intros (DB-driven copy) */
.page-intro .container-aligned { max-width: 70ch; margin: 0 auto; text-align: left; }
.page-intro p { line-height: 1.55; }

/* Centered title for category pages while keeping paragraph left-aligned */
.page-intro--center h1 {
  text-align: center;
}
.page-intro--center .container-aligned {
  margin-left: auto;
  margin-right: auto;
  max-width: 70ch;
}
.page-intro--center p {
  text-align: left;
  margin-left: 0;
}

.accordion .accordion-item {
  border: 1px solid var(--faq-border);
  border-radius: 12px;
  background: var(--faq-card);
  box-shadow: 0 6px 16px rgba(10,16,28,.06);
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
@media (hover:hover) {
  .accordion .accordion-item:hover { box-shadow: 0 10px 22px rgba(10,16,28,.08); }
}

.accordion .accordion-summary {
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  min-height: 44px;
  font: inherit;
  font-weight: 600;
  color: var(--faq-text);
  list-style: none;
}
.accordion .accordion-summary::-webkit-details-marker { display: none; }

.accordion .accordion-summary::after{
  content:"";
  width:18px;height:18px;
  background:center / contain no-repeat url("data:image/svg+xml;utf8, \
  <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' aria-hidden='true'> \
  <path fill='%23858fa3' d='M12 15.5 6.5 10l1.4-1.4L12 12.7l4.1-4.1L17.5 10z'/></svg>");
  transform:rotate(0deg);
  transition:transform .18s ease;
  opacity:.9;
}
.accordion details[open] > .accordion-summary::after { transform: rotate(180deg); }

.accordion .accordion-summary:focus-visible {
  outline: 3px solid var(--faq-focus);
  outline-offset: 3px;
  border-radius: 10px;
}

.accordion .accordion-body {
  padding: 12px 20px 16px;
  color: var(--faq-text);
  line-height: 1.6;
}
.accordion .accordion-body > * { margin-block: 8px; }
.accordion .accordion-body > *:first-child { margin-block-start: 0; }
.accordion .accordion-body > *:last-child  { margin-block-end: 0; }

.accordion .accordion-body ul,
.accordion .accordion-body ol { margin: 8px 0 8px 20px; }

.accordion details[open] { background: var(--faq-open); border-color: #d5defa; }

@media print {
  .accordion .accordion-item { border: none; box-shadow: none; background: #fff; }
  .accordion .accordion-summary::after { display: none; }
}
.accordion .accordion-summary { list-style: none; }
.accordion .accordion-summary::-webkit-details-marker { display: none; }
.accordion .accordion-summary::marker { content: ""; }

/* formats variant icon on the left */
.formats-panel .accordion-summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 10px;
}
.formats-panel .accordion-summary::after { display: none; }
.formats-panel .accordion-summary::before{
  content:"";
  width:18px;height:18px;display:block;
  background:center / contain no-repeat url("data:image/svg+xml;utf8, \
  <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' aria-hidden='true'> \
  <path fill='%23858fa3' d='M12 15.5 6.5 10l1.4-1.4L12 12.7l4.1-4.1L17.5 10z'/></svg>");
  transform:rotate(0deg); transition:transform .18s ease; opacity:.9;
}
.formats-panel details[open] > .accordion-summary::before { transform: rotate(180deg); }

/* ——— Result cards (legacy v1) ——— */

.result-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(10,16,28,.05);
  padding: 12px;
  margin-top: 10px;
}

.res-head {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: center;
}

.res-head img,
.res-thumb.skeleton,
.res-thumb.error {
  width: 54px;
  height: 54px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  object-fit: cover;
}

.res-meta .res-name {
  display: block;
  font-weight: 700;
  margin: 0 0 2px;
  color: #0b1020;
}

.res-meta .res-sizes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: #334155;
}

.res-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.res-progress {
  height: 6px;
  background: #eef2ff;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 6px;
}

.res-bar { height: 100%; background: #2f7d32; transition: width .3s ease; }

.res-thumb.skeleton {
  background: linear-gradient(90deg,#eee,#f6f6f6,#eee);
  background-size: 200% 100%;
  animation: sheen 1.2s linear infinite;
}
@keyframes sheen { 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }

.res-thumb.error { position:relative; background:#ffe5e5; }
.res-thumb.error::after {
  content:'!';
  position:absolute; inset:0;
  display:grid; place-items:center;
  color:#b00020; font-weight:700;
}

.error-text { color: #b00020; }

@media (max-width: 480px) {
  .res-head { grid-template-columns: 44px 1fr; }
  .res-head img,
  .res-thumb.skeleton,
  .res-thumb.error { width: 44px; height: 44px; }
}

/* ——— Result cards (unified v2 structure) ——— */

#toolRoot .result-card { display:flex; gap:12px; align-items:flex-start; }

/* place thumb (48px) and meta side-by-side */
#toolRoot .result-card__body{
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 48px 1fr; /* thumb | name+metrics */
  gap: 10px;
  align-items: center;
}
#toolRoot .result-card__meta{ display:flex; flex-direction:column; min-width:0; }

#toolRoot .result-card__actions{
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.result-card__thumb {
  max-width: 96px;
  max-height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.result-card__name  { font-weight: 600; }
.result-card__sizes { font-size: .92em; color: #4b5563; margin-top: 2px; }

.result-card__status {
  font-size: .92em;
  color: #6b7280;
  margin-top: 6px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.result-card.is-stale .result-card__status { color: #8a8f9a; }

@media (max-width: 480px) {
  #toolRoot .result-card__body{
    grid-template-columns: 44px 1fr;
  }
  .result-card__thumb { width: 44px; height: 44px; }
}

/* Accessible progress bar (indeterminate by default) */
.progress {
  height: 6px;
  background: #e5e7eb;
  overflow: hidden;
  border-radius: 6px;
  position: relative;
}
.progress__bar {
  position: absolute;
  left: 0; top: 0;
  height: 100%; width: 28%;
  background: #22c55e;
  animation: rot-indet 1.2s linear infinite;
}
@keyframes rot-indet {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* results zipbar used by unified component */
.results-zipbar {
  margin: .5rem 0;
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* utilities */
.hidden { display: none !important; }
.control--inline { display:flex; align-items:center; gap:10px; }
.control--inline .lbl { margin:0; }

/* ——— Uploaded message ——— */

.queue-info {
  margin: 10px 0 6px;
  font-weight: 600;
  color: #0b1020;
}
.queue-info.hidden { display: none !important; }

.queue-panel .thumb-card { background: #fff; }
.queue-panel .thumb-card + .thumb-card { margin-top: 6px; }

/* Accessible focus ring for remove buttons (audit) */
.btn-remove:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.queue-panel { border: 2px solid #22c55e; border-radius: 10px; padding: 8px; background: #f6fff9; }
.queue-panel__head { font-weight: 700; color: #065f46; margin: 2px 4px 6px; }
.queue-panel__body.is-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.queue-panel__body:not(.is-grid) { display: flex; flex-direction: column; gap: 8px; }

.chips-wrap { display:flex; flex-wrap:wrap; gap:12px; }
.queue-chip { display:flex; align-items:center; gap:10px; padding:8px 10px; border:1px solid rgba(0,0,0,.08); border-radius:9999px; background:#fff; }
.queue-chip .chip-title { font-weight:600; }
.queue-chip .chip-meta { font-size:.85rem; color:#6c757d; }
.queue-chip .btn--sm { padding:4px 10px; }

