/* ==========================================================================
   Scoped styles for the explanatory article section appended to each tool page.
   Everything is namespaced under .tool-article so it cannot collide with the
   page-specific inline CSS that each tool page already carries.
   ========================================================================== */

.tool-article {
    max-width: 72ch;
    margin: 3.5rem auto 1rem;
    padding: 0 4px;
    line-height: 1.7;
    color: #333;
}

.tool-article h2 {
    font-size: 1.6rem;
    color: #2c5530;
    line-height: 1.3;
    margin: 2.75rem 0 1rem;
}

.tool-article h3 {
    font-size: 1.2rem;
    color: #1e3d21;
    margin: 2rem 0 0.6rem;
}

.tool-article h4 {
    font-size: 1.02rem;
    color: #1e3d21;
    margin: 1.4rem 0 0.4rem;
}

.tool-article > h2:first-child {
    margin-top: 0;
}

.tool-article p,
.tool-article ul,
.tool-article ol {
    margin: 0 0 1.2rem;
    font-size: 1rem;
}

.tool-article ul,
.tool-article ol {
    padding-left: 1.5rem;
}

.tool-article li {
    margin-bottom: 0.5rem;
}

.tool-article a {
    color: #2c5530;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tool-article a:hover,
.tool-article a:focus {
    color: #1e3d21;
}

.tool-article strong {
    color: #1e3d21;
}

.tool-article code {
    background: #f0f4f0;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.92em;
}

.tool-article hr {
    border: 0;
    border-top: 1px solid #e2eae2;
    margin: 2.5rem 0;
}

/* Callout */
.tool-article .ta-note {
    background: #f6faf6;
    border: 1px solid #d6e6d6;
    border-radius: 10px;
    padding: 1.15rem 1.4rem;
    margin: 1.75rem 0;
}

.tool-article .ta-note > *:first-child {
    margin-top: 0;
}

.tool-article .ta-note > *:last-child {
    margin-bottom: 0;
}

.tool-article .ta-note.warn {
    background: #fffaf0;
    border-color: #f0e0bc;
}

/* Tables */
.tool-article .ta-table {
    overflow-x: auto;
    margin: 0 0 1.5rem;
    -webkit-overflow-scrolling: touch;
}

.tool-article table {
    border-collapse: collapse;
    width: 100%;
    min-width: 420px;
    font-size: 0.94rem;
}

.tool-article th,
.tool-article td {
    text-align: left;
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid #e4ebe4;
    vertical-align: top;
}

.tool-article thead th {
    background: #f2f7f2;
    color: #1e3d21;
    font-weight: 600;
    border-bottom: 2px solid #d6e6d6;
}

/* FAQ list — plain markup, no JS required */
.tool-article .ta-faq {
    margin: 1.5rem 0;
}

.tool-article .ta-faq > div {
    border-top: 1px solid #e6ece6;
    padding: 1.1rem 0;
}

.tool-article .ta-faq > div:last-child {
    border-bottom: 1px solid #e6ece6;
}

.tool-article .ta-faq h3 {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
}

.tool-article .ta-faq p:last-child {
    margin-bottom: 0;
}

/* Related links */
.tool-article .ta-related {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
    margin: 1.75rem 0;
    padding: 0;
    list-style: none;
}

.tool-article .ta-related li {
    border: 1px solid #e2eae2;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    margin: 0;
}

.tool-article .ta-related a {
    font-weight: 600;
    text-decoration: none;
}

.tool-article .ta-related a:hover,
.tool-article .ta-related a:focus {
    text-decoration: underline;
}

.tool-article .ta-related span {
    display: block;
    font-size: 0.88rem;
    color: #5b665e;
    margin-top: 0.3rem;
}

.tool-article .ta-meta {
    font-size: 0.85rem;
    color: #6b7a6b;
    border-top: 1px solid #e6ece6;
    padding-top: 1rem;
    margin-top: 2.5rem;
}

@media (max-width: 768px) {
    .tool-article {
        margin-top: 2.5rem;
    }

    .tool-article h2 {
        font-size: 1.35rem;
    }
}
