/* PocketPlay tools network, kit v2 site CSS.
   Loads after /_kit/v2/pp.css and uses only its tokens. Three jobs:
   1. page furniture for tool pages and the hub / sub-site homes,
   2. a compatibility layer that maps the original tool vocabulary (.panel, .btn-primary, .dropzone, .input …)
      onto kit v2 so every tool keeps its DOM, ids and scripts while looking like the rest of PocketPlay,
   3. old custom-property names (--panel, --fg, --muted …) aliased to kit tokens for the 120 inline <style> blocks. */

/* ─────────────── 0. Token aliases for legacy tool styles ─────────────── */
:root {
  --panel: var(--surface); --panel-2: var(--surface-2);
  --fg: var(--ink); --muted: var(--ink-2); --dim: var(--ink-3);
  --accent-fg: var(--accent-ink); --soft: var(--bg-2);
  --radius: var(--r-m); --shadow: var(--shadow-1); --shadow-lift: var(--shadow-2);
  --topbar-h: var(--header-h);
}
.pp [hidden] { display: none !important; }

/* ─────────────── 1. Tool page furniture ─────────────── */
.tool-head { padding-top: 22px; display: grid; gap: 14px; }
.tool-head .pp-crumbs { justify-content: flex-start; }
.tool-head__main { position: relative; display: grid; justify-items: center; text-align: center; gap: 14px; padding: 18px 0 8px; }
.tool-head__main::before { content: ""; position: absolute; z-index: -1; left: 50%; top: -6px; width: min(760px, 100%); height: 230px; transform: translateX(-50%);
  background: radial-gradient(46% 62% at 50% 28%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 72%); filter: blur(8px); pointer-events: none; }
.tool-head .pp-glyph { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), inset 0 -1px 0 rgba(0, 0, 0, .1), 0 2px 4px rgba(23, 21, 15, .12), 0 16px 32px -12px color-mix(in srgb, var(--g) 70%, transparent); }
.tool-head .pp-title { font-size: clamp(32px, 4.4vw, 52px); letter-spacing: -.035em; max-width: 22ch; }
:lang(zh) .tool-head .pp-title { max-width: 18em; }
.tool-head .pp-lede { margin: 0 auto; max-width: 64ch; }
.tool-head .pp-checks { justify-content: center; margin-top: 4px; }
.tool-note { display: flex; align-items: flex-start; gap: 9px; max-width: 68ch; margin: 2px auto 0; padding: 10px 14px; border-radius: var(--r-m); background: var(--warn-soft); color: var(--ink); font-size: 13.5px; line-height: 1.5; text-align: left; }
.tool-note .pp-i { color: var(--warn); margin-top: 2px; }

.tool-stage { margin-top: 26px; }
.tool-surface {
  max-width: 1040px; margin: 0 auto; padding: clamp(10px, 1.8vw, 20px);
  border-radius: var(--r-xl); border: 1px solid var(--accent-tint);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, var(--surface-2)), color-mix(in srgb, var(--accent) 4%, var(--bg)));
  box-shadow: var(--shadow-2);
}
.tool-surface--wide { max-width: none; }
.tool-ad { margin-top: 28px; }

.tool-related-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tool-info { display: grid; gap: 12px; }
.tool-how, .tool-faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1); overflow: hidden; }
.tool-how > summary, .tool-q > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; }
.tool-how > summary::-webkit-details-marker, .tool-q > summary::-webkit-details-marker { display: none; }
.tool-how > summary { padding: 18px 22px; }
.tool-how > summary h2, .tool-faq > h2 { font-size: 20px; letter-spacing: -.02em; }
.tool-how > summary .pp-i, .tool-q > summary .pp-i { color: var(--ink-3); transition: transform .2s var(--ease); }
.tool-how[open] > summary .pp-i, .tool-q[open] > summary .pp-i { transform: rotate(180deg); }
.tool-how__body { padding: 0 22px 22px; color: var(--ink-2); font-size: 15.5px; line-height: 1.7; }
.tool-how__body > * + * { margin-top: .8em; }
.tool-how__body ol { display: grid; gap: 14px; counter-reset: step; }
.tool-how__body ol > li { counter-increment: step; position: relative; padding-left: 46px; min-height: 30px; }
.tool-how__body ol > li::before { content: counter(step); position: absolute; left: 0; top: -1px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-tint); color: var(--accent-text); font: 700 14px/1 var(--font-sans); }
.tool-how__body ul { list-style: disc; padding-left: 1.3em; }
.tool-how__body li > b, .tool-how__body li > strong { color: var(--ink); }
.tool-how__body code, .tool-q__a code { font: .88em var(--font-mono); padding: 2px 6px; border-radius: 6px; background: var(--bg-2); color: var(--ink); }
.tool-faq > h2 { padding: 18px 22px 8px; }
.tool-q { border-top: 1px solid var(--line); }
.tool-faq > h2 + .tool-q { border-top: 0; }
.tool-q > summary { padding: 15px 22px; font-weight: 600; font-size: 15.5px; }
.tool-q > summary:hover { background: var(--surface-2); }
.tool-q__a { padding: 0 22px 18px; color: var(--ink-2); font-size: 15px; line-height: 1.7; }
.tool-q__a > * + * { margin-top: .6em; }
.tool-foot { display: grid; gap: 20px; }
.tool-guides { max-width: 100%; }
.tool-cta { margin-top: 0; }
.tool-legal { text-align: center; }
.tool-legal a:hover { color: var(--ink); text-decoration: underline; }

