:root {
    --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --text-xs: .75rem;
    --text-sm: .8125rem;
    --text-ui: .875rem;
    --text-body: 1rem;
    --text-lead: 1.0625rem;
    --text-h3: 1.25rem;
    --text-h2: clamp(1.625rem, 2.2vw, 2rem);
    --text-h1: clamp(2.25rem, 4vw, 3.5rem);
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
}

html {
    font-size: 16px;
}

body,
input,
textarea,
select,
button {
    font-family: var(--font-ui);
}

body {
    font-size: var(--text-body);
    font-weight: var(--weight-regular);
    line-height: 1.55;
    text-rendering: optimizeLegibility;
}

p,
li {
    line-height: 1.6;
}

b,
strong {
    font-weight: var(--weight-semibold);
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-ui);
}

h1,
.project-hero h1,
.positions-hero h1,
.audit-hero h1,
.analyzer-home-hero h1,
.type-guide-hero h1 {
    font-size: var(--text-h1);
    font-weight: var(--weight-bold);
    letter-spacing: -.04em;
    line-height: 1.06;
}

h2,
.site-manager h2,
.audit-overview-copy h2,
.type-guide-panel > header h2 {
    font-size: var(--text-h2);
    font-weight: var(--weight-semibold);
    letter-spacing: -.025em;
    line-height: 1.18;
}

h3,
.project-card h3,
.site-card h3,
.recommendation-card h3,
.audit-check h3,
.audit-empty h3 {
    font-size: var(--text-h3);
    font-weight: var(--weight-semibold);
    letter-spacing: -.012em;
    line-height: 1.3;
}

h4,
.recommendation-item h4 {
    font-size: 1rem;
    font-weight: var(--weight-semibold);
    line-height: 1.4;
}

small {
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
    line-height: 1.45;
}

a {
    font-weight: var(--weight-medium);
}

/* Header and shared navigation */

.brand b {
    font-size: 1.25rem;
    font-weight: var(--weight-bold);
}

.brand {
    font-weight: var(--weight-regular);
}

.brand small {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: .09em;
}

.knowledge-link {
    font-size: var(--text-ui);
    font-weight: var(--weight-semibold);
}

.privacy-pill {
    font-size: var(--text-ui);
    font-weight: var(--weight-medium);
}

.breadcrumbs {
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
}

.breadcrumbs a {
    font-weight: var(--weight-medium);
}

.eyebrow,
.type-guide-overline {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    letter-spacing: .08em;
    line-height: 1.4;
}

.hero-copy,
.factor-intro,
.audit-hero-copy > p:not(.eyebrow),
.positions-hero > div:first-child > p:last-child,
.analyzer-home-hero > div > p:last-child,
.type-guide-lead {
    font-size: var(--text-lead);
    font-weight: var(--weight-regular);
    line-height: 1.65;
}

.footer {
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
}

.footer b,
.footer a {
    font-weight: var(--weight-semibold);
}

.footer a {
    color: var(--green);
    text-underline-offset: 3px;
}

/* Forms and actions */

label > span,
.add-site-form label {
    font-size: var(--text-ui);
    font-weight: var(--weight-semibold);
    line-height: 1.4;
}

label em {
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
}

input,
textarea,
select,
.add-site-form input,
.edit-site input {
    font-size: .9375rem;
    font-weight: var(--weight-regular);
    line-height: 1.45;
}

.button,
.text-button,
.recommendations-link,
.edit-site button,
.remove-site-form button,
.delete-form button {
    font-size: var(--text-ui);
    font-weight: var(--weight-semibold);
    line-height: 1.35;
}

.step-badge,
.section-heading > span,
.tool-card-status,
.status,
.site-role,
.page-type,
.engine-badge,
.factor-kind,
.source-status,
.audit-status,
.audit-check > em,
.audit-group > summary em,
.recommendation-meta span,
.recommendation-meta small,
.recommendation-card header > span,
.pair-counts span,
.verdict,
.similarity-score,
.no-pair,
.http-code,
.type-status {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: .035em;
    line-height: 1.35;
}

.flash,
.errors,
.report-warning,
.scan-notice,
.source-update-notice,
.audit-notice {
    font-size: var(--text-ui);
    font-weight: var(--weight-regular);
}

.scan-notice b,
.source-update-notice b,
.audit-notice b {
    font-weight: var(--weight-semibold);
}

.scan-notice small,
.source-update-notice small,
.audit-notice small {
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
}

/* Tables and dense data */

table {
    font-size: var(--text-ui);
    font-weight: var(--weight-regular);
    line-height: 1.45;
}

th {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: .04em;
    line-height: 1.35;
}

td {
    font-size: var(--text-ui);
    font-weight: var(--weight-regular);
}

td b,
td strong,
.metric-pair b,
.delta,
.position-change {
    font-weight: var(--weight-semibold);
}

td small,
.url-cell small,
.factor-cell span,
.issues span,
.paired-urls i,
.metric-pair small {
    font-size: var(--text-xs);
    font-weight: var(--weight-regular);
    line-height: 1.4;
}

