:root {
    --bg: #eff6ff;
    --surface: #ffffff;
    --ink: #0b1742;
    --muted: #536482;
    --line: #dbe6f3;
    --blue: #0866ff;
    --blue-dark: #0754d4;
    --blue-soft: #e8f2ff;
    --ad-lavender: #eeeafe;
    --ad-gold: #fff5d9;
    --ad-mint: #e7f8ee;
    --shadow: 0 10px 24px rgba(11, 23, 66, 0.05);
    --radius: 18px;
    --wrap: 1120px;
    --header: 74px;
    --text-hero: clamp(1.7rem, 3.05vw, 2.7rem);
    --text-section: 1.5rem;
    --text-card: 1.02rem;
    --text-body: 0.95rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(520px 280px at 8% 120px, rgba(190, 216, 255, 0.45), transparent 70%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 320px, #f5f9ff 100%);
    font-family: Inter, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: absolute;
    inset: var(--header) 0 auto 0;
    height: 560px;
    background:
        radial-gradient(420px 280px at -6% 22%, rgba(176, 208, 255, 0.42), transparent 72%),
        radial-gradient(380px 260px at 108% 0%, rgba(214, 228, 255, 0.7), transparent 74%);
    pointer-events: none;
    z-index: 0;
}

body,
.site-header,
main {
    position: relative;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

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

h1,
h2,
h3,
p {
    margin-top: 0;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -48px;
    z-index: 80;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--blue-dark);
    color: #fff;
    text-decoration: none;
}

.skip-link:focus {
    top: 12px;
}

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

.wrap {
    width: min(var(--wrap), calc(100% - 32px));
    margin-inline: auto;
}

.site-header,
main,
.site-footer {
    z-index: 1;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.header__bar {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: var(--header);
    flex-wrap: wrap;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
    color: var(--ink);
}

.logo__nimb,
.logo__tools {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1;
}

.logo__nimb {
    color: var(--blue);
}

.logo__tools {
    color: var(--ink);
}

.nav-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    order: 2;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 10px;
    border-radius: 8px;
    color: #334155;
    font-weight: 500;
    font-size: 0.96rem;
    text-decoration: none;
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--blue-dark);
}

.header-search {
    display: flex;
    align-items: center;
    margin-left: auto;
    min-width: 190px;
    padding: 4px 4px 4px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
}

.header-search input {
    width: 128px;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 0.9rem;
}

.header-search input::placeholder {
    color: #94a3b8;
}

.header-search button {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.header-search:focus-within {
    border-color: #bfd4ff;
    box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.12);
}

.header__signin {
    order: 3;
}

.menu-toggle {
    display: none;
    order: 4;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
}