/* ─────────────── 2. Homes (hub + sub-sites) ─────────────── */
.tool-home-hero { position: relative; padding-top: 60px; gap: 18px; }
.tool-home-hero::before { content: ""; position: absolute; z-index: -1; left: 50%; top: -30px; width: min(1000px, 120vw); height: 460px; transform: translateX(-50%); filter: blur(10px); pointer-events: none;
  background: radial-gradient(40% 52% at 50% 32%, color-mix(in srgb, var(--accent) 17%, transparent), transparent 72%), radial-gradient(30% 40% at 18% 48%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%), radial-gradient(30% 40% at 84% 42%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%); }
.tool-home-hero .pp-display { max-width: 16ch; }
:lang(zh) .tool-home-hero .pp-display { max-width: 14em; }
.tool-home-hero .pp-glyph { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), inset 0 -1px 0 rgba(0, 0, 0, .1), 0 2px 4px rgba(23, 21, 15, .12), 0 16px 32px -12px color-mix(in srgb, var(--g) 70%, transparent); }
.tool-home-hero .pp-searchbar { margin-top: 6px; }
.tool-hub-hero { padding-top: 76px; }
.tool-hub-hero::before { background: radial-gradient(40% 50% at 22% 40%, rgba(229, 72, 77, .10), transparent 70%), radial-gradient(38% 46% at 50% 30%, rgba(232, 164, 0, .14), transparent 70%), radial-gradient(40% 50% at 78% 42%, rgba(62, 99, 221, .10), transparent 70%); }

.tool-feature small { -webkit-line-clamp: 2; }
.tool-feature { align-items: start; }
.tool-feature > .pp-glyph { margin-top: 2px; }
.tool-feature > .pp-i { align-self: center; }
.tool-filter { margin-bottom: 22px; }
.tool-section + .tool-section { margin-top: 34px; }
.tool-section__title { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; font-size: 15px; font-weight: 650; color: var(--ink-2); letter-spacing: -.01em; }
.tool-section__title .pp-count, .az-group .pp-count { font: 500 12px/1 var(--font-mono); color: var(--ink-3); }

