/* BBQ Tools — shared stylesheet. No external dependencies, no frameworks.
   Design v2.22 (2026-12-05): Cron field-by-field table wraps instead of
   scrolling — the shared batch-table nowrap forced the Means column wider
   than the card.
   Design v2.21 (2026-12-05): Ten new tools added (Markdown, URL, Regex,
   CSV to JSON, Image to Base64, Unit, Timezone, Lorem Ipsum, UUID, Cron):
   per-tool accent rules + homepage cards 11-20 + sitemap entries. JS still ?v=1.
   Design v2.20 (2026-12-05): LIVE badge removed from homepage tool cards
   (user call: redundant); card grid back to 3 rows.
   Design v2.19 (2026-12-05): One-screen tightening — the whole working
   area (inputs, options, result/preview, main buttons) fits in one
   viewport at 1920x1080 on 8/10 tools and at 1440x900 on 5/10, without
   shrinking fonts or touch targets: tighter head (h1 28px, lede 1.4),
   toolbox padding/margins, smaller textareas, secondary controls folded
   (QR colours, timestamp batch, Base64 templates, colour-blind + CSS
   variables), Base64 three file sections in one row. Colour Picker and
   Case Converter still need a scroll (500px contrast panel / full-width
   output block); on phones the input + main action are on the first
   screen and the result is one scroll down.
   Design v2.18 (2026-12-05): Two small fixes from independent re-review —
   password copyText now falls back to execCommand on clipboard denial
   and reports "Copy failed" honestly (same pattern as the timestamp
   tool); word counter no longer counts a standalone '#' heading
   marker as a word ('#hashtag' still counts).
   Design v2.17 (2026-12-05): Base64 upgrade — decode back to a file
   (type detected from magic bytes, image preview), Data-URI / CSS /
   HTML snippet templates, 76-character MIME wrap, per-line encode/decode,
   validate-and-repair decoding, roomy duo layout.
   (v2.16: Case Converter upgrade — style-guide Title
   Case (AP/Chicago/APA/MLA), Inverse / dot.case / SCREAMING_SNAKE_CASE /
   Slugify, live counts on both sides, .txt/.md upload, .txt download,
   "use result as input" chaining, keyboard shortcuts, acronym/brand
   preservation, roomy duo layout.
   (v2.15: Color Picker upgrade — WCAG contrast checker
   (AA/AAA + UI 3:1), colour-blind simulation, 6 harmony rules, HSV + CMYK,
   148 named colours, CSS-variables export, roomy studio layout.
   (v2.14: Word Counter upgrade — keyword density %,
   readability (Flesch + grade in plain words), syllables / unique words /
   averages, word goal with progress, .txt/.md upload, browser-only autosave.
   (v2.13: Timestamp upgrade — µs/ns precision with
   auto-detect by digit length, named IANA timezone picker, ISO 8601
   parsing, relative-time hero result, roomy studio layout.)
   (v2.12: PDF upgrade — extract-images mode, page-range selection,
   PNG output, JPG→PDF rotate + merge toggle + GIF/BMP/AVIF input.)
   (v2.11: Image Compressor — AVIF output, PNG8 palette, batch of 30.)
   Sage-green site palette (yuzoudiyigongzuotai.cn set) — solid greens,
   no orange gradients.
   Stylesheet is served with ?v=17 cache-busting — bump the version in
   every <link> when this file changes, or returning visitors keep the
   old design for up to 12h (Cache-Control: max-age=43200). All class
   names are part of the public contract — tool pages and JS rely on
   them, so do not rename or remove any. */
