/* The free tools: the hub and the tool pages. Site tokens only (site.css); every tool's states (empty, loading, error, too
   large, unsupported) are drawn here so each tool looks like the others. */

/* ---- The hub ---- */
.tools-hero { padding-bottom: 48px; }
.tools-filter { position: relative; max-width: 420px; margin: 32px 0 0; }
.tools-filter[hidden] { display: none; }
.tools-filter input { width: 100%; height: 44px; padding: 0 14px 0 40px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--paper); color: var(--text); font: 400 16px/1 var(--sans); -webkit-appearance: none; appearance: none; }
.tools-filter input::placeholder { color: var(--faint); }
.tools-filter input:hover { border-color: var(--border-stronger); }
.tools-filter input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--accent); }
.tools-filter-icon { position: absolute; left: 15px; top: 14px; width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.tools-hub { padding-bottom: 96px; }
.tools-cat { padding: 36px 0 8px; border-top: 1px solid var(--rule); }
.tools-cat[hidden] { display: none; }
.tools-cat h2 { margin: 0 0 18px; font-size: 26px; }
.tools-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tools-cards li[hidden] { display: none; }
.tools-cards a, .tool-related a { display: grid; align-content: start; gap: 4px; height: 100%; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--paper); color: var(--text); text-decoration: none; transition: border-color 150ms var(--ease), background-color 150ms var(--ease); }
.tools-cards a:hover, .tool-related a:hover { border-color: var(--accent-line); background: var(--canvas); color: var(--text); }
.tools-cards a:focus-visible, .tool-related a:focus-visible { border-radius: var(--r-lg); }
.tools-cards b, .tool-related b { font: 600 16px/1.35 var(--sans); }
.tools-cards span, .tool-related span { font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.tools-empty { margin: 36px 0 0; padding: 28px; border-radius: var(--r-lg); background: var(--panel); text-align: center; color: var(--muted); }
.tools-empty[hidden] { display: none; }
.tools-empty b { color: var(--text); font-weight: 600; }

/* ---- A tool page ---- */
.tool-bar { border-bottom: 1px solid var(--rule); }
.tool-bar-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; }
.tool-bar a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font: 500 14px/1 var(--sans); text-decoration: none; }
.tool-bar-back { color: var(--muted); }
.tool-bar-back:hover { color: var(--text); }
.tool-bar-start { color: var(--accent); }
.tool-bar-start:hover { color: var(--accent-hi); text-decoration: underline; }
.tool-head { padding-top: 40px; padding-bottom: 24px; }
.tool-head h1 { font-size: 44px; line-height: 1.08; }
.tool-sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; margin-top: 14px; }
.tool-lede { margin: 0; max-width: 40em; font-size: 18px; line-height: 1.5; color: var(--muted); }
.tool-local { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; color: var(--ok-ink); }
.tool-local svg { width: 16px; height: 16px; flex: none; }
.tool-wrap { padding-bottom: 40px; }
.tool { min-height: 120px; }
.tool-loading { margin: 0; padding: 40px 0; text-align: center; color: var(--muted); }
.tool-msg { margin: 0; padding: 24px; border-radius: var(--r-lg); background: var(--panel); color: var(--muted); }

.tool-cta { margin: 8px 0 0; padding: 22px 24px; border-radius: var(--r-xl); background: var(--accent-soft); }
.tool-cta-row { display: flex; align-items: center; gap: 16px; }
.tool-cta .pglyph { width: 24px; height: 24px; flex: none; color: var(--accent-hi); }
.tool-cta p { flex: 1; margin: 0; font-size: 16.5px; line-height: 1.5; color: var(--text); }
.tool-body { padding-top: 56px; }
.tool-body .prose { max-width: 720px; }
.tool-related { padding-top: 40px; padding-bottom: 96px; }
.tool-related h2 { margin: 0 0 16px; font: 600 15px/1.3 var(--sans); letter-spacing: 0; color: var(--text); }
.tool-related ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

