:root {
    --bg: #f3f5f7;
    --surface: #ffffff;
    --surface-2: #eef2f5;
    --text: #13233b;
    --muted: #5d6a7a;
    --brand: #0f5e66;
    --brand-2: #f2aa4c;
    --danger: #a3363a;
    --ok: #1f7a45;
    --ring: rgba(15, 94, 102, 0.2);
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px rgba(8, 25, 45, 0.08);
}

[data-theme="dark"] {
    --bg: #111820;
    --surface: #182431;
    --surface-2: #223245;
    --text: #e6edf5;
    --muted: #a7b5c6;
    --brand: #58c8d3;
    --brand-2: #ffbd62;
    --danger: #ff8a94;
    --ok: #7dda9c;
    --ring: rgba(88, 200, 211, 0.26);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

body {
    background: radial-gradient(circle at 3% 0%, rgba(15, 94, 102, 0.08), transparent 32%),
    radial-gradient(circle at 95% 5%, rgba(242, 170, 76, 0.14), transparent 28%),
    var(--bg);
    color: var(--text);
    font-family: "Manrope", "Segoe UI", sans-serif;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    letter-spacing: -0.02em;
}

a {
    color: var(--brand);
}

.site-header {
    backdrop-filter: blur(8px);
    background: color-mix(in srgb, var(--surface) 92%, transparent) !important;
}

.navbar .nav-link {
    color: var(--text);
    font-weight: 600;
}

.navbar .nav-link:hover {
    color: var(--brand);
}

.hero-gradient {
    background: linear-gradient(115deg, #dff2f3 0%, #f8f3e8 45%, #e5edf8 100%);
}

[data-theme="dark"] .hero-gradient {
    background: linear-gradient(115deg, #163640 0%, #3f3224 45%, #203145 100%);
}

.hero-card {
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    border: 1px solid color-mix(in srgb, var(--muted) 22%, transparent);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.section-title {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.tool-chip {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    text-decoration: none;
    border: 1px solid color-mix(in srgb, var(--muted) 28%, transparent);
    border-radius: .7rem;
    padding: .6rem .72rem;
    background: var(--surface);
    color: var(--text);
    font-size: .9rem;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.tool-chip:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--brand) 45%, transparent);
    box-shadow: 0 8px 20px rgba(8, 25, 45, 0.08);
}

.card,
.card-stat {
    border: 1px solid color-mix(in srgb, var(--muted) 22%, transparent);
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-stat small {
    color: var(--muted);
}

.adsense-slot {
    border: 1px dashed color-mix(in srgb, var(--muted) 46%, transparent);
    background: color-mix(in srgb, var(--surface) 74%, var(--surface-2));
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    color: var(--muted);
    min-height: 90px;
}

.ad-safe-shell {
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface-2) 56%, transparent);
    padding: 0.45rem;
}

.mobile-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid color-mix(in srgb, var(--muted) 26%, transparent);
    text-align: center;
    padding: .65rem;
    font-size: .82rem;
    z-index: 1050;
}

.result-box {
    min-height: 180px;
    background: #0f1924;
    color: #d8e9ff;
    border-radius: .75rem;
    padding: 1rem;
    overflow: auto;
}

.result-panel {
    border: 1px solid color-mix(in srgb, var(--muted) 22%, transparent);
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 0.9rem;
}

.result-kv {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    margin: 0;
}

.result-kv dt,
.result-kv dd {
    margin: 0;
    padding: 0.45rem 0.6rem;
    background: var(--surface-2);
    border-radius: 8px;
}

.mega-tools {
    width: min(900px, 92vw);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--muted) 24%, transparent);
}

.mega-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem 1.3rem;
}

.mega-group-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.mega-link {
    display: block;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.mega-link:hover {
    color: var(--brand);
}

.metric-pill {
    border: 1px solid color-mix(in srgb, var(--muted) 25%, transparent);
    border-radius: 999px;
    padding: .42rem .75rem;
    font-size: .82rem;
    color: var(--text);
    background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.trust-logo {
    border: 1px solid color-mix(in srgb, var(--muted) 26%, transparent);
    border-radius: 10px;
    background: var(--surface);
    padding: .55rem .8rem;
    font-size: .84rem;
    color: var(--muted);
    font-weight: 700;
}

.surface-strip {
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    border: 1px solid color-mix(in srgb, var(--muted) 20%, transparent);
    border-radius: var(--radius);
}

.quick-search {
    min-width: 220px;
}

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: color-mix(in srgb, var(--brand) 88%, #000);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--brand) 88%, #000);
}

.btn-dark {
    --bs-btn-bg: #143a52;
    --bs-btn-border-color: #143a52;
}

.fade-up {
    animation: fadeUp .5s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 991px) {
    .mega-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .quick-search {
        min-width: 100%;
    }
}

@media (max-width: 767px) {
    main {
        padding-bottom: 66px;
    }
    .tool-grid {
        grid-template-columns: 1fr;
    }
    .mega-grid {
        grid-template-columns: 1fr;
    }
    .result-kv {
        grid-template-columns: 1fr;
    }
    .btn, .form-control {
        min-height: 42px;
    }
}
