/* PixelFixAll site styles. Mobile-first, automatic light/dark. */

@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  /* Cool "screen and press" palette: slate ink, registration cyan, process magenta */
  --bg: #f3f5f8;
  --surface: #ffffff;
  --sunk: #e9edf3;
  --ink: #17202d;
  --muted: #545f70;
  --line: #d5dbe4;
  --grid: rgba(23, 32, 45, .07);
  --cyan: #00699c;
  --cyan-strong: #0088c8;
  --cyan-tint: #e2f2fa;
  --magenta: #c01d63;
  --on-cyan: #ffffff;
  --focus: #c01d63;
  --shadow: 0 1px 2px rgba(23, 32, 45, .06), 0 8px 24px -12px rgba(23, 32, 45, .18);

  /* Category colors (text-safe) and tints */
  --c-photo: #00699c; --t-photo: #e2f2fa;
  --c-video: #b0185b; --t-video: #fbe6ef;
  --c-text:  #8a5f00; --t-text:  #fbf0d2;
  --c-print: #1b7348; --t-print: #e0f2e7;
  --c-design: #5b3fd1; --t-design: #ece8fd;

  /* Process inks for the hero overprint */
  --ink-c: rgba(0, 174, 239, .45);
  --ink-m: rgba(236, 0, 140, .38);
  --ink-y: rgba(255, 221, 0, .62);
  --ink-blend: multiply;
  --dot: rgba(23, 32, 45, .13);

  --font-display: "Bricolage", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson", "Segoe UI", system-ui, -apple-system, sans-serif;

  --wrap: 1120px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161f;
    --surface: #171e2a;
    --sunk: #0d1219;
    --ink: #e6eaf1;
    --muted: #a3adbd;
    --line: #2a3445;
    --grid: rgba(230, 234, 241, .06);
    --cyan: #5cc6f2;
    --cyan-strong: #5cc6f2;
    --cyan-tint: #13324a;
    --magenta: #f06aa2;
    --on-cyan: #071420;
    --focus: #f06aa2;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .6);
    --c-photo: #5cc6f2; --t-photo: #13324a;
    --c-video: #f06aa2; --t-video: #3a1628;
    --c-text:  #f2c94c; --t-text:  #3a2e0f;
    --c-print: #5fd39a; --t-print: #123524;
    --c-design: #a895ff; --t-design: #251f45;
    --ink-c: rgba(0, 174, 239, .38);
    --ink-m: rgba(236, 0, 140, .34);
    --ink-y: rgba(255, 221, 0, .30);
    --ink-blend: screen;
    --dot: rgba(230, 234, 241, .10);
  }
}

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-body);
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.6vw, 2.9rem); font-weight: 720; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); font-weight: 680; margin-top: 2.2rem; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--cyan); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.muted { color: var(--muted); }
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; float: none !important; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: var(--r-sm); z-index: 20; }
.skip:focus { top: 1rem; }
.icon { flex: none; vertical-align: middle; }

/* ---- Banner + nav ------------------------------------------------------- */
.banner { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 10; }
.banner-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .9rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; }
.logo-wrench { fill: var(--ink); }
.logo-pixel { fill: var(--magenta); }
.brand-word { font: 720 1.35rem/1 var(--font-display); letter-spacing: -.02em; }
.banner-note { display: none; margin: 0; align-items: center; gap: .45rem; font-size: .9rem; color: var(--muted); }
.banner-note .icon { color: var(--cyan); }
@media (min-width: 640px) { .banner-note { display: inline-flex; } }

.toolnav { border-top: 1px solid var(--line); }
.toolnav-inner { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; padding-block: .35rem; }
.toolnav-all, .navcat > summary {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .5rem .8rem; border-radius: var(--r-sm);
  font: 600 .95rem/1.2 var(--font-body); color: var(--ink); text-decoration: none; cursor: pointer;
}
.toolnav-all:hover, .navcat > summary:hover { background: var(--sunk); }
.toolnav-all[aria-current="page"] { color: var(--cyan); }
.navcat > summary { list-style: none; }
.navcat > summary::-webkit-details-marker { display: none; }
.navcat > summary .icon { transition: transform .15s ease; color: var(--muted); }
.navcat[open] > summary { background: var(--sunk); }
.navcat[open] > summary .icon { transform: rotate(180deg); }
.navpanel {
  position: absolute; left: 0; right: 0; top: calc(100% + 1px);
  background: var(--surface); border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--r-md) var(--r-md); box-shadow: var(--shadow);
  padding: 1rem 1.25rem 1.25rem;
}
.navpanel-blurb { color: var(--muted); font-size: .92rem; margin-bottom: .6rem; }
.navpanel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.navpanel a { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; }
.navpanel a .icon { color: var(--cyan); }
.navpanel a:hover { background: var(--sunk); }
.navpanel a[aria-current="page"] { font-weight: 700; color: var(--cyan); }

/* ---- Buttons + form controls -------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .6rem 1rem; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 600 .95rem/1.2 var(--font-body); cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--cyan); }
.btn-primary { background: var(--cyan); border-color: var(--cyan); color: var(--on-cyan); padding: .75rem 1.25rem; }
.btn-primary:hover { background: var(--cyan-strong); }
.link-btn { background: none; border: 0; padding: .2rem .3rem; color: var(--cyan); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: .18em; }

input[type="number"], input[type="text"] {
  width: 100%; padding: .65rem .75rem;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg); color: var(--ink);
  font: 600 1.15rem/1.2 var(--font-body); font-variant-numeric: tabular-nums;
}
input[type="number"]:focus-visible, input[type="text"]:focus-visible { outline-offset: 0; border-color: var(--focus); }
.field { flex: 1 1 8rem; min-width: 0; }
.field label, .seg legend { display: block; font-size: .9rem; font-weight: 700; margin-bottom: .3rem; }
.field-sm { flex: 0 1 7rem; }
.field-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin-bottom: 1rem; }
.field-colon { font: 700 1.5rem/2.6rem var(--font-display); color: var(--muted); }
.icon-btn {
  flex: none; width: 2.75rem; height: 2.75rem; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); cursor: pointer;
}
.icon-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.check { display: inline-flex; align-items: center; gap: .55rem; font-weight: 600; margin-bottom: 1rem; cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--cyan); }

/* Segmented radio control */
.seg { border: 0; padding: 0; margin: 0 0 1.25rem; display: inline-flex; flex-wrap: wrap; gap: 0; background: var(--sunk); border-radius: var(--r-md); padding: .25rem; }
.seg legend { float: left; width: 100%; }
.seg label { position: relative; padding: .55rem 1rem; border-radius: calc(var(--r-md) - 3px); font-weight: 600; cursor: pointer; color: var(--muted); }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 1px; }
.seg-sm { margin: 0; background: none; padding: 0; align-items: center; gap: .25rem; }
.seg-sm legend { margin-bottom: .3rem; }
.seg-sm label { background: var(--sunk); padding: .6rem .9rem; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: 1.25rem; }
.chips-label { font-size: .9rem; font-weight: 700; margin-right: .2rem; }
.chip {
  padding: .35rem .7rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 600 .9rem/1.2 var(--font-body); font-variant-numeric: tabular-nums; cursor: pointer;
}
.chip:hover { border-color: var(--cyan); }
.chip[aria-pressed="true"] { background: var(--cyan); border-color: var(--cyan); color: var(--on-cyan); }

