:root {
    --home-bg: #090f1f;
    --home-panel: rgba(20, 31, 51, 0.78);
    --home-panel-strong: rgba(25, 38, 63, 0.9);
    --home-line: rgba(148, 163, 184, 0.18);
    --home-line-strong: rgba(148, 163, 184, 0.28);
    --home-text: #e8eef8;
    --home-muted: #93a4ba;
    --home-soft: #c6d3e4;
    --home-radius: 8px;
    --home-shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
}

body {
    background: var(--home-bg);
}

.toolhome-shell {
    min-height: 760px;
    color: var(--home-text);
    font-family: "Manrope", "Inter", "Segoe UI", sans-serif;
    background:
        linear-gradient(90deg, rgba(37, 99, 235, 0.08) 0 1px, transparent 1px) 0 0 / 58px 58px,
        radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--home-accent) 18%, transparent), transparent 34%),
        radial-gradient(circle at 78% 6%, rgba(56, 213, 255, 0.1), transparent 31%),
        linear-gradient(180deg, #0a1020 0%, #0d1426 48%, #090f1f 100%);
}

.toolhome-layout {
    display: grid;
    grid-template-columns: 206px minmax(0, 1fr) 292px;
    min-height: 760px;
    border-top: 1px solid var(--home-line);
}

.toolhome-leftbar,
.toolhome-rightbar {
    min-width: 0;
    border-color: var(--home-line);
    background: linear-gradient(180deg, rgba(12, 20, 36, 0.94), rgba(10, 17, 32, 0.86));
}

.toolhome-leftbar {
    padding: 18px 10px 24px;
    border-right: 1px solid var(--home-line);
}

.toolhome-rightbar {
    padding: 24px 14px;
    border-left: 1px solid var(--home-line);
}

.toolhome-main {
    min-width: 0;
    padding: 24px 34px 38px;
}

.toolhome-mobile-rail {
    display: none;
}

.toolhome-mobile-details,
.toolhome-load-all {
    display: none;
}

.toolhome-nav-card h2,
.why-card h2,
.new-tools-card h2 {
    margin: 0 0 12px;
    color: #f8fbff;
    font-size: 0.95rem;
    font-weight: 900;
}

.toolhome-category-list {
    display: grid;
    gap: 5px;
}

.toolhome-category-link {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: var(--home-radius);
    color: #d7e0ed;
    font-size: 0.84rem;
    font-weight: 800;
    text-decoration: none;
}

.toolhome-category-link.active,
.toolhome-category-link:hover {
    border-color: color-mix(in srgb, var(--home-accent) 32%, transparent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--home-accent) 18%, transparent), rgba(56, 213, 255, 0.05));
    color: #ffffff;
}

.toolhome-category-icon,
.tool-card-icon,
.row-icon,
.why-card li span,
.new-tools-card a span,
.toolhome-hero-icon {
    display: grid;
    place-items: center;
    border-radius: var(--home-radius);
    background: color-mix(in srgb, var(--home-accent) 22%, transparent);
    color: color-mix(in srgb, var(--home-accent) 78%, #ffffff);
}

.toolhome-category-icon {
    width: 28px;
    height: 28px;
}

.toolhome-category-link small {
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #9fb3ca;
    font-size: 0.68rem;
    font-style: normal;
}

.toolhome-premium-card,
.why-card,
.new-tools-card,
.toolhome-ad,
.toolhome-newsletter {
    border: 1px solid var(--home-line-strong);
    border-radius: var(--home-radius);
    background: linear-gradient(180deg, rgba(28, 40, 64, 0.82), rgba(17, 26, 44, 0.84));
    box-shadow: var(--home-shadow);
}

.toolhome-premium-card {
    margin-top: 26px;
    padding: 14px;
}

.premium-mark {
    color: #f6b43f;
}

.toolhome-premium-card h3 {
    margin: 8px 0 8px;
    color: #ffffff;
    font-size: 0.92rem;
}

.toolhome-premium-card p,
.toolhome-premium-card li,
.why-card small,
.new-tools-card small {
    color: var(--home-muted);
    font-size: 0.78rem;
    line-height: 1.55;
}

.toolhome-premium-card p {
    margin: 0 0 12px;
}

.toolhome-premium-card ul {
    display: grid;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.toolhome-premium-card li i {
    color: #25d983;
    margin-right: 7px;
}

.toolhome-premium-card button,
.toolhome-search button,
.toolhome-newsletter button {
    min-height: 38px;
    border: 0;
    border-radius: 7px;
    background: linear-gradient(135deg, var(--home-accent), #237bff);
    color: #ffffff;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 900;
    cursor: pointer;
}

.toolhome-premium-card button {
    width: 100%;
}

.toolhome-ad {
    display: grid;
    place-items: center;
    min-height: 88px;
    margin-bottom: 18px;
    border-style: dashed;
    text-align: center;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--home-accent) 12%, transparent), rgba(8, 145, 178, 0.08)),
        rgba(15, 23, 42, 0.34);
}

