/* ============================================================
   Typeform Automator — design system
   Component-class layer. No !important except where we must
   beat Tailwind preflight. Tailwind utilities remain useful for
   layout (flex/grid/gap/etc) but elements should not stack
   competing sizing utilities (px-*, py-*, text-*, rounded-*).
   ============================================================ */

:root {
  --tfm-bg: #09090b;             /* page bg (zinc-950) */
  --tfm-panel: #18181b;          /* card / modal solid (zinc-900) */
  --tfm-panel-soft: rgba(24, 24, 27, 0.4);
  --tfm-border: #27272a;         /* zinc-800 */
  --tfm-border-soft: #3f3f46;    /* zinc-700 */
  --tfm-text: #e4e4e7;           /* zinc-200 */
  --tfm-text-soft: #a1a1aa;      /* zinc-400 */
  --tfm-text-muted: #71717a;     /* zinc-500 */
  --tfm-text-dim: #52525b;       /* zinc-600 */

  --tfm-accent: #6366f1;
  --tfm-accent-hover: #818cf8;
  --tfm-success: #10b981;
  --tfm-success-hover: #34d399;
  --tfm-warn: #f59e0b;
  --tfm-danger: #f43f5e;
  --tfm-info: #38bdf8;

  --tfm-r: 3px;
  --tfm-r-pill: 9999px;

  /* Type scale — tight, predictable */
  --tfm-fs-xs:   10px;
  --tfm-fs-sm:   11px;
  --tfm-fs-md:   12px;
  --tfm-fs-base: 13px;
  --tfm-fs-lg:   15px;
  --tfm-fs-xl:   20px;

  /* 4-pt spacing */
  --tfm-s-1: 4px;
  --tfm-s-2: 8px;
  --tfm-s-3: 12px;
  --tfm-s-4: 16px;
  --tfm-s-5: 20px;
  --tfm-s-6: 24px;

  /* Standard control height (button + input + select all match) */
  --tfm-h-xs: 22px;
  --tfm-h-sm: 26px;
  --tfm-h-md: 28px;
  --tfm-h-lg: 32px;
}

/* ---------- Body / typography baseline ---------- */
html, body { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; }
body { font-size: var(--tfm-fs-base); line-height: 1.5; color: var(--tfm-text); background: var(--tfm-bg); }

/* Page main wrapper — single source of truth.
   Pages add their own max-w-[..] utility on top if a wider layout is needed. */
.tfm-main { flex: 1 1 auto; padding: 16px; width: 100%; min-width: 0; }
@media (min-width: 640px) { .tfm-main { padding: 24px; } }
.font-mono, code, pre, kbd { font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace; }

/* Account for fixed mobile topbar */
@media (max-width: 767px) { body { padding-top: 48px; } }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--tfm-bg); }
::-webkit-scrollbar-thumb { background: var(--tfm-border); border-radius: var(--tfm-r); border: 2px solid var(--tfm-bg); }
::-webkit-scrollbar-thumb:hover { background: var(--tfm-border-soft); }

/* Page heading scale (for h1/h2/h3 inside main) */
main h1 { font-size: var(--tfm-fs-xl); font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
main h2 { font-size: var(--tfm-fs-base); font-weight: 600; line-height: 1.35; }
main h3 { font-size: var(--tfm-fs-xs); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--tfm-text-muted); line-height: 1.3; }

/* ---------- Form controls ---------- */
.tfm-input,
.tfm-select,
.tfm-textarea {
  background: var(--tfm-panel);
  border: 1px solid var(--tfm-border-soft);
  color: var(--tfm-text);
  border-radius: var(--tfm-r);
  font-family: inherit;
  font-size: var(--tfm-fs-base);
  line-height: 1.4;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  display: block;
  color-scheme: dark;
  -webkit-text-fill-color: var(--tfm-text);
}
.tfm-input::-webkit-outer-spin-button,
.tfm-input::-webkit-inner-spin-button { background: var(--tfm-panel); }
.tfm-input:-webkit-autofill,
.tfm-input:-webkit-autofill:hover,
.tfm-input:-webkit-autofill:focus,
.tfm-textarea:-webkit-autofill,
.tfm-select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--tfm-panel) inset !important;
  -webkit-text-fill-color: var(--tfm-text) !important;
  caret-color: var(--tfm-text);
}
.tfm-input,
.tfm-select { height: var(--tfm-h-md); padding: 0 10px; }
.tfm-textarea {
  padding: 8px 10px;
  min-height: 64px;
  resize: vertical;
  line-height: 1.5;
}
.tfm-input:focus,
.tfm-select:focus,
.tfm-textarea:focus {
  border-color: var(--tfm-accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.18);
}
.tfm-input::placeholder,
.tfm-textarea::placeholder { color: var(--tfm-text-muted); font-style: italic; opacity: 1; }

