/* Native anchor scrolling across the site, with reduced-motion support. */
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 110px; }
#site-top { scroll-margin-top: 0; }
@media (prefers-reduced-motion: reduce) {
 html { scroll-behavior: auto; }
}

/* Homepage guidance and shared footer: use the existing KTUI theme tokens. */
.ftg-seo, .ftg-footer { --ftg-muted: var(--muted-foreground); }
.dark .ftg-seo, .dark .ftg-footer { --ftg-muted: var(--color-zinc-400, #a1a1aa); }
.ftg-seo { display: grid; gap: 28px; margin-bottom: 0; }
.ftg-seo .ftg-section-title { margin: 0; font-size: 18px; line-height: 1.45; font-weight: 600; color: var(--foreground); }
.ftg-check-header { gap: 20px; padding: 20px 24px; }
.ftg-check-header .kt-btn { flex-shrink: 0; }
.ftg-check-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; list-style: none; margin: 0; padding: 24px; }
.ftg-check-step { min-width: 0; }
.ftg-step-heading { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.ftg-step-number { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; background: var(--muted); color: var(--ftg-muted, var(--muted-foreground)); font-size: 12px; font-weight: 600; }
.ftg-step-title { margin: 0; font-size: 14px; line-height: 1.5; font-weight: 600; color: var(--foreground); }
.ftg-step-text { margin: 0; padding-left: 40px; font-size: 13px; line-height: 1.7; color: var(--ftg-muted, var(--muted-foreground)); }
.ftg-step-text code { font-family: inherit; color: var(--secondary-foreground); font-size: inherit; overflow-wrap: anywhere; }
.ftg-check-note { padding: 14px 24px; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--muted) 40%, var(--card)); border-radius: 0 0 var(--radius) var(--radius); }
.ftg-check-note > i { color: var(--ftg-muted, var(--muted-foreground)); font-size: 17px; margin-top: 1px; flex-shrink: 0; }
.ftg-check-note p { margin: 0; font-size: 12px; line-height: 1.7; color: var(--ftg-muted, var(--muted-foreground)); }
.ftg-guide-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.ftg-guide-header p { margin: 5px 0 0; font-size: 13px; line-height: 1.7; color: var(--ftg-muted, var(--muted-foreground)); }
.ftg-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ftg-guide-card { min-width: 0; transition: background-color 160ms ease; }
.ftg-guide-card:hover, .ftg-guide-card:focus-within { background-color: var(--muted); }
.ftg-guide-link { position: relative; display: block; height: 100%; padding: 22px 24px; border-radius: inherit; text-decoration: none; }
.ftg-guide-copy { min-width: 0; }
.ftg-guide-copy h3 { padding-right: 26px; margin: 0 0 7px; font-size: 15px; font-weight: 600; line-height: 1.5; color: var(--foreground); }
.ftg-guide-copy p { margin: 0; color: var(--ftg-muted, var(--muted-foreground)); font-size: 13px; line-height: 1.7; }
.ftg-guide-arrow { margin-top: 4px; font-size: 18px; color: var(--ftg-muted, var(--muted-foreground)); transition: color 160ms ease, transform 160ms ease; }
.ftg-guide-link:hover .ftg-guide-arrow { color: var(--primary); transform: translate(2px, -2px); }
.ftg-guide-link:focus-visible, .ftg-footer a:focus-visible, .ftg-check-header a:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
#searchForm { scroll-margin-top: 120px; }
.ftg-footer { margin-top: auto; }
.ftg-footer-main { display: grid; grid-template-columns: 1.35fr .8fr 1.1fr .9fr; gap: 36px; padding: 24px 0 28px; }
.ftg-footer-brand { min-width: 0; }
.ftg-brand-link { display: inline-flex; align-items: center; gap: 5px; color: var(--foreground); font-size: 20px; font-weight: 750; line-height: 1.3; letter-spacing: -.6px; text-decoration: none; }
.ftg-brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; border-radius: 50%; background: linear-gradient(152deg, #ff7b7b 24.79%, #a02c2c); color: white; font-size: 15px; font-weight: 900; letter-spacing: 0; }
.ftg-footer-description { max-width: 250px; margin: 12px 0 0; color: var(--ftg-muted, var(--muted-foreground)); font-size: 13px; line-height: 1.7; }
.ftg-footer-heading { margin: 0 0 13px; color: var(--foreground); font-size: 13px; line-height: 1.5; font-weight: 600; }
.ftg-footer-list { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; list-style: none; padding: 0; margin: 0; }
.ftg-footer-list a { color: var(--ftg-muted, var(--muted-foreground)); font-size: 13px; line-height: 1.6; text-decoration: none; transition: color 160ms ease; }
.ftg-footer-list a:hover { color: var(--primary); }
.ftg-footer-contact p { margin: 10px 0 0; max-width: 210px; font-size: 12px; line-height: 1.7; color: var(--ftg-muted, var(--muted-foreground)); }
.ftg-footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0 22px; color: var(--ftg-muted, var(--muted-foreground)); font-size: 12px; line-height: 1.5; }
.ftg-footer-top { display: inline-flex; align-items: center; gap: 6px; color: var(--ftg-muted, var(--muted-foreground)); text-decoration: none; }
.ftg-footer-top:hover { color: var(--primary); }
@media (max-width: 1023px) {
 .ftg-check-steps { gap: 20px; }
 .ftg-step-text { padding-left: 0; }
 .ftg-step-heading { min-height: 42px; align-items: flex-start; }
 .ftg-footer-main { grid-template-columns: 1.2fr 1fr; gap: 28px 40px; }
}
@media (max-width: 639px) {
 .ftg-seo { gap: 24px; margin-bottom: 0; }
 .ftg-seo .ftg-section-title { font-size: 17px; }
 .ftg-check-header { flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px; }
 .ftg-check-steps { grid-template-columns: minmax(0, 1fr); padding: 20px; gap: 22px; }
 .ftg-step-heading { min-height: 28px; align-items: center; margin-bottom: 6px; }
 .ftg-step-text { padding-left: 40px; }
 .ftg-check-note { padding: 14px 20px; }
 .ftg-guide-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
 .ftg-guide-link { padding: 18px; }
 .ftg-guide-arrow { font-size: 16px; }
 .ftg-footer-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px 22px; padding-top: 26px; }
 .ftg-footer-brand, .ftg-footer-contact { grid-column: 1 / -1; }
 .ftg-footer-description { max-width: 310px; }
 .ftg-footer-contact { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 0 16px; }
 .ftg-footer-contact .ftg-footer-heading { margin-bottom: 5px; }
 .ftg-footer-contact .kt-btn { grid-column: 2; grid-row: 1; align-self: center; }
 .ftg-footer-contact p { margin: 0; }
 .ftg-footer-bottom { padding: 16px 0 22px; }
}
@media (prefers-reduced-motion: reduce) {
 .ftg-guide-card, .ftg-guide-arrow, .ftg-footer-list a { transition: none; }
 .ftg-guide-link:hover .ftg-guide-arrow { transform: none; }
}

