:root {
    --bg-light: #f4f4f4;
    --bg-dark: #1e1e1e;
    --card-light: #ffffff;
    --card-dark: #2c2c2c;
    --text-light: #333;
    --text-dark: #eee;
    --accent: #25d366;
    --hover: #1ebe57;
    --disabled: #bbb;
    --surface-light: rgba(255, 255, 255, 0.78);
    --surface-dark: rgba(44, 44, 44, 0.82);
    --muted-light: #6f7681;
    --muted-dark: #c8ced6;
    --border-light: rgba(37, 211, 102, 0.16);
    --border-dark: rgba(255, 255, 255, 0.08);
    --shadow-light: 0 1.2rem 3rem rgba(15, 23, 42, 0.06);
    --shadow-dark: 0 1.2rem 3rem rgba(0, 0, 0, 0.2);
}

html {
    font-size: 62.5%;
    width: 100%;
    height: 100%;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

@media (max-width: 140rem) {
    html {
        font-size: 62%;
    }
}

@media (max-width: 120rem) {
    html {
        font-size: 61%;
    }
}

@media (max-width: 99.2rem) {
    html {
        font-size: 60%;
    }
}

@media (max-width: 76.8rem) {
    html {
        font-size: 56.25%;
    }
}

@media (max-width: 57.6rem) {
    html {
        font-size: 50%;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[data-theme="light"] {
    --bg: var(--bg-light);
    --card: var(--card-light);
    --text: var(--text-light);
    --surface: var(--surface-light);
    --muted: var(--muted-light);
    --border: var(--border-light);
    --shadow: var(--shadow-light);
}

[data-theme="dark"] {
    --bg: var(--bg-dark);
    --card: var(--card-dark);
    --text: var(--text-dark);
    --surface: var(--surface-dark);
    --muted: var(--muted-dark);
    --border: var(--border-dark);
    --shadow: var(--shadow-dark);
}

body {
    margin: 0;
    font-family: "Inter", sans-serif;
    background-color: var(--bg);
    background:
        radial-gradient(
            circle at top left,
            rgba(37, 211, 102, 0.1),
            transparent 30%
        ),
        radial-gradient(
            circle at top right,
            rgba(58, 134, 255, 0.08),
            transparent 28%
        ),
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.1),
            rgba(255, 255, 255, 0)
        ),
        var(--bg);
    background-repeat: no-repeat;
    background-size:
        cover,
        cover,
        100% 100%,
        auto;
    background-attachment: fixed;
    color: var(--text);
    width: 100dvw;
    height: 100dvh;
    overflow: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
    transition:
        background 0.3s ease,
        color 0.3s ease;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.home_shell {
    width: 100%;
    height: 100%;
    padding: 1.6rem;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 1.6rem;
}

.tools_layout {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(30rem, 0.9fr) minmax(0, 1.6fr);
    gap: 1.6rem;
}

.tools_layout.no_pinned_tools {
    grid-template-columns: minmax(0, 1fr);
}

.hero_panel,
.tools_section {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 0.1rem solid var(--border);
    border-radius: 1.8rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(1.2rem);
}

.tools_section {
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 1.6rem;
}

#pinned-section {
    max-height: none;
}

#pinned-section[hidden] {
    display: none !important;
}

.tools_section[hidden] {
    display: none !important;
}

#pinned-grid {
    overflow: visible;
}

.hero_panel {
    position: relative;
    padding: 1.4rem 1.6rem;
}

.hero_panel::before {
    content: "";
    position: absolute;
    inset: auto -4rem -6rem auto;
    width: 14rem;
    height: 14rem;
    z-index: 0;
    pointer-events: none;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        rgba(37, 211, 102, 0.14),
        rgba(58, 134, 255, 0.06)
    );
    filter: blur(0.8rem);
}

.hero_bar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    margin-bottom: 0.8rem;
}

