/* =========================================================
   Utility Platform
   Base Design System
   ========================================================= */

:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;

    --text: #0f172a;
    --text-muted: #64748b;

    --border: #e2e8f0;

    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;

    --shadow-sm:
        0 1px 2px rgba(15, 23, 42, 0.05);

    --shadow-md:
        0 8px 30px rgba(15, 23, 42, 0.08);

    --container: 1160px;
}


/* ---------------------------------------------------------
   Reset
   --------------------------------------------------------- */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--bg);
    color: var(--text);

    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}


/* ---------------------------------------------------------
   Layout
   --------------------------------------------------------- */

.container {
    width: min(
        calc(100% - 40px),
        var(--container)
    );

    margin: 0 auto;
}


/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;

    background: rgba(255, 255, 255, 0.92);

    backdrop-filter: blur(12px);

    border-bottom: 1px solid var(--border);
}

.header-inner {
    height: 68px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    font-weight: 750;
    font-size: 20px;
}

.brand-mark {
    width: 34px;
    height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: var(--primary);
    color: white;

    border-radius: 9px;

    font-size: 16px;
    font-weight: 800;
}

.brand-name {
    letter-spacing: -0.02em;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 28px;

    color: var(--text-muted);

    font-size: 14px;
    font-weight: 600;
}

.desktop-nav a {
    transition: color 0.2s ease;
}

.desktop-nav a:hover {
    color: var(--text);
}


/* ---------------------------------------------------------
   Mobile Navigation
   --------------------------------------------------------- */

.mobile-menu-button {
    display: none;

    width: 42px;
    height: 42px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: white;

    cursor: pointer;
}

.mobile-menu-button span {
    display: block;

    width: 18px;
    height: 2px;

    margin: 4px auto;

    background: var(--text);

    border-radius: 2px;
}

.mobile-nav {
    display: none;

    padding: 10px 20px 20px;

    border-top: 1px solid var(--border);
}

.mobile-nav a {
    display: block;

    padding: 12px 0;

    color: var(--text-muted);

    font-weight: 600;
}


/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */

.hero {
    padding: 88px 0 70px;

    text-align: center;
}

.hero-eyebrow {
    display: inline-flex;

    padding: 6px 12px;

    margin-bottom: 18px;

    border-radius: 999px;

    background: var(--primary-soft);
    color: var(--primary);

    font-size: 13px;
    font-weight: 700;
}

.hero h1 {
    max-width: 780px;

    margin: 0 auto;

    font-size: clamp(38px, 6vw, 64px);

    line-height: 1.05;

    letter-spacing: -0.045em;
}

.hero p {
    max-width: 650px;

    margin: 22px auto 30px;

    color: var(--text-muted);

    font-size: 18px;
}


/* ---------------------------------------------------------
   Search
   --------------------------------------------------------- */

.search-box {
    width: min(100%, 680px);

    margin: 0 auto;

    position: relative;
}

.search-box input {
    width: 100%;

    padding: 17px 22px 17px 50px;

    background: white;

    border: 1px solid var(--border);

    border-radius: 14px;

    outline: none;

    box-shadow: var(--shadow-md);

    font-size: 16px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.search-box input:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.1);
}

.search-icon {
    position: absolute;

    left: 18px;
    top: 50%;

    transform: translateY(-50%);

    color: var(--text-muted);

    font-size: 18px;
}


/* ---------------------------------------------------------
   Sections
   --------------------------------------------------------- */

.section {
    padding: 30px 0 80px;
}

.section-header {
    display: flex;

    align-items: end;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 25px;
}

.section-header h2 {
    margin: 0;

    font-size: 28px;

    letter-spacing: -0.03em;
}

.section-header p {
    margin: 5px 0 0;

    color: var(--text-muted);
}

.section-link {
    color: var(--primary);

    font-weight: 700;

    font-size: 14px;
}


/* ---------------------------------------------------------
   Cards
   --------------------------------------------------------- */

.tool-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;
}

.tool-card {
    padding: 25px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-sm);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.tool-card:hover {
    transform: translateY(-3px);

    border-color: #cbd5e1;

    box-shadow: var(--shadow-md);
}