/* ---- Homepage ----------------------------------------------------------- */
.hero { padding-block: clamp(1.5rem, 4vw, 3rem) 1rem; }
.viewfinder {
  position: relative;
  padding: clamp(2.25rem, 6vw, 4.5rem) clamp(1.5rem, 6vw, 4.5rem) clamp(3rem, 6vw, 4.75rem);
  /* rule-of-thirds grid */
  background:
    linear-gradient(to right, transparent calc(33.333% - .5px), var(--grid) calc(33.333% - .5px), var(--grid) calc(33.333% + .5px), transparent calc(33.333% + .5px), transparent calc(66.666% - .5px), var(--grid) calc(66.666% - .5px), var(--grid) calc(66.666% + .5px), transparent calc(66.666% + .5px)),
    linear-gradient(to bottom, transparent calc(33.333% - .5px), var(--grid) calc(33.333% - .5px), var(--grid) calc(33.333% + .5px), transparent calc(33.333% + .5px), transparent calc(66.666% - .5px), var(--grid) calc(66.666% - .5px), var(--grid) calc(66.666% + .5px), transparent calc(66.666% + .5px));
}
.vf-corner { position: absolute; width: clamp(22px, 4vw, 40px); height: clamp(22px, 4vw, 40px); border: 0 solid var(--ink); }
.vf-corner.tl { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; }
.vf-corner.tr { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; }
.vf-corner.bl { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; }
.vf-corner.br { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; }
.vf-read { position: absolute; bottom: .7rem; font: 600 .82rem/1 var(--font-body); font-variant-numeric: tabular-nums; color: var(--cyan); }
.vf-dims { left: clamp(2rem, 5vw, 3.25rem); }
.vf-ratio { right: clamp(2rem, 5vw, 3.25rem); color: var(--magenta); }
.viewfinder h1 { font-size: clamp(3rem, 9vw, 5.75rem); font-weight: 780; line-height: .95; letter-spacing: -.035em; margin-bottom: .4em; }
.viewfinder h1 span { display: block; }
.viewfinder h1 span + span { padding-left: .55em; }
.hero-lede { font-size: clamp(1.08rem, 1.8vw, 1.25rem); max-width: 58ch; }
.hero-points { color: var(--muted); max-width: 58ch; margin-bottom: 1.5rem; }

.who { padding-block: 1rem 1.5rem; }
.who-lede { max-width: 62ch; }
.hats { display: grid; gap: 1.25rem 2.5rem; margin: 1.5rem 0 0; }
@media (min-width: 720px) { .hats { grid-template-columns: 1fr 1fr; } }
.hats > div { border-top: 2px solid var(--ink); padding-top: .8rem; }
.hats dt { font: 680 1.1rem/1.2 var(--font-display); margin-bottom: .3rem; }
.hats dd { margin: 0; color: var(--muted); }

.tools { padding-block: 1rem 1rem; }
.tool-group { margin-top: 1.75rem; }
.tool-group h3 { padding-bottom: .5rem; border-bottom: 1px solid var(--line); margin-bottom: .5rem; }
.tool-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem 1.5rem; }
@media (min-width: 720px) { .tool-list { grid-template-columns: 1fr 1fr; } }
.tool-row > a, .tool-row > div { display: flex; align-items: flex-start; gap: .9rem; padding: .8rem .6rem; border-radius: var(--r-md); color: var(--ink); text-decoration: none; }
.tool-row > a:hover { background: var(--surface); box-shadow: var(--shadow); }
.tool-icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: var(--r-sm); background: var(--cyan-tint); color: var(--cyan); flex: none; }
.tool-text { display: grid; gap: .1rem; min-width: 0; }
.tool-name { font-weight: 700; }
.tool-row > a:hover .tool-name { color: var(--cyan); }
.tool-blurb { color: var(--muted); font-size: .95rem; }
.is-soon .tool-icon { background: var(--sunk); color: var(--muted); }
.is-soon .tool-name { color: var(--muted); }
.soon { margin-left: auto; flex: none; font-size: .78rem; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .15rem .55rem; white-space: nowrap; }

.local { padding-block: 1rem 2rem; }

/* ---- Content pages ------------------------------------------------------ */
.prose { max-width: 68ch; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .55rem; }
.prose li::marker { color: var(--cyan); font-weight: 700; }
.page { padding-block: 2.5rem 3rem; }
.page h1 { margin-bottom: .6em; }
.contact-email { font-size: 1.25rem; font-weight: 700; }
.notfound { max-width: 760px; }
.nf-code { font: 780 clamp(4rem, 14vw, 7rem)/1 var(--font-display); letter-spacing: -.04em; color: var(--line); margin: 0; }

/* ---- Tool pages --------------------------------------------------------- */
.tool-page { padding-block: 1.75rem 3rem; }
.tool-head { max-width: 68ch; margin-bottom: 1.25rem; }
.tool-head h1 { margin-bottom: .3em; }
.tool-lede { color: var(--muted); font-size: 1.1rem; margin: 0; }
.tool-app {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: clamp(1rem, 3vw, 1.75rem); box-shadow: var(--shadow);
}
.howto { margin-top: 1rem; }
.faq { max-width: 68ch; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: .9rem 2rem .9rem 0; font-weight: 700; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .25rem; top: .7rem; font: 600 1.3rem/1 var(--font-display); color: var(--cyan); }
.faq details[open] summary::after { content: "–"; }
.faq-a { padding-bottom: .6rem; }
.related { margin-top: 1rem; }
.gear { margin-top: 1rem; max-width: 68ch; }
.gear-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .9rem; }
.gear-list a { font-weight: 700; }
.gear-list p { margin: .2rem 0 0; color: var(--muted); }
.disclosure { font-size: .88rem; color: var(--muted); border-left: 3px solid var(--line); padding-left: .8rem; }

