/* Tool pages: layouts/tool.njk. Moved verbatim from styles.css (TOOL PAGES + CSV cleaner), new tool styles follow. */

/* Self-hosted fonts (the strict CSP on private tools does not allow Google Fonts). Latin subset, variable weight. */
@font-face {
  font-family: 'Onest'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/assets/fonts/onest-latin-wght-normal.woff2') format('woff2-variations'), url('/assets/fonts/onest-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2-variations'), url('/assets/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2');
}

/* ============================================
   TOOL PAGES (layouts/tool-app.njk)
   ============================================ */
.tool-hero { padding: 120px 0 56px; }

/* Two columns: intro on the left, the app's first step on the right (see tool-app.njk). */
.tool-top {
  position: relative; z-index: 2; width: 100%;
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.25fr); gap: 24px 48px; align-items: center;
}
.tool-top .csv-tool { display: contents; }
.tool-top .csv-step { grid-column: 1 / -1; }
.tool-top__intro { text-align: left; }
.tool-top__art { display: flex; justify-content: center; }
.csv-art { width: 100%; max-width: 680px; height: auto; overflow: visible; }
.csv-art text { font-family: var(--font-mono); font-size: 10.5px; fill: var(--text-secondary); }
.csv-art .art-label { font-size: 10px; letter-spacing: 0.12em; fill: var(--text-tertiary); }
.csv-art .art-hd { font-size: 9.5px; letter-spacing: 0.04em; fill: var(--text-tertiary); }
.csv-art .art-faint { font-style: italic; fill: var(--text-tertiary); }
.csv-art .art-good { fill: var(--text-primary); }
.csv-art .art-card { fill: var(--bg-elevated); stroke: var(--border-strong); stroke-width: 1; }
.csv-art .art-card--bad { stroke: var(--danger); stroke-opacity: 0.5; }
.csv-art .art-card--good { stroke: var(--accent-green-border); }
.csv-art .art-rule { stroke: var(--border-subtle); stroke-width: 1; }
.csv-art .art-flag--warn { fill: var(--danger-soft); }
.csv-art .art-flag--dup { fill: var(--danger-soft); }
.csv-art .art-empty { fill: none; stroke: var(--border-strong); stroke-dasharray: 4 3; }
.csv-art .art-arrow-bg { fill: var(--accent); }
.csv-art .art-arrow { fill: none; stroke: var(--text-on-accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.csv-art .art-chip { fill: var(--accent-soft); stroke: var(--border-accent); }
.csv-art .art-chip-t { font-size: 9.5px; fill: var(--accent-text); }
.csv-art .art-ok { fill: none; stroke: var(--accent-green); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.csv-art .art-ok-t { fill: var(--accent-green); font-size: 11px; }
.tool-top__intro .crumb { margin-bottom: 14px; }
.tool-top__intro .eyebrow { display: flex; width: fit-content; margin-bottom: 16px; }
.tool-top__intro .hero__title { font-size: clamp(2rem, 3.6vw, 2.9rem); margin-bottom: 14px; }
.tool-top__intro .hero__sub { font-size: 1rem; max-width: none; margin: 0 0 20px; }
@media (max-width: 960px) {
  .tool-top { grid-template-columns: minmax(0, 1fr); }
  .tool-top__art { display: none; }
}

.privacy-lead { color: var(--text-primary); font-weight: 600; }
.privacy-lead svg { display: inline-block; vertical-align: -2px; margin-right: 6px; color: var(--accent); }
.tool-top__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* inline text button, e.g. "Select all" */
.link-btn {
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
  color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--text-primary); }
.link-btn:disabled { color: var(--text-tertiary); text-decoration: none; cursor: default; }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.csv-select-all { align-self: flex-start; font-size: 13px; }

/* ---------- CSV cleaner ---------- */
.csv-tool { display: flex; flex-direction: column; gap: 24px; }
.csv-step {
  background: var(--bg-elevated); border: 1px solid var(--border-medium); border-radius: var(--radius-lg);
  padding: 28px; display: flex; flex-direction: column; gap: 18px;
  box-shadow: var(--shadow-window);
}
.csv-step__head { display: flex; flex-direction: column; gap: 4px; }
.csv-step__title { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.015em; }
.csv-step__sub { color: var(--text-secondary); font-size: 0.95rem; }

.csv-tool select,
.csv-tool input[type="text"],
.csv-tool input[type="number"],
.csv-tool textarea {
  background: var(--bg-input); border: 1px solid var(--border-medium); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 14px; color: var(--text-primary); font-family: inherit; width: 100%;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.csv-tool select { appearance: auto; }
.csv-tool textarea { font-family: var(--font-mono); font-size: 13px; resize: vertical; }
.csv-tool select:focus-visible,
.csv-tool input:focus-visible,
.csv-tool textarea:focus-visible,
.csv-tool summary:focus-visible,
.csv-table-wrap:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
.csv-tool input[type="checkbox"], .csv-tool input[type="radio"] {
  accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; margin-top: 3px;
}
.csv-tool input[type="checkbox"]:focus-visible, .csv-tool input[type="radio"]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: none;
}
.csv-tool .btn:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.csv-tool .btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.csv-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.csv-hint { font-size: 12.5px; color: var(--text-tertiary); font-weight: 400; }
.csv-field { display: flex; flex-direction: column; gap: 6px; min-width: 180px; flex: 1; }
.csv-row > .csv-field, .csv-export > .csv-field { max-width: 300px; }
.csv-field--short { flex: 0 1 160px; min-width: 120px; }
.csv-row { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: flex-end; }
.csv-row--between { justify-content: space-between; align-items: center; }
.csv-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; color: var(--text-primary); cursor: pointer; line-height: 1.45; }
.csv-prefix { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); }