/* ---- The shared kit: taking a file ---- */
.intake[hidden] { display: none; }
.intake-zone { display: grid; justify-items: center; gap: 10px; padding: 48px 24px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-xl); background: var(--paper); text-align: center; transition: border-color 150ms var(--ease), background-color 150ms var(--ease); }
.intake-icon { width: 28px; height: 28px; color: var(--faint); }
.intake-line { margin: 0; font-size: 16px; color: var(--text); }
.intake-hint { margin: 0; font-size: 14px; color: var(--muted); }
.is-dragging .intake-zone, .it.is-dragging { border-color: var(--accent); background: var(--accent-soft); }
.it.is-dragging { outline: 2px dashed var(--accent); outline-offset: 6px; border-radius: var(--r-xl); }

/* ---- Messages: a refusal (an alert, with its reason), opening, a note, a hint or a field's error ---- */
.it-msg { margin: 16px 0 0; padding: 14px 16px 14px 44px; position: relative; border-radius: var(--r); background: var(--danger-soft); color: var(--danger-ink); font-size: 15px; line-height: 1.5; }
.it-msg::before { content: "!"; position: absolute; left: 16px; top: 15px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--danger); color: var(--paper); font: 700 12px/1 var(--sans); }
.it-msg[hidden], .it-loading[hidden], .it-note[hidden], .it-hint[hidden], .it-work[hidden] { display: none; }
.it-loading { margin: 0; padding: 48px 24px; border-radius: var(--r-xl); background: var(--panel); text-align: center; color: var(--muted); }
.it-note { margin: 0 0 16px; padding: 10px 14px; border-radius: var(--r); background: var(--panel); font-size: 14.5px; color: var(--text); }
.it-hint { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.it-hint.is-error { color: var(--danger); font-weight: 500; }
.it-hint.is-error::before { content: "Error: "; }

/* ---- Controls ---- */
.it-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 24px; }
.it-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.it-row[hidden] { display: none; }
.seg { margin: 0; padding: 0; border: 0; min-width: 0; }
.seg legend, .field > span { display: block; margin-bottom: 6px; padding: 0; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.seg-row { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: var(--r); background: var(--panel); }
.seg label { position: relative; display: inline-flex; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 7px; font: 500 14px/1 var(--sans); color: var(--muted); transition: background-color 150ms var(--ease), color 150ms var(--ease); }
.seg label:hover span { color: var(--text); }
.seg input:checked + span { background: var(--paper); color: var(--text); box-shadow: 0 1px 2px rgba(34, 31, 26, .12), 0 0 0 1px var(--border); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.field { display: block; }
.field input[type="number"] { width: 112px; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--paper); color: var(--text); font: 400 15px/1 var(--sans); }
.field-sm input[type="number"] { width: 92px; }
.field input[type="number"]:hover { border-color: var(--border-stronger); }
.field input[type="number"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--accent); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field-range { display: grid; grid-template-columns: auto 52px; align-items: center; column-gap: 12px; }
.field-range > span { grid-column: 1 / -1; }
.field-range input { width: 220px; max-width: 100%; height: 40px; margin: 0; accent-color: var(--accent); }
.field-range output { font: 500 14px/1 var(--mono); color: var(--text); }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14.5px; color: var(--text); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.it-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { height: 36px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--paper); color: var(--text); font: 500 14px/1 var(--sans); cursor: pointer; transition: background-color 150ms var(--ease), border-color 150ms var(--ease); }
.chip-btn:hover { background: var(--panel); border-color: var(--border-stronger); }
.chip-btn:active { transform: translateY(1px); }
.chip-btn:focus-visible { border-radius: var(--r-sm); }