/* Shared editorial pages. */
.ftg-article-page { --ftg-muted: var(--muted-foreground); padding-bottom: 0; }
.dark .ftg-article-page { --ftg-muted: var(--color-zinc-400, #a1a1aa); }
.ftg-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; font-size: 12px; line-height: 1.6; color: var(--ftg-muted); }
.ftg-breadcrumb a:hover { color: var(--primary); }
.ftg-breadcrumb i { font-size: 10px; }
.ftg-article-hero { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 18px; padding: 32px; margin-bottom: 28px; }
.ftg-article-hero h1 { margin: 0; font-size: clamp(26px, 2.5vw, 32px); line-height: 1.25; letter-spacing: -.7px; font-weight: 650; color: var(--foreground); text-wrap: balance; }
.ftg-article-summary p { max-width: none; margin: 0 0 20px; font-size: 14px; line-height: 1.85; color: var(--ftg-muted); }
.ftg-article-layout { width: 100%; }
.ftg-article-sidebar { position: sticky; top: 105px; }
.ftg-article-toc { padding: 22px; }
.ftg-article-toc h2 { margin: 0 0 14px; font-size: 13px; line-height: 1.5; font-weight: 600; color: var(--foreground); }
.ftg-article-toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.ftg-article-toc a { display: block; padding: 8px 0; font-size: 12px; line-height: 1.65; color: var(--ftg-muted); }
.ftg-article-toc a:hover { color: var(--primary); }
.ftg-article-body { min-width: 0; padding: 8px 36px 0; }
.ftg-article-body section { padding: 28px 0; scroll-margin-top: 110px; }
.ftg-article-body section + section { padding-top: 0; }
.ftg-article-body h2 { margin: 0 0 12px; font-size: 20px; font-weight: 600; line-height: 1.45; color: var(--foreground); }
.ftg-article-body section p { margin: 0; font-size: 14px; line-height: 1.95; color: var(--secondary-foreground); }
.ftg-article-support { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin: 0 -36px; padding: 22px 36px; border-radius: 0 0 var(--radius) var(--radius); background: color-mix(in srgb, var(--muted) 40%, var(--card)); }
.ftg-article-support > i { color: var(--ftg-muted); font-size: 20px; margin-top: 3px; }
.ftg-article-support p { margin: 0; font-size: 13px; line-height: 1.9; color: var(--ftg-muted); }
.ftg-article-support a { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; margin-left: auto; color: var(--primary); font-size: 13px; line-height: 1.9; }
.ftg-article-examples, .ftg-article-related { margin-top: 36px; }
.ftg-article-section-heading { margin-bottom: 16px; }
.ftg-article-section-heading h2 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.5; color: var(--foreground); }
.ftg-article-section-heading p { margin: 6px 0 0; font-size: 13px; line-height: 1.7; color: var(--ftg-muted); }
.ftg-example-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ftg-example-link { display: grid; grid-template-columns: 48px minmax(0, 1fr) 18px; gap: 12px; padding: 20px; align-items: center; border-radius: inherit; }
.ftg-example-link strong { display: block; font-size: 13px; line-height: 1.6; font-weight: 600; color: var(--foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ftg-example-username { display: block; margin-top: 3px; font-size: 12px; line-height: 1.6; color: var(--ftg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ftg-article-page a:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
@media (max-width: 1023px) {
 .ftg-article-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
 .ftg-article-sidebar { position: static; }
 .ftg-article-toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
 .ftg-example-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 639px) {
 .ftg-breadcrumb { margin-bottom: 22px; }
 .ftg-article-hero { padding: 22px 20px; gap: 18px; margin-bottom: 22px; }
 .ftg-article-hero h1 { letter-spacing: -.4px; }
 .ftg-article-summary p { font-size: 14px; line-height: 1.85; }
 .ftg-article-toc { padding: 20px; }
 .ftg-article-toc ol { grid-template-columns: minmax(0, 1fr); gap: 0; }
 .ftg-article-toc a { padding: 7px 0; }
 .ftg-article-body { padding: 0 20px; }
 .ftg-article-body section { padding: 24px 0; }
 .ftg-article-body h2 { font-size: 18px; }
 .ftg-article-body section p { line-height: 1.85; }
 .ftg-article-support { margin: 0 -20px; padding: 20px; }
 .ftg-article-examples, .ftg-article-related { margin-top: 28px; }
}

@media (min-width: 1024px) {
 .ftg-article-related .ftg-guide-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
 .ftg-article-hero { grid-template-columns: minmax(0, 1fr); gap: 20px; }
 .ftg-article-hero h1 { max-width: none; }
}

/* Keep the introduction alongside the page contents on wide screens. */
.ftg-article-main { display: grid; min-width: 0; gap: 20px; }
.ftg-article-main .ftg-article-hero { margin-bottom: 0; }
@media (max-width: 1023px) {
 .ftg-article-main { display: grid; }
 .ftg-article-main .ftg-article-hero { order: -1; }
}

.ftg-article-toc a { border-left: 2px solid transparent; padding-left: 10px; padding-right: 8px; border-radius: 0 5px 5px 0; }
.ftg-article-toc a[aria-current="location"] { color: var(--primary); border-left-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--card)); font-weight: 600; }

.ftg-example-info { min-width: 0; }

/* Shared page ending and compact catalog navigation. */
#content { padding-bottom: 32px; }
#content > .kt-container-fixed:last-of-type { margin-bottom: 0; }
.ftg-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; }
.ftg-pagination-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ftg-pagination-links .kt-btn { min-width: 34px; height: 34px; padding: 0 9px; justify-content: center; }
.ftg-pagination-links .kt-btn-ghost { min-width: 16px; padding: 0; pointer-events: none; }
.ftg-example-avatar { position: relative; display: block; width: 48px; height: 48px; }
.ftg-example-avatar > span { display: block; padding: 3px; }
.ftg-example-avatar img, .ftg-example-avatar > span > div { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.ftg-example-avatar > div { width: 17px; height: 17px; font-size: 12px; }
@media (max-width: 639px) {
 #content { padding-bottom: 24px; }
 .ftg-footer-main { padding-top: 20px; }
 .ftg-pagination { flex-direction: column; align-items: center; gap: 14px; margin-top: 20px; }
 .ftg-pagination-links { justify-content: center; gap: 4px; }
 .ftg-pagination-links .kt-btn { min-width: 30px; height: 32px; padding: 0 6px; font-size: 12px; }
 .ftg-pagination-links .kt-btn-ghost { min-width: 12px; padding: 0; }
}

.ftg-catalog-intro { font-size: 14px; line-height: 1.9; color: var(--muted-foreground); }
.ftg-catalog-intro h1 { display: inline; margin: 0 10px 0 0; font-size: 20px; line-height: inherit; font-weight: 600; color: var(--foreground); }
.ftg-catalog-intro p { display: inline; margin: 0; }
.ftg-catalog-loading { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; font-size: 12px; color: var(--muted-foreground); }
.ftg-catalog-loading[aria-hidden="true"] { display: none; }


.ftg-example-link:hover .ftg-guide-arrow,
.ftg-example-link:focus-visible .ftg-guide-arrow { color: var(--primary); transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) {
 .ftg-example-link:hover .ftg-guide-arrow,
 .ftg-example-link:focus-visible .ftg-guide-arrow { transform: none; }
}

.ftg-guide-link > .ftg-guide-arrow { position: absolute; top: 24px; right: 24px; margin-top: 0; }
.ftg-guide-link:focus-visible .ftg-guide-arrow { color: var(--primary); transform: translate(2px, -2px); }
@media (max-width: 639px) {
 .ftg-guide-link > .ftg-guide-arrow { top: 20px; right: 18px; }
}
@media (prefers-reduced-motion: reduce) {
 .ftg-guide-link:focus-visible .ftg-guide-arrow { transform: none; }
}

/* Article with channel examples in a separate right-hand column. */
.ftg-article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.ftg-article-layout > .ftg-article-examples { margin-top: 0; min-width: 0; position: sticky; top: 105px; }
.ftg-article-layout .ftg-example-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.ftg-article-layout .ftg-example-link { padding: 18px; }
@media (max-width: 1023px) {
 .ftg-article-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
 .ftg-article-layout > .ftg-article-examples { position: static; }
}

.ftg-example-link > .ftg-guide-arrow { font-size: 14px; }
.ftg-article-body section p + p { margin-top: 14px; }
.ftg-article-sources ul { padding-left: 18px; margin: 0; font-size: 13px; line-height: 1.9; color: var(--primary); }
.ftg-library-heading { max-width: 900px; margin-bottom: 28px; }
.ftg-library-heading h1 { margin: 0 0 16px; color: var(--foreground); font-size: clamp(25px, 2.5vw, 32px); line-height: 1.35; font-weight: 650; }
.ftg-library-heading p { margin: 0; color: var(--secondary-foreground); font-size: 14px; line-height: 1.85; }
.ftg-library-heading p + p { margin-top: 10px; }
.ftg-library .ftg-guide-grid { gap: 16px; }
.ftg-library .ftg-guide-copy h2 { padding-right: 26px; margin: 0 0 7px; font-size: 15px; line-height: 1.5; font-weight: 600; color: var(--foreground); }
.ftg-library > .ftg-breadcrumb, .ftg-library > .ftg-library-heading { margin-bottom: 0; }
/* Links inside running text keep the paragraph's type size. */
p a, .ftg-step-text a, .ftg-check-note a { font-size: inherit; line-height: inherit; }

.dark .ftg-catalog-intro { color: #a1a1aa; }

.ftg-library .ftg-guide-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ftg-article-check { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; color: var(--foreground); font-size: 15px; font-weight: 500; line-height: 1.5; border-radius: inherit; }
.ftg-article-check span { white-space: nowrap; }
.ftg-article-check i { flex-shrink: 0; color: var(--ftg-muted); font-size: 18px; transition: color 160ms ease, transform 160ms ease; }
.ftg-article-check:hover i, .ftg-article-check:focus-visible i { color: var(--primary); transform: translateX(3px); }
.ftg-article-check:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
@media (max-width: 1023px) { .ftg-library .ftg-guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) {
 .ftg-library .ftg-guide-grid { grid-template-columns: minmax(0, 1fr); }
 .ftg-article-check { padding: 20px; font-size: 13px; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
 .ftg-article-check i { transition: none; }
 .ftg-article-check:hover i, .ftg-article-check:focus-visible i { transform: none; }
}

.ftg-clean-status .kt-alert-title { color: #16a34a; }
.dark .ftg-clean-status .kt-alert-title { color: #4ade80; }
.ftg-guide-copy p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

.ftg-article-check-footer { padding: 0; margin: 0 -32px -32px; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.ftg-article-check-footer .ftg-article-check { width: 100%; padding-inline: 32px; font-size: 13px; }
.ftg-article-check-footer .ftg-article-check:hover { background-color: var(--muted); }
.ftg-article-hero .ftg-article-summary p { margin-bottom: 0; }
@media (max-width: 639px) {
 .ftg-article-check-footer { margin: 0 -20px -22px; }
 .ftg-article-check-footer .ftg-article-check { padding-inline: 20px; }
}

.ftg-support-question { display: flex; align-items: center; gap: 10px; }
.ftg-support-question > i { color: var(--ftg-muted); font-size: 20px; flex-shrink: 0; }
.ftg-support-link > i { font-size: 15px; }
.ftg-library .ftg-guide-copy h2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

.ftg-home-channels-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
#homeChannelsGrid .channel-card { display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 14px; border: 0; box-shadow: none; background-color: color-mix(in srgb, var(--muted) 65%, var(--card)); transition: background-color 160ms ease; min-width: 0; }
#homeChannelsGrid .channel-card:hover,
#homeChannelsGrid .channel-card:focus-visible { background-color: var(--muted) !important; }
#homeChannelsGrid .channel-avatar { margin-bottom: 0; }
#homeChannelsGrid .channel-avatar > div { width: 54px; height: 54px; }
#homeChannelsGrid .channel-avatar img,
#homeChannelsGrid .channel-avatar > div > div > div { width: 48px; height: 48px; }
#homeChannelsGrid .channel-info { flex: 1; align-items: flex-start; text-align: left; gap: 2px; }
#homeChannelsGrid .channel-info > div { justify-content: flex-start; }
#homeChannelsGrid .channel-info > div > span { font-size: 13px; }
#homeChannelsGrid .channel-info > span { text-align: left; margin-bottom: 0; }
@media (max-width: 1023px) { .ftg-home-channels-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .ftg-home-channels-grid { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { #homeChannelsGrid .channel-card { transition: none; } }

.ftg-home-articles .ftg-guide-copy h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; }
.ftg-home-articles .ftg-guide-copy p { -webkit-line-clamp: 2; }
@media (max-width: 639px) {
 .ftg-home-articles .ftg-guide-copy h3 { -webkit-line-clamp: 2; }
 .ftg-home-articles .ftg-guide-copy p { -webkit-line-clamp: 3; }
}