/* load */
.csv-load { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: stretch; }
.csv-drop { position: relative; }
.csv-drop__input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.csv-drop__label {
  height: 100%; min-height: 170px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 28px; text-align: center; cursor: pointer; color: var(--text-secondary);
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-md); background: var(--bg-input);
  transition: all 0.2s var(--ease);
}
.csv-drop__label svg { color: var(--accent); }
.csv-drop__icon--file { display: none; }
.csv-drop.is-loaded .csv-drop__icon--upload { display: none; }
.csv-drop.is-loaded .csv-drop__icon--file { display: block; }
.csv-drop__done { display: none; }
.csv-drop.is-loaded .csv-drop__idle { display: none; }
.csv-drop.is-loaded .csv-drop__done { display: inline; }
.csv-drop.is-loaded .csv-drop__title.csv-drop__done { display: block; }
.csv-drop__name { display: block; margin-top: 2px; font-family: var(--font-mono, ui-monospace, monospace); font-size: 13px; font-weight: 400; color: var(--text-secondary); overflow-wrap: anywhere; }
.csv-drop__title { color: var(--text-primary); font-weight: 500; }
.csv-drop__link { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.csv-drop__hint { font-size: 13px; color: var(--text-tertiary); }
.csv-drop__label:hover, .csv-drop.is-over .csv-drop__label { border-color: var(--accent); background: var(--accent-soft); }
.csv-drop__input:focus-visible + .csv-drop__label { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.csv-load__alt { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; justify-content: center; }
.csv-paste { width: 100%; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-tint); }
.csv-paste summary { cursor: pointer; padding: 12px 16px; font-size: 14.5px; font-weight: 500; border-radius: var(--radius-md); }
.csv-paste[open] { padding-bottom: 14px; }
.csv-paste[open] summary { margin-bottom: 4px; }
.csv-paste .csv-label, .csv-paste textarea, .csv-paste .btn { margin: 0 16px; width: calc(100% - 32px); }
.csv-paste textarea { margin-top: 6px; margin-bottom: 10px; }
.csv-paste .btn { width: auto; }
.csv-fileinfo { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-tertiary); }