.tool-icon {
    width: 46px;
    height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 18px;

    border-radius: 12px;

    background: var(--primary-soft);

    font-size: 21px;
}

.tool-card h3 {
    margin: 0 0 7px;

    font-size: 18px;

    letter-spacing: -0.015em;
}

.tool-card p {
    margin: 0;

    color: var(--text-muted);

    font-size: 14px;
}


/* ---------------------------------------------------------
   Categories
   --------------------------------------------------------- */

.category-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;
}

.category-card {
    display: flex;

    align-items: center;

    gap: 16px;

    padding: 22px;

    background: white;

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.category-card:hover {
    transform: translateY(-2px);

    box-shadow: var(--shadow-md);
}

.category-icon {
    width: 48px;
    height: 48px;

    flex: 0 0 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: var(--surface-soft);

    font-size: 21px;
}

.category-card h3 {
    margin: 0;

    font-size: 16px;
}

.category-card p {
    margin: 3px 0 0;

    color: var(--text-muted);

    font-size: 13px;
}


/* ---------------------------------------------------------
   Ad Placeholder
   --------------------------------------------------------- */

.ad-slot {
    width: 100%;

    min-height: 90px;

    display: flex;

    align-items: center;
    justify-content: center;

    margin: 20px 0;

    color: #94a3b8;

    font-size: 11px;
}


/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */

.site-footer {
    margin-top: 30px;

    background: white;

    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;

    grid-template-columns:
        2fr 1fr 1fr;

    gap: 50px;

    padding: 60px 0 45px;
}

.footer-brand p {
    max-width: 280px;

    color: var(--text-muted);

    font-size: 14px;
}

.footer-grid h3 {
    margin: 0 0 15px;

    font-size: 14px;
}

.footer-grid > div:not(.footer-brand) a {
    display: block;

    margin: 8px 0;

    color: var(--text-muted);

    font-size: 14px;
}

.footer-grid a:hover {
    color: var(--text);
}

.footer-bottom {
    display: flex;

    justify-content: space-between;

    gap: 20px;

    padding: 20px 0;

    border-top: 1px solid var(--border);

    color: var(--text-muted);

    font-size: 12px;
}


/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 800px) {

    .desktop-nav {
        display: none;
    }

    .mobile-menu-button {
        display: block;
    }

    .hero {
        padding: 65px 0 50px;
    }

    .hero p {
        font-size: 16px;
    }

    .tool-grid,
    .category-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-bottom {
        flex-direction: column;
    }
}


@media (max-width: 520px) {

    .container {
        width: min(
            calc(100% - 28px),
            var(--container)
        );
    }

    .hero h1 {
        font-size: 40px;
    }

    .tool-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding-bottom: 60px;
    }

    .section-header {
        align-items: start;
        flex-direction: column;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-brand {
        grid-column: auto;
    }
}

.search-box {
    position: relative;
}

.search-box input {
    padding-right: 110px;
}

.search-hint {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);

    font-size: 12px;
    color: #6b7280;

    pointer-events: none;
    white-space: nowrap;
}
.tool-search{
    margin-top:20px;
}
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #1f2937;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/*Pages*/

.content-card {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    line-height: 1.7;
}

.content-card h2 {
    margin-top: 32px;
    margin-bottom: 12px;
}

.content-card h2:first-child {
    margin-top: 0;
}

.content-card p {
    margin-bottom: 16px;
}
.content-card a{
    color:#0000FF;
}
.homepage-content {
    margin-top: 60px;
    padding: 60px 20px;
}

.homepage-content-inner {
    max-width: 1000px;
    margin: 0 auto;
}

.homepage-content h2 {
    margin: 0 0 18px;
    font-size: 28px;
    line-height: 1.3;
}

.homepage-content h2:not(:first-child) {
    margin-top: 50px;
}

.homepage-content p {
    margin: 0 0 18px;
    line-height: 1.7;
}

.homepage-content a {
    text-decoration: underline;
}

.homepage-benefits {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 25px;
}

