/**
 * Tool detail page — Rankscale layout, TOC, cards, CTA, responsive.
 *
 * Enqueued only on singular ai_tool pages (step 15 handles registration).
 * Scope: .tool-detail-layout, .tool-toc, section[id], .pricing-grid,
 *        figure/figcaption, .tool-feature-card.
 */

/* ============================================================
   DESIGN TOKENS — scoped to the detail layout (no global pollution)
   ============================================================ */
.tool-detail-layout {
    --td-card-bg: #ffffff;
    --td-card-border: #e2e8f0;
    --td-card-radius: 12px;
    --td-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --td-img-radius: 8px;
    --td-img-max-width: 100%;
    --td-caption-bg: #f8fafc;
    --td-caption-padding: 8px 12px;
    --td-caption-radius: 6px;
    --td-cta-radius: 8px;
    --td-section-margin: 40px;
    --td-heading-size: 1.5rem;
}

/* --- Pros & Cons: crisp CSS-drawn marks --- */
.tool-pros-cons .pros-cons-mark {
    position: relative;
    display: inline-block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    vertical-align: middle;
    color: currentColor;
    line-height: 1;
}

.tool-pros-cons .pros-mark {
    color: #16a34a;
}

.tool-pros-cons .cons-mark {
    color: #ea580c;
}

.tool-pros-cons .pros-cons-mark::before,
.tool-pros-cons .pros-cons-mark::after {
    position: absolute;
    display: block;
    content: '';
}

.tool-pros-cons .pros-mark::before {
    top: 4px;
    left: 3px;
    width: 10px;
    height: 6px;
    border-bottom: 3px solid currentColor;
    border-left: 3px solid currentColor;
    transform: rotate(-45deg);
}

.tool-pros-cons .cons-mark::before,
.tool-pros-cons .cons-mark::after {
    top: 1px;
    left: 8px;
    width: 3px;
    height: 17px;
    border-radius: 1px;
    background: currentColor;
}

.tool-pros-cons .cons-mark::before {
    transform: rotate(45deg);
}

.tool-pros-cons .cons-mark::after {
    transform: rotate(-45deg);
}

.tool-pros-cons h3 .pros-cons-mark {
    flex-basis: 20px;
    width: 20px;
    height: 20px;
    margin-right: 2px;
}

/* ============================================================
   SCROLL MARGIN — prevent sticky header from covering section tops
   ============================================================ */
.tool-detail-main section[id] {
    scroll-margin-top: 96px;
}

/* ============================================================
   LAYOUT — full-width reading column
   ============================================================ */
.tool-detail-layout {
    width: min(100%, 1070px);
    margin: 20px auto 0;
}

/* Keep the desktop reading column comfortable while using the available
 * space for pricing, alternatives, and FAQ cards. */
.tool-detail-container {
    max-width: 1180px;
}

.tool-detail-main {
    min-width: 0;
}

/* The hero product preview should be prominent on desktop without causing
 * horizontal overflow on smaller screens. */
.tool-hero-visual {
    flex-shrink: 1;
}

.tool-hero-product-image {
    display: block;
}

/* ============================================================
   HERO — polished product introduction and first CTA
   ============================================================ */