/* operations */
.csv-ops { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.csv-op {
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-input);
  padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.csv-op--wide { grid-column: 1 / -1; }
.csv-op__title { font-family: var(--font-sans); font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--text-secondary); padding: 0 6px; margin-left: -6px; }
.csv-op__opts { display: flex; flex-direction: column; gap: 14px; padding: 14px 0 0 26px; border-top: 1px solid var(--border-subtle); }
.csv-op__opts--inline { padding-top: 0; border-top: 0; }
.csv-op__opts[hidden], .csv-tool [hidden] { display: none !important; }
.csv-cols-box, .csv-radios { border: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.csv-cols { display: flex; flex-wrap: wrap; gap: 6px 8px; max-height: 190px; overflow: auto; font-size: 13px; color: var(--text-tertiary); }
.csv-cols .csv-check {
  font-size: 13.5px; padding: 5px 10px 5px 8px; border: 1px solid var(--border-medium); border-radius: 999px; align-items: center;
  background: var(--bg-tint);
}
.csv-cols .csv-check input { margin-top: 0; width: 14px; height: 14px; }
.csv-cols .csv-check:has(input:checked) { border-color: var(--border-accent); background: var(--accent-soft); }

.csv-manage { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; counter-reset: col; }
.csv-manage__item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; counter-increment: col;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--bg-tint);
}
.csv-manage__item::before { content: counter(col); font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); min-width: 18px; text-align: right; }
.csv-manage__item input[type="checkbox"] { margin-top: 0; }
.csv-manage__item input[type="text"] { padding: 6px 9px; }
.csv-manage__item.is-removed input[type="text"] { text-decoration: line-through; opacity: 0.5; }
.csv-icon-btn {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: var(--radius-sm); border: 1px solid var(--border-medium);
  color: var(--text-secondary); font-size: 14px; line-height: 1; background: var(--bg-tint);
}
.csv-icon-btn:hover:not(:disabled) { color: var(--text-primary); border-color: var(--border-strong); }
.csv-icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.csv-icon-btn:disabled { opacity: 0.3; cursor: default; }
.csv-empty-note { font-size: 13.5px; color: var(--text-tertiary); }
.csv-op--wide .btn { align-self: flex-start; }

/* summary + preview */
.csv-summary { padding: 16px 20px; border-radius: var(--radius-md); background: var(--bg-input); border: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 8px; }
.csv-summary__counts { font-size: 15px; color: var(--text-secondary); }
.csv-summary__counts strong { color: var(--text-primary); font-weight: 600; }
.csv-summary__list { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--text-secondary); }
.csv-summary__list:empty { display: none; }
.csv-summary__list li { position: relative; padding-left: 20px; }
.csv-summary__list li::before { content: '✓'; position: absolute; left: 0; color: var(--accent-text); font-weight: 700; }
.csv-status { font-size: 13.5px; color: var(--accent-text); min-height: 1.2em; }
.csv-status:empty { display: none; }
.csv-status.is-error { color: var(--danger); }
.csv-tool.is-busy .csv-status::before {
  content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 8px; vertical-align: -1px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: csvSpin 0.8s linear infinite;
}
@keyframes csvSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .csv-tool.is-busy .csv-status::before { animation: none; } }

.csv-seg { border: 0; display: inline-flex; padding: 3px; gap: 3px; border-radius: var(--radius-md); background: var(--bg-input); border: 1px solid var(--border-medium); }
.csv-seg label { position: relative; cursor: pointer; }
.csv-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.csv-seg span { display: block; padding: 6px 14px; font-size: 13.5px; border-radius: var(--radius-sm); color: var(--text-secondary); }
.csv-seg input:checked + span { background: var(--text-primary); color: var(--bg-primary); }
.csv-seg input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 2px; }