/* Smaller variants */
.tfm-input-sm, .tfm-select-sm { height: var(--tfm-h-sm); padding: 0 8px; font-size: var(--tfm-fs-md); }
.tfm-input-xs, .tfm-select-xs { height: var(--tfm-h-xs); padding: 0 6px; font-size: var(--tfm-fs-sm); }

/* Select chevron */
.tfm-select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  padding-right: 26px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%2371717a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='2,4 6,8 10,4' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px 10px;
}
.tfm-select::-ms-expand { display: none; }

/* Checkbox normalization */
input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--tfm-accent); margin: 0; }

/* ---------- Buttons ---------- */
.tfm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--tfm-h-md);
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--tfm-r);
  font-family: inherit;
  font-size: var(--tfm-fs-md);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  background: transparent;
  color: var(--tfm-text);
  transition: background .12s ease, border-color .12s ease, color .12s ease, transform .1s ease-out, box-shadow .12s ease;
}
.tfm-btn:active:not(:disabled) { transform: scale(0.98); }
.tfm-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.tfm-btn:focus-visible { outline: 2px solid rgba(99, 102, 241, 0.4); outline-offset: 2px; }

/* Sizes — every variant lands at one of these heights */
.tfm-btn-xs { height: var(--tfm-h-xs); padding: 0 6px; font-size: var(--tfm-fs-xs); gap: 4px; }
.tfm-btn-sm { height: var(--tfm-h-sm); padding: 0 8px; font-size: var(--tfm-fs-sm); }
.tfm-btn-md { height: var(--tfm-h-md); padding: 0 10px; font-size: var(--tfm-fs-md); }
.tfm-btn-lg { height: var(--tfm-h-lg); padding: 0 14px; font-size: var(--tfm-fs-base); }

/* Icon-only buttons — fixed square */
.tfm-btn-icon    { width: var(--tfm-h-md); height: var(--tfm-h-md); padding: 0; }
.tfm-btn-icon-sm { width: var(--tfm-h-sm); height: var(--tfm-h-sm); padding: 0; }
.tfm-btn-icon-xs { width: var(--tfm-h-xs); height: var(--tfm-h-xs); padding: 0; }