.toolhome-ad strong,
.toolhome-ad span,
.toolhome-ad small {
    display: block;
}

.toolhome-ad strong {
    color: #dbeafe;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.toolhome-ad span {
    margin-top: 5px;
    color: color-mix(in srgb, var(--home-accent) 72%, #ffffff);
    font-size: 1rem;
    font-weight: 900;
}

.toolhome-ad small {
    margin-top: 5px;
    color: #64748b;
    font-size: 0.74rem;
}

.top-ad {
    min-height: 76px;
}

.mid-ad,
.bottom-ad {
    margin: 18px 0;
}

.sidebar-ad {
    min-height: 250px;
    margin-top: 22px;
}

.toolhome-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
    color: #8a9ab1;
    font-size: 0.78rem;
}

.toolhome-breadcrumbs a {
    color: #70b5ff;
    text-decoration: none;
    font-weight: 850;
}

.toolhome-breadcrumbs li:not(:last-child)::after {
    content: ">";
    margin-left: 7px;
    color: #506176;
}

.toolhome-hero {
    margin-bottom: 18px;
}

.toolhome-identity {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.toolhome-hero-icon {
    width: 64px;
    height: 64px;
    border: 1px solid color-mix(in srgb, var(--home-accent) 28%, transparent);
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.22), transparent 28%),
        linear-gradient(135deg, var(--home-accent), #237bff);
    color: #ffffff;
    font-size: 1.8rem;
    box-shadow: 0 18px 36px color-mix(in srgb, var(--home-accent) 20%, transparent);
}

.toolhome-title-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.toolhome-title-row h1 {
    margin: 0;
    color: #ffffff;
    font-size: 1.72rem;
    line-height: 1.14;
}

.toolhome-title-row span {
    padding: 5px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--home-accent) 18%, transparent);
    color: color-mix(in srgb, var(--home-accent) 74%, #ffffff);
    font-size: 0.76rem;
    font-weight: 900;
}

.toolhome-hero p {
    max-width: 820px;
    margin: 7px 0 0;
    color: #d4dfed;
    font-size: 0.94rem;
    line-height: 1.55;
}

.toolhome-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.toolhome-pills li {
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.6);
    color: #cbd5e1;
    font-size: 0.74rem;
    font-weight: 850;
}

.toolhome-pills i {
    color: #25d983;
    margin-right: 5px;
}

.toolhome-search {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 96px;
    align-items: center;
    min-height: 46px;
    margin-bottom: 18px;
    border: 1px solid var(--home-line-strong);
    border-radius: var(--home-radius);
    background: rgba(15, 23, 42, 0.72);
    overflow: hidden;
}

.toolhome-search i {
    color: var(--home-muted);
    text-align: center;
}

.toolhome-search input {
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #e2e8f0;
    font: inherit;
    font-size: 0.88rem;
}

.toolhome-section {
    margin-top: 18px;
}

.toolhome-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.toolhome-section-head h2 {
    margin: 0;
    color: #f8fbff;
    font-size: 1rem;
    font-weight: 900;
}

.toolhome-section-head h2 i {
    color: var(--home-accent);
}