.csv-table-wrap { overflow: auto; max-height: 520px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-input); }
.csv-table { border-collapse: separate; border-spacing: 0; font-size: 13px; width: max-content; min-width: 100%; }
.csv-table th, .csv-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border-subtle); border-right: 1px solid var(--border-subtle); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csv-table thead th { position: sticky; top: 0; z-index: 1; background: color-mix(in srgb, var(--bg-elevated) 88%, #fff); color: var(--text-primary); font-weight: 600; }
.csv-table td { color: var(--text-secondary); font-family: var(--font-mono); font-size: 12.5px; }
.csv-table td.is-empty { background: var(--bg-tint); }
.csv-table .csv-table__num { color: var(--text-tertiary); font-family: var(--font-mono); font-size: 11px; font-weight: 400; text-align: right; position: sticky; left: 0; background: var(--bg-secondary); }
.csv-table thead .csv-table__num { z-index: 2; background: color-mix(in srgb, var(--bg-elevated) 88%, #fff); }
.csv-table tbody tr:hover td { background: var(--accent-soft); }

.csv-export { display: flex; flex-wrap: wrap; gap: 16px 20px; align-items: flex-end; padding-top: 18px; border-top: 1px solid var(--border-subtle); }
.csv-export__checks { display: flex; flex-direction: column; gap: 8px; }
.csv-export .btn { margin-left: auto; }
.csv-alert { padding: 14px 18px; border-radius: var(--radius-md); border: 1px solid var(--danger); color: var(--text-primary); }

@media (max-width: 960px) {
  .csv-load, .csv-ops { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .csv-step { padding: 20px 16px; }
  .csv-op__opts { padding-left: 0; }
  .csv-export .btn { width: 100%; margin-left: 0; }
  .csv-manage { grid-template-columns: 1fr; }
}


/* =====================================================================
   Shared pieces for every browser tool (layouts/tool.njk, tools/macros.njk)
   ===================================================================== */
.tool-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 14px; padding: 0; counter-reset: step; font-size: 0.95rem; color: var(--text-secondary); }
.tool-steps li { counter-increment: step; display: inline-flex; align-items: baseline; gap: 8px; }
.tool-steps li::before { content: counter(step); font-family: var(--font-mono); font-size: 11px; color: var(--accent-text); border: 1px solid var(--border-strong); border-radius: 999px; min-width: 20px; height: 20px; display: inline-grid; place-items: center; }
.tool-trust { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 20px; font-size: 0.95rem; color: var(--text-secondary); max-width: 62ch; }
.tool-trust svg { flex-shrink: 0; margin-top: 3px; color: var(--accent); }
.tool-trust strong { color: var(--text-primary); font-weight: 600; }

.tool-limits-section { padding-block: 32px; }
.tool-limits__title, .tool-others__title { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 12px; }
.tool-limits { margin: 0; padding-left: 1.2em; color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; }
.tool-limits li::marker { color: var(--danger); }
.tool-others { padding-block: 32px; }
.tool-others__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tool-others__list a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 16px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-elevated); color: var(--text-secondary); font-size: 0.9rem; line-height: 1.45; }
.tool-others__list a:hover { border-color: var(--border-strong); }
.tool-others__list a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tool-others__list strong { color: var(--text-primary); font-size: 1rem; }

.tool-runbar { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; border-top: 1px solid var(--border-subtle); }
.tool-runbar__buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.tool-progress { width: 100%; height: 8px; appearance: none; border: 0; border-radius: 999px; overflow: hidden; background: var(--border-medium); }
.tool-progress::-webkit-progress-bar { background: var(--border-medium); }
.tool-progress::-webkit-progress-value { background: var(--accent); transition: width 0.2s var(--ease); }
.tool-progress::-moz-progress-bar { background: var(--accent); }
.tool-progress[hidden] { display: none; }
.tool-summary { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-secondary); }
.tool-summary:empty { display: none; }
.csv-status.is-error::before { content: 'Problem: '; font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .tool-progress::-webkit-progress-value { transition: none; }
  .csv-tool * { scroll-behavior: auto; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
.csv-tool a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.csv-tool .btn:focus-visible, .csv-tool a:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.csv-tool fieldset { min-width: 0; }
.csv-tool input[type="color"] { width: 48px; height: 36px; padding: 2px; background: none; border: 1px solid var(--border-medium); border-radius: var(--radius-sm); }
.csv-tool input[type="range"] { width: 100%; accent-color: var(--accent); }
.csv-tool input[type="email"], .csv-tool input[type="url"] { background: var(--bg-input); border: 1px solid var(--border-medium); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 14px; color: var(--text-primary); font-family: inherit; width: 100%; }
.tool-note { padding: 12px 16px; border-radius: var(--radius-md); border: 1px solid var(--border-strong); background: var(--accent-soft); color: var(--text-primary); font-size: 14.5px; }
.tool-note--warn { border-color: var(--danger); background: var(--danger-soft); }
.tool-note strong { font-weight: 600; }
.tool-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tool-list__item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--bg-tint); min-width: 0; }
.tool-list__item[draggable="true"] { cursor: grab; }
.tool-list__item.is-dragging { opacity: 0.5; }
.tool-list__name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; color: var(--text-primary); }
.tool-list__meta { font-family: var(--font-mono); font-size: 12px; color: var(--text-tertiary); }
.tool-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-tab { padding: 7px 14px; font-size: 13.5px; color: var(--text-secondary); border: 1px solid var(--border-medium); border-radius: 999px; background: none; cursor: pointer; }
.tool-tab[aria-selected="true"] { color: var(--text-primary); border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.tool-tab:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.tool-diff { display: grid; gap: 6px; font-size: 13.5px; color: var(--text-secondary); }
.tool-diff code { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-primary); }