.eyebrow,
.section_kicker {
    margin: 0 0 0.6rem;
    color: var(--accent);
    font-size: 0.99.2rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero_bar .eyebrow {
    margin: 0;
    white-space: nowrap;
}

.hero_copy {
    position: relative;
    z-index: 1;
    margin: 0 0 1rem;
    max-width: 76.8rem;
}

.hero_copy h1 {
    margin: 0 0 0.4rem;
    font-size: clamp(1.39rem, calc(2vw + 0.24rem), 2.09rem);
    line-height: 1.15;
    letter-spacing: -0.04em;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.privacy_info_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.12);
    color: var(--accent);
    font-size: 1.3rem;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.privacy_info_btn:hover {
    background: rgba(37, 211, 102, 0.22);
}

.floating_tooltip.is_multiline {
    white-space: normal;
    max-width: 32rem;
    line-height: 1.45;
    text-align: left;
}

.shimmer_text {
    background: linear-gradient(
        90deg,
        var(--accent) 0%,
        #a8edba 40%,
        #fff 50%,
        #a8edba 60%,
        var(--accent) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s ease-in-out infinite;
}

[data-theme="dark"] .shimmer_text {
    background: linear-gradient(
        90deg,
        var(--accent) 0%,
        #72d897 35%,
        #e0ffe8 50%,
        #72d897 65%,
        var(--accent) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: 100% 50%;
    }
    100% {
        background-position: -100% 50%;
    }
}

.hero_copy p {
    margin: 0;
    max-width: 62ch;
    color: var(--muted);
    font-size: 1.12rem;
    line-height: 1.45;
}

.search_controls {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: stretch;
    gap: 1rem;
}

.search_wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1 1 auto;
    padding: 1rem 1.2rem;
    border-radius: 1.2rem;
    border: 0.1rem solid rgba(37, 211, 102, 0.18);
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 0.6rem 1.8rem rgba(37, 211, 102, 0.06);
}

[data-theme="dark"] .search_wrap {
    background: rgba(20, 20, 20, 0.5);
}

.ranking_filter_wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 21rem;
    padding: 1rem 1.2rem;
    border-radius: 1.2rem;
    border: 0.1rem solid rgba(37, 211, 102, 0.18);
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 0.6rem 1.8rem rgba(37, 211, 102, 0.06);
}

[data-theme="dark"] .ranking_filter_wrap {
    background: rgba(20, 20, 20, 0.5);
}

.search_icon {
    color: var(--accent);
    font-size: 0.95rem;
}

.ranking_filter_icon {
    color: var(--accent);
    font-size: 0.92rem;
}

.search_input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 1.2rem;
    font-family: inherit;
}

.search_input::placeholder {
    color: var(--muted);
}

.ranking_filter_select {
    width: 100%;
    border: 0;
    outline: 0;
    background: var(--card);
    color: var(--text);
    font-size: 1.19rem;
    font-family: inherit;
    cursor: pointer;
    border-radius: 0.8rem;
    padding: 1rem 1.4rem;
    color-scheme: light;
}

.ranking_filter_select option {
    background: var(--card);
    color: var(--text);
    border-radius: 1.4rem;
    padding: 1rem 1.2rem;
}

[data-theme="dark"] .ranking_filter_select {
    background: var(--card);
    color: var(--text);
    color-scheme: dark;
}

[data-theme="dark"] .ranking_filter_select option {
    background: var(--card);
    color: var(--text);
    border-radius: 1.4rem;
}

.hero_meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.6rem;
}

.meta_chip {
    padding: 0.5rem 0.9rem;
    border-radius: 99.9rem;
    border: 0.1rem solid var(--border);
    background: rgba(255, 255, 255, 0.4);
    color: var(--muted);
    font-size: 0.99rem;
}

[data-theme="dark"] .meta_chip {
    background: rgba(255, 255, 255, 0.04);
}

.trust_row {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.trust_chip {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 99.9rem;
    border: 0.1rem solid rgba(37, 211, 102, 0.16);
    background: rgba(37, 211, 102, 0.08);
    color: var(--text);
    font-size: 0.99rem;
    font-weight: 600;
}

[data-theme="dark"] .trust_chip {
    background: rgba(255, 255, 255, 0.05);
}

.tools_section[aria-labelledby="results-title"] {
    min-height: 0;
}

.section_head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1.2rem;
    margin-bottom: 1.2rem;
}

.section_head h2 {
    margin: 0;
    font-size: 1.44rem;
    letter-spacing: -0.03em;
}

.section_copy {
    margin: 0;
    max-width: 32rem;
    color: var(--muted);
    line-height: 1.35;
    font-size: 1.08rem;
    text-align: right;
}

.tools_grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
    gap: 1.2rem;
}

.tools_scroll_wrap,
.pinned_scroll_wrap {
    min-height: 0;
    flex: 1;
    overflow: auto;
    padding: 0.4rem 0.6rem 1rem 0.4rem;
}

.tools_scroll_wrap::-webkit-scrollbar,
.pinned_scroll_wrap::-webkit-scrollbar {
    width: 1rem;
}

.tools_scroll_wrap::-webkit-scrollbar-thumb,
.pinned_scroll_wrap::-webkit-scrollbar-thumb {
    background: rgba(37, 211, 102, 0.18);
    border: 0.3rem solid transparent;
    border-radius: 99.9rem;
    background-clip: content-box;
}

.tool_card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 28%),
        var(--card);
    border: 0.1rem solid var(--border);
    border-radius: 1.6rem;
    padding: 1.6rem;
    box-shadow: 0 0.6rem 1.8rem rgba(0, 0, 0, 0.05);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.tool_card:hover {
    z-index: 20;
    transform: translateY(-0.2rem);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.08);
    border-color: rgba(37, 211, 102, 0.3);
}