.homepage-benefit {
    padding: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.homepage-benefit h3 {
    margin: 0 0 10px;
    font-size: 19px;
}

.homepage-benefit p {
    margin: 0;
}

.homepage-faq {
    margin-top: 25px;
}

.homepage-faq-item {
    padding: 22px 0;
    border-bottom: 1px solid #e5e7eb;
}

.homepage-faq-item:first-child {
    border-top: 1px solid #e5e7eb;
}

.homepage-faq-item h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.homepage-faq-item p {
    margin: 0;
}

@media (max-width: 768px) {

    .homepage-content {
        margin-top: 40px;
        padding: 40px 16px;
    }

    .homepage-content h2 {
        font-size: 24px;
    }

    .homepage-benefits {
        grid-template-columns: 1fr;
    }

}
@media (max-width: 768px) {
    .content-card {
        padding: 22px;
    }
}
/*For new tool header component*/

.tool-intro {
    margin-bottom: 40px;
}

.tool-intro-heading {
    display: flex;
    align-items: center;
    gap: 24px;
}

.tool-intro-icon {
    flex: 0 0 auto;
    margin-bottom:0 !important;
}

.tool-intro h1 {
    margin: 0;
}

.tool-intro p {
    margin: 12px 0 0;
}

.error-page {
    padding: 80px 0;
}

.error-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.error-code {
    font-size: 96px;
    line-height: 1;
    font-weight: 800;
    margin-bottom: 20px;
}

.error-content h1 {
    margin: 0 0 16px;
}

.error-content p {
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .error-page {
        padding: 60px 0;
    }

    .error-code {
        font-size: 72px;
    }

    .error-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .error-actions .tool-button {
        text-align: center;
    }
}

/* ---------------------------------------------------------
   Save / Bookmark button
   --------------------------------------------------------- */

.bookmark-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    background: #ffffff;
    color: #1f2937;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        background-color 0.18s ease;
    white-space: nowrap;
}

.bookmark-button:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 23, 42, 0.22);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.bookmark-button:active {
    transform: translateY(0) scale(0.98);
}

.bookmark-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 16px;
    transition: transform 0.25s ease;
}

.bookmark-button:hover .bookmark-icon {
    transform: rotate(-12deg) scale(1.15);
}

.bookmark-button.is-saved {
    background: #111827;
    border-color: #111827;
    color: #ffffff;
}

.bookmark-button.is-saved .bookmark-icon {
    transform: scale(1.12);
}

@media (max-width: 768px) {
    .bookmark-button {
        padding: 8px 10px;
    }

    .bookmark-text {
        display: none;
    }

    .bookmark-icon {
        width: 20px;
        height: 20px;
    }
}

/* ---------------------------------------------------------
   Bookmark toast
   --------------------------------------------------------- */

.bookmark-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;

    display: flex;
    align-items: center;
    gap: 12px;

    max-width: 360px;
    padding: 14px 17px;

    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 14px;

    background: #ffffff;
    color: #111827;

    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.16);

    opacity: 0;
    transform: translateY(15px) scale(0.97);

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

.bookmark-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.bookmark-toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    border-radius: 10px;
    background: #111827;
    color: #ffffff;

    font-size: 17px;
}

.bookmark-toast strong {
    display: block;
    margin-bottom: 3px;
    font-size: 14px;
}

.bookmark-toast small {
    display: block;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 600px) {
    .bookmark-toast {
        right: 16px;
        bottom: 16px;
        left: 16px;
        max-width: none;
    }
}
/*
|--------------------------------------------------------------------------
| Favorites & Recently Used
|--------------------------------------------------------------------------
*/

.user-tools-section {
    border-top: 1px solid #f1f1f1;
}

.user-tool-card {
    position: relative;

    display: flex;
    min-height: 150px;

    border: 1px solid #e5e7eb;
    border-radius: 14px;

    background: #fff;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.user-tool-card:hover {
    transform: translateY(-2px);

    border-color: #d1d5db;

    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.user-tool-card-link {
    display: flex;
    flex: 1;

    gap: 14px;

    padding: 20px;

    color: inherit;
    text-decoration: none;
}

.user-tool-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 44px;

    width: 44px;
    height: 44px;

    border-radius: 10px;

    background: #f5f5f5;

    font-size: 18px;
    font-weight: 600;
}

