/* TFDM free tools. Everything is scoped under .tfdm-tool so the theme is not affected. */
.tfdm-tool {
	--t-accent: #e2195b;
	--t-accent-ink: #ffffff;
	--t-ink: #1f2430;
	--t-muted: #5f6675;
	--t-line: #dfe2e8;
	--t-soft: #f6f7f9;
	--t-ok: #1e7b45;
	--t-ok-bg: #e5f4ea;
	--t-warn: #8a5a00;
	--t-warn-bg: #fdf1d8;
	--t-bad: #b3261e;
	--t-bad-bg: #fbe4e2;
	color: var(--t-ink);
	background: #ffffff;
	border: 1px solid var(--t-line);
	border-radius: 12px;
	padding: 20px;
	margin: 24px 0 32px;
	font-size: 16px;
	line-height: 1.5;
	box-sizing: border-box;
	max-width: 100%;
}
.tfdm-tool *, .tfdm-tool *::before, .tfdm-tool *::after { box-sizing: border-box; }
.tfdm-tool h3 { font-size: 18px; margin: 0 0 12px; line-height: 1.3; }
.tfdm-tool h4 { font-size: 15px; margin: 16px 0 8px; text-transform: uppercase; letter-spacing: .04em; color: var(--t-muted); }
.tfdm-tool p { margin: 0 0 10px; }
.tfdm-tool .t-note { font-size: 14px; color: var(--t-muted); }

/* Tabs and segmented choices */
.tfdm-tool .t-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; }
.tfdm-tool .t-tab {
	font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
	border: 1px solid var(--t-line); background: var(--t-soft); color: var(--t-ink);
	border-radius: 999px; padding: 8px 14px; line-height: 1.2;
}
.tfdm-tool .t-tab[aria-selected="true"], .tfdm-tool .t-tab[aria-pressed="true"] {
	background: var(--t-accent); border-color: var(--t-accent); color: var(--t-accent-ink);
}
.tfdm-tool .t-tab:focus-visible, .tfdm-tool input:focus-visible, .tfdm-tool textarea:focus-visible,
.tfdm-tool select:focus-visible, .tfdm-tool .t-btn:focus-visible {
	outline: 3px solid rgba(226, 25, 91, .35); outline-offset: 2px;
}

/* Layout */
.tfdm-tool .t-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.tfdm-tool .t-fields { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tfdm-tool .t-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) {
	.tfdm-tool { padding: 16px; }
	.tfdm-tool .t-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
	.tfdm-tool .t-row2 { grid-template-columns: 1fr; }
}