.toolhome-section-head a,
.result-count {
    color: color-mix(in srgb, var(--home-accent) 72%, #ffffff);
    font-size: 0.78rem;
    font-weight: 900;
    text-decoration: none;
}

.popular-tool-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.popular-tool-card,
.all-tool-row {
    border: 1px solid var(--home-line-strong);
    border-radius: var(--home-radius);
    background: linear-gradient(180deg, rgba(28, 40, 64, 0.82), rgba(17, 26, 44, 0.84));
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}

.popular-tool-card {
    position: relative;
    min-height: 180px;
    padding: 14px;
    overflow:hidden;
    display:flex;
    flex-direction:column;
    gap:10px;
}

.popular-tool-card::before {
    content:"";
    position:absolute;
    inset:0;
    pointer-events:none;
    background:
        radial-gradient(circle at 16% 12%, color-mix(in srgb, var(--home-accent) 14%, transparent), transparent 36%),
        linear-gradient(135deg, transparent, color-mix(in srgb, var(--home-accent) 7%, transparent));
}

.popular-tool-card > * {
    position:relative;
    z-index:1;
}

.tool-card-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

.tool-card-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    color: #f6b43f;
    font-size: 0.7rem;
    font-weight: 900;
}

.tool-card-badge.live {
    color: #25d983;
}

.popular-tool-card h3 {
    margin: 4px 0 0;
    color: #f8fbff;
    font-size: 0.92rem;
}

.popular-tool-card p {
    flex:1;
    min-height: 48px;
    margin: 0;
    color: var(--home-muted);
    font-size: 0.78rem;
    line-height: 1.5;
    overflow:hidden;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:3;
}

.popular-tool-card a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--home-accent) 16%, transparent);
    color: color-mix(in srgb, var(--home-accent) 76%, #ffffff);
    font-size: 0.74rem;
    font-weight: 900;
    text-decoration: none;
    align-self:flex-end;
}

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

.all-tool-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto 16px;
    align-items: center;
    gap: 10px;
    min-height: 62px;
    padding: 10px 12px;
    color: inherit;
    text-decoration: none;
}

.all-tool-row:hover,
.popular-tool-card:hover {
    border-color: color-mix(in srgb, var(--home-accent) 38%, transparent);
    transform: translateY(-1px);
}

.row-icon {
    width: 34px;
    height: 34px;
}

.all-tool-row strong {
    display: block;
    overflow: hidden;
    color: #f8fbff;
    font-size: 0.86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.all-tool-row small {
    display: block;
    overflow: hidden;
    color: var(--home-muted);
    font-size: 0.73rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.all-tool-row em {
    color: #f6b43f;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 900;
}

.all-tool-row em.live {
    color: #25d983;
}

.all-tool-row > i {
    color: #64748b;
    font-size: 0.76rem;
}

.toolhome-newsletter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
    gap: 16px;
    align-items: center;
    margin-top: 22px;
    padding: 18px;
    background:
        radial-gradient(circle at 92% 20%, color-mix(in srgb, var(--home-accent) 22%, transparent), transparent 26%),
        linear-gradient(135deg, rgba(37, 99, 235, 0.35), color-mix(in srgb, var(--home-accent) 40%, rgba(15, 23, 42, 0.9)));
}

.toolhome-newsletter h2 {
    margin: 0 0 6px;
    color: #ffffff;
    font-size: 1rem;
}

.toolhome-newsletter p {
    margin: 0;
    color: #dbeafe;
    font-size: 0.82rem;
}

.toolhome-newsletter form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px;
    gap: 10px;
}

.toolhome-newsletter input {
    min-height: 40px;
    min-width: 0;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    font: inherit;
}

.why-card,
.new-tools-card {
    padding: 16px;
    margin-bottom: 16px;
}