.tool-detail-main .tool-hero-section {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    align-items: center;
    gap: 42px;
    min-height: 360px;
    margin: 20px 0 36px;
    padding: 34px;
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 55%, #f0fdf4 100%);
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.tool-detail-main .tool-hero-section::after {
    position: absolute;
    right: -110px;
    bottom: -150px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(191, 219, 254, 0.28);
    content: '';
    filter: blur(2px);
    pointer-events: none;
}

.tool-detail-main .tool-hero-section.has-no-visual {
    grid-template-columns: minmax(0, 760px);
}

.tool-hero-copy,
.tool-hero-visual {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.tool-hero-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.tool-hero-logo {
    display: flex;
    flex: 0 0 64px;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    box-sizing: border-box;
    object-fit: contain;
    padding: 10px;
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.1);
}

.tool-hero-logo-fallback {
    color: #2563eb;
    background: linear-gradient(135deg, #eff6ff, #eef2ff);
    font-size: 1.5rem;
    font-weight: 800;
}

.tool-hero-title-wrap {
    min-width: 0;
}

.tool-hero-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: #16a34a;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.tool-detail-main .tool-hero-section h1 {
    margin: 0 0 7px;
    color: #0f172a;
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.tool-hero-subtitle {
    margin: 0;
    color: #475569;
    font-size: 1.0625rem;
    line-height: 1.5;
}

.tool-hero-metrics {
    display: flex;
    align-items: stretch;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tool-hero-metric {
    display: flex;
    min-width: 132px;
    flex-direction: column;
    justify-content: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.tool-hero-score {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.tool-hero-metric-value {
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.15;
}

.tool-hero-score .tool-hero-metric-value {
    color: #15803d;
}

.tool-hero-metric-value small {
    margin-left: 2px;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
}

.tool-hero-metric-label {
    margin-top: 4px;
    color: #64748b;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.tool-hero-price .tool-hero-metric-value {
    white-space: nowrap;
}

.tool-hero-free-badge {
    align-self: center;
    padding: 7px 10px;
    color: #166534;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Backward-compatible styling for older cached Hero markup. */
.tool-hero-metrics > span[style*="ecfdf5"] {
    align-self: center;
    padding: 7px 10px !important;
    color: #166534 !important;
    background: #ecfdf5 !important;
    border: 1px solid #bbf7d0;
    border-radius: 999px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
}

.tool-hero-score-note {
    max-width: 680px;
    margin: 0 0 18px;
    color: #64748b;
    font-size: 0.75rem;
    line-height: 1.55;
}

.tool-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tool-hero-actions .btn {
    min-height: 44px;
    padding: 10px 17px;
}

.tool-hero-actions .btn-primary {
    box-shadow: 0 8px 16px rgba(22, 163, 74, 0.18);
}

.tool-hero-actions .btn-primary span {
    margin-left: 2px;
    font-size: 1.1em;
    transition: transform 0.15s ease;
}

.tool-hero-actions .btn-primary:hover span {
    transform: translateX(3px);
}

.tool-cta-supporting-text {
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.45;
}

.tool-hero-cta-note {
    margin: -8px 0 14px;
}

.tool-hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    color: #94a3b8;
    font-size: 0.6875rem;
}

.tool-hero-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tool-hero-meta-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
}

.tool-hero-source-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.tool-hero-source-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.tool-hero-visual {
    width: 100%;
    max-width: 420px;
    justify-self: end;
}

.tool-hero-image-frame {
    padding: 8px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid #dbeafe;
    border-radius: 16px;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.tool-hero-product-image {
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
    object-position: top;
    border-radius: 10px;
}

.tool-hero-image-caption {
    display: block;
    margin-top: 9px;
    color: #94a3b8;
    font-size: 0.6875rem;
    text-align: center;
}

/* ============================================================
   QUICK VERDICT — decision-focused audience summary
   ============================================================ */
.tool-detail-main .tool-quick-verdict {
    margin: 0 0 40px;
    padding: 24px 28px 20px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    border: 1px solid #dbe5f0;
    border-radius: 18px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.045);
}

.tool-verdict-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    margin-bottom: 22px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid #dbeafe;
    border-left: 4px solid #16a34a;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.045);
}

.tool-verdict-heading {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-width: 126px;
}

.tool-verdict-icon {
    display: inline-flex;
    flex: 0 0 24px;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #fff;
    background: #16a34a;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 800;
}

.tool-verdict-label {
    display: block;
    color: #166534;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.3;
    text-transform: uppercase;
}

.tool-verdict-label-note {
    display: block;
    margin-top: 3px;
    color: #94a3b8;
    font-size: 0.6875rem;
    line-height: 1.3;
}

.tool-verdict-summary p {
    margin: 0;
    color: #1e293b;
    font-size: 1.0625rem;
    line-height: 1.65;
}

.tool-verdict-audience-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.tool-verdict-audience {
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid;
    border-radius: 12px;
}

.tool-verdict-best-for {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.tool-verdict-not-for {
    background: #fff7ed;
    border-color: #fed7aa;
}

.tool-verdict-audience-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tool-verdict-best-for .tool-verdict-audience-heading {
    color: #15803d;
}

.tool-verdict-not-for .tool-verdict-audience-heading {
    color: #c2410c;
}

.tool-verdict-audience-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 800;
}

.tool-verdict-best-for .tool-verdict-audience-icon {
    color: #fff;
    background: #16a34a;
}

.tool-verdict-not-for .tool-verdict-audience-icon {
    color: #fff;
    background: #f97316;
}

.tool-verdict-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tool-verdict-tag {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 11px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25;
}

.tool-verdict-best-for .tool-verdict-tag {
    color: #166534;
    background: rgba(255, 255, 255, 0.6);
    border-color: #bbf7d0;
}

.tool-verdict-not-for .tool-verdict-tag {
    color: #9a3412;
    background: rgba(255, 255, 255, 0.62);
    border-color: #fed7aa;
}

.tool-information-basis {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.tool-information-basis-icon {
    display: inline-flex;
    flex: 0 0 19px;
    align-items: center;
    justify-content: center;
    width: 19px;
    height: 19px;
    color: #475569;
    border: 1px solid #94a3b8;
    border-radius: 50%;
    font-size: 0.6875rem;
    font-weight: 700;
}

.tool-information-basis p {
    margin: 0;
    color: #64748b;
    font-size: 0.8125rem;
    line-height: 1.6;
}

.tool-information-basis strong {
    color: #475569;
}

.tool-information-basis a {
    margin-left: 6px;
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.tool-information-basis a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* ============================================================
   SECTION HEADINGS — consistent sizing across components
   ============================================================ */
.tool-detail-main section h2 {
    font-size: var(--td-heading-size);
    font-weight: 700;
    margin: 0 0 20px;
}

.tool-detail-main section {
    margin-bottom: var(--td-section-margin);
}

/* ============================================================
   SCREENSHOT CARDS — unified figure/figcaption styling
   ============================================================ */
.tool-detail-main figure {
    margin: 0 0 16px;
}

.tool-detail-main figure img {
    width: var(--td-img-max-width);
    height: auto;
    border-radius: var(--td-img-radius);
    border: 1px solid var(--td-card-border);
}

.tool-detail-main figcaption {
    margin-top: var(--td-caption-padding);
    padding: var(--td-caption-padding);
    background: var(--td-caption-bg);
    border-radius: var(--td-caption-radius);
    font-size: 0.8125rem;
    color: #475569;
    line-height: 1.5;
}

/* ============================================================
   CARDS — test steps, features, pricing, alternatives
   ============================================================ */
.tool-detail-main .tool-features .tool-features-grid > div,
.tool-detail-main .tool-alternatives > div > div {
    padding: 20px;
    background: var(--td-card-bg);
    border: 1px solid var(--td-card-border);
    border-radius: var(--td-card-radius);
    box-shadow: var(--td-card-shadow);
}

/* ============================================================
   PRICING GRID — responsive plan cards
   ============================================================ */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.tool-pricing-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.tool-pricing-card .visit-cta {
    margin-top: auto;
}

.tool-mobile-cta {
    display: none;
}

/* ============================================================
   CTA BUTTONS — consistent sizing in detail page context
   ============================================================ */
.tool-detail-main .btn,
.tool-detail-main .tool-final-cta .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: var(--td-cta-radius);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s;
}

.tool-detail-main .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   FINAL CTA — focused conversion card
   ============================================================ */
.tool-detail-main .tool-final-cta {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin: 48px 0 56px;
    padding: 46px 32px 30px;
    background: linear-gradient(135deg, #ecfdf5 0%, #eff6ff 52%, #f5f3ff 100%);
    border: 1px solid #dbeafe;
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    text-align: center;
}

.tool-final-cta-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
}

.tool-final-cta-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 6px 12px 6px 7px;
    color: #166534;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(187, 247, 208, 0.9);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tool-final-cta-kicker img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 7px;
    background: #fff;
}

.tool-detail-main .tool-final-cta h2 {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.tool-final-cta-summary {
    max-width: 600px;
    margin: 0 auto 24px;
    color: #475569;
    font-size: 1rem;
    line-height: 1.6;
}

.tool-final-cta-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.tool-final-cta-note {
    margin: -12px 0 18px;
    color: #475569;
    text-align: center;
}

.tool-final-cta .btn-primary {
    min-height: 48px;
    padding: 12px 22px;
    background: linear-gradient(135deg, #16a34a, #0f9f55);
    border: 1px solid #15803d;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.22);
    font-size: 1rem;
}

.tool-final-cta .btn-primary span {
    font-size: 1.15em;
    transition: transform 0.15s ease;
}

.tool-final-cta .btn-primary:hover span {
    transform: translateX(3px);
}

.tool-final-cta-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 18px;
    color: #1e40af;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
}

.tool-final-cta-secondary:hover {
    color: #1d4ed8;
    background: #fff;
}

.tool-final-cta-disclosure {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 620px;
    padding: 9px 12px;
    color: #64748b;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 8px;
    font-size: 0.75rem;
    line-height: 1.5;
    text-align: left;
}

.tool-final-cta-disclosure-icon {
    display: inline-flex;
    flex: 0 0 18px;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: #475569;
    border: 1px solid #94a3b8;
    border-radius: 50%;
    font-size: 0.6875rem;
    font-weight: 700;
}

.tool-final-cta-orb {
    position: absolute;
    z-index: 0;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    filter: blur(4px);
    opacity: 0.38;
    pointer-events: none;
}

.tool-final-cta-orb-one {
    top: -120px;
    right: -50px;
    background: #bfdbfe;
}

.tool-final-cta-orb-two {
    bottom: -150px;
    left: -70px;
    background: #bbf7d0;
}

@media (max-width: 800px) {
    .tool-detail-main .tool-final-cta {
        margin: 36px 0 44px;
        padding: 34px 18px 22px;
        border-radius: 18px;
    }

    .tool-final-cta-actions {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 20px;
    }

    .tool-final-cta .btn-primary,
    .tool-final-cta-secondary {
        width: 100%;
        box-sizing: border-box;
    }

    .tool-final-cta-disclosure {
        align-items: flex-start;
    }
}

/* ============================================================
   STICKY TOC — horizontal navigation below the hero
   ============================================================ */
.tool-toc {
    position: sticky;
    top: 72px;
    z-index: 20;
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0 0 40px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--td-card-border);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(10px);
}

.tool-toc-content {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    gap: 16px;
}

.tool-toc-title {
    flex: 0 0 auto;
    margin: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    font-weight: 600;
}

.tool-toc-list {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.4;
    overflow-x: auto;
    scrollbar-width: none;
}

.tool-toc-list::-webkit-scrollbar {
    display: none;
}

.tool-toc-link {
    flex: 0 0 auto;
    color: #475569;
    text-decoration: none;
    display: block;
    padding: 8px 10px;
    border-bottom: 2px solid transparent;
    border-radius: 6px;
    transition: color 0.15s, border-color 0.15s;
}

.tool-toc-link:hover {
    color: #0f1729;
    background: #f8fafc;
}

/* Active state — set by IntersectionObserver in tool-detail.js */
.tool-toc-link.active {
    color: #16a34a;
    font-weight: 600;
    border-bottom-color: #16a34a;
}

/* ============================================================
   RESPONSIVE — tablet (768px) and mobile (375px)
   ============================================================ */

/* Tablet: retain the horizontal TOC and reduce its footprint */
@media (max-width: 800px) {
    .tool-detail-layout {
        display: block;
    }

    .tool-detail-container {
        padding-bottom: calc(76px + env(safe-area-inset-bottom));
    }

    .tool-detail-main .tool-hero-section {
        grid-template-columns: 1fr;
        gap: 26px;
        min-height: 0;
        margin-top: 12px;
        padding: 24px 20px;
        border-radius: 18px;
    }

    .tool-detail-main .tool-quick-verdict {
        padding: 18px 16px 16px;
        border-radius: 14px;
    }

    .tool-verdict-summary {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 16px;
    }

    .tool-verdict-heading {
        min-width: 0;
    }

    .tool-verdict-audience-grid {
        grid-template-columns: 1fr;
    }

    .tool-hero-visual {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .tool-toc {
        top: 56px;
        margin-bottom: 28px;
        padding: 6px 8px;
        border-radius: 8px;
    }

    .tool-toc-content {
        gap: 8px;
    }

    .tool-toc-title {
        display: none;
    }

    .tool-mobile-cta {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 50;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.97);
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.12);
        backdrop-filter: blur(10px);
    }

    .tool-mobile-cta .btn {
        flex: 1 1 auto;
        width: auto;
        min-height: 42px;
        padding: 10px 14px;
        text-align: center;
    }

    .tool-mobile-cta-secondary {
        flex: 0 0 auto;
        color: #2563eb;
        font-size: 0.8125rem;
        font-weight: 600;
        text-decoration: none;
        white-space: nowrap;
    }

    /* Pricing: single column on tablet */
    .pricing-grid {
        grid-template-columns: 1fr;
    }

    /* Pros/Cons: stack vertically */
    .tool-pros-cons > div {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile: prevent horizontal overflow, readable font sizes */
@media (max-width: 375px) {
    .tool-detail-layout {
        margin-top: 12px;
    }

    .tool-toc {
        margin-bottom: 24px;
    }

    .tool-detail-main section {
        margin-bottom: 28px;
    }

    .tool-detail-main section h2 {
        font-size: 1.25rem;
    }

    .tool-detail-main figure img {
        border-radius: 6px;
    }

    /* Ensure cards don't overflow on very narrow screens */
    .pricing-grid > div,
    .tool-detail-main .tool-features .tool-features-grid > div,
    .tool-detail-main .tool-alternatives > div > div {
        padding: 14px;
    }

    /* CTA buttons full width on mobile */
    .tool-detail-main .btn {
        width: 100%;
    }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .tool-toc-link,
    .tool-detail-main .btn {
        transition: none;
    }

    .tool-detail-main .btn:hover {
        transform: none;
    }
}
/* ============================================================
   KEY FEATURES - balanced capability cards
   ============================================================ */
.tool-detail-main .tool-features {
    margin-bottom: 40px;
}

.tool-detail-main .tool-features .tool-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.tool-detail-main .tool-features .tool-section-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: #16a34a;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
}

.tool-detail-main .tool-features .tool-section-heading h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.5rem;
    font-weight: 750;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.tool-detail-main .tool-features .tool-section-count {
    flex-shrink: 0;
    padding: 6px 10px;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
}

.tool-detail-main .tool-features .tool-features-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.tool-detail-main .tool-features .tool-feature-card {
    position: relative;
    display: flex;
    min-height: 96px;
    flex-direction: column;
    overflow: hidden;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.045);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.tool-detail-main .tool-features .tool-feature-card::after {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: linear-gradient(180deg, #2563eb, #22c55e);
    content: '';
    opacity: 0;
    transition: opacity 160ms ease;
}

.tool-detail-main .tool-features .tool-feature-card:hover {
    border-color: #bfdbfe;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.tool-detail-main .tool-features .tool-feature-card:hover::after {
    opacity: 1;
}

.tool-detail-main .tool-features .tool-feature-card:not(.tool-feature-card--detailed) {
    display: flex;
    min-height: 72px;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    overflow: hidden;
    background: #f1f7fc;
    border: 1px solid #e4eff7;
    border-radius: 12px;
    box-shadow: none;
    transform: none;
}

.tool-detail-main .tool-features .tool-feature-card:not(.tool-feature-card--detailed)::before {
    display: inline-flex;
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: #159a60;
    border-radius: 50%;
    content: '';
}

.tool-detail-main .tool-features .tool-feature-card:not(.tool-feature-card--detailed)::after {
    position: absolute;
    top: 50%;
    left: 32px;
    right: auto;
    bottom: auto;
    display: block;
    width: 7px;
    height: 13px;
    background: transparent;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    content: '';
    opacity: 1;
    transition: none;
    transform: translate(-50%, -62%) rotate(45deg);
}

.tool-detail-main .tool-features .tool-feature-card:not(.tool-feature-card--detailed):hover {
    padding-left: 18px;
    background: #edf6fc;
    border-color: #cfe3f0;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(30, 79, 112, 0.07);
    transform: none;
}

.tool-detail-main .tool-features .tool-feature-title {
    margin: 0;
    color: #0f172a;
    font-size: 0.9375rem;
    font-weight: 650;
    line-height: 1.35;
}

.tool-detail-main .tool-features .tool-feature-card--detailed {
    min-height: 180px;
}

.tool-detail-main .tool-features .tool-feature-card--detailed .tool-feature-image {
    width: 100%;
    height: auto;
    max-height: 160px;
    margin: 0 0 14px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
}

.tool-detail-main .tool-features .tool-feature-card--detailed .tool-feature-title {
    margin: 0 0 6px;
}

.tool-detail-main .tool-features .tool-feature-use-case {
    margin: 0 0 8px;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.4;
}

.tool-detail-main .tool-features .tool-feature-description {
    margin: 0 0 10px;
    color: #475569;
    font-size: 0.875rem;
    line-height: 1.55;
}

.tool-detail-main .tool-features .tool-feature-verdict {
    margin: auto 0 0;
    padding: 7px 9px;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 7px;
    font-size: 0.75rem;
    line-height: 1.45;
}

@media (max-width: 900px) {
    .tool-detail-main .tool-features .tool-features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .tool-detail-main .tool-features {
        margin-bottom: 28px;
    }

    .tool-detail-main .tool-features .tool-section-heading {
        align-items: flex-start;
    }

    .tool-detail-main .tool-features .tool-section-count {
        margin-top: 2px;
    }

    .tool-detail-main .tool-features .tool-features-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .tool-detail-main .tool-features .tool-feature-card {
        min-height: 88px;
        padding: 14px 16px;
    }

    .tool-detail-main .tool-features .tool-feature-card:not(.tool-feature-card--detailed) {
        min-height: 68px;
        padding: 14px 16px;
    }

    .tool-detail-main .tool-features .tool-feature-card:not(.tool-feature-card--detailed):hover {
        padding-left: 16px;
    }

    .tool-detail-main .tool-features .tool-feature-card:not(.tool-feature-card--detailed)::after {
        left: 30px;
    }

    .tool-detail-main .tool-features .tool-feature-card--detailed {
        min-height: 168px;
    }
}
