:root {
    --bg: #f6f8fb;
    --card: #ffffff;
    --surface: #ffffff;
    --accent: #06b6d4;
    --accent-2: #0369a1;
    --text: #0f1724;
    --muted: #64748b;
    --radius: 12px;
    --shadow-lg: 0 18px 50px rgba(3, 22, 44, 0.12);
    --shadow-md: 0 8px 30px rgba(2, 6, 23, 0.08);
    --header-height: 72px;
    --footer-height: 72px;
    --surface-overlay: rgba(2, 6, 23, 0.04);
    --surface-text: #0f1724;
    --card-border: rgba(2, 6, 23, 0.04);
    --card-shadow: 0 12px 40px rgba(2, 6, 23, 0.06);
    --link-hover: rgba(2, 6, 23, 0.04);
    --active-bg: linear-gradient(90deg, rgba(2, 6, 23, 0.06), rgba(2, 6, 23, 0.03));
    --active-inset: inset 0 -2px 0 rgba(2, 6, 23, 0.03);
    --header-shadow: none;
    --footer-shadow: none;
    --surface-border: rgba(2, 6, 23, 0.12);
    --footer-link-bg: rgba(2, 6, 23, 0.02);
    --footer-link-hover: rgba(2, 6, 23, 0.06);
}

@media (prefers-color-scheme:dark) {
    :root {
        --bg: #07262b;
        --card: #183b42;
        --surface: #133238;
        --accent: #09d2cf;
        --accent-2: #18b9c3;
        --text: #ffffff;
        --muted: #d7eef3;
        --surface-overlay: rgba(255, 255, 255, 0.05);
        --surface-text: #ffffff;
        --card-border: rgba(255, 255, 255, 0.18);
        --surface-border: rgba(255, 255, 255, 0.14);
        --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.44);
        --input-bg: rgba(255, 255, 255, 0.06);
        --link-hover: rgba(255, 255, 255, 0.06);
        --active-bg: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
        --active-inset: inset 0 -2px 0 rgba(255, 255, 255, 0.04);
        --header-shadow: none;
        --footer-shadow: none;
    }

    .tool-ui {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
        border: 1px solid rgba(255, 255, 255, 0.14);
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.40);
    }

    .tool-card {
        border: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.40);
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
    }

    .preview {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
        border: 1px solid rgba(255, 255, 255, 0.12);
    }

    .dropzone {
        border: 1px dashed rgba(255, 255, 255, 0.14);
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
    }

    .tool-input,
    textarea,
    input[type=text],
    input[type=url],
    select {
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.14);
        color: var(--text);
    }

    .tool-btn.ghost {
        background: rgba(255, 255, 255, 0.025);
        color: var(--text);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .tool-badge {
        background: rgba(255, 255, 255, 0.04);
        color: var(--muted);
    }

    #toolSearch {
        padding: .6rem .75rem;
        border-radius: 10px;
        box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.22);
        border: 1px solid rgba(255, 255, 255, 0.12);
        background: rgba(255, 255, 255, 0.04);
        color: var(--text);
    }

    #toolSearch::placeholder,
    .tool-input::placeholder {
        color: rgba(255, 255, 255, 0.72);
        opacity: 1;
    }

    .tool-btn {
        color: var(--text);
        border: 1px solid rgba(255, 255, 255, 0.06);
        padding: .45rem .7rem;
        background: rgba(255, 255, 255, 0.015);
    }

    body,
    body * {
        color: var(--text) !important;
    }

    .muted,
    .muted-small,
    .dashboard-subtitle,
    .footer-desc,
    .last-updated,
    .legal-section p,
    .legal-section ul {
        color: var(--muted) !important;
    }

    .tool-input,
    textarea,
    input[type=text],
    input[type=url],
    select {
        color: var(--text) !important;
    }

    ::-webkit-input-placeholder {
        color: rgba(255, 255, 255, 0.72) !important;
    }

    :-ms-input-placeholder {
        color: rgba(255, 255, 255, 0.72) !important;
    }

    ::placeholder {
        color: rgba(255, 255, 255, 0.72) !important;
    }

    svg,
    svg * {
        fill: var(--text) !important;
        stroke: var(--text) !important;
    }

    .tool-input:focus,
    #toolSearch:focus {
        outline: none;
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.36), 0 0 0 3px rgba(9, 210, 207, 0.06);
        border-color: rgba(255, 255, 255, 0.18);
    }
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale
}