/* ---- Before and after ---- */
.it-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.it-fig { min-width: 0; }
/* The frame shows transparency as a faint check, so a transparent PNG reads as transparent. */
.it-frame { display: grid; place-items: center; min-height: 240px; padding: 12px; border-radius: var(--r-lg); background-color: var(--panel); background-image: linear-gradient(45deg, var(--panel-2) 25%, transparent 25%, transparent 75%, var(--panel-2) 75%), linear-gradient(45deg, var(--panel-2) 25%, transparent 25%, transparent 75%, var(--panel-2) 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; overflow: hidden; }
.it-img { display: block; max-width: 100%; max-height: 420px; width: auto; height: auto; object-fit: contain; }
.it-fig figcaption { margin-top: 8px; font-size: 14px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.it-fig figcaption b { color: var(--text); font-weight: 600; margin-right: 4px; }
.it.is-working .it-after .it-frame { opacity: .55; transition: opacity 150ms var(--ease); }
.it-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary:disabled:hover { background: var(--accent); }

/* ---- The cropper's stage ---- */
.crop-stage { position: relative; display: inline-block; max-width: 100%; line-height: 0; overflow: hidden; touch-action: none; }
.crop-stage .it-img { max-height: 420px; }
.crop-box { position: absolute; box-shadow: 0 0 0 9999px color-mix(in srgb, var(--text) 50%, transparent); outline: 2px solid var(--paper); cursor: move; touch-action: none; }
.crop-box:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-radius: 0; }
.crop-handle { position: absolute; width: var(--handle, 44px); height: var(--handle, 44px); touch-action: none; }
/* Each corner is a target inside the crop area, so the stage never clips it, shown as a two-tone bracket (a dark edge under a
   light stroke) that reads on light and dark screenshots alike. */
.crop-handle::before, .crop-handle::after { content: ""; position: absolute; border: 0 solid var(--paper); }
.crop-handle::before { width: 24px; height: 24px; border-color: var(--text); }
.crop-handle::after { width: 20px; height: 20px; }
.crop-handle[data-corner="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.crop-handle[data-corner="ne"] { right: 0; top: 0; cursor: nesw-resize; }
.crop-handle[data-corner="sw"] { left: 0; bottom: 0; cursor: nesw-resize; }
.crop-handle[data-corner="se"] { right: 0; bottom: 0; cursor: nwse-resize; }
.crop-handle[data-corner="nw"]::before { left: 0; top: 0; border-left-width: 6px; border-top-width: 6px; }
.crop-handle[data-corner="nw"]::after { left: 1px; top: 1px; border-left-width: 4px; border-top-width: 4px; }
.crop-handle[data-corner="ne"]::before { right: 0; top: 0; border-right-width: 6px; border-top-width: 6px; }
.crop-handle[data-corner="ne"]::after { right: 1px; top: 1px; border-right-width: 4px; border-top-width: 4px; }
.crop-handle[data-corner="sw"]::before { left: 0; bottom: 0; border-left-width: 6px; border-bottom-width: 6px; }
.crop-handle[data-corner="sw"]::after { left: 1px; bottom: 1px; border-left-width: 4px; border-bottom-width: 4px; }
.crop-handle[data-corner="se"]::before { right: 0; bottom: 0; border-right-width: 6px; border-bottom-width: 6px; }
.crop-handle[data-corner="se"]::after { right: 1px; bottom: 1px; border-right-width: 4px; border-bottom-width: 4px; }

/* ---- The annotation editor ---- */
.ed-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin-bottom: 16px; }
.ed-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-tool { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--paper); color: var(--text); font: 500 14px/1 var(--sans); cursor: pointer; transition: background-color 150ms var(--ease), border-color 150ms var(--ease); }
.ed-tool svg { width: 18px; height: 18px; flex: none; }
.ed-tool:hover { background: var(--panel); border-color: var(--border-stronger); }
.ed-tool:active { transform: translateY(1px); }
.ed-tool[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hi); }
.ed-text input { width: 220px; max-width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--paper); color: var(--text); font: 400 15px/1 var(--sans); }
.ed-text input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--accent); }
.ed-text[hidden] { display: none; }
.ed-history { display: flex; gap: 6px; margin-left: auto; }
.ed-history .chip-btn { height: 40px; }
.chip-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.chip-btn:disabled:hover { background: var(--paper); border-color: var(--border-strong); }
.ed-main { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; align-items: start; }
.ed-stage { position: relative; display: grid; place-items: center; padding: 12px; border-radius: var(--r-lg); background: var(--panel); }
/* Over the image: a button per mark (for Tab; the canvas does the pointer's hit testing), the selection and its handles. */
.ed-layer { position: absolute; pointer-events: none; }
.ed-hit { position: absolute; margin: 0; padding: 0; border: 0; background: none; pointer-events: none; }
.ed-hit:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.ed-sel { position: absolute; outline: 1.5px dashed var(--paper); box-shadow: 0 0 0 1.5px var(--text); pointer-events: none; }
.ed-handle { position: absolute; width: 32px; height: 32px; margin: -16px 0 0 -16px; pointer-events: auto; touch-action: none; cursor: grab; }
.ed-handle::before { content: ""; position: absolute; inset: 10px; border: 2px solid var(--text); border-radius: 3px; background: var(--paper); }
.ed-handle[data-handle="nw"], .ed-handle[data-handle="se"] { cursor: nwse-resize; }
.ed-handle[data-handle="ne"], .ed-handle[data-handle="sw"] { cursor: nesw-resize; }
.ed-canvas[data-tool="select"] { cursor: default; }
.ed-colours { display: flex; gap: 4px; padding: 3px; border-radius: var(--r); background: var(--panel); }
.ed-colour { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: var(--r-sm); background: none; cursor: pointer; }
.ed-colour span { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.ed-colour:hover { background: var(--paper); }
.ed-colour[aria-pressed="true"] { background: var(--paper); box-shadow: 0 0 0 1px var(--border-stronger); }
.ed-colour[aria-pressed="true"] span { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px currentColor; color: var(--text); }
.ed-canvas { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; cursor: crosshair; touch-action: none; border-radius: 2px; }
.ed-canvas[data-tool="text"] { cursor: text; }
.ed-canvas:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.ed-side { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--paper); }
.ed-side-title { margin: 0 0 8px; font: 600 13.5px/1.3 var(--sans); color: var(--muted); }
.ed-marks { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; counter-reset: none; }
.ed-marks li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; font-size: 14.5px; }
.ed-mark-label { flex: 1; min-width: 0; min-height: 32px; padding: 4px 8px; margin-left: -8px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text); font: inherit; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.ed-mark-label:hover { background: var(--panel); }
.ed-marks li.is-selected .ed-mark-label { background: var(--accent-soft); color: var(--accent-hi); font-weight: 500; }
.ed-marks .ed-empty { display: block; min-height: 0; padding: 4px 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.ed-remove { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); cursor: pointer; }
.ed-remove svg { width: 16px; height: 16px; }
.ed-remove:hover { background: var(--danger-soft); color: var(--danger); }
.ed-keys { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 13px; line-height: 1.5; color: var(--muted); }

