:root {
    --partner-bar-height: 38px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 175px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f7fb;
    color: #222;
    line-height: 1.6;
}

/* Shared include wrappers must not create extra layout boxes */
[data-include] {
    display: contents;
}

/* TOP PARTNER BAR */
.top-partner-bar {
    position: sticky;
    top: 0;
    z-index: 10000;
    min-height: 0;
    padding: 8px 10px;
    background: #111;
    color: #fff;
    text-align: center;
    font-size: 14px;
    line-height: 1.4;
}

.top-partner-bar span {
    opacity: 0.8;
    margin-right: 6px;
}

.top-partner-bar a {
    margin: 0 8px;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

.top-partner-bar a:hover {
    text-decoration: underline;
}

/* HEADER */
header {
    padding: 60px 20px;
    background: linear-gradient(135deg, #111827, #2563eb);
    color: #fff;
    text-align: center;
}

header h1 {
    margin: 0 0 10px;
    font-size: 44px;
}

header p {
    max-width: 720px;
    margin: 0 auto;
    font-size: 20px;
}

/* NAV */
nav {
    position: sticky;
    top: var(--partner-bar-height);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin: 0;
    padding: 14px 20px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
}

nav a {
    margin: 0;
    color: #2563eb;
    text-decoration: none;
    font-weight: bold;
}

nav a:hover {
    text-decoration: underline;
}

/* NAV LINKS + SEARCH */
.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.nav-search {
    position: relative;
    flex: 0 1 190px;
    width: 190px;
}

.nav-search input {
    display: block;
    width: 100%;
    min-height: 38px;
    height: 38px;
    margin: 0;
    padding: 7px 13px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    color: #222;
    font-size: 14px;
    line-height: 1.2;
}

.nav-search input:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.tool-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 10001;
    display: none;
    width: 280px;
    max-height: 320px;
    overflow-y: auto;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
    text-align: left;
}

.tool-search-results.open {
    display: block;
}

.tool-search-results a {
    display: block;
    margin: 0;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    color: #111827;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
}

.tool-search-results a:last-child {
    border-bottom: 0;
}

.tool-search-results a:hover {
    background: #eef4ff;
    color: #2563eb;
}

.tool-search-empty {
    padding: 10px 12px;
    color: #555;
    font-size: 14px;
}

/* MAIN */
main {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}

.intro {
    margin-bottom: 45px;
    text-align: center;
}

.intro h2 {
    margin-bottom: 10px;
    font-size: 32px;
}

.intro p {
    max-width: 760px;
    margin: 0 auto;
    color: #555;
}

.section-title {
    margin-top: 50px;
    margin-bottom: 20px;
    font-size: 28px;
    scroll-margin-top: 175px;
}

/* PAGE SEARCH */
.search-box {
    margin: 20px;
    text-align: center;
}

.search-box input {
    width: 90%;
    max-width: 500px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
}

/* TOOL GRID */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    min-height: 260px;
    padding: 24px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}

.tool-card h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.tool-card p {
    flex-grow: 1;
    margin-bottom: 20px;
    color: #555;
}

.tool-card a,
.btn {
    display: inline-block;
    align-self: flex-start;
    margin-top: auto;
    padding: 10px 18px;
    border: 0;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
}

.tool-card a:hover,
.btn:hover {
    background: #1d4ed8;
}

/* TOOL PAGES */
.tool-container {
    margin-top: 30px;
    padding: 30px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.result-box {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    background: #eef4ff;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
}

.result-box pre {
    max-width: 100%;
    padding: 10px;
    overflow-x: auto;
    overflow-wrap: anywhere;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    white-space: pre-wrap;
    word-break: break-word;
}

input,
select,
textarea {
    width: 100%;
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* NOTE BOX */
.note-box {
    margin-top: 50px;
    padding: 26px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.note-box h2 {
    margin-top: 0;
}

.note-box a {
    color: #2563eb;
    font-weight: bold;
}

/* FOOTER */
footer {
    margin-top: 60px;
    padding: 30px 20px;
    background: #111827;
    color: #fff;
    text-align: center;
}

footer a {
    margin: 0 8px;
    color: #93c5fd;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* SHARE BUTTON */
.share-button {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9000;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    font-weight: bold;
    cursor: pointer;
}

.share-button:hover {
    background: #1d4ed8;
}

/* SHARE MENU */
.share-menu {
    position: fixed;
    right: 20px;
    bottom: 75px;
    z-index: 9000;
    display: none;
    flex-direction: column;
    gap: 8px;
    min-width: 120px;
    padding: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, #111827, #2563eb);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.share-menu.open {
    display: flex;
}

.share-menu a {
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

.share-menu a:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* TABLET + MOBILE */
@media (max-width: 850px) {
    nav {
        gap: 10px;
        padding: 10px 12px;
    }

    .nav-links {
        width: 100%;
        gap: 8px 14px;
    }

    .nav-search {
        flex: 0 1 300px;
        width: 100%;
        max-width: 300px;
    }

    .tool-search-results {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .top-partner-bar {
        padding: 8px 6px;
        font-size: 14px;
        line-height: 1.4;
    }

    .top-partner-bar a {
        margin: 0 5px;
    }

    nav a {
        font-size: 13px;
    }

    header {
        padding: 45px 20px;
    }

    header h1 {
        font-size: 34px;
    }

    header p {
        font-size: 18px;
    }

    main {
        margin-top: 32px;
        padding: 0 14px;
    }

    .intro h2,
    .section-title {
        font-size: 26px;
    }

    .tool-card {
        min-height: 240px;
    }

    .tool-container {
        padding: 22px 14px;
    }

    .note-box {
        padding: 22px 16px;
    }

    .share-button {
        right: 16px;
        bottom: 18px;
        padding: 11px 16px;
    }

    .share-menu {
        right: 16px;
        bottom: 72px;
    }
}