body {
    padding-top: var(--header-height);
    padding-bottom: var(--footer-height);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem
}

.site-header {
    background: var(--surface);
    color: var(--surface-text);
    box-shadow: none;
    border-bottom: 3px solid var(--surface-border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 60;
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    text-decoration: none;
    color: inherit
}

.brand .logo {
    width: 48px;
    height: 48px
}

.brand .site-title {
    font-weight: 700;
    font-size: 1.15rem
}

.nav-menu {
    margin-left: auto;
    display: flex;
    gap: 0.6rem;
    align-items: center
}

.mobile-toggle {
    display: none;
}

.nav-menu a {
    color: var(--surface-text);
    text-decoration: none;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.98rem;
}

.nav-menu a:hover {
    background: var(--link-hover);
}

.nav-menu a.active {
    background: var(--active-bg);
    box-shadow: var(--active-inset);
}

.dashboard-main {
    padding: 2.5rem 1.25rem;
    text-align: center;
}

.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 2rem 0;
}

.hero-cta .btn-primary {
    display: inline-block;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0 3rem 0;
}


.dashboard-subtitle {
    color: var(--muted);
    margin: 0 0 1rem 0
}

.dashboard-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    justify-content: center;
    margin-top: 1.25rem;
}


.tool-card {
    background: var(--card);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--card-border);
    color: var(--text);
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    min-height: 180px;
    justify-content: space-between;
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.04);
    border-left: 6px solid var(--accent);
}

.tool-card .tool-card-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    position: relative;
}

.tool-icon {
    width: 140px;
    height: 140px;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    margin: 0 auto;
}

.tool-badge {
    background: rgba(0, 0, 0, 0.04);
    color: var(--muted);
    padding: .25rem .5rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: .85rem;
    border: none;
    position: absolute;
    left: 12px;
    top: 12px;
}

.tool-card.disabled {
    opacity: 0.6;
    pointer-events: none;
    filter: grayscale(20%);
}

.tool-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.06);
}

.tool-card h3 {
    margin: .25rem 0;
    font-size: 1.12rem
}

.tool-card p {
    color: var(--muted);
    margin: 0;
    font-size: .95rem
}

.site-footer {
    background: var(--surface);
    color: var(--surface-text);
    border-top: 3px solid var(--surface-border);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--footer-height);
    box-shadow: none;
    z-index: 50;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    height: 100%;
}

.footer-left {
    display: flex;
    gap: .9rem;
    align-items: center
}

.footer-logo {
    width: 28px;
    height: 28px
}

.footer-links {
    margin-left: auto;
    display: flex;
    gap: .6rem
}

.footer-links a {
    color: var(--surface-text);
    text-decoration: none;
    padding: .45rem .7rem;
    border-radius: 8px;
    background: var(--footer-link-bg);
}

.footer-links a:hover {
    background: var(--footer-link-hover);
}

.footer-content {
    display: flex;
    flex-direction: column
}

.footer-title {
    font-weight: 600
}

.legal-document {
    background: var(--card);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
}

.tool-ui {
    background: var(--card);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
}

.tool-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 1rem;
    align-items: start;
}

.tool-panel {
    background: transparent;
}

.tool-input,
textarea,
input[type=text],
input[type=url],
select {
    width: 100%;
    padding: .6rem .75rem;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: var(--card);
    color: var(--text);
    font-size: .95rem;
}

textarea {
    min-height: 240px;
    resize: vertical;
}