/* ---- Templates, packs and the bug report form ---- */
.tc, .br { display: grid; gap: 20px; }
.tc-pick { margin: 0; padding: 0; border: 0; min-width: 0; }
.tc-pick legend { margin-bottom: 10px; padding: 0; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.tc-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.tc-option { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--paper); cursor: pointer; transition: border-color 150ms var(--ease), background-color 150ms var(--ease); }
.tc-option:hover { border-color: var(--border-stronger); }
.tc-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.tc-option:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.tc-option input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.tc-option input:focus-visible { outline: none; }
.tc-text { display: grid; gap: 2px; }
.tc-name { font: 600 15.5px/1.3 var(--sans); color: var(--text); }
.tc-about { font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.tc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.tc-status { margin: 0; font-size: 14.5px; color: var(--muted); }
.tc-status:empty { display: none; }
.tc-status.is-error { color: var(--danger); font-weight: 500; }
.tc-status.is-error::before { content: "Error: "; }
.tc-preview { display: grid; gap: 12px; }
.tc-cols { padding: 14px 16px; border-radius: var(--r-lg); background: var(--panel); }
.tc-cols-name { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.tc-cols ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tc-cols li { padding: 3px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--paper); font-size: 13px; }
.tc-start { margin: 0; padding: 14px 16px; border-radius: var(--r); background: var(--panel); font-size: 15px; line-height: 1.5; }
.tc-files { margin: 0; font-size: 14px; color: var(--muted); }
/* The case table: rendered at build time, so the rows are in the page's HTML. A wide template scrolls in its own box. */
.tc-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--paper); }
.tc-table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.tc-table caption { padding: 12px 16px; text-align: left; font: 600 14px/1.3 var(--sans); color: var(--text); border-bottom: 1px solid var(--rule); }
.tc-table th, .tc-table td { padding: 12px 14px; text-align: left; vertical-align: top; border-top: 1px solid var(--rule); }
.tc-table thead th { border-top: 0; background: var(--panel); font: 600 13px/1.3 var(--sans); color: var(--muted); white-space: nowrap; }
.tc-table tbody th { font: 500 13px/1.6 var(--mono); color: var(--muted); white-space: nowrap; }
.tc-table [data-col="Steps"] { min-width: 15em; }
.tc-table [data-col="Expected result"] { min-width: 13em; }
.tc-table td[data-col="Title"], .tc-table td[data-col="Check"] { font-weight: 600; min-width: 10em; }
.tc-type, .tc-status-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--panel); font-size: 12.5px; font-weight: 500; line-height: 1.5; color: var(--text); white-space: nowrap; }
.tc-type[data-type="negative"], .tc-status-badge[data-status="bad"] { background: var(--danger-soft); color: var(--danger-ink); }
.tc-type[data-type="positive"], .tc-status-badge[data-status="ok"] { background: var(--ok-soft); color: var(--ok-ink); }
.tc-type[data-type="boundary"] { background: var(--accent-soft); color: var(--accent-hi); }
.tc-steps { margin: 0; padding-left: 1.3em; }
.tc-steps li { margin: 0 0 2px; }