/* Run bar: progress, status, summary, buttons (macros.njk runbar) */
.tool-runbar { display: flex; flex-direction: column; gap: 10px; }
.tool-runbar__buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.tool-progress { width: 100%; height: 6px; appearance: none; border: 0; border-radius: 999px; overflow: hidden; background: var(--border-subtle); }
.tool-progress::-webkit-progress-bar { background: var(--border-subtle); }
.tool-progress::-webkit-progress-value { background: var(--accent); transition: width 0.2s; }
.tool-progress::-moz-progress-bar { background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .tool-progress::-webkit-progress-value { transition: none; } }
.tool-summary { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-tertiary); min-height: 1.2em; margin: 0; }
.tool-summary:empty { display: none; }

/* Mode picker: one radio per line with its inputs indented under it */
.tool-modes { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tool-mode { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.tool-mode:has(input[type="radio"]:checked) { border-color: var(--accent); background: var(--accent-soft); }
.tool-mode__opts { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding-left: 26px; }
.tool-mode__opts[hidden] { display: none; }
.tool-mode__opts input[type="number"] { width: 110px; }
.tool-mode__opts .csv-label { margin: 0; }

/* Listing link checker: verdict colors (never color alone — the word is the cell) */
.llc-results { margin-top: 16px; }
.llc-verdict { font-family: var(--font-mono); white-space: nowrap; }
.llc-verdict--ok { color: var(--accent-text); }
.llc-verdict--dead, .llc-verdict--unreachable { color: var(--danger); }
.llc-verdict--redirects-elsewhere, .llc-verdict--redirects-to-homepage, .llc-verdict--blocked, .llc-verdict--refused { color: var(--text-secondary); }

/* SDR prompt builder: output cards */
.sdr-req { font-weight: 400; color: var(--text-tertiary); }
.sdr-out { display: flex; flex-direction: column; gap: 14px; }
.sdr-card { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 16px 18px; background: var(--bg-elevated); }
.sdr-card h3 { margin: 0 0 10px; font-size: 15px; color: var(--text-primary); }
.sdr-card h3 a { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.sdr-card h3 a:hover, .sdr-card h3 a:focus-visible { text-decoration: underline; }
.sdr-pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6; color: var(--text-secondary); }
.sdr-pre:empty::before { content: "Waiting for a goal…"; color: var(--text-tertiary); font-style: italic; }
.sdr-followups { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6; color: var(--text-secondary); }
.sdr-followups:empty::before { content: "Waiting for a goal…"; color: var(--text-tertiary); font-style: italic; font-family: var(--font-body, inherit); }

/* CSV compare: side-by-side drops, stat strip, tabs */
.cmp-drops { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .cmp-drops { grid-template-columns: 1fr; } }
.cmp-ignore { margin-top: 14px; }
.cmp-ignore summary { cursor: pointer; color: var(--text-secondary); font-size: 14px; }
.cmp-ignore summary:hover { color: var(--text-primary); }
.cmp-results { margin-top: 18px; display: flex; flex-direction: column; gap: 16px; }
.cmp-stats { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13.5px; }
.cmp-stats span { padding: 6px 12px; border: 1px solid var(--border-subtle); border-radius: 999px; color: var(--text-secondary); font-family: var(--font-mono); }
.cmp-stats strong { color: var(--text-primary); font-weight: 600; }
.cmp-tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--border-subtle); padding-bottom: 8px; }
.cmp-tabs [role="tab"] { border: 1px solid var(--border-medium); background: none; color: var(--text-secondary); border-radius: 999px; padding: 7px 14px; font-size: 13.5px; cursor: pointer; }
.cmp-tabs [role="tab"]:hover, .cmp-tabs [role="tab"]:focus-visible { color: var(--text-primary); border-color: var(--border-strong); }
.cmp-tabs [role="tab"][aria-selected="true"] { color: var(--text-primary); border-color: var(--accent); background: var(--accent-soft); }
.cmp-toolbar { align-items: end; }
.cmp-panel:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius-sm); }

