/* Free tools platform (/tools/): catalogue search + chips, tool page shell and the kit UI (drop zone, file list, options,
   progress, result). Loaded by the tools templates only, after the site shell's own CSS. Tokens only: no colour literals
   (ui/tests.py). Class prefix tk- ; the JS kit is web/static/web/tools/kit/kit.js (docs/tools/CONTRACT.md). */

/* ---------------------------------------------------------------- catalogue */
.tk-find { padding-bottom: 0; }
.tk-search { max-width: 640px; }
.tk-search[hidden], .tk-chips[hidden], [data-empty][hidden] { display: none; }
.tk-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.tk-chip { min-height: var(--control-h-lg); padding: 0 var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--ink-2); font: inherit; font-size: var(--fs-14); cursor: pointer; transition: border-color var(--t) var(--ease), background var(--t) var(--ease); }
.tk-chip:hover { border-color: var(--brand); }
.tk-chip.is-on { background: var(--brand); border-color: var(--brand); color: var(--ink-inverse); font-weight: var(--fw-semibold); }
.tk-chip:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 2px; }
.tk-item { display: contents; }
.tk-item[hidden], [data-section][hidden], [data-popular][hidden] { display: none; }

/* ---------------------------------------------------------------- tool page shell */
.tk { display: flex; flex-direction: column; gap: var(--s-4); }
.tk__mount { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-6); min-height: 220px; }
.tk__privacy { display: flex; align-items: flex-start; gap: var(--s-2); margin: 0; color: var(--muted); font-size: var(--fs-14); }
.tk__privacy svg { flex: none; margin-top: 2px; color: var(--success); }
.tk__nojs { padding: var(--s-4); border: 1px solid var(--warning-line); border-radius: var(--r); background: var(--warning-bg); color: var(--warning); }
.tk-steps { display: grid; gap: var(--s-3); margin: 0; padding: 0; list-style: none; max-width: 760px; }
.tk-steps__item { display: flex; gap: var(--s-3); align-items: flex-start; color: var(--ink-2); line-height: var(--lh); }
.tk-steps__n { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-pill); background: var(--brand); color: var(--ink-inverse); font-weight: var(--fw-bold); font-size: var(--fs-14); }

/* ---------------------------------------------------------------- kit: stage + drop zone */
.tk-stage { display: flex; flex-direction: column; gap: var(--s-4); }
.tk-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-2); min-height: 200px; padding: var(--s-7) var(--s-4); border: 2px dashed var(--line-input); border-radius: var(--r-lg); background: var(--surface-2); text-align: center; color: var(--ink-2); transition: border-color var(--t) var(--ease), background var(--t) var(--ease); }
.tk-drop.is-over { border-color: var(--brand); background: var(--surface-sel); }
.tk-drop svg { color: var(--brand); }
.tk-drop__title { margin: 0; font-size: var(--fs-20); font-weight: var(--fw-semibold); color: var(--ink); }
.tk-drop__hint { margin: 0; font-size: var(--fs-14); color: var(--muted); }
.tk-drop__input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tk-drop--compact { min-height: 0; padding: var(--s-4); flex-direction: row; justify-content: center; }

/* ---------------------------------------------------------------- kit: file list */
.tk-list { display: grid; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.tk-file { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s-3); padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.tk-file.is-dragging { opacity: .5; }
.tk-file.is-target { border-color: var(--brand); }
.tk-file__grip { cursor: grab; color: var(--muted); display: inline-grid; place-items: center; min-width: var(--touch-min); min-height: var(--touch-min); touch-action: none; }
.tk-file__body { min-width: 0; }
.tk-file__name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-medium); color: var(--ink); }
.tk-file__meta { display: block; font-size: var(--fs-13); color: var(--muted); }
.tk-file__acts { display: flex; gap: var(--s-1); }
.tk-file__thumb { width: 48px; height: 48px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); }