.user-tool-card-content {
    min-width: 0;
    padding-right: 28px;
}

.user-tool-card-content h3 {
    margin: 0 0 6px;

    font-size: 17px;
    line-height: 1.3;
}

.user-tool-card-content p {
    margin: 0;

    color: #6b7280;

    font-size: 14px;
    line-height: 1.5;
}

.user-tool-favorite {
    position: absolute;

    top: 12px;
    right: 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: transparent;

    color: #9ca3af;

    font-size: 21px;
    line-height: 1;

    cursor: pointer;

    transition:
        color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.user-tool-favorite:hover {
    background: #f3f4f6;
    color: #374151;

    transform: scale(1.08);
}

.user-tool-favorite.is-favorite {
    color: #eab308;
}

.user-tool-favorite.is-favorite:hover {
    color: #ca8a04;
}


@media (max-width: 600px) {

    .user-tool-card {
        min-height: 0;
    }

    .user-tool-card-link {
        padding: 16px;
    }

    .user-tool-card-icon {
        flex-basis: 40px;

        width: 40px;
        height: 40px;
    }

}

.tool-card-wrapper {
    position: relative;
    min-width: 0;
}

.tool-card-wrapper .tool-card {
    height: 100%;
    padding-right: 52px;
}

.tool-favorite-button {
    position: absolute;
    top: 14px;
    right: 14px;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    padding: 0;

    border: 1px solid #e5e7eb;
    border-radius: 50%;

    background: #ffffff;
    color: #9ca3af;

    font-size: 20px;
    line-height: 1;

    cursor: pointer;
    z-index: 2;

    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.tool-favorite-button:hover {
    color: #ca8a04;
    background: #fffbeb;
    border-color: #facc15;
    transform: scale(1.05);
}

.tool-favorite-button.is-favorite {
    color: #ca8a04;
    background: #fffbeb;
    border-color: #facc15;
}

.tool-grid > .tool-card-wrapper {
    min-width: 0;
    width: 100%;
}

/* =========================================================
   Platform features (Favorites, Search, Shortcuts, Collections)
   ========================================================= */

:root {
    --cat-text: #7c3aed;
    --cat-text-soft: #f3e8ff;
    --cat-calculators: #b45309;
    --cat-calculators-soft: #fef3c7;
    --cat-developer: #1d4ed8;
    --cat-developer-soft: #dbeafe;
    --cat-converters: #0f766e;
    --cat-converters-soft: #ccfbf1;
    --cat-date-time: #be185d;
    --cat-date-time-soft: #fce7f3;
    --cat-image: #15803d;
    --cat-image-soft: #dcfce7;
    --cat-generators: #c2410c;
    --cat-generators-soft: #ffedd5;
    --cat-pdf: #b91c1c;
    --cat-pdf-soft: #fee2e2;
    --favorite: #e11d48;
    --success: #15803d;
    --danger: #b91c1c;
}

[data-category="text"] { --cat: var(--cat-text); --cat-soft: var(--cat-text-soft); }
[data-category="calculators"] { --cat: var(--cat-calculators); --cat-soft: var(--cat-calculators-soft); }
[data-category="developer"] { --cat: var(--cat-developer); --cat-soft: var(--cat-developer-soft); }
[data-category="converters"] { --cat: var(--cat-converters); --cat-soft: var(--cat-converters-soft); }
[data-category="date-time"] { --cat: var(--cat-date-time); --cat-soft: var(--cat-date-time-soft); }
[data-category="image"] { --cat: var(--cat-image); --cat-soft: var(--cat-image-soft); }
[data-category="generators"] { --cat: var(--cat-generators); --cat-soft: var(--cat-generators-soft); }
[data-category="pdf"] { --cat: var(--cat-pdf); --cat-soft: var(--cat-pdf-soft); }


/* ---------------------------------------------------------
   Accessibility helpers
   --------------------------------------------------------- */

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 2000;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--text);
    color: #fff;
    font-weight: 600;
}

