.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
    padding: 2rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: rgba(15, 17, 21, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

#searchInput {
    padding: 0.7rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    width: 320px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    outline: none;
    transition: all 0.2s ease;
}

#searchInput:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

nav {
    display: flex;
    gap: 1rem;
    position: relative;
}

#categoryMenuBtn {
    padding: 0.6rem 1.2rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    transition: all 0.2s;
}

.nav-link {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
    font-weight: 600;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
}

#categoryMenuBtn:hover {
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Hero */
.hero {
    text-align: center;
    padding: 6rem 1.5rem 3rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    margin: 0 0 1rem 0;
    background: linear-gradient(135deg, #FFF 0%, #A1A1AA 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.2rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Ad Container */
.ad-container {
    padding: 2rem;
    text-align: center;
    background: var(--surface);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

.menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background: rgba(20, 22, 27, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 0.5rem;
    display: none;
    z-index: 101;
    overflow: hidden;
}

.menu-dropdown.show {
    display: block;
    animation: fadeIn 0.15s ease-out;
}

.menu-item {
    padding: 0.8rem 1rem;
    cursor: pointer;
    transition: background 0.1s;
    font-size: 0.95rem;
    border-radius: 6px;
    color: var(--text);
    display: block;
}

.menu-item:hover {
    background: var(--surface-hover);
    color: white;
}

/* Tool Pages */
.tool-container {
    max-width: 900px;
    margin: 3rem auto;
    padding: 0 1.5rem;
    min-height: 70vh;
}

.tool-desc {
    color: var(--text-muted);
    font-size: 1.15rem;
    margin-bottom: 2.5rem;
}

.tool-section {
    max-width: 1200px;
    margin: 0 auto 2rem;
}

.tool-section h2 {
    margin: 1rem 1.5rem 0;
}

/* Static Content Pages */
.page-shell {
    max-width: 960px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

.page-hero {
    margin-bottom: 2rem;
}

.page-hero .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.page-hero h1 {
    margin: 0.4rem 0 0.5rem;
    font-size: 2.4rem;
}

.page-meta {
    color: var(--text-muted);
    margin: 0;
}

.page-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.page-card h2 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.page-card h3 {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.page-card p,
.page-card ul {
    color: var(--text-muted);
}

.page-card ul {
    padding-left: 1.25rem;
}

.inline-link-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

/* Footer */
.site-footer {
    padding: 1.75rem 1.5rem 2rem;
    border-top: 1px solid var(--border);
    background: rgba(15, 17, 21, 0.7);
    color: var(--text-muted);
    text-align: center;
    margin-top: 4rem;
}

.footer-links {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.footer-links a:hover {
    color: #fff;
}

.footer-note {
    margin: 0;
    color: var(--text-muted);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tool Layout 3-Column */
.tool-layout-wrapper {
    display: flex;
    justify-content: center;
    gap: 2rem;
    max-width: 1440px;
    margin: 3rem auto;
    padding: 0 1.5rem;
    align-items: start;
}

.ad-sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 6rem;
    height: 600px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.tool-centered {
    flex: 1;
    max-width: 800px;
    min-width: 300px;
}

@media (max-width: 1200px) {
    .tool-layout-wrapper {
        grid-template-columns: 1fr;
    }

    .ad-sidebar {
        display: none;
        /* Hide sidebars on smaller screens or move to bottom */
    }
}

@media (max-width: 768px) {
    .site-header {
        flex-wrap: wrap;
        gap: 0.75rem;
        align-items: flex-start;
    }

    #searchInput {
        width: 100%;
        order: 3;
    }

    nav {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
        order: 2;
    }

    .site-header nav .nav-link {
        display: none;
    }

    #categoryMenuBtn {
        flex: 1;
        text-align: center;
        font-size: 1rem;
    }
}