/*
 * Mateen Labs — shared Free Tools stylesheet
 * Location: /tools/assets/tools.css
 *
 * Load on tools pages only. Uses design tokens from /assets/style.css
 * (including its dark-mode values), so nothing here hard-codes colors.
 *
 * Naming:
 *   .tool-*   components used inside an individual tool page.
 *   .tools-*  helpers for the tools directory and category pages.
 */

/* ------------------------------------------------------------------ */
/* Directory and category page helpers                                 */
/* ------------------------------------------------------------------ */

.tools-block {
    margin-top: 28px;
}

/* Keep a lone card at a sensible width instead of stretching the full row. */
.grid.tools-block {
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
}

.tools-back {
    margin-top: 30px;
}

.panel .card-icon {
    margin-bottom: 12px;
}

/* ------------------------------------------------------------------ */
/* Tool page layout                                                    */
/* ------------------------------------------------------------------ */

.tool-page {
    width: 100%;
    max-width: 1050px;
    margin: 16px auto 42px;
}

.tool-page > h1 {
    font-size: clamp(34px, 5vw, 50px);
    margin-bottom: 14px;
}

.tool-intro {
    max-width: 760px;
    font-size: 18px;
}

/* Breadcrumb trail */
.tool-breadcrumb {
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--muted);
}

.tool-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tool-breadcrumb li + li::before {
    content: "/";
    margin-right: 8px;
    color: var(--line-strong);
}

.tool-breadcrumb a {
    color: var(--muted);
    text-decoration: none;
}

.tool-breadcrumb a:hover {
    color: var(--accent-text);
    text-decoration: underline;
}

/* Privacy badges */
.tool-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 20px 0 26px;
}

.tool-badges span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--accent-soft);
    color: var(--accent-text);
    padding: 6px 13px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.tool-badges span::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ------------------------------------------------------------------ */
/* Action rows (buttons and selects)                                   */
/* ------------------------------------------------------------------ */

.tool-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin: 16px 0;
}

.tool-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.tool-actions button,
.tool-actions select {
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.3;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.tool-actions button:hover,
.tool-actions select:hover {
    border-color: var(--accent);
    background: var(--panel);
}

.tool-actions button:focus-visible,
.tool-actions select:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring);
}

.tool-actions button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.tool-actions button.primary {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.tool-actions button.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.tool-actions label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Input / output workspace                                            */
/* ------------------------------------------------------------------ */

.tool-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    margin-top: 18px;
}

.tool-panel {
    min-width: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.tool-panel:focus-within {
    border-color: var(--accent);
    box-shadow: var(--ring);
}

.tool-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 18px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.tool-panel-header strong {
    color: var(--text);
    font-size: 14px;
}

.tool-panel-header span {
    color: var(--muted);
    font-size: 12px;
    text-align: right;
}

.tool-editor {
    display: block;
    width: 100%;
    min-height: 400px;
    margin: 0;
    padding: 18px;
    resize: vertical;
    border: 0;
    border-radius: 0;
    outline: none;
    background: var(--surface);
    color: var(--text);
    font: 13.5px/1.7 var(--mono);
    tab-size: 2;
}

.tool-editor::placeholder {
    color: var(--muted);
    opacity: .75;
}

/* ------------------------------------------------------------------ */
/* Status messages and statistics                                      */
/* ------------------------------------------------------------------ */

.tool-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 50px;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

/* Icons repeat the state so it never relies on color alone. */
.tool-status.success::before,
.tool-status.warning::before,
.tool-status.error::before {
    flex: none;
    font-weight: 800;
}

.tool-status.success {
    background: var(--ok-bg);
    color: var(--ok-text);
    border-color: var(--ok-line);
}

.tool-status.success::before {
    content: "✓";
    content: "✓" / "";
}

.tool-status.warning {
    background: var(--warn-bg);
    color: var(--warn-text);
    border-color: var(--warn-line);
}

.tool-status.warning::before {
    content: "!";
    content: "!" / "";
}

.tool-status.error {
    background: var(--err-bg);
    color: var(--err-text);
    border-color: var(--err-line);
}

.tool-status.error::before {
    content: "✕";
    content: "✕" / "";
}

.tool-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    color: var(--muted);
    font-size: 13px;
}