.skip-link:focus {
    top: 12px;
}

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.45);
    outline-offset: 2px;
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: #fff;
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.link-button,
.footer-link-button {
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.footer-link-button {
    display: block;
    margin: 8px 0;
    color: var(--text-muted);
    font-size: 14px;
    text-align: left;
}

.footer-link-button:hover {
    color: var(--text);
}


/* ---------------------------------------------------------
   Header: nav, favorites count, search
   --------------------------------------------------------- */

.header-inner {
    gap: 18px;
}

.desktop-nav {
    gap: 22px;
}

.nav-favorites {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.nav-favorites > span[aria-hidden="true"] {
    color: var(--favorite);
}

.favorites-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--favorite);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.header-search {
    position: relative;
    flex: 0 1 240px;
    margin-left: auto;
}

.header-search input {
    width: 100%;
    height: 38px;
    padding: 0 38px 0 34px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.header-search input:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.header-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.header-search-kbd {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.header-search-button {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-size: 20px;
    margin-left: auto;
}

@media (max-width: 1100px) {
    .header-search {
        flex-basis: 170px;
    }
}

@media (max-width: 980px) {
    .desktop-nav a[href$="/new"],
    .desktop-nav a[href$="/categories"] {
        display: none;
    }
}

@media (max-width: 800px) {
    .header-search {
        display: none;
    }

    .header-search-button {
        display: inline-flex;
    }

    .header-inner {
        gap: 10px;
    }
}


/* ---------------------------------------------------------
   Tool cards: badges, favorite toggle, playful hover
   --------------------------------------------------------- */

.tool-card {
    display: block;
    color: inherit;
}

.tool-card-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.tool-card-top .tool-icon {
    margin-bottom: 0;
    margin-right: 4px;
}

.tool-card[data-category] .tool-icon {
    background: var(--cat-soft, var(--primary-soft));
    color: var(--cat, var(--text));
    transition: transform 0.25s ease;
}

.tool-card:hover .tool-icon {
    transform: rotate(-6deg) scale(1.08);
}

.tool-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--cat-soft, var(--surface-soft));
    color: var(--cat, var(--text-muted));
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.4;
    white-space: nowrap;
}

.tool-badge-new {
    background: linear-gradient(135deg, #fde68a, #fbcfe8);
    color: #9d174d;
}

.tool-favorite-button.is-favorite,
.tool-favorite-button.is-favorite:hover {
    color: var(--favorite);
    background: #fff1f2;
    border-color: #fda4af;
}

.tool-favorite-button:hover {
    color: var(--favorite);
    background: #fff1f2;
    border-color: #fda4af;
}

.pop {
    animation: oot-pop 0.35s ease;
}

@keyframes oot-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.3); }
    100% { transform: scale(1); }
}


/* ---------------------------------------------------------
   Tool page toolbar (favorite, shortcuts, privacy)
   --------------------------------------------------------- */

.tool-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
    max-width: 1000px;
    margin: -12px auto 22px;
}

.tool-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tool-toolbar-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.tool-toolbar-button:hover {
    border-color: #cbd5e1;
    background: var(--surface-soft);
}

.tool-page-favorite .tool-page-favorite-icon {
    color: var(--favorite);
    font-size: 15px;
}

.tool-page-favorite.is-favorite {
    border-color: #fda4af;
    background: #fff1f2;
    color: #9f1239;
}

.privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    padding: 8px 13px;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    background: #f0fdf4;
    color: #14532d;
    font-size: 13px;
    line-height: 1.5;
}

.privacy-note strong {
    color: #14532d;
}


/* ---------------------------------------------------------
   Button feedback (copy / download) — text + icon, not colour alone
   --------------------------------------------------------- */

.tool-button.is-success,
.url-copy-button.is-success {
    background: #dcfce7 !important;
    border-color: #86efac !important;
    color: #14532d !important;
}