.url-cell a,
.paired-urls a {
    font-size: var(--text-ui);
    font-weight: var(--weight-semibold);
}

/* Home */

.home-local-badge b {
    font-size: .9375rem;
    font-weight: var(--weight-semibold);
}

.home-local-badge span {
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
    line-height: 1.5;
}

.analyzer-tool-card h2 {
    font-size: 1.5rem;
    font-weight: var(--weight-semibold);
}

.analyzer-tool-card > p {
    font-size: var(--text-body);
    font-weight: var(--weight-regular);
    line-height: 1.6;
}

.tool-card-footer {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
}

.tool-card-footer b,
.tool-card-footer i {
    font-weight: var(--weight-semibold);
}

.home-workflow span {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
}

.home-workflow b {
    font-size: .9375rem;
    font-weight: var(--weight-semibold);
}

.home-workflow small {
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
}

/* Projects and comparison reports */

.hero-stat strong,
.score-number,
.quality-pill b,
.mini-stats strong,
.factor-summary b,
.audit-score b,
.audit-stats b,
.positions-summary b,
.type-query-position b,
.type-query-change b {
    font-weight: var(--weight-bold);
}

.hero-stat span,
.project-card p,
.project-card time,
.chips span,
.site-limit-note,
.primary-site-note,
.crawl-stats,
.quality-pill span {
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
    line-height: 1.5;
}

.feature-list li::before,
.site-icon {
    font-weight: var(--weight-semibold);
}

.feature-list b {
    font-size: .9375rem;
    font-weight: var(--weight-semibold);
}

.feature-list span {
    font-size: var(--text-ui);
    font-weight: var(--weight-regular);
    line-height: 1.55;
}

.note {
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
    line-height: 1.5;
}

.site-manager > div > p:last-child {
    font-size: var(--text-body);
    font-weight: var(--weight-regular);
    line-height: 1.6;
}

.muted,
.site-error {
    font-size: var(--text-ui);
    font-weight: var(--weight-regular);
    line-height: 1.5;
}

.edit-site summary {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
}

.project-card h3,
.site-card h3 {
    font-size: 1.125rem;
}

.site-role {
    font-size: var(--text-xs);
}

.site-card a {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
}

.status {
    font-size: var(--text-xs);
}

.mini-stats strong {
    font-size: 1.375rem;
}

.mini-stats span {
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
    line-height: 1.4;
}

.score-explainer b,
.score-notes-grid h3,
.metric-guide b,
.forms-inventory h3,
.forms-grid article p,
.page-comparison-heading h3 {
    font-weight: var(--weight-semibold);
}

.pair-heading b,
.site-details summary b {
    font-size: 1rem;
    font-weight: var(--weight-semibold);
}

.pair-heading > span,
.site-details summary span {
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
}

.score-explainer span,
.score-notes-grid span,
.score-notes-grid small,
.metric-guide span,
.forms-grid article span,
.forms-grid article small,
.comparison-highlights span,
.pair-heading small,
.page-comparison-heading p,
.paired-urls span {
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
    line-height: 1.5;
}

.forms-grid article p,
.page-comparison-heading h3 {
    font-size: var(--text-ui);
}

.forms-grid article b,
.metric-pair b {
    font-size: var(--text-ui);
    font-weight: var(--weight-semibold);
}

.factor-cell sup {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
}

.recommendations-link {
    font-size: var(--text-ui);
}

.recommendation-item p,
.recommendation-empty p {
    font-size: .9375rem;
    font-weight: var(--weight-regular);
    line-height: 1.6;
}

.recommendations-note p {
    font-size: var(--text-body);
    font-weight: var(--weight-regular);
    line-height: 1.6;
}

.recommendations-note b,
.recommendation-card h3,
.recommendation-item h4,
.recommendation-empty b {
    font-weight: var(--weight-semibold);
}

.recommendation-card h3 {
    font-size: 1.0625rem;
}

.recommendation-card header small,
.recommendation-item em,
.recommendation-card footer {
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
    line-height: 1.5;
}

.recommendation-item i,
.recommendation-card header > span {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
}

.versus,
.delta,
.verdict,
.similarity-score,
.no-pair {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
}

.versus {
    font-weight: var(--weight-bold);
}

.recommendation-meta span,
.recommendation-meta small {
    font-size: var(--text-xs);
}

/* Ranking factors */

.factor-hero form small,
.factor-summary span,
.factor-filters > a,
.source-error {
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
    line-height: 1.45;
}

.factor-summary b {
    font-size: 1.75rem;
}

.factor-card-top span,
.factor-card footer span,
.factor-card footer a {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    line-height: 1.4;
}

.factor-card .engine-badge,
.factor-card .factor-kind {
    font-weight: var(--weight-semibold);
}

.factor-card h2 {
    font-size: 1.25rem;
    font-weight: var(--weight-semibold);
    line-height: 1.3;
}

