:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --line: #d9e2ee;
    --text: #162033;
    --muted: #66748a;
    --brand: #d71920;
    --brand-dark: #9f1218;
    --ok: #157347;
    --warn: #9a6700;
    --bad: #b42318;
    --shadow: 0 16px 42px rgba(22, 32, 51, .08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "Albert Sans", "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 68px;
    padding: 12px clamp(16px, 4vw, 48px);
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-weight: 800;
}

.brand img {
    width: 154px;
    height: auto;
    display: block;
}

.brand span {
    color: var(--brand);
    font-size: 15px;
    text-transform: uppercase;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.topbar nav a {
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
}

.topbar nav a:hover {
    color: var(--text);
    background: #eef3f9;
}

.page-shell {
    width: min(1220px, calc(100% - 32px));
    margin: 28px auto 48px;
}

.tools-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    align-items: center;
    gap: 28px;
    padding: 30px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.tools-header img {
    width: 210px;
    max-width: 100%;
    justify-self: end;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.08;
}

h2 {
    margin: 26px 0 12px;
    font-size: 20px;
}

p {
    margin: 10px 0 0;
}

.muted {
    color: var(--muted);
}

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

.tool-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 14px;
    min-height: 132px;
    padding: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(22, 32, 51, .04);
}

.tool-card:hover {
    border-color: #b9c7d8;
    transform: translateY(-1px);
}

.tool-icon,
.tool-nav a span:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: #f2f5f9;
    color: var(--brand);
    font-size: 12px;
    font-weight: 900;
}

.tool-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 17px;
}

.tool-card small {
    color: var(--muted);
    font-size: 14px;
}

.tool-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    min-width: 0;
}

.tool-nav,
.tool-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    min-width: 0;
    width: 100%;
}

.tool-nav {
    position: sticky;
    top: 88px;
    padding: 10px;
}

.tool-nav a {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 8px;
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
}

.tool-title > div,
.tool-nav a span:last-child {
    min-width: 0;
}

.tool-nav a.active,
.tool-nav a:hover {
    color: var(--text);
    background: #f2f5f9;
}

.tool-nav .back-link {
    display: block;
    grid-template-columns: none;
    margin-bottom: 8px;
    padding: 10px;
    color: var(--brand);
}

.tool-panel {
    padding: clamp(18px, 3vw, 30px);
}

.tool-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.tool-title h1 {
    font-size: clamp(28px, 3vw, 42px);
}

.tool-badge {
    padding: 6px 10px;
    border-radius: 6px;
    background: #fff1f1;
    color: var(--brand);
    font-size: 12px;
    font-weight: 900;
}

.tool-form {
    margin-top: 22px;
}

.tool-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-weight: 800;
}

.input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 132px;
    gap: 10px;
}

input {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
}

button,
.primary-button {
    min-height: 46px;
    padding: 0 16px;
    border: 0;
    border-radius: 6px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

button:hover,
.primary-button:hover {
    background: var(--brand-dark);
}

.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.captcha-box {
    margin-top: 14px;
}

.alert-box {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 6px;
    border: 1px solid var(--line);
}

.alert-box.error {
    border-color: #f1b8b8;
    background: #fff5f5;
    color: var(--bad);
}

.result-box {
    margin-top: 24px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.score-row,
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.score-tile,
.metric-grid div {
    min-height: 82px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.score-tile span,
.metric-grid span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.score-tile strong,
.metric-grid strong {
    display: block;
    margin-top: 6px;
    overflow-wrap: anywhere;
    font-size: 26px;
    line-height: 1.15;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    overflow-wrap: anywhere;
    font-size: 14px;
}

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

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.kv {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.kv span,
.kv strong {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}

.kv span {
    background: #f8fafc;
    color: var(--muted);
}

.kv strong {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.clean-list,
.risk-list {
    display: grid;
    gap: 8px;
    padding: 0;
    list-style: none;
}

.clean-list li,
.risk-list li {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fafc;
}

.risk-list li {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
}

.risk-critical strong {
    color: var(--bad);
}

.risk-warning strong {
    color: var(--warn);
}

.risk-ok strong {
    color: var(--ok);
}

pre {
    max-height: 420px;
    overflow: auto;
    padding: 14px;
    border-radius: 8px;
    background: #101828;
    color: #e8eef7;
    white-space: pre-wrap;
}

.speedtest-box {
    margin-top: 22px;
}

.mail-hub {
    margin-top: 22px;
}

.lead {
    max-width: 940px;
    color: #344055;
    font-size: 18px;
}

.hub-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 0 28px;
}

.hub-actions a {
    display: grid;
    gap: 6px;
    min-height: 118px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    text-decoration: none;
}

.hub-actions a:hover {
    border-color: #c5d0de;
    background: #f2f5f9;
}

.hub-actions strong {
    color: var(--brand);
    font-size: 17px;
}

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

.seo-content {
    margin-top: 34px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.seo-content h2 {
    max-width: 820px;
}

.seo-content h3 {
    margin: 22px 0 8px;
    font-size: 18px;
}

.seo-content p {
    max-width: 920px;
    color: #344055;
}

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

.seo-columns article,
.faq-list details {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.seo-checklist {
    display: grid;
    gap: 8px;
    padding-left: 20px;
}

.seo-checklist li {
    padding-left: 4px;
}

.related-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.related-tools a {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--brand);
    background: #fff;
    font-weight: 800;
    text-decoration: none;
}

.related-tools a:hover {
    border-color: #c5d0de;
    background: #f2f5f9;
}

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

.faq-list summary {
    cursor: pointer;
    font-weight: 900;
}

.faq-list details p {
    margin-top: 10px;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto 32px;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 920px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar nav {
        justify-content: flex-start;
    }

    .tools-header,
    .tool-layout {
        grid-template-columns: 1fr;
    }

    .tools-header img {
        justify-self: start;
    }

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

    .tool-nav {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .page-shell {
        width: min(100% - 20px, 1220px);
        margin-top: 14px;
    }

    .tools-header,
    .tool-panel {
        padding: 18px;
    }

    .tool-grid,
    .score-row,
    .metric-grid,
    .input-row,
    .tool-nav,
    .hub-actions,
    .seo-columns {
        grid-template-columns: 1fr;
    }

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

    .risk-list li {
        grid-template-columns: 1fr;
    }

    .brand img {
        width: 136px;
    }
}