/* ------------------------------------------------------------------ */
/* Supporting content below a tool                                     */
/* ------------------------------------------------------------------ */

.tool-info {
    max-width: 800px;
    margin-top: 60px;
    padding-top: 36px;
    border-top: 1px solid var(--line);
}

.tool-info h2 {
    margin-top: 48px;
    font-size: 26px;
}

.tool-info > h2:first-child {
    margin-top: 0;
}

.tool-info h3 {
    margin-top: 26px;
}

.tool-info p,
.tool-info li {
    font-size: 16.5px;
}

.tool-info ul,
.tool-info ol {
    padding-left: 22px;
}

.tool-info li {
    margin-bottom: 8px;
    color: var(--muted);
}

.tool-info kbd {
    padding: 2px 7px;
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: var(--panel);
    color: var(--text);
    font: 12.5px var(--mono);
}

.tool-info code {
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--accent-soft);
    color: var(--accent-text);
    font: .92em var(--mono);
}

/* Code examples */
.tool-example {
    margin: 12px 0 22px;
    padding: 16px 18px;
    overflow-x: auto;
    background: var(--code-bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    font: 13.5px/1.65 var(--mono);
    tab-size: 2;
}

.tool-info .tool-example code {
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
}

.tool-example-label {
    margin: 22px 0 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--text);
}

/* FAQ accordion (native details/summary) */
.tool-faq details {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    transition: border-color .2s ease;
}

.tool-faq details:hover,
.tool-faq details[open] {
    border-color: var(--line-strong);
}

.tool-faq details + details {
    margin-top: 10px;
}

.tool-faq summary {
    padding: 15px 18px;
    cursor: pointer;
    font-weight: 650;
    color: var(--text);
}

.tool-faq details[open] summary {
    border-bottom: 1px solid var(--line);
}

.tool-faq details p {
    margin: 0;
    padding: 15px 18px;
}

/* Related links */
.tool-info .tool-related {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.tool-info .tool-related li {
    margin: 0;
}

.tool-related a {
    display: inline-block;
    padding: 9px 16px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--panel);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    transition: border-color .2s ease, background .2s ease;
}

.tool-related a:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* ------------------------------------------------------------------ */
/* Responsive layout                                                   */
/* ------------------------------------------------------------------ */

@media (max-width: 720px) {
    .tool-page {
        margin: 8px auto 28px;
    }

    .tool-intro {
        font-size: 17px;
    }

    .tool-workspace {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .tool-editor {
        min-height: 280px;
        padding: 14px;
    }

    .tool-panel-header {
        padding: 12px 14px;
    }

    .tool-actions {
        align-items: stretch;
    }

    .tool-group {
        width: 100%;
    }

    /* Primary actions share the row evenly; options sit below. */
    .tool-group > button {
        flex: 1 1 auto;
    }

    /* Indent label + select fill one row; the two buttons share the next. */
    .tool-group-end select {
        flex: 1 1 calc(100% - 90px);
    }

    .tool-info {
        margin-top: 44px;
    }
}

@media (max-width: 420px) {
    .tool-actions button,
    .tool-actions select {
        padding: 9px 12px;
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tool-actions button,
    .tool-actions select,
    .tool-panel,
    .tool-faq details,
    .tool-related a {
        transition: none;
    }
}

/* ------------------------------------------------------------------ */
/* Directory: search, category filters and tool list                   */
/* ------------------------------------------------------------------ */

/* Without JavaScript only the plain list shows. */
.tools-filters,
.tools-controls,
.tools-status {
    display: none;
}

.js .tools-filters { display: block; }
.js .tools-controls { display: flex; }
.js .tools-status { display: block; }

.tools-layout {
    margin-top: 28px;
}

.js .tools-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    margin-top: 18px;
}

.tools-filters,
.tools-main {
    min-width: 0;
}

/* Categories are one row of filter chips above the list (no second sidebar). */
.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.category-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 6px 10px 6px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.category-btn .icon {
    flex: none;
    width: 18px;
    height: 18px;
    color: var(--accent-text);
}

.category-btn:hover {
    border-color: var(--line-strong);
    background: var(--panel);
}

.category-btn[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-text);
}

