:root {
    --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --c-nav-bg: #181a1f;
    --c-nav-text: #e0e1e5;
    --c-nav-muted: #8b8f98;
    --c-nav-border: #2a2d35;
    --c-nav-hover: #24272e;
    --c-hero-bg: #1e2028;
    --c-hero-text: #f0f1f3;
    --c-hero-muted: #9a9ea8;
    --c-page-bg: #111318;
    --c-surface: #1a1d24;
    --c-surface-alt: #21242c;
    --c-border: #2a2d36;
    --c-border-hover: #3a3e48;
    --c-text: #e0e1e5;
    --c-text-2: #a0a4ae;
    --c-text-3: #7c818c;
    --c-text-muted: #5a5e68;
    --c-accent: #0f7b65;
    --c-accent-hover: #0a6352;
    --c-accent-bg: rgba(15, 123, 101, 0.15);
    --c-accent-text: #d5fff4;
    --c-blue: #8da2ff;
    --c-blue-bg: rgba(59, 91, 219, 0.15);
    --c-amber: #d8ad37;
    --c-amber-bg: rgba(184, 134, 11, 0.15);
    --c-green: #49b87a;
    --c-green-bg: rgba(26, 122, 76, 0.15);
    --c-red: #d0755d;
    --c-red-bg: rgba(185, 74, 42, 0.15);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.36);
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;
    --sp-12: 48px;
    --sp-16: 64px;
    --max-w: 1200px;
    --r-sm: 4px;
    --r-md: 6px;
    --r-lg: 8px;
    --r-xl: 12px;
    --c-bg: var(--c-page-bg);
    --c-card: var(--c-surface);
    --c-card-soft: var(--c-surface-alt);
    --c-fg: var(--c-text);
    --c-muted: var(--c-text-2);
    --c-muted-strong: var(--c-text);
    --c-success: var(--c-green);
    --c-danger: var(--c-red);
    --c-warning: var(--c-amber);
    --radius: var(--r-lg);
    --shadow: var(--shadow-md);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    background: var(--c-page-bg);
    color: var(--c-text);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--c-text);
    background: var(--c-page-bg);
    min-height: 100vh;
    font-size: 1rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

a { color: var(--c-accent); text-decoration: none; }
a:hover, a:focus { color: var(--c-accent-hover); text-decoration: underline; }

h1, h2, h3, h4 { color: var(--c-text); line-height: 1.3; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: 2rem; letter-spacing: 0; }
h2 { font-size: 1.35rem; margin-top: 1.5em; letter-spacing: 0; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }

.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 var(--sp-6); }

.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--sp-6);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.card-hover:hover {
    border-color: var(--c-border-hover);
    box-shadow: var(--shadow-md);
}

main#content {
    transition: opacity 120ms ease;
}

.is-page-loading main#content {
    opacity: 0.58;
    pointer-events: none;
}

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

.site-header {
    border-bottom: 1px solid var(--c-nav-border);
    background: var(--c-nav-bg);
    position: sticky;
    top: 0;
    z-index: 10;
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    min-height: 56px;
}

.brand {
    display: inline-flex;
    flex-direction: column;
    gap: 0.1rem;
    flex-shrink: 0;
    color: var(--c-nav-text);
}

.brand:hover { text-decoration: none; }
.brand__name { font-weight: 800; font-size: 1.03rem; line-height: 1.15; }
.brand__descriptor { color: var(--c-nav-muted); font-size: 0.78rem; font-weight: 600; line-height: 1.15; }
.primary-nav { display: flex; gap: var(--sp-1); flex-wrap: wrap; align-items: center; margin-left: var(--sp-4); }
.primary-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 var(--sp-3);
    border-radius: var(--r-md);
    color: var(--c-nav-muted);
    font-size: 0.9rem;
    font-weight: 650;
}
.primary-nav a:hover { background: var(--c-nav-hover); color: var(--c-nav-text); text-decoration: none; }
.site-search { width: 260px; margin-left: auto; }
.site-search input {
    width: 100%;
    min-height: 38px;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--c-nav-border);
    border-radius: var(--r-md);
    background: var(--c-surface);
    color: var(--c-text);
    font: inherit;
}