.tool-button.is-error,
.url-copy-button.is-error {
    background: #fee2e2 !important;
    border-color: #fca5a5 !important;
    color: #7f1d1d !important;
}

.tool-shortcut-hint {
    margin: 12px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.tool-shortcut-hint kbd {
    height: 20px;
    min-width: 20px;
    font-size: 11px;
}


/* ---------------------------------------------------------
   Dialogs (search & shortcuts)
   --------------------------------------------------------- */

html.has-dialog {
    overflow: hidden;
}

.oot-dialog {
    width: min(640px, calc(100% - 24px));
    max-height: min(640px, calc(100vh - 80px));
    margin: 8vh auto auto;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    color: var(--text);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.25);
    overflow: hidden;
}

.oot-dialog[open] {
    display: flex;
    flex-direction: column;
    animation: oot-dialog-in 0.18s ease;
}

.oot-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
}

@keyframes oot-dialog-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.dialog-close {
    flex: 0 0 auto;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.search-dialog-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.search-dialog-icon {
    color: var(--text-muted);
    font-size: 20px;
}

.search-dialog-field input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 17px;
}

.search-dialog-field input::-webkit-search-cancel-button {
    display: none;
}

.search-dialog-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.search-dialog-label {
    margin: 8px 8px 8px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.search-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 8px 10px;
}

.search-chip {
    padding: 6px 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.search-chip:hover {
    background: var(--primary-soft);
    border-color: #bfdbfe;
    transform: translateY(-1px);
}

.search-results {
    margin: 0;
    padding: 0;
    list-style: none;
}

.search-result-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
}

.search-result.is-active .search-result-link,
.search-result-link:hover,
.search-result-link:focus {
    background: var(--primary-soft);
    outline: none;
}

.search-result.is-active .search-result-link {
    box-shadow: inset 3px 0 0 var(--primary);
}

.search-result-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--surface-soft);
    font-size: 16px;
    font-weight: 700;
}

.search-result-text {
    flex: 1;
    min-width: 0;
}

.search-result-text strong,
.search-result-text small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-text small {
    color: var(--text-muted);
    font-size: 12px;
}

.search-dialog-empty {
    padding: 30px 16px;
    text-align: center;
    color: var(--text-muted);
}

.search-dialog-empty a {
    color: var(--primary);
    font-weight: 600;
}

.search-dialog-footer {
    display: flex;
    gap: 18px;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text-muted);
    font-size: 12px;
}

.search-dialog-footer kbd {
    height: 18px;
    min-width: 18px;
    margin-right: 3px;
    font-size: 10px;
}

.shortcuts-dialog {
    padding: 22px 24px;
}

.shortcuts-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.shortcuts-dialog-header h2 {
    margin: 0;
    font-size: 20px;
}

.shortcuts-list {
    margin: 0;
}

.shortcuts-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.shortcuts-list dt {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 13px;
}

.shortcuts-list dd {
    margin: 0;
    text-align: right;
    font-size: 14px;
}

.shortcuts-note {
    margin: 14px 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

@media (max-width: 600px) {
    .oot-dialog {
        margin-top: 12px;
        max-height: calc(100vh - 24px);
    }

    .search-dialog-footer {
        display: none;
    }
}


/* ---------------------------------------------------------
   Personal sections & empty states
   --------------------------------------------------------- */

.personal-tools .section-header h2 span {
    color: var(--favorite);
}

.personal-tools-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.personal-tools.section {
    padding-bottom: 40px;
}

.empty-state {
    padding: 44px 24px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    background: #fff;
    text-align: center;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.empty-state p {
    max-width: 460px;
    margin: 0 auto 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
    border-radius: 20px;
    background: #fff1f2;
    color: var(--favorite);
    font-size: 30px;
    animation: oot-float 3s ease-in-out infinite;
}

@keyframes oot-float {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-5px) rotate(-5deg); }
}


/* ---------------------------------------------------------
   Directory (/tools): jump nav & filter
   --------------------------------------------------------- */

.tool-page.directory-hero {
    padding-bottom: 24px;
}

