/* The Chrome extension's tools on the website
   (templates/free_tools/keyword_wrapper.html, ab_test_calculator.html;
   js/ft_kit.js, js/keyword_wrapper.js, js/ab_test_calculator.js).
   D1 look, tokens from site.css only, so light and dark both follow. The
   set-up is the one framed panel; results sit on the page; lines separate
   rows, not items. */

/* ---------- head ---------- */
.ft-t-head { padding: clamp(28px, 4vw, 56px) 0 clamp(18px, 2.4vw, 28px); }
.ft-t-back { display: inline-block; color: var(--muted); font-size: 14px; text-decoration: none; }
.ft-t-back:hover { color: var(--ink); }
.ft-t-title-row { display: flex; align-items: center; gap: clamp(14px, 2vw, 22px); margin-top: 14px; }
.ft-t-title { margin: 0; font: 800 clamp(36px, 5vw, 64px)/.98 var(--sans); letter-spacing: -.035em; font-variation-settings: "wdth" 84; color: var(--ink); }
.ft-t-lede { max-width: 44em; margin: 18px 0 0; font-size: clamp(16px, 1.3vw, 18px); line-height: 1.6; color: var(--ink-2); }
.ft-t-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.ft-t-meta > span, .ft-t-meta > a { display: inline-flex; align-items: center; gap: 8px; }
.ft-t-meta .bi { color: var(--blue); }
.ft-t-meta a { color: var(--ink-2); text-decoration: none; }
.ft-t-meta a b { color: var(--blue); font-weight: 600; }
.ft-t-meta a:hover b { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) {
    .ft-t-title-row .shot-ico-lg { width: 56px; height: 56px; border-radius: 14px; }
    .ft-t-title-row .shot-ico-lg .glyph { width: 42px; height: 42px; }
}

.ft-t-tool { padding: 0 0 clamp(40px, 6vw, 80px); }
.ft-t-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0 48px; align-items: start; }
@media (max-width: 1080px) { .ft-t-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; } }

/* ---------- headings and notes ---------- */
.ft-t-h2 { margin: 0; font: 800 clamp(22px, 2vw, 28px)/1.15 var(--sans); letter-spacing: -.02em; color: var(--ink); }
.ft-t-h3 { margin: 0 0 12px; font: 700 18px/1.2 var(--sans); letter-spacing: -.01em; color: var(--ink); }
.ft-t-note { max-width: 72ch; margin: 6px 0 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.ft-t-label { display: flex; align-items: baseline; gap: 8px; margin: 0; color: var(--ink); font-weight: 700; font-size: 15px; }
.ft-t-opt { color: var(--muted); font-weight: 500; font-size: 13px; }
.ft-t-count { margin-left: auto; min-width: 8ch; color: var(--muted); font-weight: 500; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.ft-sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.btn-p[aria-disabled="true"], .btn-s[aria-disabled="true"] { opacity: .5; cursor: default; }
.btn-p[aria-disabled="true"]:hover { background: var(--blue); }
.btn-s[aria-disabled="true"]:hover { background: var(--card); }
.ft-link-btn { border: 0; background: none; padding: 0; color: var(--blue); font: 600 14px/1.4 var(--body); cursor: pointer; }
.ft-link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.ft-link-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

/* ---------- the set-up panel (the one frame) ---------- */
.ft-setup { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 20px clamp(16px, 2.4vw, 28px); }
.ft-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 8px 24px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.ft-row:first-child { border-top: 0; padding-top: 0; }
.ft-row:last-child { padding-bottom: 0; }
.ft-row-name { color: var(--ink); font-weight: 700; font-size: 14.5px; }
.ft-row-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; min-width: 0; }
@media (max-width: 640px) { .ft-row { grid-template-columns: 1fr; } }

/* a segmented choice: the one in force has a white fill and a blue bold label */
.ft-seg { display: inline-flex; flex: none; gap: 2px; padding: 3px; border-radius: 9px; background: var(--tint); }
.ft-seg-btn {
    position: relative; border: 0; background: none; color: var(--ink-2); font: 600 13px/1 var(--body);
    padding: 8px 14px; border-radius: 7px; cursor: pointer; white-space: nowrap; transition: background .12s, color .12s;
}
.ft-seg-btn:hover { color: var(--ink); }
.ft-seg-btn[aria-pressed="true"] { background: var(--bg); color: var(--blue); font-weight: 700; box-shadow: 0 0 0 1px var(--line-2); }
.ft-seg-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.ft-seg-btn code { padding: 0; background: none; color: inherit; font: inherit; font-family: 'Fragment Mono', ui-monospace, monospace; font-weight: 500; }

.ft-check { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--ink); font-size: 14px; cursor: pointer; }
.ft-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.ft-q {
    display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
    background: var(--tint); color: var(--muted); font: 700 11px/1 var(--body); cursor: default;
}
.ft-q:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.ft-textarea {
    display: block; width: 100%; padding: 10px 12px; resize: vertical;
    border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); color: var(--ink);
    font: 14px/1.55 'Fragment Mono', ui-monospace, monospace;
}
.ft-textarea:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.ft-textarea::placeholder { color: var(--muted); opacity: .8; }