/* Color variants */
.tfm-btn-primary   { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.tfm-btn-primary:hover:not(:disabled)   { background: #6366f1; border-color: #6366f1; }

.tfm-btn-success   { background: #059669; color: #fff; border-color: #059669; }
.tfm-btn-success:hover:not(:disabled)   { background: #10b981; border-color: #10b981; }

.tfm-btn-danger    { background: #e11d48; color: #fff; border-color: #e11d48; }
.tfm-btn-danger:hover:not(:disabled)    { background: #f43f5e; border-color: #f43f5e; }

.tfm-btn-secondary { background: var(--tfm-panel); color: var(--tfm-text); border-color: var(--tfm-border-soft); }
.tfm-btn-secondary:hover:not(:disabled) { border-color: var(--tfm-text-muted); }

.tfm-btn-ghost     { background: transparent; color: var(--tfm-text-soft); }
.tfm-btn-ghost:hover:not(:disabled)     { background: var(--tfm-border); color: var(--tfm-text); }

.tfm-btn-outline   { background: transparent; color: var(--tfm-text-soft); border-color: var(--tfm-border-soft); }
.tfm-btn-outline:hover:not(:disabled)   { color: var(--tfm-text); border-color: var(--tfm-text-muted); }

/* Hover hints for icon ghost buttons */
.tfm-btn-ghost.tfm-h-sky:hover:not(:disabled)     { color: #38bdf8; }
.tfm-btn-ghost.tfm-h-emerald:hover:not(:disabled) { color: #10b981; }
.tfm-btn-ghost.tfm-h-indigo:hover:not(:disabled)  { color: #818cf8; }
.tfm-btn-ghost.tfm-h-rose:hover:not(:disabled)    { color: #fb7185; }
.tfm-btn-ghost.tfm-h-amber:hover:not(:disabled)   { color: #fbbf24; }

/* ---------- Cards ---------- */
.tfm-card {
  background: var(--tfm-panel-soft);
  border: 1px solid var(--tfm-border);
  border-radius: var(--tfm-r);
}
.tfm-card-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--tfm-border);
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.tfm-card-header h2,
.tfm-card-header h3 { margin: 0; }
.tfm-card-body { padding: 12px 14px; }
.tfm-card-body-tight { padding: 10px 12px; }

/* ---------- Tabs (pill switcher) ---------- */
.tfm-tabs {
  display: inline-flex;
  padding: 2px;
  background: var(--tfm-bg);
  border: 1px solid var(--tfm-border);
  border-radius: var(--tfm-r);
}
.tfm-tab {
  padding: 4px 10px;
  font-size: var(--tfm-fs-sm);
  font-family: inherit;
  font-weight: 500;
  color: var(--tfm-text-muted);
  border-radius: 2px;
  cursor: pointer;
  background: transparent;
  border: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.tfm-tab:hover { color: var(--tfm-text); }
.tfm-tab.is-active,
.tfm-tab[aria-selected="true"] { background: var(--tfm-border); color: #fff; }

/* ---------- Toolbar (single row of controls) ---------- */
.tfm-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---------- Field & label ---------- */
.tfm-field { display: block; }
.tfm-field + .tfm-field { margin-top: 8px; }
.tfm-label {
  display: block;
  font-size: var(--tfm-fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tfm-text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}
.tfm-help {
  font-size: var(--tfm-fs-sm);
  color: var(--tfm-text-muted);
  margin-top: 4px;
}

/* ---------- Modal ---------- */
.tfm-modal-bg {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(9, 9, 11, 0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.tfm-modal-bg.hidden { display: none; }
.tfm-modal-card {
  background: var(--tfm-panel);
  border: 1px solid var(--tfm-border);
  border-radius: var(--tfm-r);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column;
  width: 100%;
  max-height: 92vh;
}
.tfm-modal-card-sm  { max-width: 28rem; }
.tfm-modal-card-md  { max-width: 36rem; }
.tfm-modal-card-lg  { max-width: 48rem; }
.tfm-modal-card-xl  { max-width: 64rem; }
.tfm-modal-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--tfm-border);
  display: flex; align-items: center; gap: 8px;
}
.tfm-modal-header h3 {
  font-size: var(--tfm-fs-base);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: #fff;
  margin: 0;
}
.tfm-modal-body { padding: 14px; overflow: auto; flex: 1 1 auto; min-height: 0; }
.tfm-modal-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--tfm-border);
  display: flex; gap: 8px; justify-content: flex-end;
  align-items: center;
}

/* ---------- Tables ----------
   Pattern: table fills container (width:100%). Most columns are
   .tfm-col-fit (shrink to content). One column omits .tfm-col-fit
   so it absorbs all leftover space (no trailing gap at row end). */
.tfm-table { width: 100%; border-collapse: collapse; font-size: var(--tfm-fs-md); table-layout: auto; }
.tfm-col-fit { width: 1px; white-space: nowrap; }
.tfm-col-grow { width: auto; }
.tfm-col-actions { width: 1px; white-space: nowrap; text-align: right; }
.tfm-table {
  /* fixed layout = column widths driven by <colgroup>/<th width> not by content.
     Stops "long URL squeezes other columns" wrap bug. Pair with overflow-x:auto wrapper
     when the whole table needs h-scroll on narrow viewports. */
  table-layout: fixed;
  width: 100%;
}
.tfm-table thead { background: rgba(24, 24, 27, 0.6); }
.tfm-table th {
  text-align: left;
  font-size: var(--tfm-fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tfm-text-muted);
  padding: 7px 12px;
  white-space: nowrap;
}
.tfm-table td {
  padding: 6px 12px;
  border-top: 1px solid var(--tfm-border);
  font-size: var(--tfm-fs-md);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Allow wrapping inside cells that opt-in (e.g. samples cell with HTML markup) */
.tfm-table td.tfm-td-wrap { white-space: normal; overflow: visible; text-overflow: clip; }
.tfm-table td.tfm-col-actions,
.tfm-table td:has(.tfm-btn-group) { overflow: visible; }
.tfm-table tbody tr:hover td { background: rgba(24, 24, 27, 0.5); }

/* Sticky first column on h-scrollable tables */
.tfm-sticky-first th:first-child,
.tfm-sticky-first td:first-child {
  position: sticky; left: 0;
  background: var(--tfm-panel);
  z-index: 2;
}
.tfm-sticky-first thead th:first-child { background: var(--tfm-panel); }

/* ---------- Badges ---------- */
.tfm-badge {
  display: inline-flex; align-items: center;
  padding: 1px 8px;
  border: 1px solid transparent;
  border-radius: var(--tfm-r-pill);
  font-size: var(--tfm-fs-xs);
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.tfm-badge-ok   { background: rgba(16, 185, 129, 0.1); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.tfm-badge-info { background: rgba(56, 189, 248, 0.1); color: #38bdf8; border-color: rgba(56, 189, 248, 0.3); }
.tfm-badge-warn { background: rgba(245, 158, 11, 0.1); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }
.tfm-badge-bad  { background: rgba(244, 63, 94, 0.1);  color: #fb7185; border-color: rgba(244, 63, 94, 0.3); }
.tfm-badge-mute { background: rgba(63, 63, 70, 0.4);   color: #d4d4d8; border-color: var(--tfm-border-soft); }

/* ---------- Tooltip (kept) ---------- */
.tip { position: relative; outline: none; }
.tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(2px);
  background: var(--tfm-panel);
  border: 1px solid var(--tfm-border-soft);
  color: var(--tfm-text);
  font-size: var(--tfm-fs-sm);
  line-height: 1.4;
  padding: 6px 8px;
  border-radius: var(--tfm-r);
  white-space: normal;
  width: max-content;
  max-width: 240px;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s, transform .15s;
  z-index: 60;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
}
.tip:hover::after, .tip:focus::after, .tip:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 640px) { .tip::after { max-width: 200px; font-size: 10.5px; } }

/* Tooltips inside tables: CSS pseudo is clipped by wrapper's overflow-x:auto
   (which coerces overflow-y to auto). Suppress pseudo and let JS portal
   render the tooltip at body level so it can escape the clip. */
.tfm-table .tip::after { content: none; }

/* JS portal tooltip rendered at <body> level (escapes overflow clipping) */
.tfm-tip-portal {
  position: fixed;
  z-index: 9999;
  background: var(--tfm-panel);
  border: 1px solid var(--tfm-border-soft);
  color: var(--tfm-text);
  font-size: var(--tfm-fs-sm);
  line-height: 1.4;
  padding: 6px 8px;
  border-radius: var(--tfm-r);
  max-width: 240px;
  white-space: normal;
  text-align: left;
  pointer-events: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity .15s, transform .15s;
}
.tfm-tip-portal.tfm-tip-show { opacity: 1; transform: translateY(0); }

/* Diff highlight (find/replace preview) */
.diff ins { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; text-decoration: none; padding: 0 2px; border-radius: 2px; }
.diff del { background: rgba(244, 63, 94, 0.12); color: #fda4af; text-decoration: line-through; padding: 0 2px; border-radius: 2px; }

/* Truncate URL helper */
.truncate-url { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 768px) { .truncate-url { max-width: 160px; } }

/* Pulse for running rows */
@keyframes tfm-pulse { 0%,100% { opacity: 1 } 50% { opacity: .55 } }
.tfm-running { animation: tfm-pulse 1.4s ease-in-out infinite; }

/* Refresh progress panel */
@keyframes tfm-shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.tfm-bar-stripe {
  background-image: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.20) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: tfm-shimmer 1.6s linear infinite;
}
.tfm-loadbar-stripe {
  background-image: linear-gradient(90deg, transparent, rgba(99,102,241,.9), transparent);
  background-size: 200% 100%;
  animation: tfm-shimmer 1.6s linear infinite;
}
.tfm-table-locked > table { opacity: .55; pointer-events: none; user-select: none; filter: blur(2px); }
.tfm-updating-pill {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; z-index: 5;
}
/* Tailwind's .hidden (display:none) and this rule are equal specificity; since
   shared.css loads after tailwind.min.css, .tfm-updating-pill would win and the
   overlay would never hide. This combined selector (higher specificity) ensures
   .hidden actually hides it. */
.tfm-updating-pill.hidden { display: none; }
.tfm-updating-pill > div {
  background: rgba(24,24,27,.95);
  border: 1px solid var(--tfm-border);
  color: #e4e4e7;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--tfm-r);
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,.45);
}

/* ---------- Subtle feedback animations (minimal, restrained) ---------- */
@keyframes tfm-pop {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes tfm-fade-slide {
  0%   { transform: translateY(-8px); opacity: 0; }
  100% { transform: translateY(0);    opacity: 1; }
}
@keyframes tfm-slide-in {
  0%   { transform: translateY(-8px); opacity: 0; }
  100% { transform: translateY(0);    opacity: 1; }
}
@keyframes tfm-fade-in {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes tfm-border-fade {
  0%   { box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.55); }
  100% { box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0); }
}
@keyframes tfm-prog-done {
  0%   { filter: saturate(1.6) brightness(1.1); }
  100% { filter: saturate(1) brightness(1); }
}

.tfm-anim-pop        { animation: tfm-pop        .15s ease-out both; }
.tfm-anim-slide-in   { animation: tfm-slide-in   .2s  ease-out both; }
.tfm-anim-fade-slide { animation: tfm-fade-slide .2s  ease-out both; }
.tfm-anim-fade-in    { animation: tfm-fade-in    .18s ease-out both; }
.tfm-anim-border-fade{ animation: tfm-border-fade .6s ease-out 1; }
.tfm-anim-prog-done  { animation: tfm-prog-done  .4s ease-out 1; }

@media (prefers-reduced-motion: reduce) {
  .tfm-anim-pop,
  .tfm-anim-slide-in,
  .tfm-anim-fade-slide,
  .tfm-anim-fade-in,
  .tfm-anim-border-fade,
  .tfm-anim-prog-done { animation: none !important; }
  .tfm-btn:active:not(:disabled) { transform: none; }
}

/* ---------- Action button group (joined icon bar) ---------- */
.tfm-btn-group { display: inline-flex; align-items: center; }
.tfm-btn-group > .tfm-btn { border-radius: 0; margin: 0; }
.tfm-btn-group > .tfm-btn + .tfm-btn { border-left-width: 0; }
.tfm-btn-group > .tfm-btn:first-child { border-top-left-radius: var(--tfm-r); border-bottom-left-radius: var(--tfm-r); }
.tfm-btn-group > .tfm-btn:last-child  { border-top-right-radius: var(--tfm-r); border-bottom-right-radius: var(--tfm-r); }
.tfm-btn-group > .tfm-btn:focus-visible,
.tfm-btn-group > .tfm-btn:hover { z-index: 1; }

/* Skeleton placeholder shimmer (for async-loading rows) */
.tfm-skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.10) 50%,
    rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  animation: tfm-shimmer 1.4s linear infinite;
  border-radius: var(--tfm-r);
}

/* Card subtle hover lift (only on cards meant to be interactive — opt-in) */
.tfm-card-hover {
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.tfm-card-hover:hover {
  border-color: var(--tfm-text-muted);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px -8px rgba(0,0,0,0.5);
}

/* Reduced-motion users — strip everything except essentials */
@media (prefers-reduced-motion: reduce) {
  .tfm-btn,
  .tfm-anim-pop,
  .tfm-anim-slide-in,
  .tfm-anim-fade-in,
  .tfm-anim-glow,
  .tfm-skeleton,
  .tfm-card-hover { animation: none !important; transition: none !important; }
  .tfm-btn:active:not(:disabled) { transform: none; }
}

/* Sidebar nav (matches body type scale) */
#tfm-nav nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  border-radius: var(--tfm-r);
  font-size: var(--tfm-fs-base);
  color: var(--tfm-text-soft);
  text-decoration: none;
  transition: background .12s, color .12s;
}
#tfm-nav nav a:hover { color: #fff; background: rgba(63, 63, 70, 0.4); }
#tfm-nav nav a.is-active,
#tfm-nav nav a[aria-current="page"] { background: var(--tfm-border); color: #fff; }

/* --- Loading spinners must ALWAYS spin --------------------------------------
   FontAwesome (and our own reduced-motion block above) clamp .fa-spin to
   1ms/1-iteration under `prefers-reduced-motion: reduce`. Windows Server
   reports that preference by default, so every "creating…/loading…" spinner
   froze mid-frame and read as a hung UI. A progress spinner is a status
   indicator, not decoration — re-enable it explicitly for reduced-motion. */
@keyframes tfm-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .fa-spin, .fa-spin-pulse {
    -webkit-animation: tfm-spin .9s linear infinite !important;
            animation: tfm-spin .9s linear infinite !important;
  }
}
