:root {
    --bg: #f4f7f6;
    --card: #ffffff;
    --text: #1d2528;
    --text-dark: #111827;
    --muted: #69777d;
    --muted-dark: #4b5563;
    --line: #dbe4e1;
    --line-soft: #e5e7eb;
    --critical: #c73535;
    --critical-bg: #fff0f0;
    --warning: #b76a00;
    --warning-bg: #fff6e6;
    --notice: #2469a6;
    --notice-bg: #edf6ff;
    --success: #227a53;
    --info-bg: #f9fafb;
    --dark: #111827;
    --blue: #2563eb;
    --shadow: 0 12px 30px rgba(29, 37, 40, 0.08);
    --shadow-soft: 0 16px 50px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

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

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

h1 {
    margin-bottom: 18px;
    font-size: 34px;
    line-height: 1.15;
}

h2 {
    margin-bottom: 18px;
    font-size: 24px;
}

h3 {
    margin-bottom: 12px;
    font-size: 18px;
}

p:last-child {
    margin-bottom: 0;
}

code {
    padding: 3px 6px;
    border-radius: 6px;
    background: rgba(29, 37, 40, 0.08);
    color: #172026;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
}

.page {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0;
}

.card {
    margin-bottom: 18px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    box-shadow: var(--shadow);
}

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

.success {
    margin-bottom: 0;
    color: var(--success);
    font-weight: 700;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

/* Report hero */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 170px;
    min-height: 150px;
    padding: 18px;
    border-radius: 8px;
    background: #102a43;
    color: #ffffff;
}

.score {
    font-size: 64px;
    font-weight: 800;
    line-height: 1;
}

.score-label {
    margin-top: 8px;
    color: #d7e6ee;
    font-weight: 700;
}

/* Generic grids */
.grid {
    display: grid;
    gap: 18px;
}

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

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

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

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

/* Summary cards */
.stat {
    margin-bottom: 18px;
    box-shadow: none;
}

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

.stat strong {
    font-size: 34px;
}

.stat-critical {
    border-color: rgba(199, 53, 53, 0.45);
}

.stat-warning {
    border-color: rgba(183, 106, 0, 0.45);
}

.stat-notice {
    border-color: rgba(36, 105, 166, 0.45);
}

.stat-info {
    border-color: #d1d5db;
}

/* Definition lists */
.meta,
.data-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.meta div,
.data-list div {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.meta div:last-child,
.data-list div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

dt {
    color: var(--muted);
    font-weight: 700;
}

dd {
    margin: 0;
    overflow-wrap: anywhere;
}

/* Lists */
.inline-list,
.instruction-list {
    margin: 0;
    padding-left: 20px;
}

.inline-list li + li,
.instruction-list li + li {
    margin-top: 6px;
}

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

.marker-list li {
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #eef5f3;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

/* Priority */
.priority-panel {
    padding-bottom: 18px;
}

.priority-card {
    min-height: 100%;
    padding: 16px;
    border: 1px solid var(--line);
    border-left-width: 5px;
    border-radius: 8px;
    background: var(--card);
}

.priority-card h3 {
    margin-bottom: 12px;
}

.priority-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.priority-item + .priority-item {
    margin-top: 10px;
}

.priority-item strong {
    display: block;
    margin-bottom: 4px;
}

.priority-item code {
    font-size: 12px;
}

.priority-critical {
    border-left-color: var(--critical);
    background: var(--critical-bg);
}

.priority-warning {
    border-left-color: var(--warning);
    background: var(--warning-bg);
}

.priority-notice {
    border-left-color: var(--notice);
    background: var(--notice-bg);
}

.priority-info {
    border-color: #d1d5db;
    border-left-color: #9ca3af;
    background: var(--info-bg);
}

/* Metrics in report */
.metric-card {
    min-height: 118px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbfa;
}

.metric-card .metric-label,
.metric-card .metric-note {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.metric-card .metric-value {
    display: block;
    margin: 8px 0 4px;
    color: var(--text);
    font-size: 34px;
    line-height: 1.1;
    word-break: break-word;
}

.metric {
    padding: 16px;
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    background: var(--info-bg);
}

.metric .metric-label {
    display: block;
    margin-bottom: 6px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
}

.metric .metric-value {
    display: block;
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
}

.text-preview {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.text-preview p {
    margin-bottom: 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

/* Issues */
.issue-group + .issue-group {
    margin-top: 24px;
}

.issue {
    margin-bottom: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-left-width: 5px;
    border-radius: 8px;
}

.issue-critical {
    border-left-color: var(--critical);
    background: var(--critical-bg);
}

.issue-warning {
    border-left-color: var(--warning);
    background: var(--warning-bg);
}

.issue-notice {
    border-left-color: var(--notice);
    background: var(--notice-bg);
}

.issue-info {
    border-color: #d1d5db;
    border-left-color: #9ca3af;
    background: var(--info-bg);
}

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

.recommendation {
    margin-bottom: 0;
    color: var(--text);
    font-weight: 700;
}

/* Fixes */
.fixes {
    display: grid;
    gap: 12px;
}

.fix {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.fix h3 {
    margin-bottom: 8px;
}

.fix p {
    margin-bottom: 0;
}

.schema-markup {
    border-color: var(--notice);
}

.schema-code,
.copy-card pre {
    margin: 0 0 12px;
    padding: 16px;
    overflow: auto;
    border-radius: 8px;
    background: #0f1720;
    color: #eef4f8;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.schema-code code,
.copy-card code {
    display: block;
    padding: 0;
    background: transparent;
    color: inherit;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: inherit;
    line-height: inherit;
    white-space: inherit;
}

/* Copy blocks */
.copy-section {
    margin-top: 28px;
}

.copy-card {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    background: var(--info-bg);
}

.copy-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.copy-card-header h3 {
    margin: 0;
    font-size: 18px;
}

.copy-card pre {
    margin-bottom: 0;
    border-radius: 14px;
    background: var(--dark);
    color: #f9fafb;
}

.copy-button {
    flex: 0 0 auto;
    padding: 9px 13px;
    border: 0;
    border-radius: 12px;
    background: var(--blue);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.copy-button:hover {
    background: #1d4ed8;
}

.copy-button.copied {
    background: #059669;
}

.copy-note {
    margin: 12px 0 0;
    color: var(--muted-dark);
    font-size: 14px;
    line-height: 1.5;
}

.warning-note {
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px solid #fed7aa;
    border-radius: 14px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

/* Legacy homepage blocks: kept for template compatibility */
.hero-card {
    max-width: 900px;
    margin: 40px auto 28px;
    padding: 36px;
    border: 1px solid var(--line-soft);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.hero-label {
    display: inline-block;
    margin-bottom: 14px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 13px;
    font-weight: 700;
}

.hero-card h1 {
    margin: 0 0 14px;
    font-size: 36px;
    line-height: 1.15;
}

.hero-text {
    max-width: 720px;
    margin: 0 0 26px;
    color: var(--muted-dark);
    font-size: 17px;
    line-height: 1.6;
}

.url-form {
    margin-top: 24px;
}

.url-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.url-form-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.url-form input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    font-size: 16px;
}

.url-form input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
    outline: none;
}

.url-form button {
    padding: 14px 22px;
    border: 0;
    border-radius: 14px;
    background: var(--dark);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.url-form button:hover {
    background: #1f2937;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
}

.quick-links a {
    color: var(--blue);
    font-weight: 600;
    text-decoration: none;
}

.quick-links a:hover {
    text-decoration: underline;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    max-width: 900px;
    margin: 0 auto 48px;
}

.info-card {
    padding: 24px;
    border: 1px solid var(--line-soft);
    border-radius: 20px;
    background: #ffffff;
}

.info-card h2 {
    margin-top: 0;
    font-size: 20px;
}

.info-card ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.info-card li {
    margin-bottom: 8px;
}

/* Current homepage */
.index-page {
    padding-top: 32px;
}

.index-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
    gap: 32px;
    align-items: stretch;
    padding: 40px;
}

.index-hero h1 {
    max-width: 760px;
    margin: 0 0 18px;
    color: var(--text-dark);
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.04;
    letter-spacing: -0.045em;
}

.index-lead {
    max-width: 760px;
    margin: 0;
    color: var(--muted-dark);
    font-size: 18px;
    line-height: 1.6;
}

.index-form {
    max-width: 820px;
    margin-top: 30px;
}

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

.index-form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.index-form input {
    width: 100%;
    padding: 15px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    color: var(--text-dark);
    font-size: 16px;
}

.index-form input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
    outline: none;
}

.index-form button {
    padding: 15px 22px;
    border: 0;
    border-radius: 14px;
    background: var(--dark);
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

.index-form button:hover {
    background: #1f2937;
}

.index-note {
    max-width: 760px;
    margin: 16px 0 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.index-side {
    display: grid;
    gap: 16px;
}

.index-score-preview {
    padding: 24px;
    border-radius: 22px;
    background: var(--dark);
    color: #ffffff;
}

.index-score-preview span {
    display: block;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 700;
}

.index-score-preview strong {
    display: block;
    margin-top: 8px;
    font-size: 76px;
    line-height: 0.95;
    letter-spacing: -0.06em;
}

.index-score-preview small {
    display: block;
    margin-top: 10px;
    color: #cbd5e1;
}

.index-check-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 20px;
    border: 1px solid var(--line-soft);
    border-radius: 22px;
    background: var(--info-bg);
    list-style: none;
}

.index-check-list li {
    position: relative;
    padding-left: 24px;
    color: #374151;
    font-weight: 700;
}

.index-check-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #059669;
    font-weight: 900;
}

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

.index-card h2 {
    margin-top: 0;
}

.index-card p {
    margin-bottom: 0;
    color: var(--muted-dark);
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 900px) {
    .summary-grid,
    .priority-grid,
    .metric-grid,
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .index-hero {
        grid-template-columns: 1fr;
        padding: 28px;
    }

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

@media (max-width: 760px) {
    .page {
        width: min(100% - 20px, 1100px);
        padding: 16px 0;
    }

    .card {
        padding: 18px;
    }

    .hero,
    .issue-head,
    .copy-card-header {
        align-items: stretch;
        flex-direction: column;
    }

    .score-box {
        width: 100%;
        min-width: 0;
    }

    .meta div,
    .data-list div {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 28px;
    }

    .hero-card {
        margin: 18px auto;
        padding: 22px;
        border-radius: 18px;
    }

    .hero-card h1 {
        font-size: 28px;
    }

    .url-form-row,
    .index-form-row,
    .info-grid {
        grid-template-columns: 1fr;
    }

    .url-form button,
    .index-form button,
    .copy-button {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .index-page {
        padding-top: 16px;
    }

    .index-hero {
        padding: 22px;
    }
}

@media (max-width: 560px) {
    .summary-grid,
    .priority-grid,
    .metric-grid,
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}