/* ---------------------------------------------------------------- kit: options, actions, messages */
.tk-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s-4); }
.tk-opts--wide { grid-template-columns: 1fr; }
.tk-radio { display: flex; flex-direction: column; gap: var(--s-2); border: 0; padding: 0; margin: 0; }
.tk-radio legend { padding: 0; margin-bottom: var(--s-1); font-weight: var(--fw-medium); color: var(--ink); }
.tk-radio label { display: flex; align-items: center; gap: var(--s-2); min-height: var(--control-h-lg); color: var(--ink-2); }
.tk-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.tk-msg { display: flex; gap: var(--s-2); align-items: flex-start; padding: var(--s-3) var(--s-4); border: 1px solid var(--line); border-radius: var(--r); font-size: var(--fs-14); }
.tk-msg--error { background: var(--error-bg); border-color: var(--error-line); color: var(--error); }
.tk-msg--warn { background: var(--warning-bg); border-color: var(--warning-line); color: var(--warning); }
.tk-msg--info { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }
.tk-msg[hidden] { display: none; }
.tk-bar { width: 100%; height: var(--meter-h); border: 0; border-radius: var(--r-pill); overflow: hidden; background: var(--surface-3); appearance: none; }
.tk-bar::-webkit-progress-bar { background: var(--surface-3); }
.tk-bar::-webkit-progress-value { background: var(--brand); border-radius: var(--r-pill); }
.tk-bar::-moz-progress-bar { background: var(--brand); border-radius: var(--r-pill); }
.tk-prog { display: grid; gap: var(--s-2); }
.tk-prog__label { margin: 0; font-size: var(--fs-14); color: var(--ink-2); }

/* ---------------------------------------------------------------- kit: result + thumbnails */
.tk-result { display: grid; gap: var(--s-4); text-align: center; justify-items: center; padding: var(--s-6) 0; }
.tk-result__title { margin: 0; font-size: var(--fs-24); font-weight: var(--fw-semibold); color: var(--ink); }
.tk-stats { display: flex; flex-wrap: wrap; gap: var(--s-5); justify-content: center; margin: 0; }
.tk-stats div { display: grid; gap: 2px; }
.tk-stats dt { font-size: var(--fs-13); color: var(--muted); }
.tk-stats dd { margin: 0; font-size: var(--fs-18); font-weight: var(--fw-semibold); color: var(--ink); font-variant-numeric: tabular-nums; }
.tk-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s-3); margin: 0; padding: 0; list-style: none; }
.tk-thumb { position: relative; display: grid; gap: var(--s-2); justify-items: center; padding: var(--s-2); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.tk-thumb.is-on { border-color: var(--brand); background: var(--surface-sel); }
.tk-thumb canvas, .tk-thumb img { max-width: 100%; height: auto; background: var(--surface); }
.tk-thumb__n { font-size: var(--fs-13); color: var(--muted); }
.tk-thumb__box { display: grid; place-items: center; width: 100%; min-height: 150px; }
.tk-thumb__wait { color: var(--muted); font-size: var(--fs-24); }
.tk-thumb__acts { display: flex; flex-wrap: wrap; gap: var(--s-1); justify-content: center; }
.tk-thumb.is-off { opacity: .45; }
.tk-thumb.is-dragging { opacity: .5; }
.tk-canvas { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.tk-toolbar { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }

/* ---------------------------------------------------------------- kit: calculators and generators (web/static/web/tools/shared/calcui.js) */
.tk-calc { display: grid; gap: var(--s-5); }
.tk-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-4); }
.tk-form .field + .field { margin-top: 0; }
.tk-form .field--wide { grid-column: 1 / -1; }
.tk-form .field--check { flex-direction: row; align-items: center; gap: var(--s-2); min-height: var(--control-h); }
.tk-form .field[hidden] { display: none; }
.tk-out { display: grid; gap: var(--s-4); padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); min-width: 0; }
.tk-out[hidden] { display: none; }
.tk-big { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s-4); margin: 0; }
.tk-big div { display: grid; gap: 2px; min-width: 0; }
.tk-big dt { font-size: var(--fs-13); color: var(--muted); }
.tk-big dd { margin: 0; font-size: var(--fs-24); font-weight: var(--fw-semibold); color: var(--brand); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tk-rows { display: grid; gap: 0; margin: 0; }
.tk-rows div { display: flex; justify-content: space-between; gap: var(--s-4); padding: var(--s-2) 0; border-top: 1px solid var(--line); }
.tk-rows dt { color: var(--ink-2); font-size: var(--fs-14); }
.tk-rows dd { margin: 0; color: var(--ink); font-weight: var(--fw-medium); text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tk-note { margin: 0; font-size: var(--fs-13); color: var(--muted); }
.tk-note + .tk-note { margin-top: calc(var(--s-2) * -1); }
.tk-out .table-wrap { max-height: 360px; }
.tk-out .table th, .tk-out .table td { padding: var(--s-2) var(--s-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tk-out .table td { border-bottom: 1px solid var(--line); text-align: right; }
.tk-out .table th { text-align: right; }
.tk-out .table th:first-child, .tk-out .table td:first-child { text-align: left; }
.tk-text { margin: 0; padding: var(--s-3) var(--s-4); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 3em; }
.tk-text--mono { font-family: var(--font-mono, monospace); font-size: var(--fs-14); }
.tk-pills { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.tk-pill { padding: var(--s-1) var(--s-3); border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--ink-2); font-size: var(--fs-14); }
.tk-pill.is-ok { border-color: var(--success-line); background: var(--success-bg); color: var(--success); }
.tk-pill.is-bad { border-color: var(--error-line); background: var(--error-bg); color: var(--error); }
.tk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s-3); margin: 0; padding: 0; list-style: none; }
.tk-card { display: grid; gap: var(--s-2); align-content: start; padding: var(--s-3) var(--s-4); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-14); }
.tk-qr { display: grid; justify-items: center; gap: var(--s-3); }
.tk-qr canvas { max-width: 100%; height: auto; border-radius: var(--r); }
.tk-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s-5); align-items: start; }
.tk-sig { padding: var(--s-4); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); overflow-x: auto; }