.category-name {
    min-width: 0;
}

.category-count {
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.category-btn[aria-pressed="true"] .category-count {
    background: var(--surface);
    color: var(--accent-text);
}

.tools-controls {
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.tools-search {
    position: relative;
    flex: 1 1 280px;
}

.tools-search .icon {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 20px;
    height: 20px;
    color: var(--muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.tools-search input {
    width: 100%;
    min-height: 48px;
    padding: 10px 44px 10px 44px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
}

.tools-search input:focus-visible,
.tools-sort select:focus-visible,
.category-btn:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.tools-search kbd {
    position: absolute;
    top: 50%;
    right: 12px;
    min-width: 24px;
    padding: 1px 7px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--panel);
    color: var(--muted);
    font: 600 13px var(--mono);
    text-align: center;
    transform: translateY(-50%);
}

.tools-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.tools-sort select {
    min-height: 48px;
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
}

.tools-status {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.tool-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tool-list[hidden],
.tools-empty[hidden],
.tool-item[hidden] {
    display: none;
}

.tool-item > .card {
    height: 100%;
}

.card-title {
    margin: 8px 0 8px;
    font-size: 20px;
    letter-spacing: -.01em;
}

.tools-empty {
    padding: 40px 24px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    text-align: center;
}

.tools-empty h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.tools-empty p {
    margin: 0 0 16px;
    color: var(--muted);
}

@media (max-width: 860px) {
    /* On phones the chips become one swipeable row. */
    .category-list {
        flex-wrap: nowrap;
        padding-bottom: 6px;
        overflow-x: auto;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }
}


/* App promo card (links to our iOS apps from a tool page)             */
/* ------------------------------------------------------------------ */

.app-promo {
    display: flex;
    align-items: center;
    gap: 22px;
    margin: 30px 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.app-promo .product-icon {
    flex: none;
    margin: 0;
}

.app-promo-text {
    flex: 1;
    min-width: 0;
}

.app-promo-text h2 {
    margin: 8px 0 6px;
    font-size: 22px;
    letter-spacing: -.01em;
}

.app-promo-text p {
    margin: 0;
    color: var(--muted);
}

.app-promo .button {
    flex: none;
}

@media (max-width: 860px) {
    .app-promo {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .app-promo .button {
        width: 100%;
        text-align: center;
    }
}

/* ------------------------------------------------------------------ */
/* Free Tools page: Most used and Browse by category                   */
/* ------------------------------------------------------------------ */

.hub-section {
    margin-top: 34px;
}

.hub-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 18px;
    margin-bottom: 14px;
}

.hub-head h2 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -.01em;
}

.hub-head p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.hub-head-spaced {
    margin-top: 44px;
}

.most-used {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: 10px 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.most-used-item {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    padding: 10px 16px 10px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.most-used-item:hover,
.most-used-item:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 6px 20px rgba(37, 99, 235, .12);
}

.most-used-item:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.most-used-rank {
    flex: none;
    width: 26px;
    color: var(--muted);
    font: 700 13px var(--mono);
}

.most-used-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-text);
}

.most-used-icon .icon {
    width: 21px;
    height: 21px;
}

.most-used-text {
    display: grid;
    flex: 1;
    min-width: 0;
}

.most-used-text strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.most-used-text span {
    color: var(--muted);
    font-size: 13px;
}

.most-used-item > .icon {
    flex: none;
    width: 18px;
    height: 18px;
    color: var(--accent-text);
}

.category-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.category-tile {
    display: grid;
    gap: 4px;
    height: 100%;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: border-color .2s ease, transform .2s ease;
}

.category-tile:hover,
.category-tile:focus-visible {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.category-tile:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.category-tile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 8px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent-text);
}

.category-tile-icon .icon {
    width: 22px;
    height: 22px;
}

.category-tile span:last-child {
    color: var(--muted);
    font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
    .category-tile:hover,
    .category-tile:focus-visible {
        transform: none;
    }
}

/* Keep text colours on hover: the site-wide a:hover rule would otherwise recolour these links. */
.most-used-item:hover,
.most-used-item:focus-visible,
.category-tile:hover,
.category-tile:focus-visible {
    color: var(--text);
}

/* Homepage */
.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    padding: 36px 0 12px;
}

.home-hero h1 {
    margin: 10px 0 16px;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.05;
    letter-spacing: -.03em;
}

.home-hero h1 span {
    display: block;
    color: var(--accent-text);
}

.home-lead {
    max-width: 600px;
    margin: 0 0 22px;
    font-size: 17px;
}

.home-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 26px 0 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    list-style: none;
}