.factor-card > p {
    font-size: .9375rem;
    font-weight: var(--weight-regular);
    line-height: 1.6;
}

.factor-card footer a {
    font-weight: var(--weight-semibold);
}

.source-status {
    font-size: var(--text-xs);
}

/* SEO audit */

.audit-form label {
    font-size: var(--text-ui);
    font-weight: var(--weight-semibold);
}

.audit-capabilities span,
.audit-form small,
.audit-score span,
.audit-overview-copy > p:last-child,
.audit-stats span,
.audit-page-summary span,
.audit-recommendation > div small,
.audit-recommendation em,
.audit-group > summary span,
.audit-check small,
.audit-check > em,
.audit-empty p,
.audit-item-details > summary b,
.audit-item-details li > span,
.audit-item-details li > small,
.audit-item-details .audit-item-details-more {
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
    line-height: 1.5;
}

.audit-recommendation > div span,
.audit-recommendation > div small {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    line-height: 1.35;
}

.audit-capabilities span,
.audit-recommendation em,
.audit-check > em,
.audit-item-details > summary b,
.audit-item-details li > span {
    font-weight: var(--weight-semibold);
}

.audit-score b {
    font-size: 2.375rem;
}

.audit-overview-copy h2 {
    font-size: 1.75rem;
}

.audit-overview-copy > a {
    font-size: var(--text-ui);
    font-weight: var(--weight-semibold);
}

.audit-overview-copy > p:last-child,
.audit-recommendation p,
.audit-check p,
.audit-empty p {
    font-size: var(--text-ui);
    font-weight: var(--weight-regular);
    line-height: 1.55;
}

.audit-stats b {
    font-size: 1.375rem;
}

.audit-page-summary b {
    font-size: 1rem;
    font-weight: var(--weight-semibold);
}

.audit-recommendation h3,
.audit-group > summary b,
.audit-check h3,
.audit-empty h3 {
    font-size: .9375rem;
    font-weight: var(--weight-semibold);
}

.audit-status,
.audit-group > summary em,
.audit-check > em {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
}

.audit-item-details code {
    font-size: var(--text-xs);
    font-weight: var(--weight-regular);
}

.audit-empty h2 {
    font-size: 1.375rem;
    font-weight: var(--weight-semibold);
}

/* Positions */

.positions-source-status b {
    font-size: .9375rem;
    font-weight: var(--weight-semibold);
}

.positions-source-status span,
.positions-privacy,
.positions-site-meta,
.positions-summary span,
.positions-connection-settings {
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
    line-height: 1.45;
}

.positions-setup ol,
.positions-token-panel > p {
    font-size: var(--text-body);
    font-weight: var(--weight-regular);
    line-height: 1.6;
}

.positions-setup code {
    font-size: var(--text-sm);
}

.positions-site-heading a {
    font-size: var(--text-ui);
    font-weight: var(--weight-medium);
}

.positions-summary b {
    font-size: 1.75rem;
}

.positions-calendar {
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
}

.positions-calendar th {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
}

.positions-calendar th b {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
}

.positions-calendar th small,
.position-cell small {
    font-size: var(--text-xs);
    font-weight: var(--weight-regular);
}

.positions-legend,
.positions-legend small {
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
    line-height: 1.45;
}

.positions-query-text,
.positions-query-column > .positions-query-text {
    display: block;
    overflow: hidden;
    color: #27312c;
    font-size: var(--text-ui);
    font-weight: var(--weight-semibold);
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.positions-query-link {
    font-weight: var(--weight-semibold);
    text-decoration-color: #a8cf7d;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.positions-query-id,
.positions-query-column > small.positions-query-id {
    display: block;
    margin-top: 4px;
    color: #7e8982;
    font-size: var(--text-xs);
    font-weight: var(--weight-regular);
    line-height: 1.4;
}

.position-cell b {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
}

.position-cell small,
.position-change {
    font-weight: var(--weight-semibold);
}

.position-change {
    font-size: var(--text-sm);
}

.positions-empty h3 {
    font-size: 1.125rem;
}

.positions-empty p {
    font-size: var(--text-body);
    font-weight: var(--weight-regular);
    line-height: 1.55;
}

.positions-connection-settings summary {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
}

/* Shared progress */

.operation-progress-heading b {
    font-size: var(--text-body);
    font-weight: var(--weight-semibold);
}

.operation-progress-heading p {
    font-size: var(--text-ui);
    font-weight: var(--weight-regular);
}

.operation-progress-heading time,
.operation-progress > small {
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
}

.operation-progress-heading time {
    font-weight: var(--weight-semibold);
}

@media (max-width: 620px) {
    h1,
    .project-hero h1,
    .positions-hero h1,
    .audit-hero h1,
    .analyzer-home-hero h1,
    .type-guide-hero h1 {
        font-size: 2.25rem;
    }

    h2,
    .site-manager h2,
    .audit-overview-copy h2,
    .type-guide-panel > header h2 {
        font-size: 1.5rem;
    }
}
