/* ============================================================
   DIGITAL WITH THEJAS — Free Marketing Tools
   ------------------------------------------------------------
   Loaded after main.css on /free-tools/ and every
   /free-tools/<slug>/ page. It consumes the tokens and
   components already defined in main.css (--color-purple,
   .container, .btn, .tag, .breadcrumb pattern, .reveal,
   .final-cta) and only adds the surfaces the tools need:
   form panels, output blocks, score cards and check lists.

   Nothing here overrides a main.css selector, so the navbar,
   footer, typography and buttons stay exactly as they are on
   the rest of the site.
   ============================================================ */

/* ============================================================
   1. PAGE SHELL
   ============================================================ */
.ft-page {
  padding-top: calc(var(--navbar-height) + var(--space-10));
  padding-bottom: var(--space-16);
}

.ft-shell {
  max-width: 880px;
  margin-inline: auto;
}

/* The hub lists every tool, so it gets the full container width. */
.ft-shell--wide { max-width: var(--container-max); }

/* ---- Breadcrumb (same visual language as /services/ and /about/) ---- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-bottom: var(--space-5);
}
.breadcrumb a { color: var(--color-muted); transition: color var(--transition-fast); }
.breadcrumb a:hover { color: var(--color-purple); }
.breadcrumb .sep { opacity: 0.45; }
.breadcrumb [aria-current="page"] { color: var(--color-dark); font-weight: 500; }

/* ---- Hero ---- */
.ft-hero { margin-bottom: var(--space-10); }

.ft-hero__title {
  font-size: clamp(var(--text-3xl), 4.4vw, var(--text-5xl));
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-4);
}

.ft-hero__lede {
  font-size: var(--text-lg);
  color: var(--color-muted);
  line-height: 1.7;
  max-width: 62ch;
}

.ft-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

/* ============================================================
   2. TOOL PANEL — the interface card
   ============================================================ */
.ft-panel {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
}

.ft-panel + .ft-panel { margin-top: var(--space-6); }

.ft-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.ft-panel__title {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ft-panel__hint {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* ============================================================
   3. FORM FIELDS
   ============================================================ */
.ft-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

.ft-grid--1 { grid-template-columns: minmax(0, 1fr); }
.ft-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ft-span-2 { grid-column: 1 / -1; }

.ft-field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }

.ft-field label,
.ft-legend {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-dark);
}

.ft-field label .ft-opt {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--color-muted);
  letter-spacing: 0;
}

.ft-field input[type="text"],
.ft-field input[type="url"],
.ft-field input[type="number"],
.ft-field input[type="search"],
.ft-field select,
.ft-field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-dark);
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  /* 16px minimum keeps iOS Safari from zooming the viewport on focus. */
  min-height: 48px;
}

.ft-field textarea {
  min-height: 180px;
  line-height: 1.65;
  resize: vertical;
}

.ft-field textarea.ft-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--text-sm);
}

.ft-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%236B6B6B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.ft-field input:hover,
.ft-field select:hover,
.ft-field textarea:hover { border-color: #d4d4d4; }

.ft-field input:focus,
.ft-field select:focus,
.ft-field textarea:focus {
  outline: none;
  border-color: var(--color-purple);
  box-shadow: 0 0 0 4px rgba(108,59,255,0.12);
}

.ft-field input:focus-visible,
.ft-field select:focus-visible,
.ft-field textarea:focus-visible { outline: none; }

.ft-hint {
  font-size: var(--text-xs);
  color: var(--color-muted);
  line-height: 1.55;
}

/* ---- Validation ---- */
.ft-err {
  display: none;
  font-size: var(--text-xs);
  font-weight: 600;
  color: #C0341A;
  line-height: 1.5;
}

.ft-field.is-invalid .ft-err { display: block; }

.ft-field.is-invalid input,
.ft-field.is-invalid select,
.ft-field.is-invalid textarea {
  border-color: #E0533A;
  background: #FFF8F6;
}

.ft-field.is-invalid input:focus,
.ft-field.is-invalid textarea:focus { box-shadow: 0 0 0 4px rgba(224,83,58,0.14); }

/* ---- Character counter ---- */
.ft-count {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}

.ft-count__bar {
  flex: 1;
  height: 4px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.ft-count__fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--color-purple);
  border-radius: var(--radius-full);
  transition: width var(--transition-fast), background var(--transition-fast);
}