.tool_card:focus-within {
    z-index: 20;
}

.tool_card_clickable {
    cursor: pointer;
}

.tool_card_clickable:focus-visible {
    outline: 0.2rem solid rgba(37, 211, 102, 0.55);
    outline-offset: 0.3rem;
}

.tool_card_pinned {
    border-color: rgba(37, 211, 102, 0.42);
}

.tool_top_row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.8rem;
}

.badge_group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.2rem;
    height: 4.2rem;
    border-radius: 1.2rem;
    font-size: 2rem;
    color: var(--accent);
    background: rgba(37, 211, 102, 0.08);
}

.tool_card h3 {
    margin: 0;
    font-size: 1.24rem;
    line-height: 1.25;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.8rem;
    border-radius: 99.9rem;
    font-size: 1.24rem;
    font-weight: 600;
    background-color: transparent;
    border: 0.1rem solid;
    color: var(--text);
    opacity: 0.75;
}

.badge.pinned {
    border-color: rgba(37, 211, 102, 0.32);
    color: var(--accent);
}

.badge.hot {
    border-color: #ee6c4d;
    color: #ee6c4d;
}

.badge.popular {
    border-color: #ffb703;
    color: #ffb703;
}

.badge.new {
    border-color: #3a86ff;
    color: #3a86ff;
}

.badge.underrated {
    border-color: #8338ec;
    color: #8338ec;
}

.tool_card p {
    font-size: 1.08rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.45;
}

.tool_info_row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.info_chip {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.9rem;
    border-radius: 99.9rem;
    border: 0.1rem solid transparent;
    font-size: 0.99.2rem;
    font-weight: 600;
    line-height: 1.2;
}

.info_chip.browser,
.info_chip.no_data {
    background: rgba(37, 211, 102, 0.09);
    border-color: rgba(37, 211, 102, 0.2);
    color: var(--accent);
}

.info_chip.backend,
.info_chip.stores_data {
    background: rgba(58, 134, 255, 0.08);
    border-color: rgba(58, 134, 255, 0.18);
    color: #2f6fdf;
}

.friendlyness_icons {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
}

.friendlyness_icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 1rem;
    border: 0.1rem solid rgba(15, 23, 42, 0.12);
    background: rgba(15, 23, 42, 0.06);
    color: var(--text);
    font-size: 0.76.8rem;
}

.floating_tooltip {
    position: fixed;
    left: 0;
    top: 0;
    padding: 0.8rem 1rem;
    border-radius: 1rem;
    background: rgba(15, 23, 42, 0.96);
    color: #fff;
    font-size: 0.99.2rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 1.4rem 2.8rem rgba(15, 23, 42, 0.22);
    transform: translateY(0.6rem);
    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
    z-index: 2147483647;
}

.floating_tooltip::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -0.4rem;
    width: 0.9rem;
    height: 0.9rem;
    background: rgba(15, 23, 42, 0.96);
    transform: translateX(-50%) rotate(45deg);
}

.floating_tooltip.is_bottom {
    transform: translateY(-0.6rem);
}

.floating_tooltip.is_bottom::before {
    top: -0.4rem;
    bottom: auto;
}

.floating_tooltip.is_visible {
    opacity: 1;
    transform: translateY(0);
}

[data-theme="dark"] .info_chip.backend,
[data-theme="dark"] .info_chip.stores_data {
    color: #8fb5ff;
}

[data-theme="dark"] .friendlyness_icon {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.action {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
    padding-top: 0.2rem;
}

.pin_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    border: 0.1rem solid transparent;
    border-radius: 99.9rem;
    min-width: 3.4rem;
    min-height: 3.4rem;
    padding: 0.6rem 0.8rem;
    background: rgba(37, 211, 102, 0.07);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        border-color 0.2s ease;
}

.pin_button:hover {
    background: rgba(37, 211, 102, 0.12);
    border-color: rgba(37, 211, 102, 0.16);
    transform: translateY(-0.1rem);
}

.pin_button.is_pinned {
    background: rgba(37, 211, 102, 0.16);
    border-color: rgba(37, 211, 102, 0.2);
    color: var(--accent);
}

.pin_button.is_pinned:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.18);
    color: #dc2626;
}

.pin_button span {
    display: none;
}