:root {
  --ink: #22302a;
  --ink-strong: #203c2d;
  --muted: #5f7166;
  --line: #eef3ed;
  --line-strong: #d5dfd5;
  --bg: #e8efe9;
  --soft: #f3f8f3;
  --card: #fefefd;
  --accent: #2f6f4f;
  --accent-2: #4d7a5e;
  --accent-dark: #24573d;
  --accent-soft: #eef3ed;
  --accent-tint: #e2ede3;
  --green: #15803d;
  --green-soft: #eef3ed;
  --focus: #2f6f4f;
  --radius: 14px;
  --radius-sm: 10px;
  --max: 1080px;
  --shadow-sm: 0 1px 2px rgba(32, 60, 45, .06), 0 1px 6px rgba(32, 60, 45, .05);
  --shadow-md: 0 6px 20px rgba(32, 60, 45, .10);
  --shadow-lg: 0 12px 32px rgba(32, 60, 45, .14);
  /* Per-tool accent (default = site green; overridden per card below). */
  --card-accent: #2f6f4f;
  --card-tint: #eef3ed;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

::selection { background: #c9dccb; color: #203c2d; }

a { color: var(--accent); }
a:hover { color: var(--accent-2); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3 { line-height: 1.25; color: var(--ink-strong); overflow-wrap: break-word; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin: 0 0 .5rem; letter-spacing: -.02em; }
h2 { font-size: clamp(1.35rem, 3vw, 1.5rem); margin: 2.5rem 0 .75rem; letter-spacing: -.01em; }
h3 { font-size: 1.15rem; margin: 1.75rem 0 .5rem; }
p { margin: 0 0 1rem; overflow-wrap: break-word; }
ul, ol { margin: 0 0 1rem; padding-left: 1.4rem; }
li { margin-bottom: .35rem; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .1em .35em;
  overflow-wrap: break-word;
}
pre {
  background: #111827;
  color: #f9fafb;
  padding: 1rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-size: .9rem;
}
pre code { background: none; border: 0; padding: 0; color: inherit; }
img { max-width: 100%; height: auto; }
svg, canvas { max-width: 100%; }

/* ---------- layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 clamp(16px, 4vw, 28px); }
.narrow { max-width: 780px; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(254, 254, 253, .92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 60px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink-strong);
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 4px 10px rgba(47, 111, 79, .35);
}
.logo small {
  font-size: .7rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.main-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
}
.main-nav a:hover { background: var(--soft); color: var(--accent-dark); }

.hero {
  text-align: center;
  padding: clamp(40px, 7vw, 72px) 20px clamp(32px, 5vw, 48px);
  background:
    radial-gradient(600px 220px at 15% 0%, rgba(47, 111, 79, .22), transparent 70%),
    radial-gradient(500px 200px at 85% 10%, rgba(77, 122, 94, .18), transparent 70%),
    linear-gradient(180deg, #e2ede3, #e8efe9 80%);
  border-bottom: 1px solid var(--line);
}
.hero h1 { font-size: clamp(1.9rem, 5.5vw, 2.9rem); margin-bottom: .75rem; }
.hero .lede {
  font-size: clamp(1.02rem, 2.5vw, 1.18rem);
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 1.5rem;
}
.hero .trust {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  padding: 0;
  margin: 0;
}
.hero .trust li {
  margin: 0;
  background: rgba(254, 254, 253, .85);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  box-shadow: var(--shadow-sm);
}
.hero .trust li::before { content: "\2713  "; color: var(--green); font-weight: 700; }

section { padding: 8px 0 32px; }
.section-title { font-size: clamp(1.35rem, 3vw, 1.5rem); margin-bottom: .25rem; }
.section-title::after {
  content: "";
  display: block;
  width: 44px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), #4d7a5e);
  margin-top: 8px;
}
.section-sub { color: var(--muted); margin-bottom: 1.5rem; }

/* ---------- tool grid ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.tool-card {
  border: 1px solid var(--line);
  border-top: 3px solid var(--card-accent);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--card);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto 1fr;
  gap: 6px 12px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
/* Icon sits left of the title (2026-12-05, user call): icon + title side
   by side, description and CTA full width. The LIVE badge row was removed
   the same day (user call: redundant). */
.tool-card .icon { grid-column: 1; grid-row: 1; }
.tool-card h3 { grid-column: 2; grid-row: 1; align-self: center; }
.tool-card p { grid-column: 1 / -1; grid-row: 2; }
.tool-card .cta { grid-column: 1 / -1; grid-row: 3; align-self: end; }
a.tool-card { text-decoration: none; color: inherit; }
a.tool-card:hover {
  border-color: var(--card-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.tool-card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--card-tint);
  color: var(--card-accent);
  font-size: 1.5rem;
  line-height: 1;
}
.tool-card h3 { margin: 0; font-size: 1.05rem; }
.tool-card p { margin: 0; font-size: .92rem; color: var(--muted); }
.tool-card .cta { font-size: .9rem; font-weight: 700; color: var(--card-accent); padding-top: 8px; }
.tool-card.soon { background: var(--soft); }
.tool-card.soon .cta { color: var(--muted); font-weight: 600; }
/* One accent per tool, so the grid reads as ten different tools, not ten clones. */
.tool-grid > li:nth-child(1) .tool-card { --card-accent: #ea580c; --card-tint: #fff4ed; }
.tool-grid > li:nth-child(2) .tool-card { --card-accent: #0284c7; --card-tint: #f0f9ff; }
.tool-grid > li:nth-child(3) .tool-card { --card-accent: #7c3aed; --card-tint: #f5f3ff; }
.tool-grid > li:nth-child(4) .tool-card { --card-accent: #15803d; --card-tint: #f0fdf4; }
.tool-grid > li:nth-child(5) .tool-card { --card-accent: #b45309; --card-tint: #fffbeb; }
.tool-grid > li:nth-child(6) .tool-card { --card-accent: #be185d; --card-tint: #fdf2f8; }
.tool-grid > li:nth-child(7) .tool-card { --card-accent: #0f766e; --card-tint: #f0fdfa; }
.tool-grid > li:nth-child(8) .tool-card { --card-accent: #c026d3; --card-tint: #fdf4ff; }
.tool-grid > li:nth-child(9) .tool-card { --card-accent: #1d4ed8; --card-tint: #eff6ff; }
.tool-grid > li:nth-child(10) .tool-card { --card-accent: #0e7490; --card-tint: #ecfeff; }
.tool-grid > li:nth-child(11) .tool-card { --card-accent: #dc2626; --card-tint: #fef2f2; }
.tool-grid > li:nth-child(12) .tool-card { --card-accent: #65a30d; --card-tint: #f7fee7; }
.tool-grid > li:nth-child(13) .tool-card { --card-accent: #db2777; --card-tint: #fdf2f8; }
.tool-grid > li:nth-child(14) .tool-card { --card-accent: #4f46e5; --card-tint: #eef2ff; }
.tool-grid > li:nth-child(15) .tool-card { --card-accent: #0891b2; --card-tint: #ecfeff; }
.tool-grid > li:nth-child(16) .tool-card { --card-accent: #a16207; --card-tint: #fefce8; }
.tool-grid > li:nth-child(17) .tool-card { --card-accent: #9333ea; --card-tint: #faf5ff; }
.tool-grid > li:nth-child(18) .tool-card { --card-accent: #059669; --card-tint: #ecfdf5; }
.tool-grid > li:nth-child(19) .tool-card { --card-accent: #0d9488; --card-tint: #f0fdfa; }
.tool-grid > li:nth-child(20) .tool-card { --card-accent: #475569; --card-tint: #f1f5f9; }

/* ---------- feature / how it works ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}
.steps li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: .9rem;
  margin-bottom: 10px;
  box-shadow: 0 3px 8px rgba(47, 111, 79, .3);
}
.steps h3 { margin: 0 0 .25rem; }
.steps p { margin: 0; font-size: .93rem; color: var(--muted); }

/* ---------- tool workspace ---------- */
.toolbox {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  padding: clamp(16px, 4vw, 28px);
  margin: 1.5rem 0;
  box-shadow: var(--shadow-md);
}
.dropzone {
  border: 2px dashed #c5d2c6;
  border-radius: var(--radius);
  background: var(--soft);
  padding: clamp(28px, 6vw, 44px) 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.dropzone:hover, .dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.dropzone .big { font-size: 2.2rem; line-height: 1; display: block; margin-bottom: 10px; }
.dropzone p { margin: 0 0 .5rem; }
.dropzone .hint { font-size: .88rem; color: var(--muted); }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.control label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 6px; }
.control .value { font-weight: 400; color: var(--muted); }
.control input[type="range"] { width: 100%; min-height: 32px; accent-color: var(--accent); }
.control input[type="number"],
.control select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
}
.control input[type="number"]:focus,
.control select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(29, 78, 216, .35);
  outline-offset: 0;
}
.control .note { font-size: .85rem; color: var(--muted); margin-top: 6px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  padding: 12px 22px;
  min-height: 48px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(47, 111, 79, .28);
  transition: background .15s, transform .15s, box-shadow .15s;
}
.btn:hover { background: var(--accent-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(47, 111, 79, .32); }
.btn:active { transform: translateY(0); box-shadow: 0 3px 8px rgba(47, 111, 79, .28); }
.btn:disabled { background: #e0e7e0; color: #8b9b8f; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.secondary { background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); }
.btn.secondary:hover { background: var(--soft); color: var(--ink); box-shadow: var(--shadow-md); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

.result { margin-top: 24px; }
.result[hidden] { display: none; }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat .num { font-size: 1.35rem; font-weight: 800; color: var(--ink-strong); overflow-wrap: break-word; }
.stat .num.good { color: var(--green); }
.stat .lbl { font-size: .85rem; color: var(--muted); }
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.compare figure { margin: 0; min-width: 0; }
.compare figcaption { font-size: .88rem; color: var(--muted); margin-top: 6px; text-align: center; }
.compare img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  display: block;
}
.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 16px;
  overflow-wrap: break-word;
}
.error[hidden] { display: none; }

/* ---------- article / guide ---------- */
.guide { padding-bottom: 16px; }
.guide table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1rem;
  font-size: .95rem;
  background: var(--card);
}
.guide th, .guide td {
  border: 1px solid var(--line);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}
.guide th { background: var(--soft); }
.faq dt { font-weight: 700; margin-top: 1rem; }
.faq dd { margin: .25rem 0 0; }
.callout {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin: 1.25rem 0;
  box-shadow: var(--shadow-sm);
}
.related { list-style: none; padding: 0; margin: 0; display: flex; gap: 12px; flex-wrap: wrap; }
.related li { margin: 0; }
.related a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  text-decoration: none;
  font-size: .95rem;
  font-weight: 600;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.related a:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: #203c2d;
  color: #c9d6cc;
  padding: 40px 0 32px;
  margin-top: 40px;
  font-size: .92rem;
}
.site-footer h3 { font-size: 1rem; margin: 0 0 10px; color: #fefefd; letter-spacing: .01em; }
.site-footer p { color: #c9d6cc; }
.site-footer .cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: #c9d6cc; text-decoration: none; }
.site-footer a:hover { color: #a8c3ad; }
.site-footer .fine { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(254, 254, 253, .14); font-size: .85rem; color: #8fa393; }

.breadcrumb { font-size: .88rem; color: var(--muted); margin: 20px 0 0; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-dark); }

/* ---------- shared form elements (tools 2-10) ---------- */
.toolbox textarea,
.toolbox input[type="text"],
.toolbox input[type="number"],
.toolbox input[type="datetime-local"],
.toolbox select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
}
.toolbox textarea:focus,
.toolbox input[type="text"]:focus,
.toolbox input[type="number"]:focus,
.toolbox input[type="datetime-local"]:focus,
.toolbox select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(29, 78, 216, .35);
  outline-offset: 0;
}
.toolbox textarea {
  min-height: 140px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92rem;
  line-height: 1.5;
}
.toolbox textarea.plain { font-family: inherit; font-size: 1rem; }
.toolbox label { display: block; font-weight: 700; font-size: .92rem; margin: 0 0 6px; }
.toolbox .field { margin-bottom: 16px; }
.toolbox .field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.toolbox .check-row { display: flex; gap: 8px 16px; flex-wrap: wrap; margin: 4px 0 16px; }
.toolbox .check-row label { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; margin: 0; min-height: 36px; cursor: pointer; }
.toolbox .check-row input { width: 20px; height: 20px; accent-color: var(--accent); flex-shrink: 0; }
.output-box {
  width: 100%;
  min-height: 140px;
  background: #111827;
  color: #f9fafb;
  border-radius: 8px;
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: pre-wrap;
  word-break: break-word;
}
.mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-family: inherit;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  cursor: pointer;
  color: var(--ink);
}
.mini:hover { border-color: var(--accent); color: var(--accent-dark); }
.mini:disabled { opacity: .45; cursor: not-allowed; }
.tool-output { margin-top: 16px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.05rem; word-break: break-all; overflow-wrap: anywhere; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.strength-track { height: 10px; background: #e2ebe2; border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.strength-bar { height: 100%; width: 0; background: #15803d; border-radius: 999px; transition: width .2s; }
.strength-label { font-weight: 700; }
.file-list { list-style: none; padding: 0; margin: 12px 0; }
.file-list li { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-size: .92rem; overflow-wrap: break-word; }
.file-list .mini { margin-left: 6px; }

/* batch section (timestamp converter) */
.batch { margin-top: 20px; }
.batch-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 8px; }
.batch-head h3 { margin: 0; }

/* bulk QR grid */
.qr-bulk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 16px; }
.qr-bulk-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px; text-align: center; box-shadow: var(--shadow-sm); }
.qr-bulk-card canvas { max-width: 100%; height: auto; }
.qr-bulk-card .qr-bulk-label { font-size: .85rem; word-break: break-all; overflow-wrap: anywhere; margin: 8px 0; }
.qr-bulk-card .meta { font-size: .8rem; color: var(--muted); margin: 4px 0 10px; }
.qr-bulk-card.error-card { border-color: #dc2626; }
.qr-bulk-card .qr-bulk-err { color: #991b1b; font-size: .85rem; margin: 8px 0 0; }

/* password batch rows */
.pw-batch-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.pw-batch-row input { flex: 1; min-width: 0; }

/* tabs (PDF tool) */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button {
  border: 1px solid var(--line-strong);
  background: var(--card);
  border-radius: 999px;
  padding: 9px 18px;
  min-height: 44px;
  font-size: .95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: var(--ink);
}
.tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* key/value result rows (timestamp tool) */
.kv-row { display: flex; gap: 4px 12px; align-items: baseline; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; }
.kv-key { font-weight: 700; min-width: 140px; font-size: .92rem; }
.kv-val { flex: 1; min-width: 0; font-size: .92rem; background: none; border: 0; padding: 0; word-break: break-all; overflow-wrap: anywhere; }

/* colour swatches */
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 8px; }
.swatch-wrap { text-align: center; font-size: .8rem; color: var(--muted); min-width: 0; }
.swatch {
  display: block;
  width: 100%;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 8px;
  padding: 14px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem;
  cursor: pointer;
  overflow-wrap: break-word;
}
.color-preview { border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 16px; text-align: center; font-weight: 800; font-size: 1.2rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin-bottom: 16px; overflow-wrap: break-word; }
input[type="color"] { width: 100%; height: 48px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); padding: 4px; cursor: pointer; }

/* QR preview */
.qr-preview { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-top: 16px; }
.qr-preview canvas { max-width: 100%; height: auto; image-rendering: pixelated; }
.qr-preview .meta { font-size: .88rem; color: var(--muted); margin-top: 10px; overflow-wrap: break-word; }

/* ad slots: hidden until the site config turns them on */
.ad-slot { margin: 20px 0; text-align: center; }
.ad-slot[hidden] { display: none; }

/* admin page */
.admin-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); padding: clamp(16px, 4vw, 24px); margin: 1.5rem 0; }
.admin-box .field { margin-bottom: 16px; }
.notice { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 8px; padding: 12px 14px; margin: 1rem 0; font-size: .92rem; }
.aff-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px; margin-bottom: 8px; }
.aff-row input { width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px; font-size: .92rem; border: 1px solid var(--line-strong); border-radius: 8px; }

/* batch results table (timestamp converter) */
.batch-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.batch-table { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--card); }
.batch-table th, .batch-table td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; white-space: nowrap; }
.batch-table th { background: var(--soft); }
.batch-table tr.batch-error td { background: #fef2f2; color: #991b1b; white-space: normal; }

/* BBQ share styles */
.share-bar { margin: 28px 0 8px; padding: clamp(16px, 4vw, 22px); background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); }
.share-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; color: var(--ink-strong); }
.share-text { color: var(--muted); font-size: .95rem; margin: 0 0 14px; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: .9rem; font-weight: 600; font-family: inherit; text-decoration: none; cursor: pointer; }
.share-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.share-btn.share-copy, .share-btn.share-native { background: var(--accent); border-color: var(--accent); color: #fff; }
.share-btn.share-copy:hover, .share-btn.share-native:hover { background: var(--accent-dark); color: #fff; }
.share-link-box { display: flex; gap: 8px; margin: 0 0 16px; }
.share-link-box input { flex: 1; min-width: 0; min-height: 44px; padding: 10px 12px; font-size: .92rem; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--ink); }
.share-qr { display: flex; align-items: center; gap: 16px; margin: 0 0 8px; }
.share-qr img { width: 120px; height: 120px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); flex-shrink: 0; }
.share-qr p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- responsive ---------- */
/* Laptop and smaller: comparison panels stack before they get cramped. */
@media (max-width: 1024px) {
  .compare { grid-template-columns: 1fr; }
  .hero { background:
    radial-gradient(480px 180px at 15% 0%, rgba(47, 111, 79, .22), transparent 70%),
    radial-gradient(420px 170px at 85% 10%, rgba(77, 122, 94, .18), transparent 70%),
    linear-gradient(180deg, #e2ede3, #e8efe9 80%); }
}

/* Tablet: header nav becomes a horizontal scroll strip instead of wrapping
   into a tall block; footer drops to two columns. */
@media (max-width: 768px) {
  body { font-size: 16px; }
  .site-header .wrap { flex-wrap: wrap; gap: 0; padding-bottom: 8px; }
  .logo { min-height: 56px; }
  .main-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 calc(-1 * clamp(16px, 4vw, 28px));
    padding: 0 clamp(16px, 4vw, 28px) 4px;
    width: calc(100% + 2 * clamp(16px, 4vw, 28px));
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { padding: 10px 12px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
  .guide table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .qr-bulk-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* Phone: single-column everything, thumb-sized buttons, no sideways scroll. */
@media (max-width: 640px) {
  h1 { font-size: 1.65rem; }
  .hero { padding: 40px 20px 28px; }
  .hero h1 { font-size: 1.9rem; }
  .hero .trust li { font-size: .85rem; padding: 5px 11px; }
  .steps { grid-template-columns: 1fr; }
  .toolbox { border-radius: 12px; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .aff-row { grid-template-columns: 1fr; }
  .aff-row .mini { justify-self: start; }
  .share-link-box { flex-direction: column; }
  .share-link-box .share-btn { width: 100%; }
  .share-qr { flex-direction: column; align-items: flex-start; }
  .site-footer .cols { grid-template-columns: 1fr; }
  .swatch-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* Small phone: full-width primary buttons, key/value rows stack. */
@media (max-width: 480px) {
  .btn-row .btn { flex: 1 1 160px; }
  .kv-row { flex-direction: column; gap: 2px; }
  .kv-key { min-width: 0; }
  .logo small { display: none; }
  .tool-grid { grid-template-columns: 1fr; }
  .pw-batch-row { flex-wrap: wrap; }
  .pw-batch-row input { flex-basis: 100%; }
}

/* Touch devices: everything tappable is at least finger-sized. */
@media (pointer: coarse) {
  .main-nav a { min-height: 44px; display: inline-flex; align-items: center; }
  .btn { min-height: 48px; }
  .mini { min-height: 40px; }
  .tabs button { min-height: 48px; }
  .share-btn { min-height: 44px; }
  .control input[type="range"] { min-height: 40px; }
  .toolbox .check-row input { width: 22px; height: 22px; }
}

/* Motion: respect the user's reduced-motion setting. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- per-tool workspace: Image Compressor (pilot, 2026-12-05) ----------
   Same design system as the rest of the site, but a file tool gets a
   "studio" layout: controls in a side panel, results on a preview stage.
   Other tools keep the single-column toolbox until their own pass.
   Scoped to body.tool-image-compressor so nothing else changes. */
body.tool-image-compressor { --tool-accent: #ea580c; --tool-tint: #fff4ed; }

.tool-head { display: flex; gap: 16px; align-items: flex-start; }
.tool-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  margin-top: 4px;
  border-radius: 16px;
  background: var(--tool-tint);
  color: var(--tool-accent);
  font-size: 2rem;
  line-height: 1;
  box-shadow: var(--shadow-sm);
}
.tool-head-text { min-width: 0; }
.tool-head-text h1 { margin: 0 0 .35rem; }
.tool-head-text .lede { margin: 0; }

.tool-studio {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.tool-side { min-width: 0; }
.tool-side .dropzone {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-width: 2px;
}
.tool-stage {
  min-width: 0;
  min-height: 340px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: clamp(16px, 3vw, 24px);
  background: var(--card);
}
/* The checkerboard is an image-tool cue only — other tools get a plain stage. */
body.tool-image-compressor .tool-stage {
  background-color: #fefefd;
  background-image:
    linear-gradient(45deg, #e2ebe2 25%, transparent 25%),
    linear-gradient(-45deg, #e2ebe2 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2ebe2 75%),
    linear-gradient(-45deg, transparent 75%, #e2ebe2 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}
.tool-stage .batch, .tool-stage .result { margin-top: 0; }
.tool-stage-empty { text-align: center; color: var(--muted); padding: 56px 16px; }
.tool-stage-empty-icon { display: block; font-size: 2.4rem; line-height: 1; margin-bottom: 12px; }
.tool-stage-empty p { margin: 0 0 .5rem; }
/* The empty state vanishes the moment the batch queue or a result appears.
   :has() is supported in all current browsers; no JS change was needed. */
.tool-stage:has(.batch:not([hidden])) .tool-stage-empty,
.tool-stage:has(.result:not([hidden])) .tool-stage-empty { display: none; }
body.tool-image-compressor .tool-stage .stats .stat .num { font-size: 1.6rem; }
body.tool-image-compressor .tool-stage .compare figcaption { font-weight: 700; color: var(--ink); }
body.tool-image-compressor .tool-stage .compare img { background: var(--card); }

@media (min-width: 1025px) {
  .tool-side { position: sticky; top: 84px; }
}
@media (max-width: 1024px) {
  .tool-studio { grid-template-columns: 1fr; }
  .tool-stage { min-height: 0; }
  .tool-stage-empty { padding: 36px 16px; }
}
@media (max-width: 640px) {
  .tool-head { flex-direction: column; gap: 12px; }
  .tool-emblem { width: 56px; height: 56px; font-size: 1.7rem; margin-top: 0; }
}

/* ---------- per-tool workspaces, all 10 tools (Design v2.3, 2026-12-05) ----------
   One design system, four workspace families:
   - studio: file tools (image, pdf), generators (qr, password, color),
     converter (timestamp) — controls left, results on a stage right.
   - duo: text tools (json, word, case, base64) — input left, result right.
   Accent colours match each tool's homepage card. No JS was changed for
   any of this; wrappers and :has() do the work. */

/* The hidden attribute must always win: layout classes like .tool-studio
   set display:grid, which would otherwise override the UA's [hidden]
   rule and show a hidden panel (caught on PDF: both tabs visible). */
[hidden] { display: none !important; }

/* Per-tool accents (same values as the homepage cards). */
body.tool-pdf-to-jpg { --tool-accent: #0284c7; --tool-tint: #f0f9ff; }
body.tool-qr-code-generator { --tool-accent: #7c3aed; --tool-tint: #f5f3ff; }
body.tool-json-formatter { --tool-accent: #15803d; --tool-tint: #f0fdf4; }
body.tool-timestamp-converter { --tool-accent: #b45309; --tool-tint: #fffbeb; }
body.tool-password-generator { --tool-accent: #be185d; --tool-tint: #fdf2f8; }
body.tool-word-counter { --tool-accent: #0f766e; --tool-tint: #f0fdfa; }
body.tool-color-picker { --tool-accent: #c026d3; --tool-tint: #fdf4ff; }
body.tool-case-converter { --tool-accent: #1d4ed8; --tool-tint: #eff6ff; }
body.tool-base64 { --tool-accent: #0e7490; --tool-tint: #ecfeff; }
body.tool-markdown-to-html { --tool-accent: #dc2626; --tool-tint: #fef2f2; }
body.tool-url-encoder { --tool-accent: #65a30d; --tool-tint: #f7fee7; }
body.tool-regex-tester { --tool-accent: #db2777; --tool-tint: #fdf2f8; }
body.tool-csv-to-json { --tool-accent: #4f46e5; --tool-tint: #eef2ff; }
body.tool-image-to-base64 { --tool-accent: #0891b2; --tool-tint: #ecfeff; }
body.tool-unit-converter { --tool-accent: #a16207; --tool-tint: #fefce8; }
body.tool-timezone-converter { --tool-accent: #9333ea; --tool-tint: #faf5ff; }
body.tool-lorem-ipsum-generator { --tool-accent: #059669; --tool-tint: #ecfdf5; }
body.tool-uuid-generator { --tool-accent: #0d9488; --tool-tint: #f0fdfa; }
body.tool-cron-explainer { --tool-accent: #475569; --tool-tint: #f1f5f9; }
/* Cron's breakdown table reuses .batch-table (nowrap): let its cells wrap
   so the Means column ("Monday through Friday") fits the card instead of
   scrolling sideways. Other tools' batch tables keep nowrap. */
body.tool-cron-explainer .batch-table td { white-space: normal; }

/* Primary buttons take the tool's own colour; secondary buttons stay neutral. */
body[class^="tool-"] .toolbox .btn:not(.secondary) {
  background: linear-gradient(180deg, var(--tool-accent), var(--tool-accent));
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}
/* Disabled primary buttons must look disabled: the accent rule above
   outranks the plain .btn:disabled rule, so repeat it here with the
   same specificity. Without this, a disabled button (e.g. "Download
   all as ZIP" with nothing to download) looks clickable. */
body[class^="tool-"] .toolbox .btn:not(.secondary):disabled {
  background: #e0e7e0;
  color: #8b9b8f;
  box-shadow: none;
}

/* ---------- duo layout (text tools) ---------- */
.tool-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.tool-input, .tool-output { min-width: 0; }
.tool-output {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: clamp(16px, 3vw, 24px);
  background: var(--card);
}
.tool-output .field:last-child { margin-bottom: 0; }
@media (min-width: 1025px) {
  .tool-duo textarea { min-height: 280px; }
  .tool-duo .tool-output textarea { min-height: 320px; }
}
@media (max-width: 1024px) {
  .tool-duo { grid-template-columns: 1fr; }
}

/* ---------- QR generator: roomy layout + styling (Design v2.8, 2026-12-05)
   5-way benchmark: QRCode Monkey, The QR Code Generator, Bitly/QRCG,
   goqr.me, QRCodeChimp. Layout follows the "roomy" standard: ~1150px
   card, 35–45px padding, 48px inputs/buttons, preview ≥300px, steps
   1 Type / 2 Content / 3 Design / 4 Download, secondary controls folded
   into one-open-at-a-time accordions. All rules scoped to
   body.tool-qr-code-generator. */
@media (min-width: 1025px) {
  body.tool-qr-code-generator main .wrap:not(.narrow) { max-width: 1150px; }
  body.tool-qr-code-generator .wrap.narrow.tool-head { max-width: 1150px; }
}
body.tool-qr-code-generator .toolbox { padding: clamp(20px, 4vw, 40px); }
@media (min-width: 1025px) {
  .tool-studio-qr {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
    gap: 24px 40px;
    align-items: start;
  }
  .tool-studio-qr > .tabs { grid-column: 1 / -1; margin-bottom: 0; }
  .tool-studio-qr > #qr-step-type,
  .tool-studio-qr > #qr-single-panel,
  .tool-studio-qr > #qr-bulk-panel,
  .tool-studio-qr > .qr-code-options,
  .tool-studio-qr > #qr-design { grid-column: 1; min-width: 0; }
  .tool-studio-qr > #qr-single-actions,
  .tool-studio-qr > #qr-bulk-actions {
    grid-column: 2;
    grid-row: 2 / span 4;
    position: sticky;
    top: 84px;
  }
}
.tool-studio-qr > #qr-single-actions,
.tool-studio-qr > #qr-bulk-actions {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: clamp(16px, 3vw, 24px);
  background: var(--card);
  min-width: 0;
}
@media (min-width: 1025px) {
  .tool-studio-qr > #qr-single-actions,
  .tool-studio-qr > #qr-bulk-actions { min-height: 340px; }
}
#qr-single-actions:has(#qr-result:not([hidden])) .tool-stage-empty,
#qr-bulk-actions:has(#qr-bulk-grid:not(:empty)) .tool-stage-empty { display: none; }

/* Steps: numbered, one job each. */
.qr-step-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  margin: 4px 0 16px;
}
.qr-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tool-accent);
  color: #fff;
  font-size: .85rem;
  flex-shrink: 0;
  transform: translateY(3px);
}
.qr-step-hint { font-weight: 400; font-size: .85rem; color: var(--muted); }
#qr-design .qr-step-title { margin-top: 8px; }

/* Type picker: icon + label tiles, never icons alone. */
.qr-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.qr-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 64px;
  padding: 10px 6px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.qr-type-btn:hover { border-color: var(--tool-accent); }
.qr-type-btn.active {
  border-color: var(--tool-accent);
  background: var(--tool-tint);
  box-shadow: inset 0 0 0 1px var(--tool-accent);
}
.qr-type-icon { font-size: 1.35rem; line-height: 1; }

/* Content types, logo, SVG. Single-line inputs stay short; only real
   multi-line text gets a taller box. The payload preview shows the
   assembled text for structured types (Wi-Fi, vCard, event…) so people
   see exactly what a phone will read. */
#qr-text, #qr-email-body, #qr-sms-body { min-height: 64px; }
.qr-payload-preview {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
  word-break: break-all;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
body.tool-qr-code-generator .toolbox input[type="text"],
body.tool-qr-code-generator .toolbox input[type="datetime-local"],
body.tool-qr-code-generator .toolbox select { min-height: 48px; }
body.tool-qr-code-generator .toolbox input[type="color"] { min-height: 48px; width: 72px; padding: 4px; }
body.tool-qr-code-generator .toolbox input[type="range"] { width: 100%; accent-color: var(--tool-accent); min-height: 32px; }
body.tool-qr-code-generator .toolbox input[type="file"] { width: 100%; font-size: .9rem; }
#qr-logo-remove { margin-top: 8px; }
.qr-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  cursor: pointer;
  min-height: 36px;
}
.qr-check input { width: 20px; height: 20px; accent-color: var(--tool-accent); flex-shrink: 0; }
#qr-grad-to { margin-top: 8px; }

/* Design accordions: one open at a time (JS enforces it). */
.qr-fold {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: var(--card);
}
.qr-fold summary {
  cursor: pointer;
  font-weight: 700;
  font-size: .95rem;
  padding: 14px 16px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.qr-fold summary::-webkit-details-marker { display: none; }
.qr-fold summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--muted); flex-shrink: 0; }
.qr-fold[open] summary::after { content: "\2212"; }
.qr-fold-body { padding: 0 16px 16px; }
.qr-fold-body .field:last-child { margin-bottom: 0; }
.qr-contrast {
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
  border-radius: 8px;
  padding: 8px 10px;
}
.qr-palettes { display: flex; flex-wrap: wrap; gap: 8px; }
.qr-palette {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 6px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}
.qr-palette:hover { border-color: var(--tool-accent); }
.qr-palette span { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); }
.qr-palette span + span { margin-left: -10px; }

/* Preview + template strip. (This .qr-preview rule comes after the base
   one and overrides its margin-top and canvas width.) */
.qr-preview-row { display: flex; gap: 12px; align-items: flex-start; }
.qr-preview-wrap { flex: 1; min-width: 0; }
.qr-preview { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 0; }
.qr-preview canvas { width: 100%; max-width: 300px; height: auto; image-rendering: pixelated; }
.qr-preview .meta { font-size: .88rem; color: var(--muted); margin-top: 10px; overflow-wrap: break-word; }
.qr-templates { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; width: 64px; }
.qr-templates-title { font-size: .8rem; font-weight: 700; color: var(--muted); margin: 0; text-align: center; }
.qr-template {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 2px 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: .72rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.qr-template:hover, .qr-template.active { border-color: var(--tool-accent); }
.qr-template.active { background: var(--tool-tint); }
.qr-template-sw { width: 28px; height: 28px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .15); }

/* Download row: always visible, buttons 48px tall. */
.qr-download { margin-top: 20px; }
.qr-download-label { font-weight: 700; font-size: .92rem; margin: 0 0 8px; }
.qr-download-row { display: flex; flex-wrap: wrap; gap: 8px; }
.qr-download-row .btn { min-height: 48px; padding: 0 18px; }
#qr-single-actions .btn-row .btn { min-height: 48px; }
.qr-embed { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.qr-embed summary {
  cursor: pointer;
  font-weight: 700;
  font-size: .95rem;
  padding: 14px 16px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.qr-embed summary::-webkit-details-marker { display: none; }
.qr-embed summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--muted); }
.qr-embed[open] summary::after { content: "\2212"; }
#qr-embed-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; width: 100%; }

@media (max-width: 1024px) {
  .qr-preview-row { flex-direction: column; }
  .qr-templates { flex-direction: row; flex-wrap: wrap; width: auto; }
  .qr-templates-title { width: 100%; text-align: left; }
  .qr-template { flex-direction: row; padding: 6px 10px 6px 6px; }
  .qr-template-sw { width: 20px; height: 20px; }
}
@media (max-width: 640px) {
  /* Paired QR fields (first/last name, lat/lng, start/end) stack on phones */
  .tool-studio-qr .field-row { grid-template-columns: 1fr; }
  .qr-type-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}

/* ---------- Password generator: modes + roomy layout (Design v2.7, 2026-12-05)
   5-way benchmark: Bitwarden, 1Password, LastPass, Norton, Dashlane.
   Modes (Random / Passphrase / PIN), minimum numbers & symbols, local
   history. Layout follows the "roomy" standard set by the QR benchmarks:
   ~1150px card, 35–45px padding, 48px inputs/buttons, big output, the
   result first and secondary options folded away. All rules scoped to
   body.tool-password-generator. */
@media (min-width: 1025px) {
  body.tool-password-generator main .wrap:not(.narrow) { max-width: 1150px; }
  body.tool-password-generator .wrap.narrow.tool-head { max-width: 1150px; }
  body.tool-password-generator .tool-studio {
    grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
    gap: 24px 40px;
  }
}
body.tool-password-generator .toolbox { padding: clamp(20px, 4vw, 40px); }
body.tool-password-generator .tool-studio > .tabs { grid-column: 1 / -1; margin-bottom: 0; }
body.tool-password-generator .tabs button.active {
  background: var(--tool-accent);
  border-color: var(--tool-accent);
}
body.tool-password-generator .toolbox input[type="text"],
body.tool-password-generator .toolbox input[type="number"],
body.tool-password-generator .toolbox select { min-height: 48px; }
body.tool-password-generator .tool-stage { padding: clamp(20px, 3vw, 32px); }
body.tool-password-generator .tool-side .control { margin-bottom: 20px; }
body.tool-password-generator .tool-side .check-row { margin: 4px 0 20px; }
body.tool-password-generator .toolbox .field { margin-bottom: 20px; }
body.tool-password-generator #pw-output {
  min-height: 64px;
  font-size: 1.25rem;
  padding: 12px 16px;
}
body.tool-password-generator .strength-track { height: 12px; margin: 12px 0 6px; }
body.tool-password-generator .pw-batch-row { gap: 12px; margin-bottom: 12px; }
body.tool-password-generator .pw-batch-row input { min-height: 48px; }
body.tool-password-generator .pw-history-tag {
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
body.tool-password-generator .pw-history-keep {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  margin: 4px 0 12px;
  cursor: pointer;
}
body.tool-password-generator .pw-history-keep input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
/* Minimum counts live in a closed-by-default disclosure: most people
   never need them, and the ones who do know where to look. */
body.tool-password-generator .pw-details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-top: 4px;
  background: var(--card);
}
body.tool-password-generator .pw-details summary {
  cursor: pointer;
  font-weight: 700;
  font-size: .95rem;
  padding: 14px 16px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
body.tool-password-generator .pw-details summary::-webkit-details-marker { display: none; }
body.tool-password-generator .pw-details summary::after {
  content: "+";
  font-size: 1.3rem;
  line-height: 1;
  color: var(--muted);
  flex-shrink: 0;
}
body.tool-password-generator .pw-details[open] summary::after { content: "\2212"; }
body.tool-password-generator .pw-details .pw-min-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px;
}
body.tool-password-generator .pw-details .note { padding: 0 16px 14px; }
body.tool-password-generator .pw-details .control { margin-bottom: 0; }
@media (max-width: 640px) {
  body.tool-password-generator .pw-details .pw-min-grid { grid-template-columns: 1fr; }
}

/* ---------- timestamp: empty state hides once a result exists ---------- */
.tool-stage:has(#ts-output:not(:empty)) .tool-stage-empty,
.tool-stage:has(#ts-batch-results:not(:empty)) .tool-stage-empty { display: none; }

/* ---------- colour picker: preview stage ---------- */
body.tool-color-picker .tool-stage .color-preview { margin: 0 0 8px; }
body.tool-color-picker .tool-stage h3 { margin-top: 0; }

/* ---------- Color Picker upgrade (Design v2.15, 2026-12-05)
   5-way benchmark: Coolors, Adobe Color, html-color-codes.info, Paletton,
   WebAIM Contrast Checker (Color Hunt noted: curated palettes only, no
   converter). Layout follows the "roomy" standard: ~1150px card, 35–45px
   padding, 48px inputs/buttons, numbered steps 1 Pick / 2 Harmony /
   3 Contrast / 4 Colour-blind / 5 CSS variables. New on the page:
   WCAG contrast checker (AA/AAA + UI 3:1, live sample), colour-blind
   simulation (protan/deutan/tritan/achromatopsia, Machado matrices),
   6 harmony rules, HSV + CMYK (folded), 148 CSS named colours,
   CSS-variables export. All rules scoped to body.tool-color-picker. */
@media (min-width: 1025px) {
  body.tool-color-picker main .wrap:not(.narrow) { max-width: 1150px; }
  body.tool-color-picker .wrap.narrow.tool-head { max-width: 1150px; }
  body.tool-color-picker .tool-studio { grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); gap: 28px; }
}
body.tool-color-picker .toolbox { padding: clamp(20px, 4vw, 40px); }
body.tool-color-picker .tool-side .btn-row .btn { min-height: 48px; }
body.tool-color-picker .tool-stage .color-preview { padding: 48px 16px; font-size: 1.4rem; }
body.tool-color-picker .tool-stage { padding: clamp(20px, 3vw, 32px); }

/* Numbered steps, same pattern as the QR / timestamp / word tools. */
.cp-step-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 800;
  font-size: 1.05rem;
  margin: 28px 0 16px;
}
.cp-step-title:first-child { margin-top: 0; }
.cp-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tool-accent);
  color: #fff;
  font-size: .85rem;
  flex-shrink: 0;
  transform: translateY(3px);
}
.cp-step-hint { font-weight: 400; font-size: .85rem; color: var(--muted); }
body.tool-color-picker .tool-side .cp-step-title { margin-top: 0; }

/* Named-colour readout under the preview. */
.cp-named { margin: 0 0 4px; font-size: .92rem; }

/* Harmony rule chips. */
.cp-rules { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cp-rule-btn {
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font-size: .92rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.cp-rule-btn:hover { background: var(--soft); }
.cp-rule-btn.active { background: var(--tool-accent); border-color: var(--tool-accent); color: #fff; }

/* More formats fold (HSV / CMYK). */
.cp-more { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.cp-more summary {
  cursor: pointer;
  font-weight: 700;
  font-size: .95rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.cp-more summary:hover { color: var(--tool-accent); }
.cp-more .field { margin-top: 12px; }

/* Contrast checker. */
.cp-contrast { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px 20px; }
.cp-contrast-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.cp-contrast-row .btn { min-height: 44px; }
.cp-bg-presets { font-size: .9rem; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cp-bg-presets button {
  min-height: 36px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font-size: .85rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.cp-bg-presets button:hover { background: var(--soft); }
.cp-ratio { font-size: 2rem; line-height: 1.2; font-weight: 800; color: var(--ink-strong); margin: 16px 0 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cp-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cp-badge { font-size: .85rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.cp-badge.pass { background: #dcfce7; color: #166534; }
.cp-badge.fail { background: #fee2e2; color: #991b1b; }
.cp-sample { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 18px 20px; }
.cp-sample p { margin: 0 0 8px; }
.cp-sample p:last-child { margin-bottom: 0; }
.cp-sample-normal { font-size: 1rem; }
.cp-sample-large { font-size: 1.5rem; font-weight: 700; }
.cp-verdict { font-size: .95rem; margin: 12px 0 0; }

/* Colour-blind simulation swatches: same grid, taller blocks. */
.cp-cb-grid .swatch { padding: 22px 6px; cursor: pointer; }

/* CSS variables export. */
#cp-vars {
  width: 100%;
  min-height: 200px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88rem;
  line-height: 1.6;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  resize: vertical;
}
body.tool-color-picker .tool-stage .btn-row .btn { min-height: 48px; }

@media (max-width: 640px) {
  body.tool-color-picker .tool-stage .color-preview { padding: 36px 12px; font-size: 1.15rem; }
  .cp-ratio { font-size: 1.6rem; }
  .cp-sample-large { font-size: 1.25rem; }
}

/* The base .tool-output sets word-break: break-all for JSON text — prose
   labels here must wrap at word boundaries, not mid-word ("Characters (n /
   o spaces)", "Flesch–Kinc aid" at 390px). */
body.tool-word-counter .tool-output { word-break: normal; overflow-wrap: break-word; }
body.tool-word-counter .tool-output .stat .lbl { font-size: .78rem; }

/* ---------- Word Counter upgrade (Design v2.14, 2026-12-05)
   5-way benchmark: WordCounter.net, wordcounter.io,
   charactercountonline.com, wordcounttool.com, thewordcounter.com.
   Layout follows the "roomy" standard: ~1150px card, 35–45px padding,
   48px inputs/buttons, big input area, numbered steps 1 Paste / 2 See.
   New on the page: keyword density % with bars, readability in plain
   words, syllables / unique words / averages, word goal with progress,
   .txt/.md upload, browser-only autosave. All rules scoped to
   body.tool-word-counter. */
@media (min-width: 1025px) {
  body.tool-word-counter main .wrap:not(.narrow) { max-width: 1150px; }
  body.tool-word-counter .wrap.narrow.tool-head { max-width: 1150px; }
  body.tool-word-counter .tool-duo { gap: 24px 40px; }
  body.tool-word-counter .tool-duo textarea { min-height: 400px; }
}
body.tool-word-counter .toolbox { padding: clamp(20px, 4vw, 40px); }
body.tool-word-counter .toolbox .btn-row .btn { min-height: 48px; }
body.tool-word-counter .tool-duo textarea {
  font-size: 1rem;
  line-height: 1.6;
}

/* Numbered steps, same pattern as the QR / timestamp tools. */
.wc-step-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 800;
  font-size: 1.05rem;
  margin: 12px 0 16px;
}
.wc-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tool-accent);
  color: #fff;
  font-size: .85rem;
  flex-shrink: 0;
  transform: translateY(3px);
}
.wc-step-hint { font-weight: 400; font-size: .85rem; color: var(--muted); }

/* Upload button is a <label> for the hidden file input. */
.wc-upload-btn { cursor: pointer; }
.wc-file-note { font-size: .9rem; color: var(--tool-accent); margin: 10px 0 0; min-height: 1.2em; }
.wc-file-note:empty { display: none; }

/* Word goal panel: presets + custom target + progress bar. */
.wc-goal {
  background: var(--tool-tint);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-top: 20px;
}
.wc-goal-title { font-weight: 800; font-size: 1.05rem; margin: 0 0 12px; }
.wc-goal-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.wc-chip {
  min-height: 44px;
  min-width: 64px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
}
.wc-chip:hover { background: var(--soft); }
.wc-chip.active {
  background: var(--tool-accent);
  border-color: var(--tool-accent);
  color: #fff;
}
.wc-goal-custom { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.wc-goal-custom label { font-size: .9rem; color: var(--muted); }
.wc-goal-custom input[type="number"] {
  min-height: 48px;
  width: 140px;
  font-size: 1rem;
}
.wc-goal-bar {
  height: 10px;
  background: var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 16px;
}
.wc-goal-fill {
  height: 100%;
  width: 0%;
  background: var(--tool-accent);
  border-radius: 999px;
  transition: width .25s ease;
}
.wc-goal-status { font-size: .92rem; color: var(--muted); margin: 10px 0 0; }
.wc-goal-clear { min-height: 44px; }

/* Readability card: the number, then the plain-language answer. */
.wc-readability {
  background: var(--tool-tint);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-top: 20px;
}
.wc-readability-title { font-weight: 800; font-size: 1.05rem; margin: 0 0 8px; }
.wc-readability-score { font-size: 1.6rem; line-height: 1.25; font-weight: 800; color: var(--tool-accent); margin: 0; }
.wc-readability-max { font-size: 1rem; font-weight: 400; color: var(--muted); }
.wc-readability-label { font-size: .98rem; margin: 6px 0 0; }
.wc-readability-grade { font-size: .88rem; color: var(--muted); margin: 4px 0 0; }

/* Keyword density: word + count + %, with a bar under each row. */
.wc-keywords-hint { font-size: .88rem; color: var(--muted); margin: -8px 0 0; }
.kw-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.kw-word { font-weight: 700; }
.kw-pct { font-weight: 800; color: var(--tool-accent); white-space: nowrap; }
.kw-bar { height: 6px; background: var(--line-strong); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.kw-fill { height: 100%; background: var(--tool-accent); border-radius: 999px; }

/* ---------- JSON formatter: tree view, repair, sort, converters (Design v2.10, 2026-12-05)
   5-way benchmark: JSONLint, jsonformatter.org, JSON Editor Online,
   CodeBeautify, CuriousConcept. Layout follows the "roomy" standard:
   ~1150px card, 35–45px padding, 48px inputs/buttons, big input/output
   areas, numbered steps 1 Paste / 2 View & download, secondary tools
   (sort, upload, indent) folded into one disclosure. Tree view is the
   headline: collapsible nodes, type colours, expand/collapse all. All
   rules scoped to body.tool-json-formatter. */
@media (min-width: 1025px) {
  body.tool-json-formatter main .wrap:not(.narrow) { max-width: 1150px; }
  body.tool-json-formatter .wrap.narrow.tool-head { max-width: 1150px; }
  body.tool-json-formatter .tool-duo { gap: 24px 40px; }
  body.tool-json-formatter .tool-duo textarea { min-height: 360px; }
  body.tool-json-formatter .tool-duo .tool-output textarea { min-height: 400px; }
}
body.tool-json-formatter .toolbox { padding: clamp(20px, 4vw, 40px); }
body.tool-json-formatter .toolbox input[type="text"],
body.tool-json-formatter .toolbox select { min-height: 48px; }
body.tool-json-formatter .toolbox .field { margin-bottom: 20px; }
body.tool-json-formatter .tool-input textarea,
body.tool-json-formatter .tool-output textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .95rem;
  line-height: 1.55;
}

/* Steps: numbered, one job each (same language as the QR steps). */
.json-step {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  margin: 4px 0 16px;
}
.json-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tool-accent);
  color: #fff;
  font-size: .85rem;
  flex-shrink: 0;
  transform: translateY(3px);
}
.json-step-hint { font-weight: 400; font-size: .85rem; color: var(--muted); }
.json-step-label { min-width: 0; }

/* The base .tool-output sets word-break: break-all for JSON text — prose
   inside this column (step titles, notes) must wrap on word boundaries. */
body.tool-json-formatter .tool-output .json-step,
body.tool-json-formatter .tool-output .json-view-tabs,
body.tool-json-formatter .tool-output .note { word-break: normal; overflow-wrap: break-word; }

/* "More tools" disclosure: sort, upload, indent — closed by default. */
.json-fold {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-top: 20px;
  background: var(--card);
}
.json-fold summary {
  cursor: pointer;
  font-weight: 700;
  font-size: .95rem;
  padding: 14px 16px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.json-fold summary::-webkit-details-marker { display: none; }
.json-fold summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--muted); flex-shrink: 0; }
.json-fold[open] summary::after { content: "\2212"; }
.json-fold-body { padding: 0 16px 16px; }
.json-fold-body .btn-row { margin-top: 0; }
.json-fold-body .field { margin-bottom: 0; }
.json-fold-body .field .note { margin-top: 6px; }
.json-upload-label { margin: 0; }

/* Success / fix feedback: green note next to the red error box. */
.json-note {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 16px;
  overflow-wrap: break-word;
}
.json-note[hidden] { display: none; }

/* Result view tabs: Text / Tree. */
.json-view-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.json-view-tab {
  min-height: 44px;
  padding: 10px 20px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.json-view-tab:hover { border-color: var(--tool-accent); }
.json-view-tab.active {
  background: var(--tool-accent);
  border-color: var(--tool-accent);
  color: #fff;
}
.json-tree-actions { display: inline-flex; gap: 8px; margin-left: auto; }
.json-mini-btn {
  min-height: 36px;
  padding: 6px 12px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font: inherit;
  font-size: .85rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.json-mini-btn:hover { border-color: var(--tool-accent); }

/* Tree view: collapsible nodes, type colours, generous row height. */
.json-tree {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92rem;
  line-height: 1.7;
  min-height: 400px;
  max-height: 560px;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}
.json-tree[hidden] { display: none; }
.json-tree-node { min-width: 0; }
.json-tree-children { margin-left: 22px; }
.json-tree-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-height: 30px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.json-tree-toggle {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  font-size: .85rem;
  line-height: 22px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
}
.json-tree-toggle:hover { background: var(--soft); color: var(--ink); }
.json-tree-toggle:disabled { cursor: default; }
.json-tree-toggle:disabled:hover { background: none; }
.json-tree-spacer { visibility: hidden; }
.json-tree-key { color: var(--ink); font-weight: 700; flex-shrink: 0; }
.json-tree-brace { color: var(--muted); }
.json-tree-count { color: var(--muted); font-size: .85rem; }
.json-tree-string { color: #15803d; }
.json-tree-number { color: #b45309; }
.json-tree-bool { color: #7c3aed; }
.json-tree-null { color: #6b7280; font-style: italic; }
.json-tree-note {
  color: var(--muted);
  font-size: .9rem;
  font-family: inherit;
  padding: 24px 8px;
  text-align: center;
}

/* Convert row sits under the copy/download row, visually grouped. */
body.tool-json-formatter .json-convert { margin-top: 20px; }
body.tool-json-formatter .json-convert .note { margin-top: 6px; }

@media (max-width: 1024px) {
  .json-tree { min-height: 320px; }
}
@media (max-width: 640px) {
  .json-tree-actions { margin-left: 0; }
  .json-view-tab { padding: 10px 16px; }
}

/* ---------- Image Compressor: AVIF + PNG8 + roomy studio (Design v2.11, 2026-12-05)
   5-way benchmark: TinyPNG, Squoosh, iLoveIMG, compressor.io,
   imagecompressor.com. Layout follows the "roomy" standard: ~1150px card,
   35–45px padding, 48px inputs/buttons, big dropzone, numbered steps
   1 Add / 2 Settings / 3 Check & download, resize + PNG colours folded
   into one disclosure. All rules scoped to body.tool-image-compressor. */
@media (min-width: 1025px) {
  body.tool-image-compressor main .wrap:not(.narrow) { max-width: 1150px; }
  body.tool-image-compressor .wrap.narrow.tool-head { max-width: 1150px; }
  body.tool-image-compressor .tool-studio { grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); gap: 28px; }
  body.tool-image-compressor .tool-stage { min-height: 440px; }
}
body.tool-image-compressor .toolbox { padding: clamp(20px, 4vw, 40px); }
body.tool-image-compressor .tool-side .dropzone { min-height: 260px; }
body.tool-image-compressor .toolbox input[type="number"],
body.tool-image-compressor .toolbox select { min-height: 48px; }
body.tool-image-compressor .tool-side .control input[type="range"] { accent-color: var(--tool-accent); }

/* Steps: numbered, one job each (same language as the QR/JSON steps). */
.img-step {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  margin: 4px 0 16px;
}
.img-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tool-accent);
  color: #fff;
  font-size: .85rem;
  flex-shrink: 0;
  transform: translateY(3px);
}
.img-step-hint { font-weight: 400; font-size: .85rem; color: var(--muted); }
.img-step-label { min-width: 0; }
.tool-stage .img-step { margin-bottom: 12px; }

/* "More settings" disclosure: resize + PNG colours — closed by default. */
.img-fold {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-top: 20px;
  background: var(--card);
}
.img-fold summary {
  cursor: pointer;
  font-weight: 700;
  font-size: .95rem;
  padding: 14px 16px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.img-fold summary::-webkit-details-marker { display: none; }
.img-fold summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--muted); flex-shrink: 0; }
.img-fold[open] summary::after { content: "\2212"; }
.img-fold-hint { font-weight: 400; font-size: .85rem; color: var(--muted); }
.img-fold-body { padding: 0 16px 16px; }
.img-fold-body .control { margin-top: 16px; }
.img-fold-body .control:first-child { margin-top: 0; }
.img-fold-body .control .note { margin-top: 6px; }

/* Quick size chips under the max-width field. */
.img-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.img-chip {
  min-height: 44px;
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font: inherit;
  font-size: .88rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.img-chip:hover { border-color: var(--tool-accent); color: var(--tool-accent); }

/* Batch total-saved line, above the queue list. */
.img-batch-summary {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 12px 0 0;
  font-size: .95rem;
}
.img-batch-summary[hidden] { display: none; }

/* Roomier result stats on the preview stage. */
body.tool-image-compressor .tool-stage .stats { gap: 14px; }
body.tool-image-compressor .tool-stage .compare { gap: 20px; }

/* The results table is four columns wide — on a phone it scrolls
   sideways instead of clipping its last column. */
@media (max-width: 640px) {
  body.tool-image-compressor .guide table { display: block; overflow-x: auto; }
}

/* ---------- PDF to JPG / JPG to PDF: extract + range + PNG + rotate (Design v2.12, 2026-12-05)
   5-way benchmark: iLovePDF, Smallpdf, CloudConvert, Sejda, pdf2jpg.net.
   Layout follows the "roomy" standard: ~1150px card, 35–45px padding,
   48px inputs/buttons, big dropzone, numbered steps 1 Add / 2 Choose /
   3 Check & download. All rules scoped to body.tool-pdf-to-jpg. */
@media (min-width: 1025px) {
  body.tool-pdf-to-jpg main .wrap:not(.narrow) { max-width: 1150px; }
  body.tool-pdf-to-jpg .wrap.narrow.tool-head { max-width: 1150px; }
  body.tool-pdf-to-jpg .tool-studio { grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); gap: 28px; }
  body.tool-pdf-to-jpg .tool-stage { min-height: 440px; }
}
body.tool-pdf-to-jpg .toolbox { padding: clamp(20px, 4vw, 40px); }
body.tool-pdf-to-jpg .tool-side .dropzone { min-height: 220px; }
body.tool-pdf-to-jpg .toolbox select { min-height: 48px; }

/* Steps: numbered, one job each (same language as the image/QR/JSON steps). */
.pdf-step {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  margin: 4px 0 16px;
}
.pdf-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tool-accent);
  color: #fff;
  font-size: .85rem;
  flex-shrink: 0;
  transform: translateY(3px);
}
.pdf-step-hint { font-weight: 400; font-size: .85rem; color: var(--muted); }
.pdf-step-label { min-width: 0; }
.tool-stage .pdf-step { margin-bottom: 12px; }

/* Mode picker: two pills, one choice (Render pages / Extract images). */
.pdf-mode { display: flex; gap: 8px; flex-wrap: wrap; }
.control label.pdf-mode-opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 48px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  margin-bottom: 0;
}
.pdf-mode-opt input { width: 18px; height: 18px; accent-color: var(--tool-accent); flex-shrink: 0; margin: 0; }
.pdf-mode-opt:has(input:checked) { border-color: var(--tool-accent); box-shadow: inset 0 0 0 1px var(--tool-accent); color: var(--tool-accent); }

/* Headings that are not <label> elements (radiogroup heading). */
.control-label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 6px; }

/* Merge checkbox row. */
.control label.pdf-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 0;
}
.pdf-check input { width: 20px; height: 20px; accent-color: var(--tool-accent); flex-shrink: 0; margin: 0; }

/* Page-range text input: same 48px treatment as the selects. */
body.tool-pdf-to-jpg .control input[type="text"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font: inherit;
  font-size: .95rem;
  background: var(--card);
  color: var(--ink);
  box-sizing: border-box;
}
body.tool-pdf-to-jpg .control input[type="text"]:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }

/* JPG→PDF file list: thumbnail + label + buttons in one row. */
#j2p-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#j2p-list .j2p-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  flex-shrink: 0;
  background: var(--soft);
}
#j2p-list .j2p-label { flex: 1 1 160px; min-width: 0; }
#j2p-list .mini { margin-left: 0; }

/* ---------- Timestamp Converter: precision + named timezones + roomy layout (Design v2.13, 2026-12-05)
   5-way benchmark: EpochConverter, Unixtimestamp.com, timestamp.online,
   currentmillis.com (plus the earlier report's EpochConverter /
   Unixtimestamp notes). Layout follows the "roomy" standard: ~1150px
   card, 35–45px padding, 48px inputs/buttons, numbered steps
   1 Timestamp → date / 2 Date → timestamp / 3 ISO 8601 → timestamp,
   batch folded into a <details>. All rules scoped to
   body.tool-timestamp-converter. */
@media (min-width: 1025px) {
  body.tool-timestamp-converter main .wrap:not(.narrow) { max-width: 1150px; }
  body.tool-timestamp-converter .wrap.narrow.tool-head { max-width: 1150px; }
  body.tool-timestamp-converter .tool-studio {
    grid-template-columns: minmax(340px, 400px) minmax(0, 1fr);
    gap: 24px 40px;
  }
}
body.tool-timestamp-converter .toolbox { padding: clamp(20px, 4vw, 40px); }

/* 48px controls: big timestamp input full width, unit + timezone side by side. */
body.tool-timestamp-converter .toolbox input[type="text"],
body.tool-timestamp-converter .toolbox input[type="datetime-local"],
body.tool-timestamp-converter .toolbox select {
  min-height: 48px;
  font-size: 1rem;
}
body.tool-timestamp-converter .ts-controls {
  grid-template-columns: 1fr 1fr;
  margin-top: 0;
}
body.tool-timestamp-converter .ts-controls .control:first-child { grid-column: 1 / -1; }
body.tool-timestamp-converter .toolbox .btn-row .btn { min-height: 48px; }
#ts-detected { color: var(--tool-accent); font-weight: 700; }

/* Numbered steps, same pattern as the QR tool. */
.ts-step-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 800;
  font-size: 1.05rem;
  margin: 24px 0 16px;
}
.ts-step-title:first-of-type { margin-top: 12px; }
.ts-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tool-accent);
  color: #fff;
  font-size: .85rem;
  flex-shrink: 0;
  transform: translateY(3px);
}
.ts-step-hint { font-weight: 400; font-size: .85rem; color: var(--muted); }

/* Relative-time hero: the human answer first, the exact UTC string under it. */
.ts-hero {
  background: var(--tool-tint);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.ts-hero-rel {
  font-size: 1.6rem;
  line-height: 1.25;
  font-weight: 800;
  color: var(--tool-accent);
}
.ts-hero-sub { font-size: .95rem; color: var(--muted); margin-top: 4px; }

/* Result rows get a little more air on this tool, and values break at
   spaces first (no mid-number splits like "UTC+00:0 / 0"). */
body.tool-timestamp-converter .kv-row { padding: 12px 16px; }
body.tool-timestamp-converter .kv-val { word-break: normal; }

/* Batch lives in a foldable <details> so the single converter stays the focus. */
.ts-batch { margin-top: 0; }
.ts-batch summary {
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  padding: 4px 0;
  list-style-position: inside;
}
.ts-batch summary::marker { color: var(--tool-accent); }
.ts-batch summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

@media (max-width: 640px) {
  body.tool-timestamp-converter .ts-controls { grid-template-columns: 1fr; }
  body.tool-timestamp-converter .ts-controls .control:first-child { grid-column: auto; }
  .ts-hero-rel { font-size: 1.35rem; }
}

/* ---------- Case Converter upgrade (Design v2.16, 2026-12-05)
   5-way benchmark: ConvertCase.net, TitleCaseConverter.com,
   CapitalizeMyTitle.com, StarlightTools.org, MultiToolsPoint.
   Layout follows the "roomy" standard: ~1150px card, 35–45px padding,
   48px inputs/buttons, big input/output areas, numbered steps
   1 Paste / 2 Pick a case / 3 Copy or download, grouped case buttons
   (Writing / Code & web) with a live example underneath, file upload
   next to step 1. New on the page: style-guide Title Case
   (AP/Chicago/APA/MLA) with a per-style note, Inverse / dot.case /
   SCREAMING_SNAKE_CASE / Slugify, live counts on both sides, .txt/.md
   upload, .txt download, "use result as input" chaining, keyboard
   shortcuts, acronym/brand preservation. All rules scoped to
   body.tool-case-converter. */
@media (min-width: 1025px) {
  body.tool-case-converter main .wrap:not(.narrow) { max-width: 1150px; }
  body.tool-case-converter .wrap.narrow.tool-head { max-width: 1150px; }
  body.tool-case-converter .tool-duo { gap: 24px 40px; }
  body.tool-case-converter .tool-duo textarea { min-height: 400px; }
}
body.tool-case-converter .toolbox { padding: clamp(20px, 4vw, 40px); }
body.tool-case-converter .toolbox .btn-row .btn { min-height: 48px; }
body.tool-case-converter .toolbox select { min-height: 48px; }
body.tool-case-converter .tool-duo textarea {
  font-size: 1rem;
  line-height: 1.6;
}

/* The base .tool-output sets monospace + word-break: break-all — prose
   inside this column (the step 3 title) must use the normal font and
   wrap on word boundaries, same fix as the word counter and JSON tools. */
body.tool-case-converter .tool-output { word-break: normal; overflow-wrap: break-word; }
body.tool-case-converter .tool-output .cc-step-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Numbered steps, same pattern as the QR / JSON / word tools. */
.cc-step-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 800;
  font-size: 1.05rem;
  margin: 4px 0 16px;
}
.cc-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tool-accent);
  color: #fff;
  font-size: .85rem;
  flex-shrink: 0;
  transform: translateY(3px);
}
.cc-step-hint { font-weight: 400; font-size: .85rem; color: var(--muted); }

/* Case groups: a small label over each row of buttons. */
.cc-group-label {
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 20px 0 10px;
}

/* The active case button reads as selected. */
body.tool-case-converter .toolbox .btn.secondary.active {
  border-color: var(--tool-accent);
  color: var(--tool-accent);
  background: var(--tool-tint);
}

/* Title Case style picker: label, select, one-line rule note. */
.cc-style-field select { width: 100%; max-width: 380px; }
.cc-style-note { font-size: .9rem; color: var(--muted); margin: 8px 0 0; }

/* Live example: the same sample phrase through the chosen case. */
.cc-example {
  background: var(--tool-tint);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 16px 0 0;
  font-size: .95rem;
  overflow-wrap: break-word;
}
.cc-example:empty { display: none; }

/* Live counts under the input, upload button + note, shortcuts line. */
.cc-input-stats { font-size: .9rem; color: var(--muted); margin: 8px 0 0; min-height: 1.2em; }
.cc-input-stats:empty { display: none; }
.cc-upload-row { margin-top: 12px; }
.cc-upload-btn { cursor: pointer; }
.cc-file-note { font-size: .9rem; color: var(--tool-accent); margin: 10px 0 0; min-height: 1.2em; }
.cc-file-note:empty { display: none; }
.cc-shortcuts { margin-top: 12px; }

/* ---------- Base64: decode-to-file + templates + wrap + repair (Design v2.17, 2026-12-05)
   5-way benchmark: base64encode.org, base64.guru, base64decode.org,
   base64encode.com, cryptii.com. Layout follows the "roomy" standard:
   ~1150px card, 35–45px padding, 48px inputs/buttons, duo gap 40px,
   textareas 400px, numbered steps 1 Input / 2 Result / 3 Decode to file /
   4 Encode a file / 5 Encode several files. New on the page: decode
   Base64 back to a file (type detected from magic bytes, image preview),
   Data-URI / CSS / HTML snippet templates, 76-character MIME wrap,
   per-line encode/decode, and validate-and-repair decoding that explains
   what was wrong. All rules scoped to body.tool-base64. */
@media (min-width: 1025px) {
  body.tool-base64 main .wrap:not(.narrow) { max-width: 1150px; }
  body.tool-base64 .wrap.narrow.tool-head { max-width: 1150px; }
  body.tool-base64 .tool-duo { gap: 24px 40px; }
  body.tool-base64 .tool-duo textarea { min-height: 400px; }
}
body.tool-base64 .toolbox { padding: clamp(20px, 4vw, 40px); }
body.tool-base64 .toolbox .btn-row .btn { min-height: 48px; }
body.tool-base64 .toolbox select,
body.tool-base64 .toolbox input[type="text"] { min-height: 48px; }
body.tool-base64 .tool-duo textarea { font-size: 1rem; line-height: 1.6; }

/* The base .tool-output sets monospace + word-break: break-all — prose
   inside this column (the step 2 title, the stats line) must use the
   normal font and wrap on word boundaries, same fix as the case
   converter. The result textarea itself stays monospace. */
body.tool-base64 .tool-output { word-break: normal; overflow-wrap: break-word; }
body.tool-base64 .tool-output .b64-step-title { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

/* Numbered steps, same pattern as the QR / JSON / word / case tools. */
.b64-step-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 800;
  font-size: 1.05rem;
  margin: 4px 0 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.b64-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tool-accent);
  color: #fff;
  font-size: .85rem;
  flex-shrink: 0;
  transform: translateY(3px);
}
.b64-step-hint { font-weight: 400; font-size: .85rem; color: var(--muted); }

/* Diagnosis box: what the decoder found (and fixed) in the pasted string.
   Tint background when it decoded fine; red when it could not. */
.b64-diagnosis {
  background: var(--tool-tint);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 16px;
  font-size: .92rem;
  overflow-wrap: break-word;
}
.b64-diagnosis.bad { background: #fef2f2; border-color: #fecaca; }
.b64-diagnosis ul { margin: 6px 0 0; padding-left: 20px; }
.b64-diagnosis li { margin: 2px 0; }

/* Stats line under the result, file status under step 3. */
.b64-stats { font-size: .9rem; color: var(--muted); margin: 10px 0 0; min-height: 1.2em; }
.b64-stats:empty { display: none; }
.b64-file-status { font-size: .92rem; color: var(--muted); margin: 10px 0 0; min-height: 1.2em; }
.b64-file-status:empty { display: none; }

/* Snippet templates: a divider, then format + content-type side by side. */
.b64-templates { border-top: 1px dashed var(--line-strong); margin-top: 20px; padding-top: 20px; }
.b64-template-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .b64-template-row { grid-template-columns: 1fr; } }
body.tool-base64 .tool-output #b64-snippet { min-height: 110px; font-size: .85rem; }

/* Full-width sections below the duo (steps 3–5). */
.b64-wide { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 24px; }
.b64-wide .field input[type="text"] { width: 100%; max-width: 420px; }

/* Decoded-image preview: checkerboard so transparency reads honestly. */
.b64-preview { margin-top: 16px; }
.b64-preview img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  width: auto;
  height: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e5e5e5 25%, transparent 25%),
    linear-gradient(-45deg, #e5e5e5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e5e5 75%),
    linear-gradient(-45deg, transparent 75%, #e5e5e5 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.b64-preview-cap { font-size: .9rem; color: var(--muted); margin: 8px 0 0; }

/* ---------- Design v2.19 — one-screen tightening (2026-12-05)
   Goal: the whole work area (breadcrumb + tool head + toolbox) fits in
   one viewport on desktop (1920x1080, and 1440x900 where the tool's
   content allows it), so nobody has to scroll to use a tool. Guides,
   FAQ and share bars below the work area still scroll — they are
   content, not work.
   Means: tighter internal spacing, a shorter tool head, secondary
   controls folded (QR design colours, timestamp batch, colour-blind
   preview, CSS variables, Base64 templates), and a few two-column
   reflows. Type never goes below its current size and touch targets
   never go below 44px; no JS was touched. Per-page results are
   measured, not assumed — see the v2.19 verification notes. */

/* Shared fold styling for the new <details> folds (all widths). */
.b64-fold, .cp-fold { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); }
.b64-fold summary, .cp-fold summary {
  cursor: pointer; font-weight: 700; font-size: .95rem; padding: 12px 16px;
  list-style: none; display: flex; align-items: center; gap: 10px;
}
.b64-fold summary::-webkit-details-marker, .cp-fold summary::-webkit-details-marker { display: none; }
.b64-fold summary::after, .cp-fold summary::after {
  content: "+"; font-size: 1.3rem; line-height: 1; color: var(--muted); margin-left: auto; flex-shrink: 0;
}
.b64-fold[open] summary::after, .cp-fold[open] summary::after { content: "\2212"; }
.b64-fold { margin-top: 20px; }
.b64-fold .b64-templates { margin: 0; padding: 0 16px 16px; border-top: 0; }
.cp-fold { margin: 14px 0; }
.cp-fold .cp-fold-body { padding: 0 16px 16px; }
.cp-fold .cp-fold-body .swatch-grid { margin-top: 0; }

@media (min-width: 1025px) {
  /* --- page chrome above the work area --- */
  body[class^="tool-"] .breadcrumb { margin-top: 10px; }
  body[class^="tool-"] .tool-head-text h1 { font-size: 2rem; line-height: 1.25; margin-bottom: .25rem; }
  body[class^="tool-"] .tool-emblem { width: 56px; height: 56px; font-size: 1.7rem; }

  /* --- work card: less padding, tighter margins --- */
  body[class^="tool-"] .toolbox { padding: clamp(16px, 3vw, 24px); margin: 1rem 0; }
  body[class^="tool-"] .tool-studio, body[class^="tool-"] .tool-duo { gap: 20px; }
  body[class^="tool-"] .toolbox .field { margin-bottom: 12px; }
  body[class^="tool-"] .toolbox label { margin-bottom: 4px; }
  body[class^="tool-"] .toolbox .field-row { gap: 10px; }
  body[class^="tool-"] .btn-row { margin-top: 14px; gap: 10px; }
  body[class^="tool-"] .toolbox .check-row { margin: 4px 0 10px; }
  body[class^="tool-"] .tool-stage, body[class^="tool-"] .tool-output { padding: 20px; }
  body[class^="tool-"] .tool-stage { min-height: 280px; }
  body[class^="tool-"] .tool-stage-empty { padding: 36px 16px; }
  body[class^="tool-"] .tool-side .dropzone { min-height: 180px; }
  body[class^="tool-"] .dropzone { padding: clamp(20px, 4vw, 28px) 20px; }
  body[class^="tool-"] .tool-duo textarea { min-height: 240px; }
  body[class^="tool-"] .tool-duo .tool-output textarea { min-height: 280px; }

  /* --- step titles: less air around them --- */
  .qr-step-title, .ts-step-title, .cp-step-title, .cc-step-title, .b64-step-title,
  .json-step, .img-step, .pdf-step, .wc-step-title { margin-bottom: 10px; }
  .ts-step-title { margin-top: 12px; }
  .cp-step-title { margin-top: 14px; }
  #qr-design .qr-step-title { margin-top: 4px; }

  /* --- QR: options side by side, templates two-up, smaller preview --- */
  body.tool-qr-code-generator .tool-studio-qr { gap: 16px 32px; }
  body.tool-qr-code-generator .qr-code-options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  body.tool-qr-code-generator .qr-code-options .control .note { line-height: 1.4; }
  body.tool-qr-code-generator .qr-type-btn { min-height: 60px; padding: 8px 6px; }
  body.tool-qr-code-generator .qr-fold summary { padding: 12px 16px; }
  body.tool-qr-code-generator .qr-fold { margin-bottom: 8px; }
  body.tool-qr-code-generator .qr-preview canvas { max-width: 260px; }
  body.tool-qr-code-generator .qr-templates { width: 136px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; }
  body.tool-qr-code-generator .qr-templates-title { grid-column: 1 / -1; }
  body.tool-qr-code-generator .qr-download-row { flex-wrap: nowrap; }
  body.tool-qr-code-generator .qr-download-row .btn { padding: 0 12px; font-size: .9rem; }
  body.tool-qr-code-generator #qr-dl-print { line-height: 1.4; }
  body.tool-qr-code-generator .qr-download { margin-top: 14px; }
  body.tool-qr-code-generator .qr-embed { margin-top: 12px; }

  /* --- Timestamp: batch closed by default (HTML); tighter result rows --- */
  body.tool-timestamp-converter .kv-row { padding: 8px 12px; margin-bottom: 6px; }
  body.tool-timestamp-converter .kv-val { white-space: nowrap; overflow-x: auto; max-width: 100%; }
  body.tool-timestamp-converter .ts-hero { padding: 12px 16px; margin-bottom: 12px; }
  body.tool-timestamp-converter .tool-stage hr { margin: 16px 0 12px; }
  body.tool-timestamp-converter .tool-side .note { line-height: 1.4; }
  body.tool-timestamp-converter .tool-side .btn-row { margin-top: 12px; }
  body.tool-timestamp-converter .ts-batch { margin-top: 12px; }
  body.tool-timestamp-converter .ts-batch summary { padding: 10px 0; }

  /* --- Password: tighter stage and side --- */
  body.tool-password-generator #pw-output { min-height: 56px; }
  body.tool-password-generator #pw-history h3 { margin: 12px 0 6px; }
  body.tool-password-generator #pw-history .note { line-height: 1.4; }
  body.tool-password-generator .tool-side .control { margin-bottom: 12px; }
  body.tool-password-generator .tool-side .check-row { margin: 4px 0 12px; }
  body.tool-password-generator .tool-stage .field { margin-bottom: 12px; }
  body.tool-password-generator .tool-stage .btn-row { margin-top: 12px; }

  /* --- JSON: shorter text areas, tighter convert block --- */
  body.tool-json-formatter .tool-duo textarea { min-height: 280px; }
  body.tool-json-formatter .tool-duo .tool-output textarea { min-height: 300px; }
  body.tool-json-formatter .json-convert .note { line-height: 1.4; }

  /* --- Word counter: denser stats, shorter input --- */
  body.tool-word-counter .tool-duo textarea { min-height: 300px; }
  body.tool-word-counter .stats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 12px; }
  body.tool-word-counter .stat { padding: 10px; }
  body.tool-word-counter .wc-goal { padding: 12px; margin-top: 12px; }
  body.tool-word-counter .wc-readability { padding: 12px; margin-top: 12px; }
  body.tool-word-counter .tool-output h3 { margin: 16px 0 6px; }
  body.tool-word-counter .wc-keywords-hint { margin-bottom: 0; }

  /* --- Colour picker: steps 4-5 folded (HTML); tighter panels --- */
  body.tool-color-picker .tool-side .field-row:has(#cp-r),
  body.tool-color-picker .tool-side .field-row:has(#cp-h) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.tool-color-picker #cp-css { min-height: 100px; }
  body.tool-color-picker .tool-side .btn-row .btn { padding: 0 12px; font-size: .9rem; }
  body.tool-color-picker .color-preview { padding: 24px 16px; }
  body.tool-color-picker #cp-palette { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  body.tool-color-picker .cp-contrast { padding: 12px 16px; }
  body.tool-color-picker .cp-contrast .note { line-height: 1.4; }
  body.tool-color-picker .cp-contrast-row { flex-wrap: nowrap; }
  body.tool-color-picker .cp-bg-presets { flex: 1; min-width: 0; }
  body.tool-color-picker .cp-badges { gap: 6px; margin-bottom: 10px; flex-wrap: nowrap; }
  body.tool-color-picker .cp-badge { padding: 6px 10px; }
  body.tool-color-picker .cp-sample { padding: 12px 16px; }
  body.tool-color-picker .cp-verdict { margin-top: 8px; }

  /* --- Case converter: shorter text areas (buttons moved to the
         output column in HTML, so both columns end up the same height) --- */
  body.tool-case-converter .tool-duo textarea { min-height: 240px; }
  body.tool-case-converter .cc-example { margin-top: 12px; padding: 8px 12px; line-height: 1.4; }
  body.tool-case-converter .cc-group-label { margin: 14px 0 8px; }
  body.tool-case-converter .tool-output .btn-row .btn { padding: 0 12px; font-size: .9rem; }

  /* --- Base64: three file sections in one row; templates folded (HTML) --- */
  body.tool-base64 .toolbox { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  body.tool-base64 .tool-duo { grid-column: 1 / -1; }
  body.tool-base64 .b64-wide { margin: 0; }
  body.tool-base64 .tool-duo textarea { min-height: 280px; }
  body.tool-base64 #b64-file-output { min-height: 100px; }
  body.tool-base64 .b64-wide .field input[type="text"] { max-width: none; }

  /* --- Image / PDF: tighter notes and folds --- */
  body.tool-image-compressor .tool-side .control .note,
  body.tool-pdf-to-jpg .tool-side .control .note { line-height: 1.4; }
  body.tool-image-compressor .img-fold,
  body.tool-pdf-to-jpg .img-fold { margin-top: 12px; }
}

/* --- mobile: keep the core flow short --- */
@media (max-width: 640px) {
  body[class^="tool-"] .tool-emblem { display: none; }
  body[class^="tool-"] .breadcrumb { margin-top: 8px; }
  body[class^="tool-"] .toolbox { padding: 16px; }
  body[class^="tool-"] .tool-side .dropzone { min-height: 140px; }
  body[class^="tool-"] .dropzone { padding: 20px 16px; }
}
@media (max-width: 1024px) {
  body[class^="tool-"] .tool-duo textarea { min-height: 200px; }
  body[class^="tool-"] .tool-duo .tool-output textarea { min-height: 220px; }
}

/* ---------- Design v2.19 round 2 (2026-12-05) — close the remaining
   gaps measured after round 1. Same rules as round 1: no type below
   its current size, no touch target below 44px, no JS touched.
   Colour picker and Base64 will not fully close at 1920 — their
   work areas carry indivisible blocks (contrast panel ~500px;
   three file sections ~450px each in one row) that no spacing
   trim can fit into 1019px without hiding features. */

@media (min-width: 1025px) {
  /* QR: needs -34 at 1920. */
  body.tool-qr-code-generator .qr-preview canvas { max-width: 240px; }
  body.tool-qr-code-generator #qr-dl-print { line-height: 1.4; }
  body.tool-qr-code-generator .qr-download { margin-top: 10px; }
  body.tool-qr-code-generator .qr-embed { margin-top: 8px; }
  body.tool-qr-code-generator #qr-single-actions .qr-step-title { margin-top: 0; }

  /* Timestamp: bundle of small trims, needs -79 at 1920. */
  body.tool-timestamp-converter .tool-side .btn-row { margin-top: 8px; }
  body.tool-timestamp-converter .kv-row { padding: 7px 12px; margin-bottom: 5px; }
  body.tool-timestamp-converter .ts-hero { padding: 10px 16px; margin-bottom: 8px; }
  body.tool-timestamp-converter .tool-stage hr { margin: 12px 0 8px; }
  body.tool-timestamp-converter .ts-step-title { margin-top: 8px; }
  body.tool-timestamp-converter .ts-controls { gap: 12px; }
  body.tool-timestamp-converter .ts-batch summary { padding: 8px 0; }
  body.tool-timestamp-converter #ts-live-now { margin-bottom: 12px; }

  /* Base64: three file sections in one row set the floor. */
  body.tool-base64 .tool-duo textarea { min-height: 240px; }
  body.tool-base64 .tool-input .check-row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
  body.tool-base64 .tool-duo .btn-row { flex-wrap: nowrap; gap: 8px; }
  body.tool-base64 .tool-duo .btn-row .btn { padding: 0 12px; font-size: .9rem; }
  body.tool-base64 #b64-file-output { min-height: 64px; }
  body.tool-base64 .b64-wide .note { line-height: 1.45; margin-bottom: 10px; }
  body.tool-base64 .b64-wide .field { margin-bottom: 8px; }
  body.tool-base64 .b64-wide .btn-row { margin-top: 10px; }

  /* Colour picker: small trims only (see note above). */
  body.tool-color-picker .color-preview { padding: 16px; }
  body.tool-color-picker .cp-contrast .note { margin-bottom: 10px; }
  body.tool-color-picker .cp-sample { padding: 10px 16px; }
  body.tool-color-picker .cp-verdict { margin-top: 6px; }
  body.tool-color-picker .cp-badges { flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
  body.tool-color-picker .cp-step-title { margin-top: 10px; }
  body.tool-color-picker .cp-fold { margin: 10px 0; }

  /* Case converter: output column drives; needs -8 at 1440. */
  body.tool-case-converter .tool-output .cc-group-label { margin: 10px 0 8px; }
  body.tool-case-converter .tool-output .btn-row { margin-top: 10px; }

  /* Password: needs -37 at 1440. */
  body.tool-password-generator .tool-stage { padding: 16px 20px; }
  body.tool-password-generator #pw-output { min-height: 52px; }
  body.tool-password-generator .tool-stage .field { margin-bottom: 8px; }
  body.tool-password-generator .tool-stage .btn-row { margin-top: 8px; }
  body.tool-password-generator #pw-history .note { line-height: 1.4; }

  /* PDF: needs -42 at 1440. */
  body.tool-pdf-to-jpg .tool-side .dropzone { padding: 20px 16px; }
  body.tool-pdf-to-jpg .dropzone .big { font-size: 1.8rem; }
  body.tool-pdf-to-jpg .dropzone .hint { line-height: 1.4; }
  body.tool-pdf-to-jpg .dropzone p { margin-bottom: .35rem; }
  body.tool-pdf-to-jpg .img-fold { margin-top: 8px; }

  /* Image: needs -69 at 1440. */
  body.tool-image-compressor .tool-side .dropzone { padding: 20px 16px; }
  body.tool-image-compressor .dropzone .big { font-size: 1.8rem; }
  body.tool-image-compressor .dropzone .hint { line-height: 1.4; }
  body.tool-image-compressor .dropzone p { margin-bottom: .35rem; }
  body.tool-image-compressor .tool-side .controls { margin-top: 12px; }
  body.tool-image-compressor .img-step { line-height: 1.4; }
  body.tool-image-compressor .img-fold { margin-top: 8px; }
  body.tool-image-compressor .img-fold summary { padding: 10px 16px; }

  /* JSON: needs -81 at 1440. */
  body.tool-json-formatter .tool-duo .tool-output textarea { min-height: 240px; }
  body.tool-json-formatter .json-step { line-height: 1.4; }
  body.tool-json-formatter .json-convert .note { line-height: 1.4; }
  body.tool-json-formatter .tool-output .btn-row { margin-top: 10px; }

  /* Word counter: needs -170 at 1440. */
  body.tool-word-counter .tool-duo textarea { min-height: 240px; }
  body.tool-word-counter .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.tool-word-counter .stat { padding: 8px; }
  body.tool-word-counter .wc-readability { padding: 8px 12px; }
  body.tool-word-counter .tool-output h3 { margin-top: 12px; }
  body.tool-word-counter .wc-keywords-hint { line-height: 1.4; }
}

/* ---------- Design v2.19 round 3 (2026-12-05) — measurements after
   round 2 showed the left column (not the preview) drives the QR
   page, the case-converter output sits outside its duo grid (so the
   "work" measure missed it entirely), and the timestamp side needs
   margin-level trims. Same rules as before: no type below its
   current size, no touch target below 44px, no JS touched.
   Colour picker stays a miss: its contrast panel is one indivisible
   ~500px block and the page carries five steps. */

@media (min-width: 1025px) {
  /* QR: left column drives (886px); needs -67. */
  body.tool-qr-code-generator .tool-studio-qr { gap: 12px 32px; }
  body.tool-qr-code-generator .qr-type-btn { min-height: 60px; padding: 8px 6px; gap: 4px; }
  body.tool-qr-code-generator .qr-type-icon { font-size: 1.2rem; }
  body.tool-qr-code-generator #qr-single-panel .field { margin-bottom: 8px; }
  body.tool-qr-code-generator #qr-count { margin-bottom: 8px; }
  body.tool-qr-code-generator .qr-code-options .control .note { line-height: 1.35; margin-top: 4px; }
  body.tool-qr-code-generator .qr-fold summary { padding: 10px 16px; }
  body.tool-qr-code-generator #qr-meta { line-height: 1.4; margin-bottom: 8px; }
  body.tool-qr-code-generator .qr-preview { padding: 12px; }

  /* Timestamp: side drives; margin-level trims, needs -59. */
  body.tool-timestamp-converter .ts-step-title { margin-top: 6px; margin-bottom: 6px; }
  body.tool-timestamp-converter .tool-side .field { margin-bottom: 8px; }
  body.tool-timestamp-converter .tool-side .btn-row { margin-top: 6px; }
  body.tool-timestamp-converter #ts-live-now { margin-bottom: 8px; }
  body.tool-timestamp-converter .ts-controls { gap: 8px; }
  body.tool-timestamp-converter .ts-controls .control .note { line-height: 1.35; }
  body.tool-timestamp-converter .toolbox { padding-top: 22px; padding-bottom: 22px; }
  body.tool-timestamp-converter .breadcrumb { margin-top: 8px; }
  body.tool-timestamp-converter .tool-side .field label { margin-bottom: 2px; }

  /* Base64: duo text areas shorter, options in three columns. */
  body.tool-base64 .tool-duo textarea { min-height: 200px; }
  body.tool-base64 .tool-input .check-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.tool-base64 .b64-wide .note { margin-bottom: 6px; }
  body.tool-base64 .b64-wide .field { margin-bottom: 6px; }
  body.tool-base64 .b64-wide .btn-row { margin-top: 6px; }
  body.tool-base64 .b64-wide h3.b64-step-title { margin-bottom: 6px; }
  body.tool-base64 .toolbox { padding-top: 20px; padding-bottom: 20px; gap: 16px; }

  /* Case converter: output is now a duo grid item (HTML); the
     input column drives, so trim it for the 1440px fit. */
  body.tool-case-converter .tool-output { margin-top: 0; }
  body.tool-case-converter .tool-duo textarea { min-height: 220px; }
  body.tool-case-converter #cc-example { margin-top: 8px; }
  body.tool-case-converter .cc-shortcuts { margin-top: 8px; }
}

/* ---------- Design v2.19 round 4 (2026-12-05) — final micro-trims.
   Case converter output stays a full-width sibling below its duo
   (the v2.16 designed layout): at 512px the output is ~900px tall
   and cannot sit beside the 554px input, so the duo-grid move was
   reverted and the page is recorded as a miss, not forced. */

@media (min-width: 1025px) {
  /* Timestamp: needs -18 at 1920. */
  body.tool-timestamp-converter .ts-step-title { line-height: 1.35; }
  body.tool-timestamp-converter .toolbox { padding-top: 20px; padding-bottom: 20px; }
  body.tool-timestamp-converter .breadcrumb { margin-top: 6px; }
  body.tool-timestamp-converter .tool-side .field { margin-bottom: 6px; }
  body.tool-timestamp-converter .tool-side .btn-row { margin-top: 4px; }

  /* Base64: output text area was still 280px — the global
     .tool-output textarea rule outranks the plain .tool-duo one. */
  body.tool-base64 .tool-duo .tool-output textarea { min-height: 200px; }
  body.tool-base64 .tool-input .check-row { grid-template-columns: 1fr 1fr; }
  body.tool-base64 .tool-output { margin-top: 0; }
  body.tool-base64 .toolbox { padding-top: 18px; padding-bottom: 18px; }

  /* JSON: input text area 280 -> 260 for the 1440px fit. */
  body.tool-json-formatter .tool-duo .tool-input textarea { min-height: 260px; }

  /* Password: small trims for the 1440px fit. */
  body.tool-password-generator .strength-track + p { line-height: 1.4; }
  body.tool-password-generator #pw-history .note { line-height: 1.35; }
  body.tool-password-generator .tool-stage { padding: 14px 20px; }
  body.tool-password-generator #pw-output { min-height: 48px; }
  body.tool-password-generator #pw-history h3 { margin: 8px 0 4px; }
}

/* ---------- Design v2.19 round 5 (2026-12-05) — last 1440px
   near-misses: password is 4px over, JSON 11px over. */
@media (min-width: 1025px) {
  body.tool-password-generator .tool-stage { padding: 12px 20px; }
  body.tool-json-formatter .tool-duo .tool-output textarea { min-height: 230px; }
  body.tool-json-formatter .json-convert { margin-top: 16px; }
}

/* ---------- Design v2.19 round 6 (2026-12-05) — strict fit.
   The round 1-5 measure compared work height against viewport-minus-
   header, but the work starts ~33px below the header bottom, so
   QR / timestamp / Base64 still overhang by 5-32px. This round
   closes the gap for real: the work bottom must sit inside the
   viewport, not just the work height inside viewport-minus-header. */
@media (min-width: 1025px) {
  body[class^="tool-"] .breadcrumb { margin-top: 6px; }
  body[class^="tool-"] .tool-head-text h1 { font-size: 1.9rem; }
  body[class^="tool-"] .tool-head-text .lede { line-height: 1.45; }
  body[class^="tool-"] .toolbox { margin-bottom: 8px; }
  /* QR: needs -11 more. */
  body.tool-qr-code-generator .qr-fold summary { padding: 8px 16px; }
  body.tool-qr-code-generator .qr-type-grid { gap: 6px; }
  body.tool-qr-code-generator #qr-count { margin-bottom: 4px; }
  /* Timestamp: needs -7 more. */
  body.tool-timestamp-converter .kv-row { padding: 6px 12px; }
}

/* ---------- Design v2.19 round 7 (2026-12-05) — last 19px on QR
   and timestamp so their work bottom sits inside a 1080px viewport. */
@media (min-width: 1025px) {
  body.tool-qr-code-generator .qr-type-btn { min-height: 56px; padding: 6px; }
  body.tool-qr-code-generator .qr-fold summary { padding: 6px 16px; }
  body.tool-timestamp-converter .ts-step-title { margin-bottom: 4px; }
  body.tool-timestamp-converter .ts-controls { gap: 6px; }
  body.tool-timestamp-converter #ts-live-now { margin-bottom: 4px; }
  body.tool-timestamp-converter .tool-side .field { margin-bottom: 4px; }
}

/* ---------- Design v2.19 round 8 (2026-12-05) — last 19px (QR)
   and 7px (timestamp) for a strict 1080px fit. Only grid gaps and
   card padding now — no content is touched. */
@media (min-width: 1025px) {
  body.tool-qr-code-generator .tool-studio-qr { row-gap: 8px; }
  body.tool-qr-code-generator .qr-type-grid { gap: 4px; }
  body.tool-qr-code-generator .toolbox { padding-top: 22px; padding-bottom: 22px; }
  body.tool-timestamp-converter .toolbox { padding-top: 18px; padding-bottom: 18px; }
  body.tool-timestamp-converter .ts-step-title { margin-bottom: 2px; }
}

/* ---------- Design v2.19 round 9 (2026-12-05) — last 11px on QR. */
@media (min-width: 1025px) {
  body.tool-qr-code-generator .toolbox { padding-top: 18px; padding-bottom: 18px; }
  body.tool-qr-code-generator .qr-type-grid { gap: 2px; }
  body.tool-qr-code-generator #qr-single-panel .field { margin-bottom: 4px; }
}

/* ---------- Design v2.19 round 9b (2026-12-05) — QR bottom margin. */
@media (min-width: 1025px) {
  body.tool-qr-code-generator .toolbox { margin-bottom: 4px; }
}

/* ---------- Design v2.19 round 10 (2026-12-05) — QR: the right
   column (actions, 793px) is what forces rows 2-5 tall; trim its
   two internal gaps for the last ~8px. */
@media (min-width: 1025px) {
  body.tool-qr-code-generator #qr-single-actions .qr-download { margin-top: 6px; }
  body.tool-qr-code-generator #qr-single-actions #qr-embed { margin-top: 4px; }
}

/* ---------- Design v2.19 round 11 (2026-12-05) — close the last
   ~20px on password / JSON / PDF at 1440x900 (strict fit: the work
   bottom must sit inside the 900px viewport). Only head + card
   margins/padding — no content is touched. */
@media (min-width: 1025px) {
  body[class^="tool-"] .tool-head-text h1 { font-size: 1.75rem; }
  body[class^="tool-"] .tool-head-text .lede { line-height: 1.4; }
  body[class^="tool-"] .breadcrumb { margin-top: 4px; }
  body[class^="tool-"] .toolbox { margin-top: 12px; margin-bottom: 4px; padding-top: 20px; }
}

/* ---------- Design v2.19 round 12 (2026-12-05) — final 2-5px at
   1440x900: card bottom margin/padding only. */
@media (min-width: 1025px) {
  body[class^="tool-"] .toolbox { margin-bottom: 0; padding-bottom: 18px; }
}