/* CSV merger: reorderable file list and the mapping grid */
.merge-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.merge-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-elevated); }
.merge-item[draggable="true"] { cursor: grab; }
.merge-item.is-dragging { opacity: 0.5; }
.merge-item__handle { color: var(--text-tertiary); font-family: var(--font-mono); user-select: none; }
.merge-item__body { flex: 1; min-width: 0; }
.merge-item__name { font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }
.merge-item__meta { font-size: 13px; color: var(--text-secondary); }
.merge-item__diff { font-size: 13px; font-family: var(--font-mono); color: var(--text-tertiary); }
.merge-item__diff.is-mismatch { color: var(--danger); }
.merge-item__buttons { display: flex; gap: 6px; flex-shrink: 0; }
.merge-item__buttons button { min-width: 34px; min-height: 34px; border: 1px solid var(--border-medium); border-radius: var(--radius-sm); background: none; color: var(--text-secondary); cursor: pointer; }
.merge-item__buttons button:hover, .merge-item__buttons button:focus-visible { color: var(--text-primary); border-color: var(--border-strong); }
.merge-mapping { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.merge-mapping__file > p { margin: 0 0 6px; font-size: 13px; color: var(--text-secondary); }
.merge-mapping__row { display: flex; align-items: center; gap: 10px; padding: 4px 0; flex-wrap: wrap; }
.merge-mapping__row label { font-family: var(--font-mono); font-size: 13px; color: var(--text-primary); min-width: 140px; overflow-wrap: anywhere; }

/* Review QR card: canvas preview and the print-only sheet */
.qr-preview-wrap { display: flex; justify-content: center; padding: 18px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-input); }
.qr-preview { max-width: 100%; height: auto; border-radius: 6px; box-shadow: var(--shadow-card); }
.qr-print-root { display: none; }
@media print {
  body > * { display: none !important; }
  body > .qr-print-root { display: block !important; }
  .qr-print-root img { display: block; margin: 0 auto; }
}

/* Delivery commission calculator: result stats */
.dc-results { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dc-stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-input); }
.dc-stat--wide { grid-column: 1 / -1; border-color: var(--accent); background: var(--accent-soft); }
.dc-stat__label { font-size: 13px; color: var(--text-secondary); }
.dc-stat__big { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.dc-stat__sub { font-size: 13px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .dc-results { grid-template-columns: 1fr; } }

/* Privacy filter: side-by-side panels and clickable highlights */
.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.pf-panel { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-input); padding: 14px 16px; font-size: 14px; line-height: 1.7; color: var(--text-secondary); white-space: pre-wrap; overflow-wrap: anywhere; min-height: 140px; max-height: 420px; overflow: auto; }
.pf-panel__title { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin: 0 0 6px; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.pf-panel__hint { font-weight: 400; font-size: 12px; color: var(--text-tertiary); }
.pf-mark { display: inline; border: 0; padding: 0 2px; margin: 0; font: inherit; cursor: pointer; border-radius: 4px; background: var(--accent-soft); color: var(--text-primary); box-shadow: inset 0 -2px 0 var(--accent); }
.pf-mark--possible { background: var(--danger-soft); box-shadow: inset 0 -2px 0 var(--danger); }
.pf-mark--possible.pf-mark--end::after { content: " ?"; font-size: 11px; color: var(--danger); font-family: var(--font-mono); }
/* Found, but put back: reads as normal text, with a dotted underline so it can be found again. */
.pf-mark--kept { background: none; box-shadow: none; color: inherit; text-decoration: underline dotted var(--text-tertiary); text-underline-offset: 3px; }
/* "Deleted" mode: words taken out are struck through, because they will not be in the copy. */
.pf-mode-remove .pf-mark:not(.pf-mark--kept) { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--danger); color: var(--text-tertiary); }
.pf-mark:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 1px; }
/* Every word in the Original panel is a toggle. The padding and negative margin cancel out, so
   hiding or keeping a word never moves the text around it. */