.tool_btn {
    display: inline-block;
    padding: 0.8rem 1.2rem;
    background-color: var(--accent);
    color: white;
    border-radius: 1rem;
    text-decoration: none;
    font-size: 1.09rem;
    font-weight: 600;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.tool_btn:hover {
    background-color: var(--hover);
    transform: translateY(-0.1rem);
}

.tool_btn.disabled {
    background-color: var(--disabled);
    cursor: not-allowed;
    pointer-events: none;
}

.empty_state {
    margin: 1rem 0 0;
    padding: 1.4rem;
    border-radius: 1.4rem;
    border: 0.1rem dashed var(--border);
    color: var(--muted);
    text-align: center;
    font-size: 1.12rem;
}

.empty_state a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.empty_state a:hover {
    text-decoration: underline;
}

/* ── Mid-screen compact hero (laptops, 1366-class) ── */
@media (max-height: 80rem), (max-width: 140rem) {
    .hero_panel {
        padding: 1rem 1.4rem;
    }

    .hero_bar {
        margin-bottom: 0.4rem;
    }

    .hero_copy {
        margin-bottom: 0.6rem;
    }

    .hero_copy h1 {
        font-size: clamp(1.29rem, calc(1.4vw + 0.24rem), 1.59rem);
        margin-bottom: 0.2rem;
    }

    .hero_copy p {
        font-size: 1.06rem;
        line-height: 1.4;
    }

    .search_wrap {
        padding: 0.8rem 1.1rem;
    }

    .search_input {
        font-size: 1.12rem;
    }

    .ranking_filter_wrap {
        min-width: 19rem;
        padding: 0.8rem 1.1rem;
    }

    .ranking_filter_select {
        font-size: 1.12rem;
    }

    .trust_row {
        margin-top: 0.6rem;
        gap: 0.5rem;
    }

    .trust_chip {
        padding: 0.4rem 0.8rem;
        font-size: 0.94rem;
    }

    .meta_chip {
        padding: 0.3rem 0.7rem;
        font-size: 0.94rem;
    }
}

@media (max-width: 76.8rem) {
    body {
        width: 100%;
        min-height: 100dvh;
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .home_shell {
        padding: 1.2rem;
        min-height: 100dvh;
        height: auto;
        grid-template-rows: auto auto;
    }

    .tools_layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .hero_panel,
    .tools_section {
        padding: 1.6rem;
        border-radius: 1.6rem;
    }

    .hero_bar {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 0.8rem;
    }

    .hero_meta {
        justify-content: flex-start;
    }

    .hero_copy h1 {
        font-size: clamp(1.19rem, calc(4.5vw + 0.24rem), 1.39rem);
    }

    #pinned-section,
    .tools_section[aria-labelledby="results-title"] {
        height: auto;
        max-height: none;
    }

    .tools_scroll_wrap,
    .pinned_scroll_wrap {
        flex: 0 1 auto;
        max-height: min(60dvh, 52rem);
    }

    .section_head {
        align-items: flex-start;
        flex-direction: column;
    }

    .section_copy {
        text-align: left;
    }

    .search_wrap {
        padding: 1.1rem 1.2rem;
        border-radius: 1.2rem;
    }

    .search_controls {
        flex-direction: column;
    }

    .ranking_filter_wrap {
        width: 100%;
        min-width: 0;
        padding: 1.1rem 1.2rem;
    }

    .tool_top_row,
    .action {
        flex-direction: column;
        align-items: flex-start;
    }

    .pin_button span {
        display: inline;
    }

    .tool_btn {
        width: 100%;
        text-align: center;
    }
}

/* ── Welcome toast ── */
.welcome_toast {
    position: fixed;
    bottom: 2.4rem;
    right: 2.4rem;
    max-width: 38rem;
    width: calc(100% - 4.8rem);
    padding: 1.8rem 2rem;
    border-radius: 1.6rem;
    overflow: hidden;
    background: var(--card);
    color: var(--text);
    border: 0.1rem solid var(--border);
    box-shadow:
        0 1.6rem 4rem rgba(0, 0, 0, 0.12),
        0 0 0 0.1rem rgba(37, 211, 102, 0.08);
    font-size: 1.09rem;
    line-height: 1.55;
    z-index: 9999;
    opacity: 0;
    transform: translateY(2rem);
    pointer-events: none;
    transition:
        opacity 0.35s ease,
        transform 0.35s ease;
}

.welcome_toast.is_visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.welcome_toast_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.welcome_toast_title {
    font-weight: 600;
    font-size: 1.16rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.welcome_toast_close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.6rem;
    padding: 0.4rem;
    border-radius: 0.8rem;
    line-height: 1;
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.welcome_toast_close:hover {
    background: rgba(37, 211, 102, 0.1);
    color: var(--accent);
}

.welcome_toast_body {
    color: var(--muted);
}

.welcome_toast_email {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.welcome_toast_email:hover {
    text-decoration: underline;
}

.welcome_toast_progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 0.3rem;
    background: var(--accent);
    border-radius: 0 0 1.6rem 1.6rem;
    transition: width linear;
}

@media (max-width: 57.6rem) {
    .welcome_toast {
        right: 1.2rem;
        bottom: 1.2rem;
        max-width: calc(100% - 2.4rem);
        width: calc(100% - 2.4rem);
        padding: 1.4rem 1.6rem;
        font-size: 1.06rem;
    }
}