.hub-portals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.hub-portal .pp-portal__art { height: 150px; }
.hub-portal .pp-cluster__set { width: 210px; height: 112px; }
.hub-portal .pp-portal__body { padding: 18px 20px 20px; gap: 6px; }
.hub-portal .pp-portal__title { font-size: 19px; }
.hub-portal .pp-portal__text { font: 500 12px/1.2 var(--font-mono); letter-spacing: .04em; color: var(--ink-3); text-transform: uppercase; }
.hub-portal .pp-portal__links { margin-top: 8px; }
.hub-portal .pp-cluster .pp-glyph { --r: 0deg; transform: rotate(var(--r)); }
.hub-portal .hub-g1 { left: 62px; top: 24px; --r: -6deg; }
.hub-portal .hub-g2 { left: 6px; top: 48px; --r: -12deg; }
.hub-portal .hub-g3 { left: 136px; top: 56px; --r: 8deg; }
.hub-portal .hub-g4 { left: 128px; top: 6px; --r: 12deg; }
.hub-portal .hub-g5 { left: 78px; top: 82px; --r: -4deg; }
.hub-portal--request .pp-portal__text { font: 400 14px/1.45 var(--font-sans); letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.hub-portal--request .pp-portal__text { font: 400 14px/1.45 var(--font-sans); letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.hub-portal--request .hub-g1 { left: 66px; top: 20px; --r: -5deg; }
.hub-portal--request .hub-g2 { left: 20px; top: 66px; --r: -12deg; }
.hub-portal--request .hub-g3 { left: 150px; top: 56px; --r: 10deg; }
.hub-popular { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.az-index { column-count: 4; column-gap: 36px; }
.az-group { break-inside: avoid; margin-bottom: 30px; }
.az-group > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; list-style: none; margin-bottom: 10px; cursor: default; }
.az-group > summary::-webkit-details-marker { display: none; }
.az-group > summary > .pp-i { display: none; color: var(--ink-3); transition: transform .2s var(--ease); }
.az-group h3 { font-size: 14px; }
.az-group h3 a { display: inline-flex; align-items: center; gap: 8px; }
.az-group h3 a:hover { color: var(--accent-text); }
.az-group ul { display: grid; gap: 1px; }
.az-group li a { display: block; padding: 3px 0; font-size: 14px; color: var(--ink-2); }
.az-group li a:hover { color: var(--accent-text); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }

/* ─────────────── 3. Legacy tool vocabulary on kit v2 ─────────────── */
.tool-body { min-width: 0; font-size: 15px; }
.tool-body img, .tool-body canvas, .tool-body video { height: auto; }
.tool-body p { margin: 0 0 .7em; }
.tool-body p:last-child { margin-bottom: 0; }
.tool-body ul:not([class]), .tool-body ol:not([class]) { list-style: revert; padding-left: 1.3em; }
.tool-body a:not([class]) { color: var(--accent-text); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }

.tool-body .panel { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-1); }
.tool-body .panel + .panel { margin-top: 14px; }
.tool-body .grid-2 > .panel + .panel, .tool-body .grid-3 > .panel + .panel, .tool-body .grid-auto > .panel + .panel, .tool-body .row > .panel + .panel { margin-top: 0; }
.tool-body .panel-title { margin: 0 0 12px; font-size: 14px; font-weight: 650; letter-spacing: -.01em; color: var(--ink); }
.tool-body .grid-2 { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tool-body .grid-3 { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tool-body .grid-auto { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.tool-body .grid-2 > *, .tool-body .grid-3 > * { min-width: 0; }
.tool-body .row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.tool-body .row.between { justify-content: space-between; }
.tool-body .stack { display: grid; gap: 14px; min-width: 0; }
.tool-body .stack > * { min-width: 0; }
.tool-body .spacer { flex: 1 1 auto; }

/* form controls */
.tool-body .field { display: grid; gap: 6px; min-width: 0; }
.tool-body .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tool-body .input, .tool-body select.input, .tool-body input.input, .tool-body .textpane {
  width: 100%; min-width: 0; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--r-s);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; line-height: 1.4; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.tool-body .input:hover, .tool-body .textpane:hover { border-color: var(--line-3); }
.tool-body .input:focus, .tool-body .textpane:focus { border-color: var(--accent-line); box-shadow: var(--ring); }
.tool-body .input::placeholder, .tool-body .textpane::placeholder { color: var(--ink-4); }
.tool-body select.input { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b867c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.tool-body .input[type="number"] { width: auto; min-width: 96px; }
.tool-body .input[type="color"] { width: 48px; min-height: 44px; height: 44px; padding: 4px; cursor: pointer; }
.tool-body .input.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.tool-body .textpane { min-height: 240px; resize: vertical; font: 13.5px/1.6 var(--font-mono); tab-size: 2; white-space: pre; overflow: auto; }
.tool-body .textpane.wrap { white-space: pre-wrap; }
.tool-body .textpane.short { min-height: 120px; }
.tool-body .textpane[readonly] { background: var(--surface-2); }
.tool-body input[type="range"].range { width: 100%; accent-color: var(--accent); height: 28px; cursor: pointer; }
.tool-body .inline-num { width: 88px !important; }
.tool-body .check { display: inline-flex; align-items: center; gap: 9px; font-size: 14.5px; color: var(--ink-2); cursor: pointer; }
.tool-body .check input { appearance: none; -webkit-appearance: none; flex: none; width: 18px; height: 18px; margin: 0; border-radius: 5px; border: 1.5px solid var(--line-3); background: var(--surface); display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s; }
.tool-body .check input[type="radio"] { border-radius: 50%; }
.tool-body .check input:checked { background: var(--accent); border-color: var(--accent); }
.tool-body .check input[type="checkbox"]:checked::after { content: ""; width: 11px; height: 11px; background: var(--accent-ink); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat; }
.tool-body .check input[type="radio"]:checked::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-ink); }
.tool-body .check input:focus-visible { box-shadow: var(--ring); outline: none; }
.tool-body input[type="checkbox"]:not(.check input), .tool-body input[type="radio"]:not(.check input) { accent-color: var(--accent); }

/* buttons */
.tool-body .btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tool-body .btn-primary, .tool-body .btn-secondary, .tool-body .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--r-pill); font: inherit; font-size: 14.5px; font-weight: 600; letter-spacing: -.005em;
  white-space: nowrap; cursor: pointer; text-decoration: none; transition: transform .12s var(--ease), filter .15s, background .15s, border-color .15s;
}
.tool-body .btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(23, 21, 15, .12); }
.tool-body .btn-primary:hover { filter: brightness(1.06); }
.tool-body .btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-1); }
.tool-body .btn-secondary:hover { border-color: var(--line-3); background: var(--surface-2); }
.tool-body .btn-ghost { background: transparent; color: var(--ink-2); }
.tool-body .btn-ghost:hover { background: var(--hover); color: var(--ink); }
.tool-body .btn-primary:active, .tool-body .btn-secondary:active { transform: translateY(1px); }
.tool-body .btn-sm { min-height: 34px; padding: 0 14px; font-size: 13.5px; }
.tool-body .btn-primary:disabled, .tool-body .btn-secondary:disabled, .tool-body .btn-ghost:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.tool-body .btn-primary.busy::before, .tool-body .btn-secondary.busy::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: pp-spin .7s linear infinite; }