.pf-w { cursor: pointer; padding: 0 2px; margin: 0 -2px; border-radius: 4px; }
.pf-w:not(.pf-mark):hover { background: var(--bg-hover); }
.pf-w.pf-mark--kept:hover { background: var(--bg-hover); }
.pf-w:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 1px; }
.pf-gap { cursor: default; padding: 0; }
/* "Take out automatically" switches: one pill per kind found, with its count. */
.pf-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-cats:empty { display: none; }
.pf-cat { position: relative; cursor: pointer; }
.pf-cat[hidden] { display: none; }
.pf-cat input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pf-cat__body { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 1px solid var(--border-medium); border-radius: 999px; font-size: 13px; color: var(--text-tertiary); background: transparent; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.pf-cat__body::before { content: ""; width: 12px; height: 12px; border-radius: 3px; border: 1px solid currentColor; flex-shrink: 0; }
.pf-cat input:checked + .pf-cat__body { color: var(--text-primary); background: var(--accent-soft); border-color: var(--accent); }
.pf-cat input:checked + .pf-cat__body::before { content: "✓"; display: grid; place-items: center; font-size: 10px; line-height: 1; background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }
.pf-cat input:focus-visible + .pf-cat__body { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.pf-cat__n { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-tertiary); }
.pf-ph { background: var(--accent-soft); color: var(--accent-text); font-family: var(--font-mono); font-size: 12.5px; padding: 0 3px; border-radius: 4px; }
.pf-warn { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--danger); border-radius: var(--radius-md); color: var(--text-primary); font-size: 14.5px; font-weight: 500; }
.pf-warn__icon { flex-shrink: 0; margin-top: 2px; }
.csv-field--gap { margin-top: 10px; }
.pf-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--text-tertiary); }
.pf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--border-medium); border-radius: 999px; font-size: 13px; color: var(--text-primary); background: var(--bg-elevated); }
.pf-format-input { flex: 0 1 320px; min-width: 0; }
/* Privacy Filter: paste text or open a spreadsheet */
.pf-inputmode { margin: 0; }
.tool-top .pf-inputmode { grid-column: 1 / -1; justify-self: start; }
.pft-cols td, .pft-cols th { vertical-align: middle; }
.pft-cols tbody th { font-weight: 600; color: var(--text-primary); text-align: left; }
.pft-cols tr.is-private th::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.pft-cols select { width: 100%; min-width: 220px; }
.pft-example { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-tertiary); font-family: var(--font-mono); font-size: 12.5px; }
@media (max-width: 640px) {
  .pft-cols thead th:nth-child(3), .pft-cols .pft-example { display: none; }
  .csv-table.pft-cols { width: 100%; }
  .csv-table.pft-cols td, .csv-table.pft-cols th { white-space: normal; overflow-wrap: break-word; padding: 8px; }
  .csv-table.pft-cols th:first-child { min-width: 88px; }
  .pft-cols select { min-width: 0; }
}
.pft-sheet { width: auto; min-width: 200px; max-width: 100%; }
.pft-sub { font-size: 14px; font-weight: 600; margin: 10px 0 0; color: var(--text-secondary); }
.pft-report { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.pft-report .btn { align-self: flex-start; }
/* Privacy Filter Pro */
.pf-pro-tag { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; vertical-align: 1px; background: var(--accent-soft); color: var(--accent-text); }
.pf-pro { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border: 1px solid var(--border-accent); border-radius: var(--radius-md); background: var(--accent-soft); }
.pf-pro__title { margin: 0; font-weight: 700; color: var(--text-primary); }
.pf-pro__why { margin: 0; color: var(--text-secondary); font-size: 14.5px; }
.pf-pro__plans { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-pro__form { display: flex; flex-direction: column; gap: 6px; }
.pf-pro__form input { flex: 1 1 260px; min-width: 0; }
.pf-pro__msg { margin: 0; }
.pf-pro__status { margin: 8px 0 0; }
.tool-top .pf-pro__status { grid-column: 1 / -1; }
.pf-pro__link { border: 0; background: none; padding: 0; color: var(--accent-text); font: inherit; text-decoration: underline; cursor: pointer; }
.pf-keybtn { align-self: flex-start; margin-top: 10px; }
.pf-pass { gap: 6px; }
.pf-chip__mono { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.02em; }
.pf-chip button { border: 0; background: none; color: var(--text-tertiary); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.pf-chip button:hover, .pf-chip button:focus-visible { color: var(--danger); outline: none; }
.pf-checklist { margin: 0; padding-left: 1.2em; color: var(--text-secondary); font-size: 0.95rem; line-height: 1.7; }
@media (max-width: 860px) { .pf-grid { grid-template-columns: 1fr; } }

/* Output file list (splitter, compare exports) */
.tool-filelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.tool-filelist li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 12px; font-size: 13px; border-bottom: 1px solid var(--border-subtle); }
.tool-filelist li:last-child { border-bottom: 0; }
.tool-filelist .tool-filelist__name { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-primary); overflow-wrap: anywhere; }
.tool-filelist .tool-filelist__count { color: var(--text-tertiary); white-space: nowrap; font-family: var(--font-mono); font-size: 12px; }

@media (max-width: 720px) {
  .tool-steps { flex-direction: column; }
  .tool-mode__opts { padding-left: 0; }
}

/* Last step + Ko-fi tip card (partials/tool-tip.njk): step on the left, sand card on the right.
   The card is a plain link; nothing loads from Ko-fi until clicked. Sand = --bg-warm, the one light
   "window" surface on the charcoal page (scheme 5). */
.tool-top .tool-final { grid-column: 1 / -1; }
.tool-final:has(> .tool-tip) { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
/* Beats `.tool-top .csv-step { grid-column: 1 / -1 }`, which would push the card onto its own row. */
.tool-top .tool-final > .csv-step { grid-column: 1; min-width: 0; }
.tool-top .tool-final > .tool-tip { grid-column: 2; }
/* Overhaul 1.7: content height, sticky beside the step (it used to stretch to the step's full height: 839px card, 167px content). */
.tool-tip { align-self: start; position: sticky; top: calc(var(--nav-h, 74px) + 16px); box-sizing: border-box; display: flex; flex-direction: column; justify-content: flex-start; gap: 12px; padding: 24px; border: 1px solid var(--border-warm); border-radius: var(--radius-lg); background: var(--bg-warm); color: var(--text-warm-primary); box-shadow: var(--shadow-card); }
.tool-tip__title { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; margin: 0; color: var(--text-warm-primary); }
.tool-tip__line { margin: 0; color: var(--text-warm-secondary); font-size: 0.92rem; line-height: 1.55; }
.tool-tip__btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px; padding: 12px 20px; border-radius: var(--radius-btn); background: var(--accent-deep); color: var(--text-on-accent); font-weight: 600; font-size: 0.95rem; line-height: 1; text-decoration: none; transition: filter 0.2s var(--ease); }
.csv-tool .tool-tip .tool-tip__btn { color: var(--text-on-accent); text-decoration: none; }
.tool-tip__btn:hover { filter: brightness(1.08); }
.tool-tip__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 960px) {
  .tool-final:has(> .tool-tip) { grid-template-columns: minmax(0, 1fr); }
  .tool-top .tool-final > .tool-tip { grid-column: 1; }
  .tool-tip { position: static; }
}
@media (prefers-reduced-motion: reduce) { .tool-tip__btn { transition: none; } }