/* ---- Promotions that fit the tool: a sample of what the product does, under its line ---- */
.tool-cta.has-figure { display: grid; gap: 18px; }
.promo-fig { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.promo-fig > div, .promo-capture { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--paper); }
.promo-col { margin: 0 0 8px; font: 600 13.5px/1.3 var(--sans); color: var(--muted); }
.promo-fig ul, .promo-fig ol { margin: 0; padding-left: 1.3em; font-size: 14.5px; line-height: 1.55; }
.promo-fig ul.is-auto { list-style: none; padding: 0; }
.promo-fig ul.is-auto li { position: relative; padding-left: 24px; }
.promo-fig ul.is-auto li::before { content: ""; position: absolute; left: 2px; top: .38em; width: 14px; height: 14px; border-radius: 50%; background: var(--ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M4 7.2l2 2L10 5' fill='none' stroke='%2314532d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.promo-case { margin: 0 0 8px; font-size: 14.5px; font-weight: 600; }
.promo-case code { margin-right: 6px; font-weight: 500; }
.promo-code { font: 400 13px/1.7 var(--mono); }
.promo-capture { grid-template-columns: minmax(0, 1fr); }
.promo-head { margin: 0 0 10px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.promo-title { font-weight: 600; }
.promo-pill { padding: 2px 10px; border-radius: 999px; background: var(--ok-soft); color: var(--ok-ink); font-size: 12.5px; font-weight: 500; }
.promo-fig .promo-facts { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; }
.promo-facts li { display: grid; gap: 1px; min-width: 0; }
.promo-facts b { font: 600 12.5px/1.3 var(--sans); color: var(--muted); }
.promo-facts span { font-size: 14px; overflow-wrap: anywhere; }
.promo-note { margin: -8px 0 0; font-size: 13px; color: var(--muted); }
/* The image tools: one line under the result, the file first. */
.tool-cta.is-quiet { margin-top: 0; padding: 16px 0 0; border-radius: 0; border-top: 1px solid var(--rule); background: none; }
.tool-cta.is-quiet p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 15px; color: var(--muted); }
.tool-cta.is-quiet .pglyph { width: 16px; height: 16px; align-self: center; color: var(--muted); }
.tool-cta.is-quiet a { font-weight: 500; }
.br-part { display: grid; gap: 12px; padding: 20px; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--paper); }
.br-title { margin: 0; font: 600 13.5px/1.3 var(--sans); color: var(--muted); }
.br-text { margin: 0; color: var(--muted); }
.br-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.br-wide { grid-column: 1 / -1; }
.br-field { display: grid; gap: 6px; }
.br-field > span { font-size: 13.5px; font-weight: 500; color: var(--muted); }
.br-field small { font-size: 13px; color: var(--muted); }
.br-field input, .br-field textarea, .br-field select { width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--r); background-color: var(--canvas); color: var(--text); font: 400 15px/1.5 var(--sans); }
.br-field textarea { resize: vertical; }
.br-field select { height: 44px; padding-right: 44px; }
.br-field :is(input, textarea, select):hover { border-color: var(--border-stronger); }
.br-field :is(input, textarea, select):focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--accent); }
.br-env { margin-top: -8px; }