.ft-input {
    width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px;
    background: var(--card); color: var(--ink); font: 14px/1 var(--body);
}
.ft-input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
.ft-input:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.ft-input.is-bad { border-color: #c0392b; }
.ft-input.is-bad:focus { box-shadow: 0 0 0 3px color-mix(in srgb, #c0392b 18%, transparent); }

/* ---------- the side panel (paper fill, no border) ---------- */
.ft-how { padding: 20px 22px; border-radius: 14px; background: var(--tint); color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
.ft-how p { margin: 0 0 10px; }
.ft-how-note { font-size: 13.5px; }
.ft-how code { font-family: 'Fragment Mono', ui-monospace, monospace; font-size: 13px; color: var(--ink); }
.ft-how dl { margin: 0 0 14px; }
.ft-how dt { color: var(--ink); font-weight: 600; }
.ft-how dd { margin: 2px 0 10px; font-size: 13.5px; }
.ft-how-ext { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.ft-how-ext p { font-size: 13.5px; margin-bottom: 14px; }
.ft-how-ext .btn-s { display: inline-flex; align-items: center; gap: 8px; }
.ft-how .ft-how-more { margin: 14px 0 0; }
.ft-how a:not(.btn-s) { color: var(--blue); font-weight: 600; text-decoration: none; }
.ft-how a:not(.btn-s):hover { text-decoration: underline; text-underline-offset: 3px; }

/* ================= Keyword wrapper ================= */
.kw-lists { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); gap: 0 10px; align-items: stretch; }
.kw-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kw-list .ft-textarea { flex: 1 1 auto; min-height: 190px; }
.kw-plus { display: grid; place-items: center; padding-top: 28px; color: var(--muted); font: 700 22px/1 var(--sans); }
@media (max-width: 640px) {
    .kw-lists { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .kw-plus { padding: 0; }
    .kw-list .ft-textarea { min-height: 140px; }
}
.kw-opts { margin-top: 18px; }
.kw-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }

.kw-out { margin-top: 32px; }
.kw-out-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.kw-out-line { min-height: 22px; margin: 10px 0 0; color: var(--ink-2); font-size: 14px; }
.kw-copy { min-width: 196px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.kw-out .ft-textarea { min-height: 300px; margin-top: 14px; }
.kw-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; min-height: 22px; margin: 10px 0 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.kw-facts b { color: var(--ink); font-weight: 600; }
.kw-facts .is-out { color: var(--ink-2); border-bottom: 1px dotted var(--muted); cursor: default; }

.kw-editor { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.kw-editor-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 18px; margin-top: 14px; }
.kw-field { display: flex; flex-direction: column; gap: 6px; margin: 0; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.kw-field .ft-input { width: 240px; max-width: 100%; }
.kw-field .ft-t-opt { font-weight: 500; font-size: 12px; }
.kw-ed-btn { display: inline-flex; align-items: center; gap: 6px; min-width: 150px; justify-content: center; }
@media (max-width: 640px) { .kw-field, .kw-field .ft-input { width: 100%; } }

/* ================= A/B test calculator ================= */
.ab-groups-row { margin-top: 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.ab-groups { width: 100%; border-collapse: collapse; }
.ab-groups th { padding: 0 8px 8px; color: var(--muted); font: 600 12.5px/1.2 var(--body); text-align: left; white-space: nowrap; }
.ab-groups th.num { text-align: right; }
.ab-groups td { padding: 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.ab-groups th:first-child, .ab-groups td:first-child { padding-left: 0; }
.ab-groups th:last-child, .ab-groups td:last-child { padding-right: 0; }
.ab-groups .ab-c-name { width: 40%; }
.ab-groups .ab-c-num { width: 24%; }
.ab-groups .ab-c-x { width: 40px; text-align: right; }
.ab-swatch { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; }
.ab-name-cell { display: flex; align-items: center; gap: 10px; }
.ab-row-err { display: block; min-height: 0; margin-top: 4px; color: #c0392b; font-size: 12.5px; }
:root[data-theme="dark"] .ab-row-err { color: #ff8b7e; }
.ab-x {
    display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px;
    background: none; color: var(--muted); cursor: pointer; font-size: 16px;
}
.ab-x:hover { background: var(--tint); color: var(--ink); }
.ab-x[aria-disabled="true"] { opacity: .35; cursor: default; }
.ab-x[aria-disabled="true"]:hover { background: none; color: var(--muted); }
.ab-x:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.ab-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.ab-acts .ab-sp { flex: 1 1 auto; }
.ab-acts .btn-s { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 640px) {
    .ab-groups thead { display: none; }
    .ab-groups tr { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 6px 8px; padding: 10px 0; border-top: 1px solid var(--line); }
    .ab-groups td { padding: 0; border: 0; }
    .ab-groups td.ab-c-name { grid-column: 1 / 3; width: auto; }
    .ab-groups td.ab-c-num, .ab-groups td.ab-c-x { width: auto; }
    .ab-groups td.ab-c-x { grid-column: 3; grid-row: 1; }
    .ab-groups td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
}

.ab-results { margin-top: 36px; }
.ab-res-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.ab-lead { margin: 18px 0 0; max-width: 72ch; color: var(--ink); font-size: 16px; line-height: 1.55; min-height: 50px; }
.ab-lead b { font-weight: 700; }

/* status: a dot and a word */
.ab-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ab-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ab-pill.is-sig { background: color-mix(in srgb, #1f8a4c 12%, var(--card)); color: #1a7a43; }
:root[data-theme="dark"] .ab-pill.is-sig { color: #6fd39a; }
.ab-pill.is-not { background: var(--tint); color: var(--muted); }
.ab-pill.is-base { background: var(--blue-soft); color: var(--blue); }
.ab-pill.is-none { background: none; color: var(--muted); padding-left: 0; }
.ab-pill.is-none::before { display: none; }

/* the interval chart: one track per group on a shared axis */
.ab-chart { position: relative; margin: 26px 0 0; }
.ab-ch-row { display: grid; grid-template-columns: minmax(110px, 200px) minmax(0, 1fr); gap: 16px; align-items: center; height: 40px; }
.ab-ch-name { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink); font-size: 14px; font-weight: 600; }
.ab-ch-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-ch-track { position: relative; height: 100%; }
.ab-ch-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.ab-ch-bar { position: absolute; top: calc(50% - 6px); height: 12px; border-radius: 999px; opacity: .28; transition: left .25s ease, width .25s ease; }
.ab-ch-dot {
    position: absolute; top: calc(50% - 8px); width: 16px; height: 16px; margin-left: -8px; padding: 0; border: 3px solid var(--bg); border-radius: 50%;
    cursor: pointer; transition: left .25s ease; box-shadow: 0 0 0 1px var(--line-2);
}
.ab-ch-dot:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.ab-ch-ctl { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--muted); opacity: .6; transition: left .25s ease; pointer-events: none; }
.ab-ch-axis-row { height: 22px; }
.ab-ch-axis::before { display: none; }
.ab-ch-tick { position: absolute; top: 4px; transform: translateX(-50%); color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ab-ch-tick.is-first { transform: none; }
.ab-ch-tick.is-last { transform: translateX(-100%); }
.ab-ch-empty { color: var(--muted); font-size: 14px; }
@media (max-width: 640px) {
    /* the name above its track, so the track keeps the full width */
    .ab-ch-row { grid-template-columns: minmax(0, 1fr); gap: 2px; height: auto; }
    .ab-ch-row .ab-ch-track { height: 30px; }
    .ab-ch-axis-row .ab-ch-name { display: none; }
    .ab-ch-axis-row .ab-ch-track { height: 22px; }
    .ab-ch-name { font-size: 13px; }
}

.ab-table-wrap { margin-top: 18px; overflow-x: auto; }
.ab-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.ab-table th { position: sticky; top: 0; z-index: 1; padding: 10px 12px; border-bottom: 1px solid var(--line-2); background: var(--bg); color: var(--muted); font: 600 12.5px/1.25 var(--body); text-align: left; vertical-align: bottom; }
.ab-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: middle; white-space: nowrap; }
.ab-table th:first-child, .ab-table td:first-child { padding-left: 0; }
.ab-table .num { text-align: right; }
.ab-table th { white-space: nowrap; }
.ab-table td.ab-t-name { font-weight: 600; }
.ab-table .ab-dim { color: var(--muted); }
.ab-table .ab-up { color: #1a7a43; }
.ab-table .ab-down { color: #b3261e; }
:root[data-theme="dark"] .ab-table .ab-up { color: #6fd39a; }
:root[data-theme="dark"] .ab-table .ab-down { color: #ff8b7e; }
@media (max-width: 640px) {
    /* one block per group: the name, then each figure with its column's name */
    .ab-table-wrap { overflow: visible; }
    .ab-table thead { display: none; }
    .ab-table, .ab-table tbody { display: block; }
    .ab-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
    .ab-table td { padding: 0; border: 0; white-space: normal; text-align: left !important; }
    .ab-table td::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: 12px; font-weight: 600; }
    .ab-table td.ab-t-name { grid-column: 1 / -1; font-size: 15px; }
    .ab-table td.ab-t-name::before, .ab-table td:empty { display: none; }
    .ab-table td:last-child { grid-column: 1 / -1; }
    .ab-table td:last-child::before { display: none; }
}
.ab-method { max-width: 80ch; margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* ================= Sample size, budget pacing, Customer Match ================= */
.ss-num { position: relative; display: inline-flex; align-items: center; width: 110px; }
.ss-num .ft-input { text-align: right; padding-right: 26px; font-variant-numeric: tabular-nums; }
.ss-num-wide { width: 140px; }
.ss-num-wide .ft-input { padding-right: 10px; }
.ss-unit { position: absolute; right: 10px; color: var(--muted); font-size: 14px; pointer-events: none; }
.ss-hint { min-height: 20px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.ft-input.is-bad ~ .ss-hint, .ss-num:has(.is-bad) ~ .ss-hint { color: #c0392b; }
:root[data-theme="dark"] .ss-num:has(.is-bad) ~ .ss-hint { color: #ff8b7e; }
.ss-step { display: inline-flex; align-items: center; gap: 4px; padding: 2px; border: 1px solid var(--line-2); border-radius: 8px; }
.ss-step-n { min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; color: var(--ink); }
.ft-check.is-off { opacity: .5; cursor: default; }
.ft-check.is-off input { cursor: default; }

.ss-results { margin-top: 36px; }
.ss-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 28px; margin-top: 18px; }
.ss-fact { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ss-fact-l { color: var(--muted); font-size: 13px; font-weight: 600; }
.ss-fact-v { align-self: flex-start; font: 800 clamp(24px, 2.4vw, 32px)/1.05 var(--sans); letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.ss-fact-s { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
@media (max-width: 800px) { .ss-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ss-lead { min-height: 0; }
.ss-h3 { margin-top: 30px; font-size: 16px; }
.ab-table tr.is-chosen td { background: var(--blue-soft); }
.ab-table tr.is-chosen td:first-child { box-shadow: inset 3px 0 0 var(--blue); padding-left: 10px; }

/* budget pacing: spent against even pace and the budget */
.bp-table th { white-space: normal; min-width: 64px; }
.bp-table td { padding-left: 8px; padding-right: 8px; font-size: 13.5px; }
.bp-bar-cell { min-width: 110px; width: 14%; padding-right: 16px !important; }
.bp-bar { position: relative; height: 10px; border-radius: 999px; background: var(--tint); cursor: default; }
.bp-bar:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.bp-bar-proj { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: color-mix(in srgb, var(--blue) 22%, transparent); }
.bp-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--blue); transition: width .25s ease; }
.bp-bar-fill.is-over { background: var(--pink); }
.bp-bar-exp { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.bp-bar-cap { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 2px dotted var(--muted); }
.bp-table tfoot td { border-top: 1px solid var(--line-2); border-bottom: 0; font-weight: 700; }
@media (max-width: 640px) {
    .bp-table tfoot { display: block; }
    .bp-table .bp-bar-cell { grid-column: 1 / -1; }
    .bp-table td.bp-bar-cell::before { display: block; }
}

/* Customer Match */
.cm-src { flex-direction: column; align-items: stretch; gap: 10px; }
.cm-drop {
    display: flex; align-items: center; gap: 12px; padding: 16px 18px; border: 1px dashed var(--line-2); border-radius: 12px;
    color: var(--ink-2); font-size: 14.5px; cursor: pointer; transition: border-color .15s, background .15s;
}
.cm-drop .bi { color: var(--blue); font-size: 26px; }
.cm-drop b { color: var(--blue); }
.cm-drop:hover, .cm-drop.is-over, .cm-drop:focus-within { border-color: var(--blue); background: var(--blue-soft); }
.cm-paste { max-width: none; }
.cm-map { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.cm-col { display: flex; flex-direction: column; gap: 3px; width: 170px; margin: 0; }
.cm-col-h { color: var(--ink); font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-col-eg { color: var(--muted); font: 12px/1.4 'Fragment Mono', ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-sel, .cm-country { height: 34px; padding: 0 8px; }
.cm-country { width: auto; max-width: 100%; }
.cm-prepare { min-width: 190px; position: relative; }
.cm-prepare.is-working > span { visibility: hidden; }
.cm-prepare.is-working::after {
    content: ""; position: absolute; left: calc(50% - 9px); top: calc(50% - 9px); width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid currentColor; border-right-color: transparent; animation: ft-spin .8s linear infinite;
}
@keyframes ft-spin { to { transform: rotate(360deg); } }
.cm-progress { height: 6px; margin-top: 14px; border-radius: 999px; background: var(--tint); overflow: hidden; }
.cm-progress[hidden] { display: none; }
.cm-progress-bar { width: 0; height: 100%; background: var(--blue); transition: width .2s ease; }
.cm-table td { font-size: 13px; }
.cm-table .cm-before { color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.cm-table .cm-out { font-family: 'Fragment Mono', ui-monospace, monospace; }
@media (max-width: 640px) {
    .cm-col { width: calc(50% - 9px); }
    .cm-table thead { display: table-header-group; }
    .cm-table, .cm-table tbody { display: table; }
    .cm-table tr { display: table-row; }
    .cm-table td { display: table-cell; padding: 8px; border-bottom: 1px solid var(--line); }
    .cm-table td::before { display: none; }
    .cm-table-wrap, .ss-results .ab-table-wrap:has(.cm-table) { overflow-x: auto; }
}

/* ---------- feedback: ✓ over a button's own label, bumps and glows ---------- */
.btn-p.is-done, .btn-s.is-done { position: relative; color: transparent !important; }
.btn-p.is-done > *, .btn-s.is-done > * { visibility: hidden; }
.btn-p.is-done::after, .btn-s.is-done::after {
    content: attr(data-done); position: absolute; inset: 0; display: grid; place-items: center;
    color: var(--blue); font-weight: 700; animation: ft-pop .25s ease-out;
}
.btn-p.is-done::after { color: #fff; }
:root[data-theme="dark"] .btn-p.is-done::after { color: var(--bg); }
.is-bump { display: inline-block; animation: ft-bump .35s ease-out; }
.is-glow { animation: ft-glow 1.1s ease-out; }
textarea.is-glow, .ft-setup.is-glow { animation-name: ft-glow-box; }
@keyframes ft-pop { from { transform: scale(.85); opacity: .4; } to { transform: scale(1); opacity: 1; } }
@keyframes ft-bump { 0% { transform: scale(1); } 40% { transform: scale(1.12); color: #1f8a4c; } 100% { transform: scale(1); } }
@keyframes ft-glow { 0% { background: color-mix(in srgb, var(--yellow) 45%, transparent); } 100% { background: transparent; } }
@keyframes ft-glow-box { 0% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--yellow) 60%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- the instant tooltip and the toast (at the end of <body>) ---------- */
.ft-tip {
    position: fixed; z-index: 2000; max-width: 320px; padding: 8px 10px; border-radius: 8px; pointer-events: none;
    background: var(--ink); color: var(--bg); font: 500 12.5px/1.4 var(--body); box-shadow: var(--shadow); white-space: pre-line;
}
.ft-tip[hidden] { display: none; }

.ft-toasts { position: fixed; left: 20px; bottom: 20px; z-index: 1900; display: flex; flex-direction: column; gap: 8px; width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.ft-toast {
    display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 12px; pointer-events: auto;
    border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 14px; box-shadow: var(--shadow);
    animation: ft-toast-in .22s ease-out;
}
.ft-toast.is-success { background: color-mix(in srgb, #1f8a4c 8%, var(--card)); }
.ft-toast.is-warning { background: color-mix(in srgb, var(--yellow) 14%, var(--card)); }
.ft-toast.is-danger { background: color-mix(in srgb, #c0392b 8%, var(--card)); }
.ft-toast.is-info { background: color-mix(in srgb, var(--blue) 8%, var(--card)); }
.ft-toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.ft-toast-ico { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 13px; }
.is-success .ft-toast-ico { background: #1f8a4c; }
.is-warning .ft-toast-ico { background: #c98a00; }
.is-danger .ft-toast-ico { background: #c0392b; }
.is-info .ft-toast-ico { background: var(--blue); }
.ft-toast-msg { flex: 1 1 auto; line-height: 1.35; }
.ft-toast-undo { flex: none; border: 0; background: none; color: var(--blue); font: 700 13.5px/1 var(--body); padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.ft-toast-undo:hover { background: var(--tint); }
.ft-toast-x { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.ft-toast-x:hover { background: var(--tint); color: var(--ink); }
@keyframes ft-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* On a phone: at the top, below the top bar, clear of the buttons just pressed */
@media (max-width: 640px) { .ft-toasts { top: 72px; bottom: auto; left: 16px; } }