.directory-controls {
    position: sticky;
    top: 68px;
    z-index: 50;
    padding: 14px 0;
    background: rgba(248, 250, 252, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.directory-controls .search-box {
    width: 100%;
    max-width: none;
}

.directory-controls .search-box input {
    padding-top: 13px;
    padding-bottom: 13px;
    box-shadow: none;
}

.jump-nav {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.jump-nav::-webkit-scrollbar {
    display: none;
}

.jump-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--cat-soft, #fff);
    color: var(--cat, var(--text));
    font-size: 13px;
    font-weight: 700;
    transition: transform 0.15s ease;
}

.jump-nav a:hover {
    transform: translateY(-1px);
}

.jump-nav a[hidden] {
    display: none;
}

.jump-nav-count {
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    font-size: 11px;
}

.tool-category {
    scroll-margin-top: 190px;
    margin-bottom: 56px;
}

.tool-category-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tool-category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--cat-soft, var(--surface-soft));
    font-size: 20px;
}

.directory-summary {
    margin: 0 0 22px;
    color: var(--text-muted);
    font-size: 14px;
}


/* ---------------------------------------------------------
   Collections & New
   --------------------------------------------------------- */

.collection-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.collection-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(160deg, #fff 55%, var(--primary-soft));
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.collection-card:hover {
    transform: translateY(-3px) rotate(-0.4deg);
    box-shadow: var(--shadow-md);
}

.collection-card-icon {
    font-size: 30px;
}

.collection-card h3 {
    margin: 0;
    font-size: 19px;
}

.collection-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.collection-card-count {
    margin-top: auto;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

.collection-intro {
    max-width: 820px;
    margin-bottom: 34px;
}

.collection-intro p {
    color: #475569;
    font-size: 16px;
    line-height: 1.75;
}

.new-tools-group {
    margin-bottom: 44px;
}

.new-tools-date {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    font-size: 15px;
    color: var(--text-muted);
}

.new-tools-date::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

@media (max-width: 800px) {
    .collection-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .directory-controls {
        top: 68px;
    }
}

@media (max-width: 520px) {
    .collection-grid {
        grid-template-columns: 1fr;
    }
}


/* ---------------------------------------------------------
   Footer (4 columns) & tip
   --------------------------------------------------------- */

.footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
}

.footer-tip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    font-size: 13px !important;
}

.footer-tip a {
    color: var(--primary);
    font-weight: 600;
}

@media (max-width: 800px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (max-width: 520px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}


/* ---------------------------------------------------------
   Respect reduced motion
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* ---------------------------------------------------------
   Tool of the Day
   --------------------------------------------------------- */

.tool-of-the-day-section {
    margin-top: -30px;
    padding-bottom: 10px;
}

.tool-of-the-day {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    max-width: 760px;
    margin: 0 auto;
    padding: 26px 24px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 0 0, var(--cat-soft, var(--primary-soft)), transparent 55%),
        #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-of-the-day:hover {
    transform: translateY(-2px) rotate(-0.3deg);
    box-shadow: var(--shadow-md);
}

.totd-label {
    position: absolute;
    top: -12px;
    left: 20px;
    padding: 3px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fde68a, #fbcfe8);
    color: #831843;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.totd-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: var(--cat-soft, var(--primary-soft));
    color: var(--cat, var(--primary));
    font-size: 24px;
    font-weight: 800;
}

.tool-of-the-day:hover .totd-icon {
    animation: oot-wiggle 0.5s ease;
}

.totd-body strong {
    display: block;
    font-size: 18px;
}

.totd-body span {
    display: block;
    color: var(--text-muted);
    font-size: 14px;
}

.totd-cta {
    color: var(--primary);
    font-weight: 800;
    white-space: nowrap;
}

@keyframes oot-wiggle {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-8deg) scale(1.05); }
    75% { transform: rotate(8deg) scale(1.05); }
}

@media (max-width: 600px) {
    .tool-of-the-day {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .totd-cta {
        grid-column: 2;
    }
}

.mobile-install {
    display: block;
    width: 100%;
    padding: 12px 0;
    border: 0;
    background: none;
    color: var(--primary);
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}