.tk-list-plain { margin: 0; padding-left: var(--s-5); }
.tk-note--text { color: var(--ink); font-size: var(--fs-14); white-space: pre-wrap; overflow-wrap: anywhere; }
.tk-preview { display: grid; gap: var(--s-2); min-height: 8em; }
.tk-preview blockquote { margin: 0; border-left: 3px solid var(--line-strong); }
.tk-preview pre { margin: 0; }

@media (max-width: 640px) {
  .tk__mount { padding: var(--s-4); }
  .tk-drop { min-height: 160px; padding: var(--s-5) var(--s-3); }
  .tk-file { grid-template-columns: auto 1fr; }
  .tk-file__acts { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) { .tk-chip, .tk-drop { transition: none; } }

/* ---------------------------------------------------------------- live tools (SEO + text categories; web/tools/kit/live.js) */
.tk-live { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
@media (min-width: 960px) { .tk-live--split, .tk-live { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.tk-live__in, .tk-live__result, .tk-live__out { display: grid; gap: var(--s-4); min-width: 0; align-content: start; }
.tk-live__in .field + .field, .tk-live__out .field + .field { margin-top: 0; }
.tk-live__h { margin: 0; font-size: var(--fs-16); font-weight: var(--fw-semibold); color: var(--ink); }
.tk-live__hint { color: var(--muted); font-size: var(--fs-14); }
.tk-live__node[hidden], .tk-live__stats[hidden] { display: none; }
.tk-code { font-family: var(--mono); font-size: var(--fs-13); line-height: 1.5; tab-size: 2; }
.tk-offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
.tk-check { display: flex; align-items: center; gap: var(--s-2); min-height: var(--control-h-lg); color: var(--ink-2); }
.tk-stats--left { justify-content: flex-start; }
.tk-kv { display: grid; gap: var(--s-2); margin: 0; }
.tk-kv div { display: grid; grid-template-columns: minmax(110px, 30%) 1fr; gap: var(--s-3); padding-bottom: var(--s-2); border-bottom: 1px solid var(--line); }
.tk-kv dt { color: var(--muted); font-size: var(--fs-14); }
.tk-kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.tk-table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); }
.tk-table th, .tk-table td { padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.tk-table th { color: var(--muted); font-weight: var(--fw-medium); }
.tk-scroll { overflow-x: auto; max-width: 100%; }
.tk-card { padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); min-width: 0; }
.tk-meter { display: block; height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.tk-meter > span { display: block; height: 100%; background: var(--brand); }
.tk-meter > .is-bad { background: var(--error); }
.tk-meter > .is-ok { background: var(--success); }
.tk-pill { display: inline-block; padding: 0 var(--s-2); border-radius: var(--r-pill); background: var(--surface-3); color: var(--ink-2); font-size: var(--fs-13); }
.tk-pill--ok { background: var(--success-bg); color: var(--success); }
.tk-pill--bad { background: var(--error-bg); color: var(--error); }
.tk-pill--warn { background: var(--warning-bg); color: var(--warning); }
/* SERP / social previews: neutral cards, not a copy of any search engine's styling */
.tk-serp { display: grid; gap: 2px; padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); max-width: 100%; }
.tk-serp__url { font-size: var(--fs-13); color: var(--muted); overflow-wrap: anywhere; }
.tk-serp__title { font-size: var(--fs-18); color: var(--info); line-height: 1.3; overflow-wrap: anywhere; }
.tk-serp__desc { font-size: var(--fs-14); color: var(--ink-2); line-height: 1.5; overflow-wrap: anywhere; }
.tk-serp--m { max-width: 380px; }
.tk-og { display: grid; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface-2); max-width: 520px; }
.tk-og__img { display: grid; place-items: center; min-height: 160px; background: var(--surface-3); color: var(--muted); font-size: var(--fs-14); }
.tk-og__img img { width: 100%; display: block; }
.tk-og__body { display: grid; gap: 2px; padding: var(--s-3) var(--s-4); }
.tk-og__host { font-size: var(--fs-13); color: var(--muted); text-transform: uppercase; }
.tk-og__title { font-weight: var(--fw-semibold); color: var(--ink); overflow-wrap: anywhere; }
.tk-og__desc { font-size: var(--fs-14); color: var(--ink-2); overflow-wrap: anywhere; }
/* text diff */
.tk-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; font-family: var(--mono); font-size: var(--fs-13); }
.tk-diff__row { display: contents; }
.tk-diff__cell { padding: 2px var(--s-3); white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.6em; border-bottom: 1px solid var(--line); min-width: 0; }
.tk-diff__cell--del { background: var(--error-bg); color: var(--error); }
.tk-diff__cell--add { background: var(--success-bg); color: var(--success); }
.tk-diff__cell--empty { background: var(--surface-3); }
.tk-diff__head { padding: var(--s-2) var(--s-3); background: var(--surface-3); font-weight: var(--fw-semibold); color: var(--ink); }
/* markdown preview */
.tk-md { color: var(--ink-2); line-height: var(--lh); overflow-wrap: anywhere; }
.tk-md h1, .tk-md h2, .tk-md h3, .tk-md h4 { color: var(--ink); margin: var(--s-4) 0 var(--s-2); }
.tk-md code { font-family: var(--mono); background: var(--surface-3); padding: 0 var(--s-1); border-radius: var(--r-sm); }
.tk-md pre { background: var(--surface-3); padding: var(--s-3); border-radius: var(--r); overflow-x: auto; }
.tk-md pre code { background: none; padding: 0; }
.tk-md blockquote { margin: var(--s-3) 0; padding-left: var(--s-4); border-left: 3px solid var(--brand); color: var(--muted); }
.tk-md a { color: var(--brand-ink); }
.tk-md img { max-width: 100%; }
.tk-md table { border-collapse: collapse; }
.tk-md th, .tk-md td { border: 1px solid var(--line); padding: var(--s-1) var(--s-3); }
/* fancy text + emoji grids */
.tk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: var(--s-3); }
.tk-style { display: grid; gap: var(--s-1); padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); min-width: 0; }
.tk-style__name { font-size: var(--fs-13); color: var(--muted); }
.tk-style__text { font-size: var(--fs-18); color: var(--ink); overflow-wrap: anywhere; }
.tk-emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: var(--s-1); }
.tk-emoji { min-height: 48px; font-size: 26px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); cursor: pointer; }
.tk-emoji:hover { border-color: var(--brand); }
.tk-emoji:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 2px; }
.tk-big { font-size: var(--fs-24); font-weight: var(--fw-bold); color: var(--ink); overflow-wrap: anywhere; }
.tk-limit { display: grid; gap: var(--s-1); }
.tk-limit__row { display: flex; justify-content: space-between; gap: var(--s-3); font-size: var(--fs-14); color: var(--ink-2); }
.tk-live .field[hidden], .tk-live .tk-check[hidden] { display: none; }
.tk-hd { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s-1); }
.tk-hd li { display: flex; gap: var(--s-2); align-items: baseline; overflow-wrap: anywhere; }
.tk-hd__tag { flex: none; min-width: 2.2em; font-family: var(--mono); font-size: var(--fs-13); color: var(--brand-ink); font-weight: var(--fw-bold); }
.tk-hd .l2 { padding-left: var(--s-4); } .tk-hd .l3 { padding-left: var(--s-7); } .tk-hd .l4 { padding-left: var(--s-8); }
.tk-hd .l5 { padding-left: calc(var(--s-8) + var(--s-4)); } .tk-hd .l6 { padding-left: calc(var(--s-8) + var(--s-7)); }
/* ---------------------------------------------------------------- kit: workbench layouts (image + developer tools) */
.tk-work { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, 1fr); gap: var(--s-5); align-items: start; }
.tk-work--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tk-pane { display: grid; gap: var(--s-3); min-width: 0; }
.tk-pane__title { margin: 0; font-size: var(--fs-14); font-weight: var(--fw-semibold); color: var(--ink); }
.tk-controls { display: grid; gap: var(--s-4); min-width: 0; }
.tk-controls .field + .field { margin-top: 0; }
.tk-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; }
.tk-row > .field { flex: 1 1 140px; }
.tk-canvas { display: grid; place-items: center; padding: var(--s-2); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-3); overflow: auto; max-height: 70vh; }
.tk-canvas canvas, .tk-canvas img { display: block; max-width: 100%; height: auto; }
.tk-canvas--pick canvas { cursor: crosshair; touch-action: none; }
.tk-canvas--crop canvas { touch-action: none; cursor: move; }
.tk-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.tk-code { width: 100%; min-height: 220px; padding: var(--s-3); border: 1px solid var(--line-input); border-radius: var(--r); background: var(--surface-2); color: var(--ink); font-family: var(--mono); font-size: var(--fs-13); line-height: 1.5; resize: vertical; tab-size: 2; }
.tk-code:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.tk-code--out { background: var(--surface-3); }
.tk-code--short { min-height: 96px; }
.tk-swatches { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.tk-swatch { display: grid; gap: var(--s-1); justify-items: center; }
.tk-swatch__chip { width: 64px; height: 44px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--r-sm); cursor: pointer; padding: 0; }
.tk-swatch__chip canvas { display: block; width: 100%; height: 100%; border-radius: inherit; }
.tk-swatch__chip:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 2px; }
.tk-swatch__hex { font-family: var(--mono); font-size: var(--fs-12); color: var(--ink-2); }
.tk-meter { height: var(--meter-h); border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.tk-meter__fill { display: block; height: 100%; border-radius: var(--r-pill); background: var(--error); transition: width var(--t) var(--ease); }
.tk-meter__fill.is-fair { background: var(--warning); }
.tk-meter__fill.is-good { background: var(--info); }
.tk-meter__fill.is-strong { background: var(--success); }
.tk-table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); }
.tk-table th, .tk-table td { padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tk-table th { color: var(--muted); font-weight: var(--fw-medium); font-size: var(--fs-13); }
.tk-table td { font-family: var(--mono); color: var(--ink); word-break: break-all; }
.tk-mark { background: var(--brand-soft); color: var(--ink); border-bottom: 2px solid var(--brand); border-radius: 2px; }
.tk-mark--alt { background: var(--primary-soft); border-bottom-color: var(--info); }
.tk-pre { margin: 0; padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); color: var(--ink); font-family: var(--mono); font-size: var(--fs-13); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.tk-demo { min-height: 160px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-3); display: grid; place-items: center; padding: var(--s-5); }
.tk-demo__box { width: 140px; height: 100px; background: var(--surface); }
.tk-demo__box--wide { width: 100%; height: 160px; background: none; }
.tk-demo__box--lg { width: 180px; height: 120px; background: var(--brand); }
.tk-range { display: flex; align-items: center; gap: var(--s-3); }
.tk-range input[type="range"] { flex: 1; min-width: 0; accent-color: var(--brand); }
.tk-range output { min-width: 3.5em; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: var(--fs-14); }
.tk-inline { display: flex; flex-wrap: wrap; gap: var(--s-4); }
.tk-check { display: flex; align-items: center; gap: var(--s-2); min-height: var(--control-h-lg); color: var(--ink-2); }
.tk-copyrow { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.tk-copyrow .input { flex: 1 1 200px; font-family: var(--mono); }
.tk-seg { display: inline-flex; flex-wrap: wrap; gap: var(--s-2); }
.tk-seg .btn[aria-pressed="true"] { background: var(--brand-btn); border-color: var(--brand-btn); color: var(--brand-btn-ink); }
.tk-line-error { color: var(--error); font-family: var(--mono); font-size: var(--fs-13); }
@media (max-width: 760px) {
  .tk-work, .tk-work--even, .tk-compare { grid-template-columns: 1fr; }
  .tk-canvas { max-height: 55vh; }
}