/* tabs -> segmented control */
.tool-body .tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-radius: var(--r-pill); background: var(--bg-2); border: 1px solid var(--line); max-width: 100%; }
.tool-body .tab { min-height: 32px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-2); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.tool-body .tab:hover { color: var(--ink); }
.tool-body .tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.tool-body .tab-panel[hidden] { display: none; }

/* dropzone: the primary action */
.tool-body .dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 250px; padding: 28px 20px; text-align: center; cursor: pointer;
  border: 2px dashed var(--accent-line); border-radius: var(--r-l); color: var(--ink-2);
  background: color-mix(in srgb, var(--accent) 4%, var(--surface)); transition: border-color .15s, background .15s, transform .15s;
}
.tool-body .dropzone:hover, .tool-body .dropzone.is-over, .tool-body .dropzone:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.tool-body .dropzone.is-over { transform: scale(1.005); }
.tool-body .dropzone strong { font-size: 19px; font-weight: 650; letter-spacing: -.02em; color: var(--ink); }
.tool-body .dropzone small { font-size: 14px; color: var(--ink-3); }
.tool-body .dropzone .dz-ico {
  display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 4px; border-radius: 17px; font-size: 0; line-height: 0;
  background: linear-gradient(155deg, color-mix(in srgb, var(--accent) 74%, #fff) 0%, var(--accent) 52%, color-mix(in srgb, var(--accent) 84%, #000) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), 0 1px 2px rgba(23, 21, 15, .14), 0 10px 22px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
.tool-body .dropzone .dz-ico::before { content: ""; width: 27px; height: 27px; background: var(--accent-ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='m17 8-5-5-5 5'/%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='m17 8-5-5-5 5'/%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3C/svg%3E") center/contain no-repeat; }
.tool-body .dropzone[data-cta]::after { content: attr(data-cta); display: inline-flex; align-items: center; height: 46px; margin-top: 10px; padding: 0 28px; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font-size: 15.5px; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(23, 21, 15, .14); }
.tool-body .dropzone.compact { min-height: 76px; flex-direction: row; gap: 14px; padding: 12px 16px; }
.tool-body .dropzone.compact .dz-ico { width: 40px; height: 40px; margin: 0; border-radius: 12px; }
.tool-body .dropzone.compact .dz-ico::before { width: 20px; height: 20px; }
.tool-body .file-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.tool-body .file-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); font-size: 14px; }
.tool-body .file-item .name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.tool-body .file-item .meta { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.tool-body .file-item .thumb { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: var(--bg-2); flex: 0 0 38px; }
.tool-body .file-item .x { border: 0; background: transparent; color: var(--ink-3); font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.tool-body .file-item .x:hover { background: var(--hover); color: var(--ink); }
.tool-body .file-item.dragging { opacity: .5; }

/* results */
.tool-body .stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.tool-body .stat { padding: 14px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); text-align: center; box-shadow: var(--shadow-1); }
.tool-body .stat b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tool-body .stat span { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.tool-body .preview { position: relative; overflow: auto; min-height: 120px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface-2); }
.tool-body .preview img, .tool-body .preview canvas, .tool-body .preview video { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.tool-body .preview.center { display: grid; place-items: center; }
.tool-body .checker { background-color: #fff; background-image: linear-gradient(45deg, #dcdfe6 25%, transparent 25%), linear-gradient(-45deg, #dcdfe6 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #dcdfe6 75%), linear-gradient(-45deg, transparent 75%, #dcdfe6 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
:root[data-theme="dark"] .tool-body .checker { background-color: #2a2f3a; background-image: linear-gradient(45deg, #3a4150 25%, transparent 25%), linear-gradient(-45deg, #3a4150 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #3a4150 75%), linear-gradient(-45deg, transparent 75%, #3a4150 75%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tool-body .checker { background-color: #2a2f3a; background-image: linear-gradient(45deg, #3a4150 25%, transparent 25%), linear-gradient(-45deg, #3a4150 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #3a4150 75%), linear-gradient(-45deg, transparent 75%, #3a4150 75%); } }
.tool-body .hint { margin: 8px 0 0; font-size: 13px; color: var(--ink-3); }
.tool-body .error { margin: 8px 0 0; font-size: 13.5px; color: var(--err); }
.tool-body .mono { font-family: var(--font-mono); }
.tool-body .code { margin: 0; padding: 14px; border-radius: var(--r-s); background: var(--bg-2); border: 1px solid var(--line); font: 13px/1.6 var(--font-mono); overflow: auto; white-space: pre; }
.tool-body .kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 14px; }
.tool-body .kv dt { color: var(--ink-3); }
.tool-body .kv dd { margin: 0; word-break: break-all; }
.tool-body .table-wrap { overflow-x: auto; }
.tool-body table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tool-body table.tbl th, .tool-body table.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tool-body table.tbl th { color: var(--ink-3); font-weight: 600; font-size: 12.5px; }
.tool-body table.tbl tr:hover td { background: var(--surface-2); }
.tool-body .progress { height: 8px; border-radius: var(--r-pill); background: var(--bg-2); overflow: hidden; }
.tool-body .progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }
.tool-body .swatch { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-2); display: inline-block; vertical-align: middle; }
.tool-body .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-body .chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 13px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13.5px; font-weight: 550; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.tool-body .chip:hover { border-color: var(--line-3); color: var(--ink); }
.tool-body .chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.tool-body .badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: var(--r-pill); background: var(--accent-tint); color: var(--accent-text); font-size: 11.5px; font-weight: 600; }
.tool-body .badge.ok { background: var(--ok-soft); color: var(--ok); }
.tool-body .badge.warn { background: var(--warn-soft); color: var(--warn); }

/* kit toast with success / error tint (tools.js delegates to PP.toast) */
.pp-toast.is-err { background: var(--err); color: #fff; }
.pp-toast.is-ok { background: var(--ok); color: #fff; }

/* ─────────────── 4. Responsive ─────────────── */
@media (max-width: 1080px) {
  .tool-related-grid, .hub-popular { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hub-portals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .az-index { column-count: 2; }
}
@media (max-width: 760px) {
  .tool-body .grid-2, .tool-body .grid-3 { grid-template-columns: 1fr; }
  .pp-grid--3.tool-sites { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .tool-head { padding-top: 14px; }
  .tool-head__main { padding-top: 10px; }
  .tool-head .pp-glyph { --gs: 64px; }
  .tool-home-hero { padding-top: 40px; }
  .tool-surface { padding: 8px; border-radius: var(--r-l); }
  .tool-body .panel { padding: 14px; border-radius: var(--r-m); }
  .tool-body .btn-primary, .tool-body .btn-secondary { flex: 1 1 auto; }
  .tool-body .dropzone { min-height: 200px; padding: 22px 14px; }
  .tool-related-grid, .hub-popular { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-portals { grid-template-columns: 1fr; gap: 14px; }
  .hub-portal .pp-portal__art { height: 116px; }
  .hub-portal .pp-cluster__set { transform: scale(.82); }
  .az-index { column-count: 1; }
  .az-group { margin-bottom: 0; border-top: 1px solid var(--line); padding: 12px 0; }
  .az-group > summary { cursor: pointer; margin-bottom: 0; }
  .az-group > summary > .pp-i { display: block; }
  .az-group[open] > summary { margin-bottom: 8px; }
  .az-group[open] > summary > .pp-i { transform: rotate(180deg); }
  .az-group ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }
  .tool-how > summary, .tool-how__body, .tool-q > summary, .tool-q__a, .tool-faq > h2 { padding-left: 16px; padding-right: 16px; }
  .tool-how__body { padding-bottom: 18px; }
}