/* Schedule to Calendar (partials/tools/schedule-to-calendar.njk) */
.s2c-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.s2c-roles:empty { display: none; }
.s2c-role { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-tint); min-width: 0; }
.s2c-role .csv-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); }
.s2c-role.is-ignored { opacity: 0.6; }
.s2c-role:not(.is-ignored) { border-color: var(--border-accent); background: var(--accent-soft); }
.s2c-tag { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; background: var(--accent-deep); color: var(--text-on-accent); vertical-align: 1px; }
.s2c-table th.s2c-col--out { color: var(--text-tertiary); font-weight: 500; }
.s2c-table td.s2c-col--out { color: var(--text-tertiary); text-decoration: line-through; opacity: 0.55; }
.s2c-table tr.is-skipped td { opacity: 0.35; }
.s2c-table .csv-table__num input { margin: 0; width: 15px; height: 15px; }
.s2c-field--wide { flex: 2; }
.s2c-field--wide code { font-family: var(--font-mono); font-size: 12px; color: var(--text-primary); }
.s2c-chip { cursor: pointer; }
.s2c-chip:hover, .s2c-chip:focus-visible { border-color: var(--accent); outline: none; }
.s2c-reminders { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.s2c-reminders .csv-cols { max-height: none; }
.s2c-reminders input[type="time"], .csv-tool input[type="time"] { background: var(--bg-input); border: 1px solid var(--border-medium); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 14px; color: var(--text-primary); font-family: inherit; }
.s2c-reminders input[type="number"] { width: 90px; }
.csv-tool .tool-modes legend { margin-bottom: 8px; }
.s2c-custom { align-items: center; }
.s2c-custom select { width: auto; flex: 0 0 auto; }
.s2c-custom input[type="number"] { width: 90px; flex: 0 0 auto; }
.csv-tool .csv-row > .s2c-field--wide { max-width: 440px; }

/* Tool-to-tool handoff ("Keep going" row, partials/tool-sendto.njk) */
.tool-sendto { margin-top: 18px; padding: 14px 16px; border: 1px dashed var(--border-medium); border-radius: var(--radius-md); display: flex; flex-direction: column; gap: 10px; }
.tool-sendto__label { margin: 0; font-size: 13px; color: var(--text-secondary); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tool-sendto__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tool-sendto__list li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tool-sendto__why { font-size: 13px; color: var(--text-tertiary); }
.s2c-parse .csv-field--short { min-width: 220px; }
.s2c-nudge { display: flex; flex-direction: column; gap: 10px; }
.s2c-nudge__text { margin: 0; }
.s2c-nudge__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.s2c-nudge__actions .btn[hidden] { display: none; }