.tool-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.tool-btn {
    background: var(--surface-overlay);
    border-radius: 10px;
    border: none;
    font-weight: 800;
    cursor: pointer;
}

.tool-btn.primary {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 8px 24px rgba(3, 105, 161, 0.08);
}

.tool-btn.ghost {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text);
}

.preview {
    padding: .75rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--card);
    min-height: 140px;
    overflow: auto
}

.muted-small {
    color: var(--muted);
    font-size: .9rem
}

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

.document-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text)
}

.last-updated {
    color: var(--muted);
    font-size: 0.92rem;
    margin-top: .25rem
}

.document-content {
    margin-top: 1rem;
    color: var(--text)
}

.legal-section {
    margin-bottom: 1rem
}

.legal-section h2 {
    font-size: 1.05rem;
    margin-bottom: .35rem
}

.legal-section p,
.legal-section ul {
    color: var(--muted);
    line-height: 1.5
}

.contact-info a {
    color: var(--accent);
    text-decoration: underline
}

@media (max-width:720px) {
    :root {
        --header-height: 60px;
        --footer-height: 64px;
    }

    .nav-container {
        padding: 0 .75rem;
    }

    .nav-menu {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: var(--header-height);
        background: var(--surface);
        border-bottom: 1px solid var(--surface-border);
        padding: .75rem 1rem;
        box-shadow: 0 10px 30px rgba(2, 6, 23, 0.06);
        z-index: 70;
        flex-direction: column;
        gap: .5rem;
    }

    body.nav-open .nav-menu {
        display: flex;
    }

    .mobile-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        appearance: none;
        -webkit-appearance: none;
        border: none;
        background: transparent;
        color: var(--surface-text);
        padding: .4rem .5rem;
        border-radius: 8px;
        cursor: pointer;
        font-size: 1.25rem;
        margin-left: auto;
    }

    .mobile-toggle:focus {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }

    .container {
        padding: .75rem;
    }

    .tool-card {
        width: 100%;
        min-height: 140px;
        padding: .75rem;
    }

    .tool-icon {
        width: 96px;
        height: 96px;
    }

    .tool-grid {
        grid-template-columns: 1fr;
        gap: .75rem;
    }

    .footer-container {
        padding: 0 .75rem;
        flex-direction: column;
        align-items: flex-start;
        gap: .5rem;
    }

    .footer-links {
        margin-left: 0;
        width: 100%;
        display: flex;
        gap: .5rem;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .footer-content {
        align-items: flex-start;
    }

    /* Ensure content can scroll above fixed footer on small screens */
    main,
    .dashboard-main,
    .container {
        padding-bottom: calc(var(--footer-height) + 1rem);
    }
}

@media (max-width:420px) {
    :root {
        --header-height: 56px;
        --footer-height: 64px;
    }

    .dashboard-title {
        text-align: center;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .dashboard-subtitle {
        text-align: center;
    }

    .tool-card {
        min-height: 120px
    }

    .tool-icon {
        width: 80px;
        height: 80px
    }
}

.muted {
    color: var(--muted)
}

.tool-card.disabled {
    opacity: 0.5;
    pointer-events: none
}

::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* ensure the main content area is never shorter than the viewport minus header/footer
   so the footer does not overlap content and users can scroll to read everything */
main,
.dashboard-main,
.container {
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    /* ensure the final content can be scrolled above the fixed footer */
    padding-bottom: calc(var(--footer-height) + 1rem);
}

/* Bookmark banner: default hidden on small screens, visible on desktop */
.bookmark-banner {
    background: #ffe066;
    color: #333;
    padding: 0.5em 1em;
    text-align: center;
    font-weight: 500;
    font-size: 1.05em;
    display: none;
    /* hide by default (mobile-first) */
}

.bookmark-banner span {
    font-weight: 700;
}

@media (min-width: 721px) {

    /* show banner on desktop widths */
    .bookmark-banner {
        display: block;
    }
}