.menu-toggle__close {
    display: none;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__open {
    display: none;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__close {
    display: inline-flex;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.btn--ghost {
    border: 1.5px solid var(--blue);
    background: #fff;
    color: var(--blue);
}

.btn--ghost:hover {
    background: #f3f7ff;
}

.btn--signin,
.btn--primary {
    border: 0;
    background: var(--blue);
    color: #fff;
    box-shadow: 0 8px 16px rgba(8, 102, 255, 0.22);
}

.btn--signin {
    min-height: 38px;
    padding: 8px 16px;
    border-radius: 10px;
}

.btn--signin:hover,
.btn--primary:hover {
    background: var(--blue-dark);
}

.btn--action {
    border: 0;
    background: linear-gradient(180deg, #1ad392 0%, #0b9a68 100%);
    color: #fff;
    box-shadow: 0 8px 16px rgba(11, 154, 104, 0.32);
}

.btn--action:hover {
    filter: brightness(1.07);
}

.page-stack {
    padding: 22px 0 48px;
}

.page-intro-wrap {
    padding-top: 28px;
}

.hero {
    padding: 28px 0 8px;
    text-align: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: #2a62dc;
    font-size: 0.78rem;
    font-weight: 700;
}

.hero h1,
.page-intro h1,
.holding h1,
.prose h1 {
    margin: 14px 0 12px;
    font-size: clamp(2.05rem, 4.6vw, 3.3rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.12;
}

.hero h1 {
    font-size: var(--text-hero);
    white-space: nowrap;
    color: var(--ink);
}

.hero__blue {
    color: var(--blue);
}

.benefit-icon {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: none;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
}

.benefit-icon svg {
    width: 16px;
    height: 16px;
}

.page-intro h1,
.holding h1,
.prose h1 {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.hero__lede,
.page-intro p,
.cta p,
.holding p,
.prose p {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.65;
}

.hero__lede {
    max-width: 640px;
    margin: 0 auto 22px;
}

.hero-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(680px, 100%);
    margin: 0 auto;
    padding: 6px 6px 6px 18px;
    border: 1px solid #d5e3f4;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(11, 23, 66, 0.06);
}

.hero-search--left {
    margin: 8px 0 22px;
}

.hero-search input {
    flex: 1;
    min-width: 0;
    padding: 10px 0;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 0.98rem;
}

.hero-search input::placeholder {
    color: #94a3b8;
}

.hero-search button {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    cursor: pointer;
}

.hero-search button:hover {
    background: var(--blue-dark);
}

.hero-search:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(8, 102, 255, 0.16);
}

.benefits {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 22px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.benefits li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #3e4e68;
    font-size: 0.92rem;
    font-weight: 600;
}

.section {
    margin-top: 26px;
}

.section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.section h2,
.trust h2,
.empty-state h2,
.empty-state h3 {
    margin-bottom: 4px;
    color: var(--ink);
    font-size: var(--text-section);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.section--categories {
    margin-top: 32px;
}

.selection-note {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: var(--text-body);
}

.section__note {
    max-width: 640px;
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.text-link {
    color: var(--blue);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.text-link:hover {
    text-decoration: underline;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.tool-card,
.category-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px 16px 14px;
    border: 1px solid #d7e3f2;
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 8px 20px rgba(11, 23, 66, 0.045);
    text-decoration: none;
}

.category-card {
    align-items: center;
    min-height: 158px;
    padding: 18px 14px 16px;
    text-align: center;
}

.category-card__icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 10px;
    border-radius: 16px;
    background: var(--blue-soft);
    color: var(--blue);
}

.category-card__icon svg {
    width: 28px;
    height: 28px;
}

.category-card__title {
    display: -webkit-box;
    margin: 0 0 4px;
    overflow: hidden;
    color: var(--ink);
    font-size: var(--text-card);
    font-weight: 700;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.category-card__count {
    margin: auto 0 0;
    color: #6b7c95;
    font-size: 0.9rem;
    font-weight: 600;
}

.category-card:hover {
    border-color: #c5d8f5;
    box-shadow: 0 12px 24px rgba(8, 102, 255, 0.08);
}

.tool-card--preview {
    cursor: default;
}

.tool-card--link {
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.tool-card--link:hover {
    border-color: #c5d8f5;
    box-shadow: 0 14px 28px rgba(8, 102, 255, 0.1);
    transform: translateY(-2px);
}

.tool-card--link:focus-visible,
.category-card:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
}

.icon-tile {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 10px;
    border-radius: 14px;
    background: var(--blue-soft);
    color: var(--blue);
}

.icon-tile svg {
    width: 24px;
    height: 24px;
}

.icon-tile--sky {
    background: #e5f3ff;
}

.icon-tile--mist {
    background: #f2f6fb;
    color: var(--ink);
}

.icon-tile--rose {
    background: #ffecec;
    color: #e11d48;
}

.tool-card__category {
    margin: 0 0 4px;
    color: var(--blue);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.tool-card__title {
    display: -webkit-box;
    min-height: 2.6em;
    margin-bottom: 6px;
    overflow: hidden;
    color: var(--ink);
    font-size: var(--text-card);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tool-card__text,
.tool-card__count {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
}

.tool-card__text {
    display: -webkit-box;
    min-height: 2.8em;
    overflow: hidden;
    color: var(--muted);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tool-card__status {
    margin: 10px 0 0;
    color: #8a4b12;
    font-size: 0.8125rem;
    font-weight: 700;
}

.tool-card__status--live {
    color: #17693a;
}

.ad {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: min(100%, 728px);
    min-height: 90px;
    margin: 8px auto 0;
    padding: 18px 88px 22px;
    border: 1px solid transparent;
    border-radius: 14px;
    text-align: center;
}

.ad__title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 800;
}

.ad__note {
    margin: 2px 0 0;
    font-size: 0.84rem;
}

.ad__by {
    position: absolute;
    right: 14px;
    bottom: 8px;
    margin: 0;
    font-size: 0.68rem;
    opacity: 0.85;
}

.ad--lavender {
    border-color: #ddd6fb;
    background: var(--ad-lavender);
    color: #4c3fb5;
}

.ad--gold,
.ad--amber {
    border-color: #f0e0aa;
    background: var(--ad-gold);
    color: #8a5a10;
}

.ad--green,
.ad--mint {
    border-color: #bfe8cc;
    background: var(--ad-mint);
    color: #17693a;
}

.ad--after-tools {
    margin-top: 32px;
    margin-bottom: 0;
}

.ad--after-cta {
    margin-top: 36px;
    margin-bottom: 0;
}

.ad--red {
    border-color: #f6c9c9;
    background: #fdecec;
    color: #b42318;
}

.ad--box {
    width: min(100%, 300px);
    min-height: 250px;
    margin: 0;
    padding: 24px 18px 36px;
}

.ad--banner {
    width: min(100%, 728px);
    min-height: 90px;
}

.cta {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 12px;
    align-items: center;
    margin-top: 36px;
    padding: 40px 44px;
    border: 1px solid #d7e6f8;
    border-radius: 28px;
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 58%, #e7f1ff 100%);
    box-shadow: 0 16px 36px rgba(11, 23, 66, 0.06);
}

.cta h2 {
    margin-bottom: 8px;
    font-size: clamp(1.6rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.cta p {
    margin-bottom: 18px;
}

.cta__art {
    display: flex;
    justify-content: center;
}

.cta__svg {
    width: min(100%, 340px);
    height: auto;
}

.trust {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 36px;
    padding-top: 4px;
}

.trust article {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 4px 0 0;
}

.trust h2 {
    margin: 0 0 4px;
    font-size: 1.05rem;
}

.trust p {
    margin: 0;
    color: var(--muted);
}

.site-footer {
    background: #fff;
    border-top: 1px solid var(--line);
}

.footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px 36px;
    padding: 42px 0 24px;
}

.footer__tagline {
    max-width: 240px;
    margin: 12px 0 16px;
    color: var(--muted);
    line-height: 1.45;
}

.social {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.social__icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #52627a;
}

.social__icon svg {
    width: 16px;
    height: 16px;
}

.footer__heading {
    margin: 4px 0 14px;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 800;
}

.footer__links {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer__links a {
    color: var(--muted);
    font-size: 0.95rem;
    text-decoration: none;
}

.footer__links a:hover {
    color: var(--blue-dark);
}

.footer__base {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0 18px;
    border-top: 1px solid var(--line);
    color: #7b8ba0;
    font-size: 0.84rem;
}

.footer__base p {
    margin: 0;
}

.footer__credit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.footer__heart {
    display: inline-flex;
    color: #ef4444;
}

.footer__heart svg {
    width: 14px;
    height: 14px;
}

.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 0.88rem;
}

.crumbs a {
    color: var(--blue);
    text-decoration: none;
}

.page-intro {
    max-width: 760px;
    margin-bottom: 22px;
}

.empty-state,
.holding,
.prose {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--shadow);
}

.prose .empty-state {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.empty-state p,
.holding__note {
    color: var(--muted);
}

.empty-state .btn,
.holding .btn {
    margin-top: 8px;
}

.holding__category {
    margin-top: -4px;
    color: var(--blue);
    font-weight: 700;
}

.catalog-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.catalog-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    text-decoration: none;
}

a.catalog-row:hover {
    border-color: #cfe0ff;
}

.catalog-row__name,
.catalog-row__meta {
    display: block;
}

.catalog-row__name {
    font-weight: 700;
}

.catalog-row__meta {
    color: var(--muted);
    font-size: 0.86rem;
}

.status {
    padding: 4px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.status--live {
    background: #e8f8ee;
    color: #166534;
}

.result-count {
    margin-bottom: 14px;
    color: var(--muted);
}

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 22px;
}

.pager__btn {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
}

.pager__btn.is-disabled {
    color: #94a3b8;
}

.pager__status {
    color: var(--muted);
    font-size: 0.9rem;
}

:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

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

    .footer__grid {
        grid-template-columns: 1fr 1fr;
    }

    .cta {
        grid-template-columns: 1fr;
        padding: 28px 22px;
    }

    .tool-top,
    .tool-mid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .menu-toggle {
        display: inline-flex;
    }

    .logo {
        margin-right: auto;
        order: 1;
    }

    .header__signin {
        order: 2;
    }

    .menu-toggle {
        order: 3;
    }

    .nav-panel {
        display: none;
        order: 4;
        flex: 1 1 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 4px 0 16px;
    }

    .nav-panel.is-open {
        display: flex;
    }

    .primary-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-link {
        padding: 12px 4px;
    }

    .header-search {
        width: 100%;
        margin-left: 0;
    }

    .header-search input {
        width: 100%;
    }
}

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

    .trust,
    .footer__base,
    .footer__grid {
        grid-template-columns: 1fr;
        display: grid;
    }

    .section__head,
    .footer__base {
        align-items: flex-start;
        flex-direction: column;
    }

    .ad {
        padding: 16px 16px 28px;
    }

    .ad__by {
        position: static;
        margin-top: 6px;
    }

    .footer__links a {
        font-size: 1rem;
    }

    .hero-search {
        border-radius: 18px;
    }

    .hero h1 {
        white-space: normal;
    }
}

@media (max-width: 460px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .tool-card--link {
        transition: none;
    }
}

.tool-page {
    padding-top: 22px;
    padding-bottom: 48px;
}

.tool-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.tool-heading h1 {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.tool-heading p {
    margin: 0;
    max-width: 640px;
    color: var(--muted);
}

.tool-top,
.tool-mid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 22px;
    align-items: start;
}

.tool-side,
.tool-mid aside {
    display: grid;
    gap: 16px;
    justify-items: center;
}

.workbench {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
}

.field {
    display: block;
    margin-bottom: 14px;
    font-weight: 700;
}

.field[hidden] {
    display: none;
}

.field input,
.field select,
.field textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px 14px;
    border: 1px solid #d7e2ef;
    border-radius: 10px;
    background: #fff;
    font-weight: 500;
}

.field textarea {
    min-height: 140px;
    resize: vertical;
}

.engine-cards-field {
    border: 0;
    margin: 0 0 14px;
    padding: 0;
    min-width: 0;
}

.engine-cards-field legend {
    margin-bottom: 8px;
    padding: 0;
    font-weight: 700;
}

.engine-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.engine-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 78px;
    padding: 10px 8px;
    border: 1.5px solid #d7e2ef;
    border-radius: 12px;
    background: #fff;
    color: #0b1742;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
}

.engine-card:hover {
    border-color: #0866ff;
}

.engine-card:has(input:checked) {
    border-color: #0866ff;
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px #0866ff;
}

.engine-card:has(input:focus-visible) {
    outline: 2px solid #0866ff;
    outline-offset: 2px;
}

.field .engine-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
}

.engine-card__icon {
    font-size: 1.25rem;
    line-height: 1;
}

@media (max-width: 700px) {
    .engine-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.engine-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.engine-presets .btn {
    min-height: 36px;
    padding: 6px 12px;
}

.engine-swatches {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f7fafc;
}

.engine-swatch {
    aspect-ratio: 1;
    min-height: 28px;
    padding: 0;
    border: 1px solid rgba(11, 23, 66, 0.2);
    border-radius: 8px;
    background: var(--swatch);
    cursor: pointer;
}

.engine-swatch.is-selected {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.engine-figure {
    margin: 0 0 14px;
}

.engine-figure svg {
    display: block;
    width: 100%;
    height: auto;
}

.engine-styles {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 14px;
}

.engine-style {
    display: grid;
    grid-template-columns: 8.5rem minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.engine-style__label,
.engine-style__value {
    margin: 0;
}

.engine-style__label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.engine-style__value {
    overflow-wrap: anywhere;
    font-size: 1.15rem;
    line-height: 1.45;
}

.engine-style__copy {
    min-height: 36px;
    padding: 6px 12px;
}

.result-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 14px;
}

@media (max-width: 640px) {
    .engine-style {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .engine-style__label {
        grid-column: 1 / -1;
    }
}

.result-panel [data-engine-download] {
    margin-left: 10px;
}

.engine-output {
    margin: 0 0 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--ink);
    font: inherit;
}

.engine-output__item {
    margin: 0;
    white-space: pre-wrap;
}

.engine-output__image {
    display: block;
    width: min(100%, 220px);
    height: auto;
    margin: 0 0 8px;
    border-radius: 12px;
    background: #fff;
}

.engine-output__item + .engine-output__item {
    margin-top: 18px;
}

.engine-output:is(:has(.engine-output__image[src*="/images/random-cards/"]), :has(.engine-output__image[src*="/images/tarot/"])) {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 12px;
    white-space: normal;
}

.engine-output:is(:has(.engine-output__image[src*="/images/random-cards/"]), :has(.engine-output__image[src*="/images/tarot/"])) .engine-output__item {
    width: 112px;
    margin: 0;
    text-align: center;
    font-size: 0.82rem;
    line-height: 1.35;
}

.engine-output:is(:has(.engine-output__image[src*="/images/random-cards/"]), :has(.engine-output__image[src*="/images/tarot/"])) .engine-output__item + .engine-output__item {
    margin-top: 0;
}

.engine-output:is(:has(.engine-output__image[src*="/images/random-cards/"]), :has(.engine-output__image[src*="/images/tarot/"])) .engine-output__image {
    width: 100%;
    margin: 0 auto 8px;
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(11, 23, 66, 0.12);
}

.engine-output:has(.engine-output__image[src*="/images/tarot/"]) .engine-output__item {
    width: 140px;
}

.engine-output:has(.engine-output__image[src*="/images/animals/"]) {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 14px;
    white-space: normal;
}

.engine-output:has(.engine-output__image[src*="/images/animals/"]) .engine-output__item {
    width: 180px;
    margin: 0;
    text-align: center;
    font-size: 0.92rem;
    line-height: 1.35;
}

.engine-output:has(.engine-output__image[src*="/images/animals/"]) .engine-output__item + .engine-output__item {
    margin-top: 0;
}

.engine-output:has(.engine-output__image[src*="/images/animals/"]) .engine-output__image {
    width: 100%;
    margin: 0 auto 8px;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(11, 23, 66, 0.12);
}

.result-panel__value.is-waiting {
    color: var(--muted);
    font-size: 1.2rem;
}

.result-panel__value.is-error {
    color: #9f1239;
    font-size: 1.05rem;
}

.result-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 180px;
    padding: 18px;
    border-radius: 14px;
    background: #f4f8ff;
}

.result-panel__label {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.result-panel__value {
    margin: 0 0 14px;
    color: var(--ink);
    font-size: 1.7rem;
    font-weight: 800;
}

.notice {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #eef5ff;
    color: #23406e;
}

.steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 22px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.steps li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.steps span {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: none;
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.chips li {
    padding: 8px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    font-weight: 600;
}

.tool-block {
    margin-top: 26px;
}

.editorial {
    max-width: 920px;
    margin-top: 8px;
}

.editorial h2 {
    margin: 28px 0 10px;
    color: var(--ink);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.editorial h3 {
    margin: 18px 0 8px;
    color: var(--ink);
    font-size: 1.12rem;
    font-weight: 800;
}

.editorial p,
.draft-note p,
.approval-list li {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.75;
}

.editorial a.editorial__link {
    color: var(--blue);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
}

.editorial a.editorial__link:hover,
.editorial a.editorial__link:focus-visible {
    color: #0548b8;
    text-decoration-thickness: 2px;
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.editorial__pending {
    font-weight: 700;
}

.editorial__table-wrap {
    overflow-x: auto;
    margin: 8px 0 18px;
}

.editorial table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.95rem;
}

.editorial caption {
    margin-bottom: 8px;
    color: var(--ink);
    font-weight: 700;
    text-align: left;
}

.editorial th,
.editorial td {
    padding: 10px 12px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.editorial th {
    background: var(--blue-soft);
    color: var(--ink);
}

.draft-note,
.approval-list {
    margin: 18px 0;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.approval-list ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.tool-block h2,
.faq h2,
.related h2 {
    margin-bottom: 10px;
    font-size: 1.35rem;
    font-weight: 800;
}

.faq {
    display: grid;
    gap: 10px;
    margin-top: 26px;
}

.faq details {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 0 16px;
}

.faq summary {
    cursor: pointer;
    padding: 16px 0;
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 700;
}

.faq details p {
    margin: 0 0 14px;
    color: var(--muted);
}

.related {
    width: min(100%, 300px);
}

.related ol {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.related li {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    font-weight: 700;
}

.related a {
    color: var(--blue);
    text-decoration: none;
}

.tool-back {
    margin: 0 0 12px;
}

.calc-error {
    margin-top: 12px;
    color: #b42318;
    font-weight: 700;
}

@media (max-width: 700px) {
    .steps,
    .workbench {
        grid-template-columns: 1fr;
    }

    .tool-heading {
        flex-direction: column;
    }
}

.tool-ad {
    display: flex;
    justify-content: center;
}

.tool-ad--top {
    margin: 8px auto 40px;
}

.tool-ad--mid,
.tool-ad--bottom {
    margin: 36px auto;
}

.tool-ad .ad {
    margin: 0 auto;
}

.tool-stage,
.tool-article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 32px;
    align-items: start;
}

.tool-stage .workbench {
    grid-template-columns: minmax(300px, 440px) minmax(220px, 1fr);
    align-items: start;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.tool-stage__ads,
.tool-article__side {
    display: grid;
    gap: 28px;
    justify-items: center;
}

.calc {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(11, 23, 66, 0.08);
}

.calc__screen {
    position: relative;
    margin-bottom: 14px;
    padding: 18px 16px 16px;
    border-radius: 18px;
    background: var(--ink);
    color: #fff;
}

.calc__expression {
    min-height: 1.3em;
    margin: 0 76px 6px 0;
    color: #c5d4ee;
    font-size: 0.98rem;
}

.calc__display {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    text-align: right;
    overflow-wrap: anywhere;
}

.calc__display.is-error {
    color: #ffd7d7;
    font-size: 1.05rem;
    text-align: left;
}

.calc__copy {
    position: absolute;
    top: 12px;
    right: 12px;
    min-height: 36px;
    padding: 6px 12px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #1ad392 0%, #0b9a68 100%);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(11, 154, 104, 0.4);
}

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

.calc__key {
    min-height: 64px;
    border: 0;
    border-radius: 16px;
    background: #f4f7fb;
    color: var(--ink);
    font: inherit;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
}

.calc__key--operator {
    background: #e7f0ff;
    color: var(--blue);
}

.calc__key--equals {
    background: var(--blue);
    color: #fff;
}

.calc__key--function {
    background: #e8eef6;
    font-size: 1rem;
}

.calc__key:hover {
    transform: translateY(-1px);
}

.calc__key:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

.calc-history {
    min-height: 280px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #fff;
}

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

.calc-history h2,
.calc-history__memory {
    margin: 0;
}

.calc-history__memory {
    margin-top: 8px;
    color: var(--blue);
    font-weight: 700;
}

.calc-history ol {
    display: grid;
    gap: 8px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.calc-history li {
    padding: 10px 12px;
    border-radius: 12px;
    background: #f4f7fb;
    font-weight: 700;
}

.related li {
    padding: 12px 14px;
}

.related-tools {
    margin: 36px 0;
}

.related-tools h2 {
    margin-bottom: 16px;
    font-size: 1.35rem;
    font-weight: 800;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.related-grid .tool-card {
    height: 100%;
}

.calc__display.is-waiting {
    color: #c5d4ee;
    font-size: 1.2rem;
}

.tool-form--pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
}

.tool-form--pair .tool-form__actions,
.tool-form--pair .calc-error {
    grid-column: 1 / -1;
}

.tool-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.difference-breakdown {
    display: grid;
    gap: 8px;
    margin: 14px 0 0;
}

.difference-breakdown div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.difference-breakdown dt {
    color: var(--ink);
    font-weight: 700;
}

.difference-breakdown dd,
.difference-steps {
    margin: 0;
    color: var(--muted);
}

.difference-steps {
    margin-top: 12px;
    padding-left: 18px;
}

@media (max-width: 700px) {
    .tool-form--pair {
        grid-template-columns: 1fr;
    }
}

.tool-form .btn {
    width: 100%;
    margin-top: 4px;
}

.tool-form .tool-form__actions .btn {
    width: auto;
}

.tool-form--pair .tool-form__actions .btn {
    width: auto;
}

@media (max-width: 1100px) {
    .tool-stage,
    .tool-article,
    .tool-stage .workbench {
        grid-template-columns: 1fr;
    }

    .related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tool-stage__ads,
    .tool-article__side {
        grid-template-columns: repeat(2, minmax(220px, 300px));
        justify-content: center;
    }
}

@media (max-width: 700px) {
    .tool-stage__ads,
    .tool-article__side,
    .related-grid {
        grid-template-columns: 1fr;
    }

    .calc__key {
        min-height: 58px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .calc__key:hover {
        transform: none;
    }
}

.gpa-board {
    display: grid;
    gap: 12px;
}

.gpa-semester {
    padding: 14px;
    border: 1px solid #d7e2ef;
    border-radius: 12px;
    background: #f8fbff;
}

.gpa-semester__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 12px;
}

.gpa-semester__bar h3 {
    margin: 0;
    font-size: 1rem;
}

.gpa-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.gpa-semester__score {
    margin: 12px 0;
    font-weight: 700;
}

.gpa-course {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e4edf6;
}

.gpa-course label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
}

.gpa-course input,
.gpa-course select {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 10px 12px;
    border: 1px solid #d7e2ef;
    border-radius: 10px;
    background: #fff;
    font-weight: 500;
}

.gpa-course__name {
    grid-column: 1 / -1;
}

.gpa-course__remove {
    align-self: end;
}

.gpa-board__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gpa-semester .btn,
.gpa-board__actions .btn {
    width: auto;
}

@media (max-width: 700px) {
    .gpa-course {
        grid-template-columns: 1fr;
    }
}