.ft-count[data-state="ok"]    .ft-count__fill { background: #17915B; }
.ft-count[data-state="warn"]  .ft-count__fill { background: #C98A00; }
.ft-count[data-state="over"]  .ft-count__fill { background: #E0533A; }
.ft-count[data-state="ok"]    .ft-count__label { color: #17915B; font-weight: 600; }
.ft-count[data-state="warn"]  .ft-count__label { color: #96690A; font-weight: 600; }
.ft-count[data-state="over"]  .ft-count__label { color: #C0341A; font-weight: 600; }

/* ---- Choice list (radio / checkbox groups) ---- */
.ft-choices {
  display: grid;
  gap: var(--space-3);
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.ft-choices legend { padding: 0; margin-bottom: var(--space-3); }

.ft-choice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.ft-choice:hover { border-color: #d4d4d4; background: #FCFCFD; }

.ft-choice input { margin-top: 0.2rem; accent-color: var(--color-purple); width: 18px; height: 18px; flex-shrink: 0; }

.ft-choice:has(input:checked) {
  border-color: var(--color-purple);
  background: var(--color-purple-light);
}

.ft-choice__body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.ft-choice__title { font-weight: 600; font-size: var(--text-sm); }
.ft-choice__desc  { font-size: var(--text-xs); color: var(--color-muted); line-height: 1.55; }

/* ============================================================
   4. ACTIONS
   ============================================================ */
.ft-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.ft-actions .btn { min-height: 48px; }

.ft-btn-quiet {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-muted);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-full);
  transition: color var(--transition-fast), background var(--transition-fast);
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.ft-btn-quiet:hover { color: var(--color-dark); background: var(--color-border-light); }

/* ============================================================
   5. OUTPUT BLOCKS
   ============================================================ */
.ft-out { margin-top: var(--space-6); }

.ft-out__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.ft-out__label {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ft-code {
  position: relative;
  background: #14141B;
  color: #E8E8F0;
  border-radius: var(--radius-md);
  padding: var(--space-5);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--text-sm);
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
  -webkit-overflow-scrolling: touch;
}

.ft-code--wrap { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }

.ft-code .ft-tok-tag  { color: #9BB4FF; }
.ft-code .ft-tok-attr { color: #E0A6FF; }
.ft-code .ft-tok-val  { color: #9DE8B4; }
.ft-code .ft-tok-cmt  { color: #7A7A8C; font-style: italic; }

.ft-code__empty { color: #7A7A8C; font-style: italic; }

/* ---- Copy button ---- */
.ft-copy {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-purple);
  background: var(--color-purple-light);
  border: 1px solid var(--color-purple-mid);
  border-radius: var(--radius-full);
  padding: 0.5rem 0.9rem;
  min-height: 36px;
  transition: all var(--transition-fast);
}

.ft-copy:hover:not(:disabled) { background: var(--color-purple); color: var(--color-white); border-color: var(--color-purple); }
.ft-copy:disabled { opacity: 0.45; cursor: not-allowed; }
.ft-copy.is-done { background: #E7F6EE; color: #12784B; border-color: #BFE6D2; }
.ft-copy.is-fail { background: #FDECE8; color: #C0341A; border-color: #F5C9BF; }

/* ---- Live preview URL ----
   This is an <output>, which is inline by default. Left inline, the
   padded background paints once per line fragment and the block looks
   torn in half on any URL that wraps. */
.ft-preview {
  display: block;
  background: var(--color-purple-light);
  border: 1px solid var(--color-purple-mid);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--text-sm);
  line-height: 1.75;
  word-break: break-all;
  overflow-wrap: anywhere;
  color: var(--color-dark);
}

.ft-preview .ft-base  { font-weight: 600; }
.ft-preview .ft-key   { color: var(--color-purple); font-weight: 600; }
.ft-preview .ft-value { color: #12784B; }
.ft-preview .ft-punct { color: var(--color-muted); }
.ft-preview__empty { color: var(--color-muted); font-style: italic; }

/* ============================================================
   6. RESULT / SCORE CARDS
   ============================================================ */
.ft-result { margin-top: var(--space-8); }
.ft-result[hidden] { display: none; }

.ft-score {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-8);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
}

.ft-ring { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.ft-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ft-ring__track { stroke: var(--color-border-light); }
.ft-ring__fill {
  stroke: var(--ft-band, var(--color-purple));
  stroke-linecap: round;
  transition: stroke-dashoffset 700ms cubic-bezier(0.22,0.61,0.36,1), stroke 300ms ease;
}

.ft-ring__centre {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
}

.ft-ring__num {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ft-ring__of { font-size: var(--text-xs); color: var(--color-muted); }

.ft-score__body { flex: 1; min-width: 240px; }

.ft-score__grade {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ft-band, var(--color-purple));
  margin-bottom: var(--space-2);
}

.ft-score__summary { color: var(--color-dark-80); line-height: 1.7; }

.ft-score__tally {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

/* ---- Stat tiles (calculators) ---- */
.ft-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: var(--space-4);
}

.ft-stat {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.ft-stat--hero {
  background: var(--color-purple-light);
  border-color: var(--color-purple-mid);
}

.ft-stat__label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--space-2);
}

.ft-stat__value {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.ft-stat--hero .ft-stat__value { color: var(--color-purple); }
.ft-stat__value.is-neg { color: #C0341A; }
.ft-stat__value.is-pos { color: #12784B; }

.ft-stat__note {
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-top: var(--space-2);
  line-height: 1.55;
}

.ft-stat__formula {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--color-muted);
  margin-top: var(--space-2);
  overflow-wrap: anywhere;
}

/* ---- Pass / warn / fail check list ---- */
.ft-checks { display: grid; gap: var(--space-3); }

.ft-check {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
}

.ft-check__icon {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.ft-check__title { font-weight: 700; font-size: var(--text-sm); letter-spacing: -0.01em; }
.ft-check__detail { font-size: var(--text-sm); color: var(--color-muted); line-height: 1.65; margin-top: 0.2rem; overflow-wrap: anywhere; }
.ft-check__fix { font-size: var(--text-sm); color: var(--color-dark-80); line-height: 1.65; margin-top: var(--space-2); }
.ft-check__fix strong { color: var(--color-dark); }

.ft-check--pass { border-left-color: #17915B; }
.ft-check--pass .ft-check__icon { background: #E7F6EE; color: #12784B; }
.ft-check--warn { border-left-color: #E5A800; }
.ft-check--warn .ft-check__icon { background: #FFF6E0; color: #96690A; }
.ft-check--fail { border-left-color: #E0533A; }
.ft-check--fail .ft-check__icon { background: #FDECE8; color: #C0341A; }
.ft-check--info { border-left-color: var(--color-purple); }
.ft-check--info .ft-check__icon { background: var(--color-purple-light); color: var(--color-purple); }

/* ---- Result group headings ---- */
.ft-group + .ft-group { margin-top: var(--space-8); }

.ft-group__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.ft-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
}

.ft-pill--pass { background: #E7F6EE; color: #12784B; border-color: #BFE6D2; }
.ft-pill--warn { background: #FFF6E0; color: #96690A; border-color: #F1DFAE; }
.ft-pill--fail { background: #FDECE8; color: #C0341A; border-color: #F5C9BF; }
.ft-pill--info { background: var(--color-purple-light); color: var(--color-purple); border-color: var(--color-purple-mid); }
.ft-pill--muted { background: var(--color-border-light); color: var(--color-muted); border-color: var(--color-border); }

/* ============================================================
   7. CALLOUTS
   ============================================================ */
.ft-note {
  display: flex;
  gap: var(--space-4);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  font-size: var(--text-sm);
  line-height: 1.7;
  border: 1px solid var(--color-border);
  background: #FCFCFD;
  color: var(--color-dark-80);
}

.ft-note p + p { margin-top: var(--space-3); }
.ft-note strong { color: var(--color-dark); }
.ft-note a { color: var(--color-purple); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ft-note code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85em; background: rgba(0,0,0,0.05); padding: 0.1em 0.35em; border-radius: 4px; }

.ft-note--info  { background: var(--color-purple-light); border-color: var(--color-purple-mid); }
.ft-note--warn  { background: #FFF9EC; border-color: #F1DFAE; }
.ft-note--error { background: #FDECE8; border-color: #F5C9BF; color: #7A2413; }
.ft-note[hidden] { display: none; }

.ft-note__icon { flex-shrink: 0; margin-top: 0.15rem; }

/* ---- Inline status line ---- */
.ft-status {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin-top: var(--space-4);
}

.ft-status[hidden] { display: none; }

.ft-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--color-purple-mid);
  border-top-color: var(--color-purple);
  border-radius: var(--radius-full);
  animation: ft-spin 700ms linear infinite;
  flex-shrink: 0;
}

@keyframes ft-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .ft-spinner { animation-duration: 2s; }
  .ft-ring__fill { transition: none; }
}

/* ============================================================
   8. SOCIAL PREVIEW CARDS (Open Graph previewer)
   ============================================================ */
.ft-previews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: var(--space-6);
}

.ft-social { min-width: 0; }

.ft-social__label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.ft-social__card {
  border: 1px solid #DADDE1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-white);
  max-width: 500px;
}

.ft-social__card--x { border-radius: 16px; border-color: #CFD9DE; }

.ft-social__img {
  position: relative;
  aspect-ratio: 1.91 / 1;
  background: #EDEFF2;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.ft-social__img img { width: 100%; height: 100%; object-fit: cover; }

.ft-social__img-fallback {
  font-size: var(--text-xs);
  color: var(--color-muted);
  text-align: center;
  padding: var(--space-4);
  line-height: 1.6;
}

.ft-social__body { padding: 10px 12px; background: #F2F3F5; }
.ft-social__card--x .ft-social__body { background: var(--color-white); border-top: 1px solid #CFD9DE; }

.ft-social__domain {
  font-size: 12px;
  color: #606770;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ft-social__card--x .ft-social__domain { text-transform: none; letter-spacing: 0; }

.ft-social__title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: #1D2129;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.ft-social__desc {
  font-size: 13px;
  line-height: 1.4;
  color: #606770;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.ft-social__note { font-size: var(--text-xs); color: var(--color-muted); margin-top: var(--space-3); line-height: 1.6; }

/* ============================================================
   9. QR CODE
   ============================================================ */
.ft-qr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-6);
  margin-top: var(--space-6);
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #FCFCFD;
}

.ft-qr[hidden] { display: none; }

.ft-qr__frame {
  width: 168px;
  height: 168px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px;
  flex-shrink: 0;
}

.ft-qr__frame svg { width: 100%; height: 100%; display: block; }
.ft-qr__body { flex: 1; min-width: 200px; }
.ft-qr__body p { font-size: var(--text-sm); color: var(--color-muted); line-height: 1.65; margin-bottom: var(--space-4); }

/* ============================================================
   10. PROSE SECTIONS — How it works / Why this matters
   ============================================================ */
.ft-section { margin-top: var(--space-16); }

.ft-section__title {
  font-size: clamp(var(--text-2xl), 3vw, var(--text-3xl));
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-5);
}

.ft-prose { color: var(--color-dark-80); line-height: 1.8; max-width: 68ch; }
.ft-prose p { margin-bottom: var(--space-4); }
.ft-prose p:last-child { margin-bottom: 0; }
.ft-prose strong { color: var(--color-dark); font-weight: 600; }
.ft-prose a { color: var(--color-purple); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ft-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--color-border-light);
  padding: 0.12em 0.4em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

.ft-steps { counter-reset: ft-step; display: grid; gap: var(--space-4); margin-top: var(--space-2); }

.ft-steps li {
  counter-increment: ft-step;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
  color: var(--color-dark-80);
  line-height: 1.7;
}

.ft-steps li::before {
  content: counter(ft-step);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: var(--color-purple-light);
  color: var(--color-purple);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--text-sm);
  display: grid;
  place-items: center;
}

.ft-steps li strong { color: var(--color-dark); }

/* ---- Definition list (parameter / directive explainers) ---- */
.ft-defs { display: grid; gap: var(--space-4); margin-top: var(--space-2); }

.ft-def {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  background: var(--color-white);
}

.ft-def__term {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-purple);
  background: var(--color-purple-light);
  border: 1px solid var(--color-purple-mid);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.5rem;
  margin-bottom: var(--space-3);
  overflow-wrap: anywhere;
}

.ft-def__desc { font-size: var(--text-sm); color: var(--color-dark-80); line-height: 1.7; }
.ft-def__desc + .ft-def__desc { margin-top: var(--space-2); }
.ft-def__eg {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-top: var(--space-2);
  overflow-wrap: anywhere;
}

/* ============================================================
   11. FAQ — <details> accordion, same pattern as /ai-tools/
   ============================================================ */
.ft-faq { margin-top: var(--space-2); }

.ft-faq__item {
  border-bottom: 1px solid var(--color-border-light);
}

.ft-faq__item:first-child { border-top: 1px solid var(--color-border-light); }

.ft-faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  list-style: none;
  cursor: pointer;
  padding: var(--space-5) 0;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-dark);
  transition: color var(--transition-fast);
}

.ft-faq__item summary::-webkit-details-marker { display: none; }
.ft-faq__item summary::marker { content: ""; }
.ft-faq__item summary:hover { color: var(--color-purple); }

.ft-faq__item summary::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--color-muted);
  border-bottom: 2px solid var(--color-muted);
  transform: rotate(45deg);
  transition: transform var(--transition-base);
  flex-shrink: 0;
  margin-right: 4px;
}

.ft-faq__item[open] summary::after { transform: rotate(225deg); }

.ft-faq__answer { padding-bottom: var(--space-5); color: var(--color-dark-80); line-height: 1.8; max-width: 68ch; }
.ft-faq__answer p + p { margin-top: var(--space-3); }
.ft-faq__answer a { color: var(--color-purple); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ============================================================
   12. RELATED TOOLS
   ============================================================ */
.ft-related {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.ft-related__card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: all var(--transition-base);
}

.ft-related__card:hover {
  border-color: var(--color-purple-mid);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.ft-related__name {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.ft-related__name::after {
  content: "→";
  color: var(--color-purple);
  transition: transform var(--transition-fast);
  margin-left: auto;
}

.ft-related__card:hover .ft-related__name::after { transform: translateX(3px); }
.ft-related__desc { font-size: var(--text-sm); color: var(--color-muted); line-height: 1.6; }

/* ============================================================
   13. SUBTLE SERVICE CTA
   ============================================================ */
.ft-cta {
  margin-top: var(--space-16);
  background: var(--color-white);
  border: 1px solid var(--color-purple-mid);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.ft-cta__body { flex: 1; min-width: 260px; }

.ft-cta__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
}

.ft-cta__text { color: var(--color-muted); line-height: 1.7; font-size: var(--text-sm); max-width: 54ch; }
.ft-cta__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ============================================================
   14. HUB PAGE
   ============================================================ */
.ft-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: var(--space-5);
}

.ft-tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.ft-tool-card:hover {
  border-color: var(--color-purple-mid);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.ft-tool-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-purple-light);
  color: var(--color-purple);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ft-tool-card__name {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Stretched link: the whole card is the click target, and the
   accessible name comes from the anchor text itself. */
.ft-tool-card__name a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.ft-tool-card__desc { font-size: var(--text-sm); color: var(--color-muted); line-height: 1.65; flex: 1; }

.ft-tool-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.ft-hub-group + .ft-hub-group { margin-top: var(--space-16); }

.ft-hub-group__title {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-2);
}

.ft-hub-group__sub { color: var(--color-muted); margin-bottom: var(--space-6); line-height: 1.7; max-width: 62ch; }

/* ============================================================
   15. TOAST — copy / download confirmation
   ============================================================ */
.ft-toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-8);
  transform: translate(-50%, 12px);
  z-index: 1200;
  background: var(--color-dark);
  color: var(--color-white);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
  max-width: calc(100vw - 2rem);
  text-align: center;
}

.ft-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   16. RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .ft-grid,
  .ft-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .ft-panel { padding: var(--space-6); }
  .ft-cta { padding: var(--space-6); }
}

@media (max-width: 768px) {
  .ft-page { padding-top: calc(var(--navbar-height) + var(--space-6)); }
  .ft-panel { padding: var(--space-5); border-radius: var(--radius-lg); }
  .ft-score { padding: var(--space-6); gap: var(--space-6); justify-content: center; text-align: center; }
  .ft-score__body { text-align: left; }
  .ft-code { padding: var(--space-4); font-size: 0.8rem; }
  .ft-section { margin-top: var(--space-12); }
  .ft-cta { margin-top: var(--space-12); }
  .ft-actions .btn,
  .ft-actions .ft-btn-quiet { flex: 1 1 100%; justify-content: center; }
  .ft-out__head { align-items: flex-start; }
  .ft-qr { justify-content: center; text-align: center; }
  .ft-qr__body { text-align: left; }
}

@media (max-width: 420px) {
  .ft-ring { width: 108px; height: 108px; }
  .ft-ring__num { font-size: var(--text-3xl); }
  .ft-check { grid-template-columns: 22px minmax(0, 1fr); gap: var(--space-3); padding: var(--space-4); }
  .ft-check__icon { width: 22px; height: 22px; font-size: 0.75rem; }
}

/* ============================================================
   17. PRINT — results should survive Ctrl+P
   ============================================================ */
@media print {
  .navbar, .navbar__mobile, .footer, .ft-cta, .ft-actions, .ft-toast { display: none !important; }
  .ft-page { padding-top: 0; }
  .ft-panel, .ft-score, .ft-check { box-shadow: none; break-inside: avoid; }
  .ft-code { background: #fff; color: #111; border: 1px solid #ccc; }
}

/* ============================================================
   18. TABS — URL input vs paste fallback
   ============================================================
   Tools that need a server fetch always offer a paste route, so
   they still work when a site blocks automated requests. The two
   routes are equal peers, not a primary and a fallback, so they
   are presented as tabs rather than a hidden "advanced" option.
   ============================================================ */
.ft-tabs {
  display: flex;
  gap: var(--space-1);
  padding: 5px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
  overflow-x: auto;
  scrollbar-width: none;
}

.ft-tabs::-webkit-scrollbar { display: none; }

.ft-tab {
  flex: 1;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-muted);
  background: transparent;
  border-radius: var(--radius-full);
  padding: 0.65rem 1.1rem;
  min-height: 42px;
  transition: all var(--transition-fast);
}

.ft-tab:hover { color: var(--color-dark); }

.ft-tab[aria-selected="true"] {
  background: var(--color-white);
  color: var(--color-dark);
  box-shadow: var(--shadow-sm);
}

.ft-tabpanel[hidden] { display: none; }

/* ============================================================
   19. TARGET TABLE — conversion planning
   ============================================================ */
.ft-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-white);
}

.ft-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  min-width: 460px;
}

.ft-table th,
.ft-table td {
  text-align: right;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border-light);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ft-table th:first-child,
.ft-table td:first-child { text-align: left; }

.ft-table thead th {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-muted);
  background: #FCFCFD;
}

.ft-table tbody tr:last-child td { border-bottom: 0; }
.ft-table tbody tr.is-current { background: var(--color-purple-light); }
.ft-table tbody tr.is-current td { font-weight: 600; }
.ft-table caption { caption-side: bottom; padding: var(--space-4) var(--space-5); font-size: var(--text-xs); color: var(--color-muted); text-align: left; line-height: 1.6; }

/* ============================================================
   20. DIMENSION BARS — AI content readiness
   ============================================================ */
.ft-dims { display: grid; gap: var(--space-4); }

.ft-dim {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.ft-dim__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.ft-dim__name { font-family: var(--font-heading); font-weight: 700; font-size: var(--text-base); letter-spacing: -0.01em; }
.ft-dim__score { font-size: var(--text-sm); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ft-band, var(--color-purple)); }

.ft-dim__track {
  height: 7px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.ft-dim__fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--ft-band, var(--color-purple));
  transition: width 600ms cubic-bezier(0.22,0.61,0.36,1);
}

.ft-dim__note { font-size: var(--text-sm); color: var(--color-muted); line-height: 1.65; }
.ft-dim__fix { font-size: var(--text-sm); color: var(--color-dark-80); line-height: 1.65; margin-top: var(--space-2); }
.ft-dim__fix strong { color: var(--color-dark); }

@media (prefers-reduced-motion: reduce) { .ft-dim__fill { transition: none; } }

/* ============================================================
   21. FOUND-ITEM LISTS — CTA phrases, sitemap children
   ============================================================ */
.ft-list { display: grid; gap: var(--space-2); }

.ft-list__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
}

.ft-list__text { min-width: 0; overflow-wrap: anywhere; }
.ft-list__text a { color: var(--color-purple); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ft-list__more { font-size: var(--text-xs); color: var(--color-muted); padding: var(--space-2) var(--space-1); }