.home-stats li {
    padding: 14px 16px;
}

.home-stats li + li {
    border-left: 1px solid var(--line);
}

.home-stats strong {
    display: block;
    color: var(--text);
    font-size: 30px;
    line-height: 1.1;
    letter-spacing: -.02em;
}

.home-stats span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sponsor-panel {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}

.sponsor-panel h2 {
    margin: 6px 0 10px;
    font-size: 22px;
}

.sponsor-panel p {
    margin: 0 0 16px;
    font-size: 15px;
}

.sponsor-slot {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 2px dashed var(--line-strong);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
}

.sponsor-slot:hover,
.sponsor-slot:focus-visible {
    border-color: var(--accent);
    color: var(--text);
}

.sponsor-slot strong {
    display: block;
    font-size: 16px;
}

.sponsor-slot span span {
    color: var(--muted);
    font-size: 14px;
}

.sponsor-plus {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 24px;
    font-weight: 700;
}

.home-chips {
    margin: 10px 0 0;
}

@media (max-width: 960px) {
    .home-hero {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 480px) {
    .home-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .home-stats li:nth-child(3) {
        border-left: 0;
    }
    .home-stats li:nth-child(n+3) {
        border-top: 1px solid var(--line);
    }
}

.home-search {
    position: relative;
    max-width: 640px;
    margin: 0;
}

.home-search .icon {
    position: absolute;
    top: 50%;
    left: 18px;
    width: 20px;
    height: 20px;
    color: var(--muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.home-search input {
    width: 100%;
    padding: 16px 18px 16px 48px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 16px;
    box-shadow: var(--shadow-sm);
}

.home-search input:focus-visible {
    border-color: var(--accent);
    outline: none;
    box-shadow: var(--ring);
}

.home-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}

.home-chip .icon {
    width: 16px;
    height: 16px;
    color: var(--accent-text);
}

.home-chip span {
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 12px;
}

.home-chip:hover,
.home-chip:focus-visible {
    border-color: var(--accent);
    color: var(--text);
}

.cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cat-head h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.cat-head .count {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 13px;
    font-weight: 700;
}

.home-tools {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-tool {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    height: 100%;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
}

.home-tool:hover,
.home-tool:focus-visible {
    border-color: var(--accent);
    color: var(--text);
}

.home-tool-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.home-tool-text span {
    color: var(--muted);
    font-size: 14px;
}

.home-empty {
    padding: 48px 0;
    text-align: center;
}

[hidden] {
    display: none !important;
}

@media (max-width: 560px) {
    .category-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.cat-head > a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 6px;
    font-weight: 650;
    white-space: nowrap;
}

#home-results .hub-section,
#privacy.hub-section {
    padding: 22px 0;
    margin: 0;
}