/* Toast */
.toast {
  position: absolute; left: 50%; bottom: 1rem; transform: translate(-50%, .5rem);
  margin: 0; padding: .5rem .9rem; border-radius: var(--r-sm);
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- Aspect ratio calculator ------------------------------------------- */
.arc-out { display: grid; gap: 1.25rem; margin-top: .5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
@media (min-width: 760px) { .arc-out { grid-template-columns: 1fr 240px; align-items: start; } }
.arc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem 1.25rem; margin-bottom: .9rem; }
.stat { display: grid; gap: .15rem; }
.stat-k { font-size: .85rem; font-weight: 700; color: var(--muted); }
.stat-v { font: 700 1.35rem/1.15 var(--font-display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-main { grid-column: 1 / -1; }
.stat-main .stat-v { font-size: clamp(2.2rem, 6vw, 3.2rem); font-weight: 760; letter-spacing: -.02em; color: var(--cyan); }
.arc-note { color: var(--muted); min-height: 1.6em; }
.arc-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.arc-preview { height: 200px; display: grid; place-items: center; background: var(--sunk); border-radius: var(--r-md); padding: 1rem; }
.arc-box {
  max-width: 100%; max-height: 100%; display: grid; place-items: center;
  border: 2px solid var(--cyan); background: var(--cyan-tint); border-radius: 3px;
  font: 700 .9rem/1 var(--font-display); color: var(--cyan); min-width: 2.5rem; min-height: 1.5rem;
  transition: aspect-ratio .2s ease;
}
.arc-table-wrap { margin-top: 1.5rem; overflow-x: auto; }
.arc-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.arc-table caption { text-align: left; font: 650 1.05rem/1.3 var(--font-display); margin-bottom: .5rem; }
.arc-table th, .arc-table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.arc-table th { font-size: .85rem; color: var(--muted); }
.arc-table td:last-child { text-align: right; }

/* ---- Ads ---------------------------------------------------------------- */
.slot { margin: 2rem 0; text-align: center; min-height: 100px; }
.pick-note { display: block; font-size: .75rem; color: var(--muted); margin-bottom: .3rem; }
.slot-placeholder {
  display: grid; place-items: center; border: 2px dashed var(--line); border-radius: var(--r-md);
  color: var(--muted); font-size: .85rem;
}
main > .slot { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

/* ---- Footer ------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 2rem; }
.footer-inner { display: grid; gap: 1rem; padding-block: 2rem; }
@media (min-width: 760px) { .footer-inner { grid-template-columns: 1.4fr 2fr auto; align-items: start; } }
.footer-name { font: 720 1.15rem/1 var(--font-display); margin-bottom: .5rem; }
.footer-brand p { max-width: 40ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }
.footer-links a { color: var(--ink); }
.footer-copy { margin: 0; font-size: .9rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ---- Decoration: hero overprint art, rulers, category colors ----------- */
.hero-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }
.hero-art { position: relative; max-width: 420px; width: 100%; justify-self: center; }
.overprint {
  position: relative; aspect-ratio: 1 / 1; isolation: isolate;
}
.overprint::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(var(--dot) 1.2px, transparent 1.7px) 0 0 / 11px 11px;
  -webkit-mask-image: radial-gradient(closest-side, #000 35%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 35%, transparent 100%);
}
.op { position: absolute; border: 2px solid; border-radius: 3px; mix-blend-mode: var(--ink-blend); display: flex; align-items: flex-end; padding: .45rem .55rem; }
.op b { font: 700 .9rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.op-169 { left: 2%;  top: 38%; width: 82%; aspect-ratio: 16 / 9; background: var(--ink-c); border-color: var(--c-photo); color: var(--c-photo); }
.op-45  { left: 24%; top: 12%; width: 44%; aspect-ratio: 4 / 5;  background: var(--ink-y); border-color: var(--c-text);  color: var(--c-text); }
.op-916 { left: 56%; top: 4%;  width: 38%; aspect-ratio: 9 / 16; background: var(--ink-m); border-color: var(--c-video); color: var(--c-video); justify-content: flex-end; }
.reg-mark { position: absolute; right: 0; bottom: 2%; color: var(--ink); opacity: .55; }

.ruler {
  height: 12px; margin-block: 1.75rem;
  background:
    repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 10px) bottom left / 100% 6px no-repeat,
    repeating-linear-gradient(to right, var(--muted) 0 1px, transparent 1px 50px) bottom left / 100% 12px no-repeat;
  border-bottom: 1px solid var(--line); opacity: .7;
}

.cat-photo { --cat: var(--c-photo); --cat-t: var(--t-photo); }
.cat-video { --cat: var(--c-video); --cat-t: var(--t-video); }
.cat-text  { --cat: var(--c-text);  --cat-t: var(--t-text); }
.cat-print { --cat: var(--c-print); --cat-t: var(--t-print); }
.cat-design { --cat: var(--c-design); --cat-t: var(--t-design); }
.tool-group h3[class*="cat-"] { display: flex; align-items: center; gap: .55rem; border-bottom-color: var(--cat); border-bottom-width: 2px; }
.tool-group h3[class*="cat-"]::before { content: ""; width: .7rem; height: .7rem; border-radius: 2px; background: var(--cat); }
.tool-row[class*="cat-"] .tool-icon { background: var(--cat-t); color: var(--cat); }
.tool-row[class*="cat-"] > a:hover .tool-name { color: var(--cat); }
.tool-row.is-soon .tool-icon { opacity: .6; }
.navcat[class*="cat-"] .navpanel a .icon { color: var(--cat); }
.navcat[class*="cat-"] > summary::before { content: ""; width: .5rem; height: .5rem; border-radius: 2px; background: var(--cat); margin-right: .15rem; }
.hats > div:nth-child(1) { border-top-color: var(--c-photo); }
.hats > div:nth-child(2) { border-top-color: var(--c-video); }
.hats > div:nth-child(3) { border-top-color: var(--c-text); }
.hats > div:nth-child(4) { border-top-color: var(--c-print); }

/* Tool panel crop marks */
.tool-app::before, .tool-app::after {
  content: ""; position: absolute; width: 18px; height: 18px; border: 0 solid var(--cyan); pointer-events: none;
}
.tool-app::before { top: -9px; left: -9px; border-top-width: 2px; border-left-width: 2px; }
.tool-app::after  { bottom: -9px; right: -9px; border-bottom-width: 2px; border-right-width: 2px; }

/* Custom inputs */
.field-help { font-size: .85rem; color: var(--muted); margin: .35rem 0 0; }
.field-btn { align-self: flex-start; margin-top: 1.85rem; }
.field-md { flex: 0 1 12rem; }
input[aria-invalid="true"] { border-color: var(--magenta); }
.chip-custom { border-style: dashed; }
.chips-saved { display: contents; }
.chip-saved { display: inline-flex; align-items: center; }
.chip-saved .chip { border-radius: 999px 0 0 999px; border-right: 0; }
.chip-x {
  padding: .35rem .55rem; border: 1px solid var(--line); border-radius: 0 999px 999px 0;
  background: var(--surface); color: var(--muted); font: 700 .9rem/1.2 var(--font-body); cursor: pointer;
}
.chip-x:hover { color: var(--magenta); border-color: var(--magenta); }
.arc-add { margin-top: 1rem; margin-bottom: .25rem; }
.arc-table tr.is-custom td:first-child { color: var(--cyan); font-weight: 700; }

/* ---- Word counter ------------------------------------------------------ */
.wc-layout { display: grid; gap: 1.5rem 2.5rem; }
@media (min-width: 900px) { .wc-layout { grid-template-columns: minmax(0, 1fr) 340px; } }
@media (max-width: 600px) { textarea { min-height: 16rem; } }
.wc-label { display: block; font-size: .9rem; font-weight: 700; margin-bottom: .35rem; }
textarea {
  width: 100%; min-height: 22rem; resize: vertical; padding: 1rem 1.1rem;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); color: var(--ink);
  font: 400 1.05rem/1.55 var(--font-body);
}
textarea:focus-visible { outline-offset: 0; border-color: var(--focus); }
.wc-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; margin: .75rem 0 1rem; }
.wc-bar .check { margin: 0; }
.wc-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 1rem 1.25rem; margin-bottom: .6rem; }
.wc-layout { padding-top: 1.25rem; border-top: 1px solid var(--line); }
.stat-big .stat-v { font-size: 2.2rem; font-weight: 760; letter-spacing: -.02em; color: var(--cyan); }
.wc-settings { border-top: 1px solid var(--line); padding-top: .4rem; margin-top: .6rem; }
.wc-settings > summary { cursor: pointer; font-weight: 700; padding: .5rem 0; }
.wc-settings .field-row { margin-top: .5rem; }
.wc-side-h { font-size: 1.1rem; margin: 0 0 .75rem; }
.limits { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: .85rem; }
.limit-top, .limit-foot { display: flex; justify-content: space-between; gap: .5rem; font-size: .9rem; }
.limit-name { font-weight: 700; }
.limit-hint { font-weight: 400; color: var(--muted); }
.limit-count { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.limit-foot { color: var(--muted); font-size: .82rem; min-height: 1.4em; }
.limit-foot .link-btn { font-size: .82rem; padding: 0; }
.limit-track { height: 8px; border-radius: 999px; background: var(--sunk); overflow: hidden; margin: .3rem 0 .2rem; }
.limit-track span { display: block; height: 100%; border-radius: inherit; background: var(--cyan); transition: width .15s ease; }
.limit.is-near .limit-track span { background: var(--c-text); }
.limit.is-near .limit-foot { color: var(--c-text); font-weight: 700; }
.limit.is-over .limit-track span { background: var(--magenta); }
.limit.is-over .limit-foot, .limit.is-over .limit-count { color: var(--magenta); font-weight: 700; }
.wc-keywords { margin-top: 1rem; }
.kw-list { list-style: none; margin: .5rem 0 0; padding-left: 0; columns: 2 12rem; column-gap: 2rem; }
.kw-list li { break-inside: avoid; display: flex; justify-content: space-between; gap: 1rem; padding: .2rem 0; border-bottom: 1px dotted var(--line); }
@media (max-width: 899px) { .hero-art { max-width: 300px; } }

/* ---- QR code generator -------------------------------------------------- */
select {
  width: 100%; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg); color: var(--ink); font: 600 1rem/1.2 var(--font-body);
}
input[type="url"], input[type="email"], input[type="tel"] {
  width: 100%; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg); color: var(--ink); font: 600 1.05rem/1.2 var(--font-body);
}
input[type="url"]:focus-visible, input[type="email"]:focus-visible, input[type="tel"]:focus-visible, select:focus-visible { outline-offset: 0; border-color: var(--focus); }
textarea.qr-textarea { min-height: 6.5rem; font-size: 1rem; }
.seg-wrap { display: flex; flex-wrap: wrap; }
.seg-wrap legend { margin-bottom: .3rem; padding-left: .2rem; }
.qr-layout { display: grid; gap: 1.75rem 2.5rem; }
@media (min-width: 900px) { .qr-layout { grid-template-columns: minmax(0, 1fr) 360px; } }
.qr-fields .field { margin-bottom: 1rem; }
.qr-fields .field-row { margin-bottom: 0; }
.qr-fields .field-row .field { margin-bottom: 1rem; }
.qr-options { border-top: 1px solid var(--line); padding-top: 1.25rem; margin-top: .5rem; }
.field-color { flex: 0 0 auto; }
input[type="color"] { width: 4.5rem; height: 2.75rem; padding: .2rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); cursor: pointer; }
.check-inline { margin: 0 0 .7rem; align-self: flex-end; }
.qr-warn { color: var(--magenta); min-height: 0; }
.qr-preview-col { align-self: start; }
@media (min-width: 900px) { .qr-preview-col { position: sticky; top: 1rem; } }
.qr-preview {
  display: grid; place-items: center; aspect-ratio: 1 / 1; padding: 1.25rem;
  background: var(--sunk); border-radius: var(--r-md);
}
.qr-preview canvas { width: 100%; max-width: 320px; height: auto; aspect-ratio: 1 / 1; border-radius: 4px; box-shadow: var(--shadow); }
.qr-empty { color: var(--muted); text-align: center; max-width: 22ch; margin: 0; }
.qr-info { font-size: .9rem; color: var(--muted); margin: .9rem 0; }
.qr-actions .btn { flex: 1 1 auto; justify-content: center; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---- Barcode generator --------------------------------------------------- */
.bc-preview { display: grid; place-items: center; min-height: 220px; padding: 1.5rem; background: var(--sunk); border-radius: var(--r-md); }
.bc-preview svg { width: 100%; max-width: 300px; height: auto; background: #fff; box-shadow: var(--shadow); border-radius: 3px; }
.bc-check { margin: .45rem 0 .5rem; font-weight: 600; font-size: .95rem; }
.bc-check.is-ok { color: var(--c-print); }
.bc-check.is-bad { color: var(--magenta); }
.bc-size { color: var(--muted); font-size: .9rem; }
.bc-batch { margin-top: 1.25rem; }
.bc-batch textarea { font-variant-numeric: tabular-nums; }
.bc-batch-opts { gap: .25rem 1.25rem; margin: .75rem 0 .25rem; }
.bc-batch-opts .check { margin: 0; }
.bc-b-errors { margin: .75rem 0 0; padding-left: 1.2rem; color: var(--magenta); font-size: .9rem; }

/* Barcode generator v2: sections, sliders */
.bc-sec { border-top: 1px solid var(--line); padding: 1rem 0 .5rem; }
.bc-sec:first-child { border-top: 0; padding-top: 0; }
.bc-sec-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .6rem; }
.bc-sec-head h2 { font-size: 1.1rem; margin: 0; }
.bc-reset { font-size: .9rem; }
.bc-units { margin-bottom: 1rem; }
.bc-inline { align-items: center; gap: .5rem 1.25rem; }
.bc-inline .check { margin: 0; }
.slider { margin-bottom: 1rem; }
.slider-top label { display: block; font-size: .9rem; font-weight: 700; margin-bottom: .3rem; }
.slider-row { display: flex; align-items: center; gap: .75rem; }
.slider-row input[type="range"] { flex: 1 1 auto; min-width: 0; accent-color: var(--cyan); height: 1.6rem; }
.slider-row input[type="number"] { flex: 0 0 6.5rem; width: 6.5rem; padding: .45rem .55rem; font-size: 1rem; text-align: right; }
.slider-unit { flex: 0 0 auto; min-width: 2.2rem; font-size: .85rem; font-weight: 700; color: var(--muted); }
.bc-type-opts { margin-top: .25rem; }
.bc-type-opts .check { display: flex; margin-bottom: .5rem; }
.bc-dl { margin-bottom: .6rem; }
.bc-dl-btn { width: 100%; justify-content: center; }
.bc-fav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .75rem; font-size: .9rem; }
.bc-preview.is-transparent svg { background: repeating-conic-gradient(#e9edf3 0 25%, #fff 0 50%) 0 0 / 16px 16px; }

/* ---- Video poster image grabber ------------------------------------------ */
.pg-drop {
  display: grid; justify-items: center; gap: .35rem; text-align: center; cursor: pointer;
  padding: 2.25rem 1.25rem; border: 2px dashed var(--line); border-radius: var(--r-md); background: var(--sunk);
  color: var(--ink); transition: border-color .15s ease, background .15s ease;
}
.pg-drop .icon { color: var(--c-video); }
.pg-drop:hover, .pg-drop.is-over { border-color: var(--c-video); background: var(--t-video); }
.pg-drop:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.pg-drop-main { font: 700 1.15rem/1.2 var(--font-display); }
.pg-drop-sub { color: var(--muted); font-size: .9rem; }
.pg-drop.is-loaded { padding: .9rem 1rem; grid-auto-flow: column; justify-content: center; align-items: center; }
.pg-drop.is-loaded .pg-drop-sub { display: none; }
.pg-drop.is-loaded .icon { width: 22px; height: 22px; }
.pg-top { display: grid; gap: 1.5rem 2.5rem; margin-top: 1.25rem; }
@media (min-width: 900px) { .pg-top { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.pg-player video { width: 100%; max-height: 60vh; background: #000; border-radius: var(--r-md); display: block; }
.pg-player-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.pg-player-bar .btn-primary { margin-left: auto; }
.pg-rate { display: inline-flex; align-items: center; gap: .4rem; margin-left: .25rem; white-space: nowrap; }
.pg-rate select { width: auto; padding: .25rem .4rem; font-size: .85rem; }
.pg-mode { margin-bottom: 1rem; }
.pg-range-btns { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: -.4rem 0 .6rem; font-size: .9rem; }
.pg-progress { height: 6px; border-radius: 999px; background: var(--sunk); overflow: hidden; margin-top: .75rem; }
.pg-progress span { display: block; height: 100%; width: 0; background: var(--c-video); transition: width .1s linear; }
.pg-grid-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; margin: 1.75rem 0 .75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.pg-grid-head h2 { margin: 0; }
.pg-size { flex: 1 1 14rem; max-width: 22rem; }
.pg-size input[type="range"] { flex: 1; accent-color: var(--c-video); }
.pg-sel-actions { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .9rem; }
.pg-grid { --thumb-w: 190px; list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(var(--thumb-w), 1fr)); }
.pg-card { border-radius: var(--r-sm); background: var(--sunk); padding: .35rem; border: 2px solid transparent; }
.pg-card.is-sel { border-color: var(--c-video); background: var(--t-video); }
.pg-thumb { display: block; width: 100%; padding: 0; border: 0; background: #000; border-radius: 4px; overflow: hidden; cursor: zoom-in; }
.pg-thumb img { display: block; width: 100%; height: auto; }
.pg-check { display: flex; align-items: center; gap: .4rem; padding: .35rem .15rem .1rem; font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; }
.pg-check input { width: 1.05rem; height: 1.05rem; accent-color: var(--c-video); }
.pg-grid-empty { padding: 1.5rem 0; max-width: none; text-align: left; }
.pg-export { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); max-width: 46rem; }

.pg-lb { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; padding: 0; border: 0; background: #0b0e14; color: #e6eaf1; display: none; }
.pg-lb[open] { display: grid; grid-template-rows: auto 1fr auto auto; }
.pg-lb::backdrop { background: rgba(0, 0, 0, .85); }
.pg-lb-bar, .pg-lb-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .6rem 1rem; }
.pg-lb-bar { justify-content: space-between; border-bottom: 1px solid #222a38; }
.pg-lb-foot { justify-content: center; border-top: 1px solid #222a38; }
.pg-lb-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.pg-lb-zoom { display: flex; gap: .35rem; }
.pg-lb .chip { background: #171e2a; color: #e6eaf1; border-color: #2a3445; }
.pg-lb .chip[aria-pressed="true"] { background: #5cc6f2; border-color: #5cc6f2; color: #071420; }
.pg-lb .btn { background: #171e2a; color: #e6eaf1; border-color: #2a3445; }
.pg-lb .btn-primary { background: #5cc6f2; border-color: #5cc6f2; color: #071420; }
.pg-lb .btn[aria-pressed="true"] { border-color: #f06aa2; color: #f06aa2; }
.pg-lb-close { background: #171e2a; color: #e6eaf1; border-color: #2a3445; }
.pg-lb-stage { position: relative; overflow: hidden; touch-action: none; cursor: zoom-in; min-height: 0; }
.pg-lb-stage.is-zoomed { cursor: grab; }
.pg-lb-stage.is-zoomed:active { cursor: grabbing; }
.pg-lb-stage canvas { position: absolute; left: 50%; top: 50%; transform-origin: center center; image-rendering: auto; }
.pg-lb-hint { margin: 0; padding: 0 1rem .7rem; text-align: center; font-size: .8rem; color: #a3adbd; }
@media (max-width: 600px) { .pg-lb-hint { display: none; } .pg-lb-foot .btn { padding: .5rem .65rem; font-size: .85rem; } }

/* ---- Ad spots and promos ------------------------------------------------- */
.slot-top .slot { margin: 1rem 0 0; min-height: 90px; }
.slot-bottom .slot { margin: 2rem 0 0; min-height: 90px; }
.content-layout { display: grid; gap: 0 2.5rem; }
.content-side { display: none; }
@media (min-width: 1100px) {
  .content-layout { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
  .content-side { display: block; position: sticky; top: 1rem; }
  .content-side .slot { margin: 2rem 0 0; }
  .slot--sidebar { min-height: 600px; }
  .pick--sidebar { min-height: 0; }
}
.pfa-pick { text-align: left; min-height: 0; }
.pfa-pick a { display: block; text-decoration: none; color: inherit; border-radius: var(--r-md); }
.pfa-pick img { display: block; width: 100%; height: auto; border-radius: var(--r-md); }
.pick-card {
  display: grid; gap: .35rem; padding: 1.1rem 1.25rem; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
  border-left: 4px solid var(--cat, var(--cyan));
}
.pfa-pick a:hover .pick-card { border-color: var(--cyan); }
.pick-name { font: 700 1.1rem/1.2 var(--font-display); color: var(--ink); }
.pick-text { color: var(--muted); font-size: .95rem; }
.pick-cta { font-weight: 700; color: var(--cyan); }
.pick--footer .pick-card, .pick--header .pick-card { grid-template-columns: auto 1fr auto; align-items: center; gap: .25rem 1.25rem; }
@media (max-width: 700px) { .pick--footer .pick-card, .pick--header .pick-card { grid-template-columns: 1fr; } }
.pick--sidebar .pick-card { padding: 1.4rem 1.25rem; }
.footer-disclosure { grid-column: 1 / -1; font-size: .82rem; margin: 0; }
/* Capture video stays "visible" off-screen so every browser keeps decoding frames */
.pg-offscreen { position: fixed; left: -10000px; top: 0; width: 320px; height: 180px; opacity: 0; pointer-events: none; }
.pg-lb-msg { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); margin: 0; padding: .6rem 1rem; border-radius: var(--r-sm); background: #f06aa2; color: #200a14; font-weight: 700; text-align: center; max-width: 90%; }

/* ---- Video rotator ------------------------------------------------------- */
.vr-top { display: grid; gap: 1.5rem 2.5rem; margin-top: 1.25rem; }
@media (min-width: 900px) { .vr-top { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }
.vr-preview-col { min-width: 0; display: grid; justify-items: center; align-content: start; }
.vr-stage { position: relative; overflow: hidden; background: #000; border-radius: var(--r-md); max-width: 100%; transition: width .2s ease, height .2s ease; }
.vr-stage video { position: absolute; left: 50%; top: 50%; transform-origin: center center; transition: transform .25s ease; }
@media (prefers-reduced-motion: reduce) { .vr-stage, .vr-stage video { transition: none; } }
.vr-play { display: flex; align-items: center; gap: .6rem; width: 100%; margin-top: .6rem; }
.vr-play input[type="range"] { flex: 1; accent-color: var(--c-video); }
.vr-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: .9rem; min-width: 3rem; }
.vr-preview-col .qr-info { justify-self: stretch; }
.vr-btns { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.1rem; }
.vr-flip { margin: 0 1rem .25rem 0; }
.vr-summary { font-weight: 700; color: var(--c-video); margin: .25rem 0 .2rem; }
.vr-method-h { margin-top: 1.25rem; }
.seg label.is-disabled { opacity: .45; cursor: not-allowed; }
.vr-go { width: 100%; justify-content: center; margin-top: .75rem; }
#vr-cancel { margin-top: .5rem; }

/* ---- Color picker ---------------------------------------------------------- */
.cp-layout { display: grid; gap: 1.75rem 2.5rem; }
@media (min-width: 860px) { .cp-layout { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); } }
.cp-wheel-wrap { position: relative; width: 100%; max-width: 340px; aspect-ratio: 1 / 1; margin: 0 auto 1rem; }
.cp-wheel-wrap canvas { width: 100%; height: 100%; border-radius: 50%; cursor: crosshair; touch-action: none; display: block; }
.cp-knob { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.4); pointer-events: none; }
.cp-val-range { accent-color: var(--c-design); }
.cp-pick-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.cp-native { position: relative; }
.cp-native input { width: 1.6rem; height: 1.3rem; padding: 0; border: 0; background: none; }
.cp-swatch { display: flex; flex-direction: column; justify-content: flex-end; min-height: 160px; padding: 1rem 1.25rem; border-radius: var(--r-md); margin-bottom: 1rem; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.cp-swatch-name { font-weight: 700; text-transform: capitalize; opacity: .9; }
.cp-swatch-hex { font: 760 2.4rem/1 var(--font-display); letter-spacing: -.02em; }
.cp-formats { list-style: none; margin: .25rem 0 .5rem; padding: 0; }
.cp-formats li { display: grid; grid-template-columns: 7.5rem 1fr auto; align-items: center; gap: .5rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.cp-fk { font-size: .85rem; font-weight: 700; color: var(--muted); }
.cp-formats code { font: 600 .98rem/1.3 var(--font-body); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cp-rows { display: grid; gap: 1.25rem; margin: 1.75rem 0 1rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.cp-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr)); gap: .35rem; }
.cp-strip-sm { grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr)); }
.cp-sw { display: flex; align-items: flex-end; min-height: 3.6rem; padding: .35rem .45rem; border: 0; border-radius: var(--r-sm); background: var(--sw); color: var(--on); cursor: pointer; font: 700 .75rem/1 var(--font-body); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.cp-sw:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), var(--shadow); }
.cp-harm-row { display: grid; gap: .3rem; margin-bottom: .6rem; }
.cp-harm-k { font-size: .85rem; font-weight: 700; color: var(--muted); text-transform: capitalize; }
.cp-contrast { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .5rem; }
.cp-ct { display: grid; gap: .15rem; padding: .8rem 1rem; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line); }
.cp-ct span { font-size: .9rem; font-variant-numeric: tabular-nums; }
.cp-badge { display: inline-block; width: max-content; padding: .1rem .45rem; border-radius: 999px; background: var(--t-print); color: var(--c-print); font-size: .75rem; font-weight: 700; }
.cp-badge.is-bad { background: var(--t-video); color: var(--c-video); }

/* ---- Theme generator ----------------------------------------------------- */
.tg-source { margin-bottom: 1.25rem; }
.tg-src-panel { margin-top: .5rem; }
.tg-drop { padding: 1.4rem 1rem; }
.tg-img-row { display: grid; gap: 1rem; grid-template-columns: 140px 1fr; align-items: start; margin-top: 1rem; }
.tg-img-row img { width: 140px; height: 140px; object-fit: cover; border-radius: var(--r-md); }
@media (max-width: 560px) { .tg-img-row { grid-template-columns: 1fr; } }
.tg-controls { display: grid; gap: 0 1.25rem; align-items: end; margin-bottom: 1.25rem; }
@media (min-width: 760px) { .tg-controls { grid-template-columns: 1fr 1fr auto; } }
.tg-controls .field { margin-bottom: 1rem; }
.tg-shuffle { margin-bottom: 1rem; justify-content: center; }
.tg-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .75rem; margin-bottom: 1.75rem; }
.tg-role { border-radius: var(--r-md); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); }
.tg-role-sw { position: relative; display: flex; align-items: flex-end; height: 7rem; padding: .6rem .75rem; background: var(--sw); color: var(--on); font: 760 1.2rem/1 var(--font-display); cursor: pointer; }
.tg-role-sw input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.tg-role-foot { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; padding: .55rem .75rem; }
.tg-role-foot strong { margin-right: auto; }
.tg-lock { border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: 600 .8rem/1 var(--font-body); padding: .3rem .55rem; cursor: pointer; }
.tg-lock[aria-pressed="true"] { border-color: var(--c-design); color: var(--c-design); background: var(--t-design); }
.tg-scales { display: grid; gap: .5rem; margin-bottom: 1.75rem; }
.tg-scale { display: grid; gap: .3rem; }
@media (min-width: 760px) { .tg-scale { grid-template-columns: 6.5rem 1fr; align-items: center; } }
.tg-scale-k { font-weight: 700; font-size: .9rem; }
.tg-steps { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 3px; }
.tg-step { display: flex; flex-direction: column; justify-content: space-between; min-height: 3.6rem; padding: .3rem .25rem; border: 0; border-radius: 4px; background: var(--sw); color: var(--on); cursor: pointer; font: 600 .62rem/1.1 var(--font-body); text-align: left; overflow: hidden; }
.tg-step b { font-size: .7rem; }
@media (max-width: 640px) { .tg-step span { display: none; } }
.tg-two { display: grid; gap: 1.5rem 2.5rem; margin-bottom: 1.5rem; }
@media (min-width: 900px) { .tg-two { grid-template-columns: 1.2fr 1fr; } }
.tg-tokens { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tg-tokens th, .tg-tokens td { text-align: left; padding: .35rem .4rem; border-bottom: 1px solid var(--line); }
.tg-tokens thead th { font-size: .8rem; color: var(--muted); }
.tg-tokens code { font: 600 .85rem var(--font-body); }
.tg-chip { display: inline-block; width: 1.1rem; height: 1.1rem; border-radius: 3px; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); vertical-align: -3px; margin-right: .4rem; }
.tg-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; font-size: .9rem; }
.tg-fixed { font-size: .78rem; font-weight: 700; color: var(--c-design); }
.tg-prev-h, .tg-exp-h { margin-top: 1.5rem; }
.tg-preview {
  margin-top: .6rem; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--t-border);
  background: var(--t-bg); color: var(--t-text); font-family: var(--font-body);
}
.tg-preview a { color: var(--t-link); text-decoration: underline; cursor: pointer; }
.tgp-nav { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.25rem; background: var(--t-surface); border-bottom: 1px solid var(--t-border); }
.tgp-logo { color: var(--t-link); font-family: var(--font-display); }
.tgp-links { display: flex; gap: 1rem; font-size: .9rem; }
.tgp-links a { color: var(--t-text); text-decoration: none; }
.tgp-hero { padding: 2rem 1.25rem 1.5rem; }
.tgp-hero h3 { font-size: clamp(1.4rem, 3vw, 2rem); margin: .6rem 0 .5rem; color: var(--t-text); }
.tgp-hero p { color: var(--t-muted); max-width: 52ch; }
.tgp-badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; background: var(--t-accent); color: var(--t-bg); font-size: .78rem; font-weight: 700; }
.tgp-btns { display: flex; flex-wrap: wrap; gap: .6rem; }
.tgp-btn { display: inline-block; padding: .6rem 1.1rem; border-radius: var(--r-sm); background: var(--t-primary); color: var(--t-on-primary); font-weight: 700; }
.tgp-btn2 { background: var(--t-secondary); color: var(--t-on-secondary); }
.tgp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .75rem; padding: 0 1.25rem 1.5rem; }
.tgp-card { background: var(--t-surface); border: 1px solid var(--t-border); border-radius: var(--r-sm); padding: .9rem 1rem; }
.tgp-card p { color: var(--t-muted); font-size: .9rem; margin: .3rem 0 0; }
.tgp-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; background: var(--t-primary); margin-right: .4rem; }
.tgp-dot2 { background: var(--t-secondary); }
.tgp-dot3 { background: var(--t-accent); }
.tgp-foot { padding: .9rem 1.25rem; border-top: 1px solid var(--t-border); color: var(--t-muted); font-size: .85rem; }
.tg-code { min-height: 14rem; font: 500 .85rem/1.5 ui-monospace, 'Cascadia Code', Consolas, monospace; white-space: pre; overflow: auto; }
.tg-dl { margin-top: .75rem; }
#cp-harm { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: .25rem 1.5rem; }
@media (max-width: 600px) { .tg-role-sw { height: 5rem; font-size: 1rem; } }

/* ---- Video converter ----------------------------------------------------- */
.vc-video { width: 100%; max-height: 50vh; background: #000; border-radius: var(--r-md); display: block; }
.vc-facts { display: grid; gap: .35rem; margin: .9rem 0 0; width: 100%; font-size: .92rem; }
.vc-facts div { display: grid; grid-template-columns: 5.5rem 1fr; gap: .5rem; padding-bottom: .35rem; border-bottom: 1px solid var(--line); }
.vc-facts dt { font-weight: 700; color: var(--muted); }
.vc-facts dd { margin: 0; overflow-wrap: anywhere; }
.vc-formats { margin-bottom: .4rem; }

/* ---- Image resizer --------------------------------------------------------- */
.ir-layout { display: grid; gap: 1.5rem 2.5rem; margin-top: 1.25rem; }
@media (min-width: 900px) { .ir-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } .ir-preview-col { position: sticky; top: 1rem; align-self: start; } }
.ir-controls .field { margin-bottom: 1rem; }
.ir-mode { margin-bottom: .25rem; }
.ir-bg-help { align-self: center; margin: 0; max-width: 30ch; }
.ir-compare { position: relative; max-width: 100%; margin: 0 auto; border-radius: var(--r-md); overflow: hidden; background: var(--sunk); min-height: 120px;
  background-image: repeating-conic-gradient(#e9edf3 0 25%, #fff 0 50%); background-size: 16px 16px; }
.ir-compare canvas { position: absolute; inset: 0; display: block; }
.ir-compare input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 2; }
.ir-tag { position: absolute; top: .5rem; z-index: 1; padding: .15rem .5rem; border-radius: 999px; background: rgba(17,22,31,.75); color: #fff; font-size: .75rem; font-weight: 700; }
.ir-tag-l { left: .5rem; } .ir-tag-r { right: .5rem; }
.ir-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.ir-item { display: flex; align-items: center; gap: .75rem; padding: .25rem .5rem; border-radius: var(--r-sm); border: 1px solid var(--line); }
.ir-item.is-current { border-color: var(--c-photo); background: var(--t-photo); }
.ir-pick { flex: 1; display: grid; gap: .1rem; text-align: left; background: none; border: 0; padding: .35rem 0; color: var(--ink); cursor: pointer; font: inherit; min-width: 0; }
.ir-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ir-dim { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ir-compare { box-shadow: 0 0 0 1px var(--line), var(--shadow); }

/* Format guide table (video converter) */
.fmt-table-wrap { overflow-x: auto; margin: 1rem 0 1.25rem; border: 1px solid var(--line); border-radius: var(--r-md); }
.fmt-table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 34rem; }
.fmt-table th, .fmt-table td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.fmt-table thead th { background: var(--sunk); font-size: .82rem; color: var(--muted); }
.fmt-table tbody th { font-weight: 700; white-space: nowrap; }
.fmt-table tbody tr:last-child th, .fmt-table tbody tr:last-child td { border-bottom: 0; }
.content-main .prose:has(.fmt-table) { max-width: none; }

/* ---- EXIF viewer ----------------------------------------------------------- */
.ex-layout { display: grid; gap: 1.5rem 2.5rem; margin-top: 1.25rem; }
@media (min-width: 900px) { .ex-layout { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); } .ex-side { position: sticky; top: 1rem; align-self: start; } }
.ex-list { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .3rem; max-height: 22rem; overflow: auto; }
.ex-item button { width: 100%; display: grid; gap: .25rem; text-align: left; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; }
.ex-item.is-current button { border-color: var(--c-photo); background: var(--t-photo); }
.ex-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-badges { display: flex; flex-wrap: wrap; gap: .25rem; }
.ex-badge { font-size: .72rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; background: var(--sunk); color: var(--muted); }
.ex-badge.is-high { background: var(--t-video); color: var(--c-video); }
.ex-badge.is-mid { background: var(--t-text); color: var(--c-text); }
.ex-badge.is-ok { background: var(--t-print); color: var(--c-print); }
.ex-clean { border-top: 1px solid var(--line); padding-top: 1rem; }
.ex-head { display: grid; grid-template-columns: 110px 1fr; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.ex-preview { width: 110px; height: 110px; object-fit: cover; border-radius: var(--r-md); background: var(--sunk); }
.ex-noprev { display: grid; place-items: center; font-size: .75rem; color: var(--muted); text-align: center; padding: .5rem; }
.ex-title { font-size: 1.15rem; margin: 0 0 .2rem; overflow-wrap: anywhere; }
.ex-reveal { border: 1px solid var(--line); border-radius: var(--r-md); padding: 1rem 1.1rem; margin-bottom: 1.25rem; background: var(--surface); }
.ex-reveal h3, .ex-group h3 { font-size: 1rem; margin: 0 0 .6rem; }
.ex-reveal ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.ex-reveal li { display: grid; gap: .1rem; padding-left: .75rem; border-left: 3px solid var(--line); }
.ex-reveal li.is-high { border-color: var(--magenta); }
.ex-reveal li.is-high strong { color: var(--magenta); }
.ex-reveal li.is-mid { border-color: var(--c-text); }
.ex-reveal li span { color: var(--muted); font-size: .92rem; overflow-wrap: anywhere; }
.ex-clean-note { color: var(--c-print); font-weight: 700; margin: 0; }
.ex-map { margin: .9rem 0 0; font-size: .92rem; }
.ex-thumb { display: flex; align-items: center; gap: .75rem; margin: .9rem 0 0; }
.ex-thumb img { width: 90px; height: auto; border-radius: 4px; box-shadow: var(--shadow); }
.ex-group { margin-bottom: 1rem; }
.ex-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ex-table th, .ex-table td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.ex-table th { width: 40%; font-weight: 600; color: var(--muted); }
.ex-table-all { min-width: 30rem; }
.ex-table-all th { width: 32%; }
.ex-grp { font-size: .7rem; font-weight: 700; color: var(--muted); width: 4.5rem; }
.ex-all { margin-top: .5rem; }
.content-layout > * { min-width: 0; }

/* ---- Video to GIF ---------------------------------------------------------- */
.gf-result { margin-top: 1.25rem; width: 100%; padding: 1rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.gf-result img { display: block; max-width: 100%; height: auto; margin: 0 auto .75rem; border-radius: 4px; background: repeating-conic-gradient(#e9edf3 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.gf-result audio { width: 100%; margin-bottom: .5rem; }

/* ---- Print size calculator ------------------------------------------------- */
.pc-units { display: flex; align-items: center; gap: .6rem; margin: 0 0 1.25rem; }
.pc-units .seg { margin: 0; }
.pc-drop { padding: 1rem; margin-bottom: 1rem; }
.pc-big { display: grid; gap: .2rem; padding: 1rem 1.2rem; margin: .5rem 0 1.25rem; border-radius: var(--r-md); background: var(--t-print); }
.pc-big .stat-v { font: 760 clamp(1.8rem, 5vw, 2.6rem)/1.1 var(--font-display); color: var(--c-print); letter-spacing: -.02em; }
.pc-table td:nth-child(2) { font-variant-numeric: tabular-nums; font-weight: 700; }
.pc-dist-out { font-weight: 600; }
.pc-files { list-style: none; padding: 0; margin: .25rem 0 1rem; display: grid; gap: .3rem; font-size: .92rem; }