.site-search input:focus {
    outline: 3px solid var(--c-accent-bg);
    border-color: var(--c-accent);
}

.topic-nav {
    display: flex;
    gap: var(--sp-1);
    flex-wrap: wrap;
    padding: 6px 0;
    border-top: 1px solid var(--c-nav-border);
}

.topic-nav a {
    min-height: 2rem;
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.7rem;
    border-radius: var(--r-md);
    color: var(--c-nav-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.topic-nav a:hover {
    background: var(--c-nav-hover);
    color: var(--c-nav-text);
    text-decoration: none;
}

.site-footer { border-top: 1px solid var(--c-border); margin-top: 4rem; padding: 1.5rem 0; color: var(--c-muted); font-size: 0.9rem; }
.footer-nav { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }

.hero {
    position: relative;
    overflow: hidden;
    padding: 5rem 0 4rem;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-hero-bg);
}

.hero .container {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero__mosaic {
    position: absolute;
    inset: -2rem;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 1rem;
    transform: rotate(-5deg) scale(1.08);
    opacity: 0.32;
    filter: blur(3px) saturate(0.9);
}

.hero__mosaic img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
}

.hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(rgba(13, 15, 26, 0.74), rgba(13, 15, 26, 0.74)),
        url("/uploads/hero/toolscout-hero-bg.png") center / cover no-repeat;
}

.hero h1 {
    max-width: 780px;
    margin: 0 auto 1rem;
    color: var(--c-hero-text);
    font-size: 2.6rem;
    font-weight: 800;
}

.hero__sub {
    margin: 0 auto 1.4rem;
    color: var(--c-hero-muted);
    font-size: 1.08rem;
    max-width: 66ch;
}

.hero__sub strong { color: #fff; }
.hero__search { max-width: 560px; margin: 0 auto 1.4rem; }
.hero__search input,
.tools-filter input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-surface);
    color: var(--c-text);
    font: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hero__search input::placeholder,
.tools-filter input::placeholder { color: #64748b; }

.hero__search input:focus,
.tools-filter input:focus {
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px var(--c-accent-bg);
}

.hero__cta { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; margin-top: 1rem; }

.section { padding: 1.5rem 0; }
.section__header { margin-bottom: 1rem; }
.section__header p { color: var(--c-muted); max-width: 72ch; }
.section__faq { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--c-border); }
.section__faq details {
    margin-bottom: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-card);
}

.section__faq summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    color: #fff;
}

.section__faq summary::-webkit-details-marker { display: none; }
.section__faq summary::after {
    content: "⌄";
    float: right;
    color: var(--c-accent);
    transition: transform 0.15s ease;
}

.section__faq details[open] summary::after { transform: rotate(180deg); }
.section__faq details > p {
    margin: 0.75rem 0 0;
    color: var(--c-muted);
    animation: faq-open 0.15s ease;
}

@keyframes faq-open {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.tool-grid { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .tool-grid { grid-template-columns: repeat(3, 1fr); } }

.tool-card {
    overflow: hidden;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.tool-card:hover,
.tool-card:focus-within {
    border-color: var(--c-border-hover);
    box-shadow: var(--shadow-md);
}

.tool-card article { min-height: 100%; display: flex; flex-direction: column; }
.card-screenshot {
    display: grid;
    place-items: center;
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--c-surface-alt);
    border-bottom: 1px solid var(--c-border);
}

.card-screenshot:hover { text-decoration: none; }
.card-screenshot img { width: 100%; height: 100%; object-fit: cover; }
.card-screenshot__placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-rows: 1fr auto auto;
    align-items: end;
    gap: var(--sp-2);
    width: 100%;
    height: 100%;
    padding: var(--sp-5);
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 18%, rgba(15, 123, 101, 0.42), transparent 28%),
        radial-gradient(circle at 82% 22%, rgba(141, 162, 255, 0.20), transparent 28%),
        linear-gradient(145deg, #21242c 0%, #171a21 58%, #111318 100%);
    color: var(--c-nav-text);
}