/* Fields */
.tfdm-tool .t-field { display: flex; flex-direction: column; gap: 4px; }
.tfdm-tool .t-field label { font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.tfdm-tool .t-field label .t-count { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tfdm-tool input[type="text"], .tfdm-tool input[type="number"], .tfdm-tool textarea, .tfdm-tool select {
	width: 100%; font: inherit; font-size: 16px; color: var(--t-ink);
	border: 1px solid var(--t-line); border-radius: 8px; padding: 9px 11px; background: #fff;
	margin: 0;
}
.tfdm-tool textarea { min-height: 96px; resize: vertical; }
.tfdm-tool .t-field.is-warn input, .tfdm-tool .t-field.is-warn textarea { border-color: #e0a526; }
.tfdm-tool .t-field.is-bad input, .tfdm-tool .t-field.is-bad textarea { border-color: var(--t-bad); }
.tfdm-tool .t-count.is-ok { color: var(--t-ok); }
.tfdm-tool .t-count.is-warn { color: var(--t-warn); }
.tfdm-tool .t-count.is-bad { color: var(--t-bad); }
.tfdm-tool .t-hint { font-size: 13px; color: var(--t-muted); }
.tfdm-tool .t-input-wrap { position: relative; display: flex; align-items: center; }
.tfdm-tool .t-input-wrap .t-suffix { position: absolute; right: 11px; color: var(--t-muted); pointer-events: none; font-size: 15px; }
.tfdm-tool .t-input-wrap input { padding-right: 34px; }

.tfdm-tool .t-btn {
	font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
	border-radius: 8px; padding: 8px 14px; border: 1px solid var(--t-line); background: #fff; color: var(--t-ink);
	align-self: flex-start;
}
.tfdm-tool .t-btn:hover { border-color: var(--t-accent); color: var(--t-accent); }
.tfdm-tool .t-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Issues */
.tfdm-tool ul.t-issues { list-style: none !important; margin: 0 0 16px !important; padding: 0 !important; display: flex; flex-direction: column; gap: 6px; }
.tfdm-tool ul.t-issues li { font-size: 14px; padding: 8px 10px; border-radius: 8px; margin: 0 !important; list-style: none !important; }
.tfdm-tool ul.t-issues li::marker { content: ''; }
.tfdm-tool ul.t-issues li::before { content: none !important; display: none !important; }
.tfdm-tool .t-issues li.is-bad { background: var(--t-bad-bg); color: var(--t-bad); }
.tfdm-tool .t-issues li.is-warn { background: var(--t-warn-bg); color: var(--t-warn); }
.tfdm-tool .t-issues li.is-ok { background: var(--t-ok-bg); color: var(--t-ok); }

/* Previews */
.tfdm-tool .t-preview-label { font-size: 13px; font-weight: 600; color: var(--t-muted); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.tfdm-tool .t-prev { border: 1px solid var(--t-line); border-radius: 10px; background: #fff; overflow: hidden; word-wrap: break-word; overflow-wrap: anywhere; }
.tfdm-tool .p-google { padding: 14px 16px; font-family: Arial, Helvetica, sans-serif; }
.tfdm-tool .p-google .g-spon { font-size: 13px; font-weight: 700; color: #202124; margin-bottom: 2px; }
.tfdm-tool .p-google .g-url { font-size: 13px; color: #202124; margin-bottom: 4px; }
.tfdm-tool .p-google .g-head { font-size: 19px; color: #1a0dab; line-height: 1.3; margin-bottom: 4px; }
.tfdm-tool .p-google .g-desc { font-size: 14px; color: #4d5156; line-height: 1.55; }
.tfdm-tool .p-social { font-family: Helvetica, Arial, sans-serif; font-size: 14px; }
.tfdm-tool .p-social .s-top { display: flex; gap: 10px; align-items: center; padding: 12px 12px 8px; }
.tfdm-tool .p-social .s-avatar { width: 36px; height: 36px; border-radius: 50%; background: #d8dbe2; flex: 0 0 auto; }
.tfdm-tool .p-social .s-name { font-weight: 700; font-size: 14px; }
.tfdm-tool .p-social .s-spon { font-size: 12px; color: #65676b; }
.tfdm-tool .p-social .s-text { padding: 0 12px 10px; white-space: pre-wrap; }
.tfdm-tool .p-social .s-more { color: #65676b; font-weight: 600; }
.tfdm-tool .p-social .s-img { aspect-ratio: 1.91 / 1; background: repeating-linear-gradient(45deg, #eef0f4, #eef0f4 10px, #e6e9ef 10px, #e6e9ef 20px); display: flex; align-items: center; justify-content: center; color: #8a909c; font-size: 13px; }
.tfdm-tool .p-social .s-foot { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; background: #f0f2f5; }
.tfdm-tool .p-social .s-foot-text { min-width: 0; }
.tfdm-tool .p-social .s-head { font-weight: 700; font-size: 15px; }
.tfdm-tool .p-social .s-desc { color: #65676b; font-size: 13px; }
.tfdm-tool .p-social .s-cta { flex: 0 0 auto; background: #e4e6eb; border-radius: 6px; padding: 7px 12px; font-weight: 600; font-size: 13px; }
.tfdm-tool .p-linkedin .s-foot { background: #fff; border-top: 1px solid var(--t-line); }
.tfdm-tool .p-linkedin .s-cta { background: #fff; border: 1px solid #0a66c2; color: #0a66c2; border-radius: 999px; }
.tfdm-tool .p-tiktok { background: #121212; color: #fff; font-family: Helvetica, Arial, sans-serif; aspect-ratio: 9 / 13; max-height: 460px; display: flex; flex-direction: column; justify-content: flex-end; padding: 16px; position: relative; }
.tfdm-tool .p-tiktok .tk-video { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #6d6d6d; font-size: 13px; }
.tfdm-tool .p-tiktok .tk-body { position: relative; }
.tfdm-tool .p-tiktok .tk-name { font-weight: 700; margin-bottom: 4px; }
.tfdm-tool .p-tiktok .tk-spon { display: inline-block; font-size: 11px; background: rgba(255,255,255,.18); border-radius: 3px; padding: 1px 5px; margin-left: 6px; font-weight: 400; }
.tfdm-tool .p-tiktok .tk-text { font-size: 14px; white-space: pre-wrap; }
.tfdm-tool .p-tiktok .tk-more { font-weight: 700; }
.tfdm-tool .p-tiktok .tk-cta { margin-top: 10px; background: #fe2c55; color: #fff; border-radius: 4px; padding: 8px; text-align: center; font-weight: 600; font-size: 14px; }
.tfdm-tool .t-empty { color: #9aa0ab; }

/* Results */
.tfdm-tool .t-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; margin-top: 4px; }
.tfdm-tool .t-stat { background: var(--t-soft); border-radius: 10px; padding: 12px 14px; }
.tfdm-tool .t-stat .t-k { font-size: 13px; color: var(--t-muted); margin-bottom: 2px; }
.tfdm-tool .t-stat .t-v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; overflow-wrap: anywhere; }
.tfdm-tool .t-stat.is-main { background: var(--t-accent); color: var(--t-accent-ink); }
.tfdm-tool .t-stat.is-main .t-k { color: rgba(255,255,255,.85); }
.tfdm-tool .t-verdict { margin-top: 12px; padding: 10px 12px; border-radius: 8px; font-size: 15px; font-weight: 600; }
.tfdm-tool .t-verdict.is-ok { background: var(--t-ok-bg); color: var(--t-ok); }
.tfdm-tool .t-verdict.is-bad { background: var(--t-bad-bg); color: var(--t-bad); }
.tfdm-tool .t-verdict.is-warn { background: var(--t-warn-bg); color: var(--t-warn); }
.tfdm-tool .t-formula { margin-top: 14px; font-size: 14px; color: var(--t-muted); background: var(--t-soft); border-radius: 8px; padding: 10px 12px; }
.tfdm-tool .t-formula code { background: transparent; padding: 0; font-size: 14px; font-family: inherit; color: inherit; white-space: normal; }
.tfdm-tool [hidden] { display: none !important; }

/* Callout box added to related guides */
.tfdm-callout { border: 1px solid #f2c4d3; background: #fff5f8; border-radius: 10px; padding: 14px 16px; margin: 20px 0; font-size: 16px; }
.tfdm-callout strong { color: #b3134a; }
.tfdm-callout a { font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .tfdm-tool * { transition: none !important; } }

.tfdm-tool .t-combos { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.tfdm-tool .p-google .g-spon { display: flex; justify-content: space-between; }
.tfdm-tool .p-google .g-num { font-weight: 600; color: #9aa0ab; font-size: 12px; }