.why-card ul {
    display: grid;
    gap: 13px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.why-card li {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
}

.why-card li span {
    width: 34px;
    height: 34px;
    grid-row: span 2;
}

.why-card strong,
.new-tools-card strong {
    display: block;
    color: #f8fbff;
    font-size: 0.84rem;
}

.why-card small {
    display: block;
}

.new-tools-card > div {
    display: grid;
    gap: 8px;
}

.category-tools-card > div {
    max-height: calc(100dvh - 150px);
    overflow-y: auto;
    padding-right: 4px;
}

.new-tools-card a {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    color: inherit;
    text-decoration: none;
}

.category-tools-card a {
    min-height: 54px;
    padding: 9px 0;
    border-bottom: 1px solid var(--home-line);
}

.category-tools-card a:last-child {
    border-bottom: 0;
}

.category-tools-card strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.new-tools-card a span {
    width: 32px;
    height: 32px;
}

.new-tools-card small {
    color: #f6b43f;
    font-weight: 900;
}

.new-tools-card a:hover strong {
    color: color-mix(in srgb, var(--home-accent) 74%, #ffffff);
}

[data-tool-card].is-hidden {
    display: none !important;
}

@media (max-width: 1220px) {
    .toolhome-layout {
        grid-template-columns: 194px minmax(0, 1fr);
    }

    .toolhome-rightbar {
        display: none;
    }
}

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

    .toolhome-leftbar {
        border-right: 0;
        border-bottom: 1px solid var(--home-line);
    }

    .toolhome-rightbar {
        display: block;
        border-left: 0;
        border-top: 1px solid var(--home-line);
    }

    .toolhome-main {
        padding: 24px 16px;
    }

    .popular-tool-grid,
    .all-tool-grid,
    .toolhome-newsletter {
        grid-template-columns: 1fr;
    }

    .toolhome-newsletter form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .toolhome-identity {
        grid-template-columns: 1fr;
    }

    .toolhome-search {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .toolhome-search button {
        grid-column: 1 / -1;
        border-radius: 0;
    }

    .all-tool-row {
        grid-template-columns: 34px minmax(0, 1fr) 16px;
    }

    .all-tool-row em {
        display: none;
    }
}

/* Popular cards compact horizontal layout */
.popular-tool-card{
    min-height:132px;
    display:grid;
    grid-template-columns:56px minmax(0, 1fr) auto;
    grid-template-rows:auto 1fr auto;
    column-gap:14px;
    align-items:start;
    padding:16px;
}

.popular-tool-card .tool-card-icon{
    grid-column:1;
    grid-row:1 / span 2;
    width:52px;
    height:52px;
    font-size:1.35rem;
}

.popular-tool-card .tool-card-badge{
    grid-column:3;
    grid-row:1;
    position:static;
    justify-self:end;
    align-self:start;
}

.popular-tool-card h3{
    grid-column:2;
    grid-row:1;
    margin:3px 0 6px;
}

.popular-tool-card p{
    grid-column:2 / 4;
    grid-row:2;
    min-height:0;
    margin:0;
}

.popular-tool-card a{
    grid-column:3;
    grid-row:3;
    justify-self:end;
    align-self:end;
    margin-top:12px;
}

@media(max-width:700px){
    .popular-tool-card{
        grid-template-columns:48px minmax(0, 1fr);
        grid-template-rows:auto auto auto;
        min-height:122px;
        padding:14px;
    }

    .popular-tool-card .tool-card-icon{
        width:46px;
        height:46px;
        font-size:1.18rem;
    }

    .popular-tool-card .tool-card-badge{
        grid-column:2;
        grid-row:1;
    }

    .popular-tool-card h3{
        grid-column:2;
        grid-row:1;
        padding-right:70px;
    }

    .popular-tool-card p{
        grid-column:1 / 3;
        grid-row:2;
        margin-top:10px;
    }

    .popular-tool-card a{
        grid-column:2;
        grid-row:3;
    }
}

/* Popular card full-height icon rail */
.popular-tool-card{
    grid-template-columns:72px minmax(0, 1fr) auto;
    column-gap:14px;
    padding:0 16px 14px 0;
    overflow:hidden;
}

.popular-tool-card .tool-card-icon{
    grid-column:1;
    grid-row:1 / 4;
    width:72px;
    height:100%;
    min-height:132px;
    align-self:stretch;
    border-radius:0;
    border-right:1px solid var(--home-line-strong);
    font-size:1.55rem;
}

.popular-tool-card .tool-card-badge{
    margin-top:14px;
}

.popular-tool-card h3{
    margin-top:18px;
}

.popular-tool-card a{
    margin-bottom:0;
}

body:not(.theme-dark) .popular-tool-card .tool-card-icon{
    background:linear-gradient(180deg, color-mix(in srgb, var(--home-accent) 18%, #ffffff), rgba(255,255,255,.72)) !important;
    border-right-color:color-mix(in srgb, var(--home-accent) 18%, rgba(29,55,88,.14)) !important;
}

body.theme-dark .popular-tool-card .tool-card-icon{
    background:linear-gradient(180deg, color-mix(in srgb, var(--home-accent) 28%, rgba(15,23,42,.82)), rgba(15,23,42,.42));
}

@media(max-width:700px){
    .popular-tool-card{
        grid-template-columns:62px minmax(0, 1fr);
        padding:0 14px 14px 0;
    }

    .popular-tool-card .tool-card-icon{
        width:62px;
        min-height:122px;
    }

    .popular-tool-card h3{
        margin-top:16px;
    }
}