/* ---- Text and data tools ---- */
.tp { display: grid; gap: 14px; }
.tp-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.tp-select { display: inline-flex; align-items: center; gap: 8px; margin-right: 8px; font-size: 14px; color: var(--muted); }
.tp-select select { height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--paper); color: var(--text); font: 400 14px/1 var(--sans); }
.tp-select select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.tp-panes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tp-pane { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 6px; min-width: 0; }
.tp-label { margin: 0; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.tp-pane textarea, .tp-output { width: 100%; height: 420px; margin: 0; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--paper); color: var(--text); font: 400 13.5px/1.55 var(--mono); resize: vertical; overflow: auto; white-space: pre; tab-size: 2; }
.tp-pane textarea:hover { border-color: var(--border-stronger); }
.tp-pane textarea:focus-visible, .tp-output:focus-visible, .tp-prompt:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--accent); border-radius: var(--r-lg); }
.tp-pane textarea.is-held::placeholder { color: var(--text); }
.tp-output { background: var(--panel); border-color: var(--border); }
.tp-output:empty::before { content: "The formatted JSON appears here."; color: var(--faint); font-family: var(--sans); }
.tp-error, .tp-refusal { margin: 0; padding: 12px 16px; border-radius: var(--r); background: var(--danger-soft); color: var(--danger-ink); font-size: 15px; }
.tp-error[hidden], .tp-refusal[hidden] { display: none; }
.tp-error.is-note { background: var(--panel); color: var(--text); }
.tp-error p { margin: 0; }
.tp-where { margin: 8px 0 0; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: var(--paper); color: var(--text); font: 400 13px/1.5 var(--mono); white-space: pre; overflow-x: auto; }
.tp-status { margin: 0; font-size: 14px; color: var(--muted); }
.tp-status:empty { display: none; }
.tp-note { margin: 0; padding: 12px 16px; border-radius: var(--r); background: var(--panel); font-size: 15px; }
.td-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.td-summary { margin: 0; font-weight: 600; }
.td-out { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--paper); overflow: auto; max-height: 640px; }
.td-out:empty { display: none; }
.td-row { display: grid; grid-template-columns: 3.5em 3.5em 1.5em minmax(0, 1fr); font: 400 13.5px/1.6 var(--mono); }
.td-n { padding: 0 8px; text-align: right; color: var(--faint); user-select: none; border-right: 1px solid var(--rule); }
.td-sign { text-align: center; font-weight: 600; }
.td-text { padding: 0 12px 0 4px; background: none; border-radius: 0; font-size: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.td-row.is-del { background: var(--danger-soft); color: var(--danger-ink); }
.td-row.is-add { background: var(--ok-soft); color: var(--ok-ink); }
.td-row del { background: color-mix(in srgb, var(--danger) 22%, transparent); text-decoration: line-through; border-radius: 3px; }
.td-row ins { background: color-mix(in srgb, var(--ok) 24%, transparent); text-decoration: none; border-radius: 3px; font-weight: 600; }
.td-fold { margin: 0; padding: 4px 12px; background: var(--panel); color: var(--muted); font-size: 13px; text-align: center; }
.bd { display: grid; gap: 16px; }
.bd-list { margin: 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--paper); overflow: hidden; }
.bd-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; padding: 10px 16px; border-top: 1px solid var(--rule); }
.bd-row:first-child { border-top: 0; }
.bd-row dt { color: var(--muted); font-size: 14.5px; }
.bd-row dd { margin: 0; font: 500 14.5px/1.5 var(--sans); overflow-wrap: anywhere; }
.bd-note { margin: 0; font-size: 14px; color: var(--muted); }
.ap { display: grid; gap: 20px; }
.ap-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ap-fields { display: grid; gap: 14px; }
.ap-out { display: grid; gap: 8px; position: sticky; top: calc(var(--header-h) + 16px); }
.tp-prompt { margin: 0; min-height: 240px; max-height: 60vh; overflow: auto; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--panel); font: 400 14px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 880px) {
  .tools-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-related ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ed-main { grid-template-columns: minmax(0, 1fr); }
  .tp-panes, .ap-grid { grid-template-columns: minmax(0, 1fr); }
  .tp-pane textarea, .tp-output { height: 280px; }
  .ap-out { position: static; }
  .promo-fig .promo-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .tools-cards, .tool-related ul { grid-template-columns: minmax(0, 1fr); }
  .tools-cat h2 { font-size: 24px; }
  .tool-head { padding-top: 28px; }
  .tool-head h1 { font-size: 34px; }
  .tool-lede { font-size: 16.5px; }
  /* The header's Start free carries the tool's ref on a phone; the tool bar's would repeat it one row below. */
  .tool-bar .tool-bar-start { display: none; }
  .tool-cta-row { flex-direction: column; align-items: stretch; text-align: left; }
  .tool-cta .pglyph { display: none; }
  .tool-cta .btn { width: 100%; }
  .tool-body { padding-top: 40px; }
  .tool-related { padding-bottom: 64px; }
  .intake-zone { padding: 32px 16px; }
  .it-preview { grid-template-columns: minmax(0, 1fr); }
  .it-frame { min-height: 160px; }
  .it-actions .btn { flex: 1 1 100%; }
  .field-range input { width: 100%; }
  .field-range { grid-template-columns: minmax(0, 1fr) 52px; width: 100%; }
  .it-row:has(.field-sm) { gap: 10px; }
  .field-sm input[type="number"] { width: 74px; }
  .ed-tool { padding: 0 10px; }
  .ed-history { margin-left: 0; }
  .ed-stage { padding: 6px; }
  .br-form { grid-template-columns: minmax(0, 1fr); }
  .br-part { padding: 16px; }
  .tc-actions .btn { flex: 1 1 100%; }
  /* On a phone a case reads as a block: each cell on its own line under its column's name. */
  .tc-table-wrap { overflow: visible; border: 0; background: none; }
  .tc-table caption { padding: 0 0 10px; border: 0; }
  .tc-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tc-table, .tc-table tbody, .tc-table tr, .tc-table th, .tc-table td { display: block; }
  .tc-table caption { display: block; }
  .tc-table tr { display: flex; flex-direction: column; margin-bottom: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--paper); }
  .tc-table tbody th { order: -2; }
  .tc-table td[data-col="Title"], .tc-table td[data-col="Check"] { order: -1; font-size: 15.5px; }
  .tc-table td:empty { display: none; }
  .tc-table th, .tc-table td { padding: 4px 0; border: 0; min-width: 0 !important; }
  .tc-table td::before { content: attr(data-label); display: block; font: 600 12.5px/1.4 var(--sans); color: var(--muted); }
  .tc-table td[data-col="Title"]::before, .tc-table td[data-col="Check"]::before { content: none; }
  .promo-fig { grid-template-columns: minmax(0, 1fr); }
  .bd-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .td-row { grid-template-columns: 2.6em 2.6em 1.2em minmax(0, 1fr); font-size: 12.5px; }
}
.td-more { justify-self: start; }
.td-more[hidden] { display: none; }
.promo-expect { margin: 8px 0 0; font-size: 14.5px; }