.card-screenshot__placeholder::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 78%);
}

.card-screenshot__placeholder::after {
    content: "";
    position: absolute;
    right: -18%;
    top: 18%;
    width: 52%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
}

.card-screenshot__mark,
.card-screenshot__title,
.card-screenshot__meta {
    position: relative;
    z-index: 1;
}

.card-screenshot__mark {
    align-self: center;
    justify-self: center;
    display: grid;
    place-items: center;
    width: 74px;
    height: 74px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--r-xl);
    background: rgba(17, 19, 24, 0.72);
    color: var(--c-text);
    box-shadow: var(--shadow-lg);
    font-size: 1.55rem;
    font-weight: 800;
}

.card-screenshot__title {
    max-width: 100%;
    overflow: hidden;
    color: var(--c-text);
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-screenshot__meta {
    max-width: 100%;
    overflow: hidden;
    color: var(--c-text-2);
    font-size: 0.78rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-screenshot__placeholder--fallback {
    display: none;
}

.card-screenshot--failed .card-screenshot__placeholder--fallback {
    display: grid;
}

.tool-card__body { padding: var(--sp-4) var(--sp-4) var(--sp-3); flex: 1; }
.tool-card__name { margin: 0 0 0.4rem; font-size: 1rem; font-weight: 600; line-height: 1.35; }
.tool-card__name a { color: var(--c-text); }
.tool-card__name a:hover { color: var(--c-text); text-decoration: none; }
.tool-card__description {
    min-height: 2.8rem;
    margin: 0 0 0.85rem;
    overflow: hidden;
    color: var(--c-text-2);
    font-size: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tool-card__price { margin: 0; color: var(--c-text); font-size: 0.94rem; font-weight: 700; }
.tool-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0 var(--sp-4) var(--sp-4);
}

.tool-card__more { color: var(--c-accent); font-size: 0.9rem; font-weight: 700; }
.tool-card__more:hover { color: var(--c-accent-hover); text-decoration: none; }
.tool-card__category {
    min-width: 0;
    color: var(--c-text-3);
    font-size: 0.82rem;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: 999px;
    color: var(--c-text-2);
    line-height: 1.4;
    font-weight: 600;
    white-space: nowrap;
}

.badge-pricing,
.badge--pricing { background: var(--c-blue-bg); color: var(--c-blue); }
.badge-free,
.badge--free { background: var(--c-green-bg); color: var(--c-green); }
.badge-rating,
.badge--rating { background: var(--c-amber-bg); color: var(--c-amber); }
.badge-featured { background: var(--c-amber-bg); color: var(--c-amber); }
.badge-outline { background: transparent; border: 1px solid var(--c-border); color: var(--c-text-2); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    font-size: 0.93rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.btn:hover, .btn:focus { text-decoration: none; }
.btn-primary,
.btn--primary { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.btn-primary:hover,
.btn--primary:hover { background: var(--c-accent-hover); border-color: var(--c-accent-hover); color: #fff; }
.btn-secondary,
.btn--secondary { background: var(--c-surface); color: var(--c-text); border-color: var(--c-border); }
.btn-secondary:hover,
.btn--secondary:hover { background: var(--c-surface-alt); border-color: var(--c-border-hover); color: var(--c-text); }
.btn-ghost,
.btn--ghost { background: transparent; color: var(--c-accent); border-color: transparent; }
.btn-ghost:hover,
.btn--ghost:hover { background: var(--c-accent-bg); color: var(--c-accent); }

.tool-detail { padding: 0 0 var(--sp-8); }
.tool-detail__tagline { color: var(--c-text-2); font-size: 1.02rem; line-height: 1.6; margin-bottom: 0; }
.tool-detail__meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.75rem 0; }
.tool-detail__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tool-detail__section { margin-bottom: var(--sp-8); }
.tool-detail__section > h2 {
    margin: 0 0 var(--sp-3);
    font-size: 1.15rem;
}
.tool-hero {
    display: grid;
    gap: var(--sp-6);
    grid-template-columns: 1fr;
    align-items: start;
    margin: 0 0 var(--sp-8);
}

.tool-hero__main {
    display: grid;
    gap: var(--sp-5);
    align-content: start;
    padding: var(--sp-8);
}
.tool-identity {
    display: flex;
    gap: var(--sp-4);
    align-items: flex-start;
}

.tool-logo {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border-radius: var(--r-lg);
    border: 1px solid var(--c-border);
    background: var(--c-surface-alt);
    object-fit: contain;
}

.tool-logo--placeholder {
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    font-size: 1.2rem;
}

.chip-row {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 1.9rem;
    padding: 5px 12px;
    border: 1px solid var(--c-border);
    border-radius: 999px;
    background: var(--c-surface-alt);
    color: var(--c-text-2);
    font-size: 0.85rem;
    font-weight: 500;
    transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.chip:hover {
    border-color: var(--c-accent);
    background: var(--c-accent-bg);
    color: var(--c-accent);
    text-decoration: none;
}

.chip--success { color: var(--c-success); }
.chip--rating { color: var(--c-warning); }

.summary-card,
.content-card,
.stat-card {
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    background: var(--c-surface);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.summary-card { padding: var(--sp-6); }
.summary-card h2,
.content-card h2 { margin-top: 0; }
.summary-card h2 {
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-3);
    border-bottom: 2px solid var(--c-border);
    font-size: 1.05rem;
}

.summary-list,
.data-table {
    display: grid;
    margin: 0;
}

.summary-list div,
.data-table div {
    display: flex;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: 10px 0;
    border-bottom: 1px solid var(--c-border);
}

.summary-list div:first-child,
.data-table div:first-child { padding-top: 0; }
.summary-list div:last-child,
.data-table div:last-child { border-bottom: 0; padding-bottom: 0; }
.summary-list dt,
.data-table dt {
    flex-shrink: 0;
    color: var(--c-text-3);
    font-size: 0.85rem;
    font-weight: 500;
}
.summary-list dd,
.data-table dd {
    margin: 0;
    color: var(--c-text);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: right;
}

.stat-grid {
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.stat-card { padding: var(--sp-4); }
.stat-card span { display: block; color: var(--c-text-3); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card strong { display: block; margin-top: 0.2rem; color: var(--c-text); font-size: 1.02rem; }
.content-card { padding: var(--sp-6); }
.content-card p:last-child { margin-bottom: 0; }
.content-card h3 {
    margin: var(--sp-5) 0 var(--sp-2);
    color: var(--c-text);
    font-size: 0.95rem;
}

.feature-grid {
    list-style: none;
    padding: 0;
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: 1fr;
}

.feature-grid li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: var(--sp-4);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    background: var(--c-surface);
}

.feature-grid li::before {
    content: "✓";
    flex: 0 0 auto;
    color: var(--c-accent);
    font-weight: 800;
}

.feature-grid span {
    display: block;
    color: var(--c-text);
    font-size: 0.93rem;
    font-weight: 500;
}

.pros-cons-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.pros,
.cons { list-style: none; padding: 0; }

.pros li,
.cons li {
    position: relative;
    display: flex;
    gap: 8px;
    padding: 8px 0;
    color: var(--c-text-2);
    font-size: 0.93rem;
    line-height: 1.5;
}

.pros li::before,
.cons li::before {
    flex: 0 0 auto;
    margin-top: 1px;
    font-weight: 800;
}

.pros li::before { content: "✓"; color: var(--c-green); }
.cons li::before { content: "!"; color: var(--c-red); }

.compare-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.55rem;
}

.compare-link-list a {
    display: block;
    padding: 8px 16px;
    border: 1px solid var(--c-border);
    border-radius: 999px;
    background: var(--c-surface-alt);
    color: var(--c-text-2);
    font-size: 0.9rem;
    font-weight: 600;
}

.compare-link-list a:hover {
    border-color: var(--c-accent);
    background: var(--c-accent-bg);
    color: var(--c-accent);
    text-decoration: none;
}
.checklist { list-style: none; padding: 0; }
.checklist li { padding-left: 1.4em; position: relative; margin-bottom: 0.4em; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--c-success); font-weight: 700; }

.proscons { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .proscons { grid-template-columns: 1fr 1fr; } }

.taglist { list-style: none; padding: 0; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.taglist a { background: var(--c-surface-alt); border: 1px solid var(--c-border); padding: 0.35rem 0.7rem; border-radius: 999px; color: var(--c-text-2); font-size: 0.9rem; }
.taglist a:hover { border-color: var(--c-accent); background: var(--c-accent-bg); color: var(--c-accent); text-decoration: none; }

.link-grid { list-style: none; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .link-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .link-grid { grid-template-columns: repeat(3, 1fr); } }
.link-grid a { display: block; padding: 0.9rem 1rem; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); color: var(--c-text); }
.link-grid a strong { display: block; margin-bottom: 0.2rem; }
.link-grid a span { color: var(--c-text-2); font-size: 0.9rem; }
.link-grid a:hover { border-color: var(--c-border-hover); box-shadow: var(--shadow-md); text-decoration: none; }

.category-pills {
    list-style: none;
    padding: 0 0 0.2rem;
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.category-pills a,
.filter-bar a {
    display: inline-flex;
    align-items: center;
    min-height: 2.3rem;
    white-space: nowrap;
    background: var(--c-surface-alt);
    border: 1px solid var(--c-border);
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.9rem;
    color: var(--c-text-2);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.category-pills a:hover,
.filter-bar a:hover,
.filter-bar a.filter-bar__active {
    background: var(--c-accent);
    border-color: var(--c-accent);
    color: #fff;
    text-decoration: none;
}

.breadcrumb { font-size: 0.9rem; color: var(--c-text-3); padding: var(--sp-4) 0; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.breadcrumb a { color: var(--c-text-3); }
.breadcrumb a:hover { color: var(--c-accent); }
.breadcrumb li + li::before { content: "›"; margin-right: 0.4rem; color: var(--c-text-3); }

.pagination { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin: 2rem 0; }
.pagination__pages { list-style: none; display: flex; gap: 0.25rem; padding: 0; margin: 0; }
.pagination__pages li { padding: 0.4rem 0.7rem; border-radius: var(--r-md); border: 1px solid var(--c-border); background: var(--c-surface); }
.pagination__pages li a { color: var(--c-text); }
.pagination__pages .pagination__current {
    background: var(--c-accent);
    border-color: var(--c-accent);
    color: #fff;
}
.pagination__ellipsis { padding: 0.4rem 0.3rem; background: transparent !important; border-color: transparent !important; }
.pagination__prev,
.pagination__next { color: var(--c-text-2); font-weight: 600; }

.filter-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }

.compare__heads { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 1rem; }
@media (min-width: 640px) { .compare__heads { grid-template-columns: 1fr 1fr; } }
.compare__head { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: 1rem; }
.compare__table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--c-border); border-radius: var(--r-lg); }
.compare__table { width: 100%; border-collapse: collapse; min-width: 600px; }
.compare__table th, .compare__table td { text-align: left; padding: 0.75rem; border-bottom: 1px solid var(--c-border); vertical-align: top; }
.compare__table thead th { background: var(--c-surface); }
.compare__table th[scope="row"] { width: 18%; color: var(--c-text-2); font-weight: 600; }
.compare__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }

.form { max-width: 560px; }
.field { display: block; margin-bottom: 1rem; }
.field__label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.field input, .field textarea { width: 100%; padding: 0.6rem 0.7rem; border: 1px solid var(--c-border); border-radius: var(--r-md); font: inherit; background: var(--c-surface); color: var(--c-text); }
.field__error { display: block; color: var(--c-danger); font-size: 0.85rem; margin-top: 0.3rem; }
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.alert--error { background: rgba(214, 162, 162, 0.12); color: var(--c-danger); border: 1px solid rgba(214, 162, 162, 0.35); }

.tools-filter { margin-bottom: 1rem; }
.tools-filter input { max-width: 420px; }

.compare-selector { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.compare-selector select { padding: 0.6rem 0.8rem; border: 1px solid var(--c-border); border-radius: var(--r-md); font: inherit; min-width: 180px; background: var(--c-surface); color: var(--c-text); }
.compare-selector .btn { padding-block: 0.55rem; }

.admin-shell { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.admin-shell__top { display: flex; gap: 1rem; justify-content: space-between; align-items: center; margin-bottom: 1rem; border-bottom: 1px solid var(--c-border); padding-bottom: 0.5rem; }
.admin-shell__nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.admin-shell__nav a { color: var(--c-fg); }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--c-border); vertical-align: top; }
.admin-table th { background: var(--c-card); }
.admin-form { display: grid; gap: 1rem; max-width: 720px; }
.admin-form__row { display: grid; gap: 0.5rem; }
.admin-form__row label { font-weight: 600; }
.admin-form__row input, .admin-form__row select, .admin-form__row textarea { width: 100%; padding: 0.5rem 0.6rem; border: 1px solid var(--c-border); border-radius: var(--r-md); font: inherit; background: var(--c-surface); color: var(--c-text); }
.admin-form__row textarea { min-height: 7rem; font-family: inherit; }
.admin-form__actions { display: flex; gap: 0.5rem; }
.admin-stat { display: inline-block; padding: 1rem 1.25rem; background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--radius); margin-right: 0.5rem; min-width: 8rem; }
.admin-stat strong { font-size: 1.5rem; display: block; }
.btn--danger { background: var(--c-danger); color: #fff; border-color: var(--c-danger); }
.btn--danger:hover { background: #dc2626; }

@media (min-width: 720px) {
    h1 { font-size: 2rem; }
    .hero h1 { font-size: 4rem; }
    .section { padding: var(--sp-8) 0; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .pros-cons-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
    .tool-hero { grid-template-columns: minmax(0, 1fr) 340px; }
    .summary-card {
        position: sticky;
        top: 72px;
    }
}

@media (max-width: 899px) {
    .site-header__inner {
        align-items: center;
        gap: var(--sp-2);
        min-height: 48px;
        padding: 6px 0;
    }
    .brand__name { font-size: 0.95rem; }
    .brand__descriptor { font-size: 0.7rem; }
    .site-search { display: none; }
    .primary-nav {
        flex: 1 1 auto;
        flex-wrap: nowrap;
        gap: var(--sp-1);
        min-width: 0;
        margin-left: 0;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .primary-nav::-webkit-scrollbar { display: none; }
    .primary-nav a {
        flex: 0 0 auto;
        min-height: 34px;
        display: inline-flex;
        align-items: center;
        padding: 0 0.55rem;
        font-size: 0.82rem;
    }
}

@media (max-width: 640px) {
    .container { padding: 0 var(--sp-4); }
    .site-header {
        position: sticky;
    }
    .brand {
        width: 112px;
    }
    .topic-nav {
        gap: var(--sp-1);
        padding: 4px 0;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .topic-nav::-webkit-scrollbar { display: none; }
    .topic-nav a {
        min-height: 30px;
        flex: 0 0 auto;
        justify-content: center;
        padding: 0.2rem 0.55rem;
        font-size: 0.76rem;
    }
    .hero { padding: 2.7rem 0 2.5rem; }
    .hero h1 { font-size: 2.05rem; }
    .hero__sub { font-size: 0.98rem; }
    .hero__mosaic { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
    .tool-hero__main { padding: var(--sp-5); }
    .tool-logo { width: 48px; height: 48px; flex-basis: 48px; }
}

@media (min-width: 900px) and (max-width: 1120px) {
    .site-header__inner {
        flex-wrap: wrap;
    }
    .site-search {
        width: 100%;
    }
}
