:root {
    --bg: #0b1220;
    --panel: #121a2c;
    --text: #e6ecff;
    --muted: #8a9bbf;
    --brand: #65d9a0;
    --accent: #ffb63c;
    --error: #ff5e5e;
    --warn: #ffb63c;
    --info: #66a8ff;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: radial-gradient(circle at top, #162440 0%, var(--bg) 60%);
    color: var(--text);
    line-height: 1.5;
    overflow-wrap: break-word;
    word-wrap: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
}

img { max-width: 100%; height: auto; }
code, pre { word-break: break-word; overflow-wrap: anywhere; }

a { color: var(--brand); word-break: break-word; }

/* --- topbar -------------------------------------------------------- */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    gap: 16px;
    flex-wrap: wrap;
}
.brand { font-size: 22px; font-weight: 800; text-decoration: none; color: var(--text); white-space: nowrap; }
.brand span { color: var(--brand); }
nav { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
nav a { text-decoration: none; color: var(--muted); white-space: nowrap; }
nav a.cta { color: var(--accent); font-weight: 600; }

/* --- layout -------------------------------------------------------- */
main { max-width: 960px; margin: 0 auto; padding: 32px 20px; }

.hero h1 { font-size: clamp(28px, 5vw, 42px); margin: 0 0 12px; line-height: 1.15; }
.lede { color: var(--muted); max-width: 680px; font-size: clamp(15px, 2vw, 17px); }

.audit-form {
    display: flex; gap: 12px; margin: 28px 0 16px;
    flex-wrap: wrap;
}
.audit-form input {
    flex: 1 1 260px; min-width: 0;
    padding: 14px 16px; font-size: 16px; border-radius: 10px;
    border: 1px solid #2a3759; background: var(--panel); color: var(--text);
}
.audit-form button {
    flex: 0 0 auto;
    padding: 14px 22px; font-size: 16px; border: 0; border-radius: 10px;
    background: var(--brand); color: #0b1220; font-weight: 700; cursor: pointer;
    min-height: 48px;
}
.audit-form button:hover { filter: brightness(1.08); }

.quota-line { color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); }

.flashes { list-style: none; padding: 0; margin: 0 auto; max-width: 960px; }
.flash { padding: 12px 18px; border-radius: 8px; margin: 8px 20px; background: var(--panel); }
.flash--error { border-left: 4px solid var(--error); }
.flash--success { border-left: 4px solid var(--brand); }

.recent { margin-top: 32px; }
.recent ul { list-style: none; padding: 0; }
.recent li { padding: 10px 0; border-bottom: 1px solid #1c2744; }

.pitch { margin-top: 32px; }
.pitch ul { padding-left: 18px; color: var(--muted); }

/* --- report -------------------------------------------------------- */
.report__head h1 { font-size: clamp(24px, 4vw, 32px); margin: 0 0 8px; }
.report__url code {
    display: inline-block;
    max-width: 100%;
    color: var(--accent);
    font-size: 0.9em;
    word-break: break-all;
    overflow-wrap: anywhere;
}
.report__meta { color: var(--muted); font-size: 14px; line-height: 1.8; }

.state {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}
.state--pending { background: #2a3759; color: var(--muted); }
.state--running { background: #2a3759; color: var(--info); }
.state--done    { background: rgba(101, 217, 160, 0.15); color: var(--brand); }
.state--failed  { background: rgba(255, 94, 94, 0.15); color: var(--error); }

.score--good { color: var(--brand); }
.score--mid  { color: var(--warn); }
.score--bad  { color: var(--error); }

.waiting {
    background: var(--panel);
    padding: 24px;
    border-radius: 12px;
    margin: 24px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    border-left: 4px solid var(--info);
}
.waiting p { margin: 0; }
.waiting__elapsed { display: block; margin-top: 6px; font-size: 13px; }

.spinner {
    width: 32px; height: 32px;
    border: 3px solid rgba(102, 168, 255, 0.25);
    border-top-color: var(--info);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.report__error {
    background: var(--panel);
    padding: 24px;
    border-radius: 12px;
    margin: 24px 0;
    border-left: 4px solid var(--error);
}
.report__error h2 { margin-top: 0; }
.error-detail {
    background: #0b1220;
    padding: 12px 14px;
    border-radius: 8px;
    color: var(--error);
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
}
.retry-form {
    display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap;
}
.retry-form input {
    flex: 1 1 220px; min-width: 0;
    padding: 10px 12px; font-size: 15px; border-radius: 8px;
    border: 1px solid #2a3759; background: #0b1220; color: var(--text);
}
.retry-form button {
    padding: 10px 18px; font-size: 15px; border: 0; border-radius: 8px;
    background: var(--accent); color: #1b1300; font-weight: 700; cursor: pointer;
}

.summary { margin: 24px 0; }
.summary dl {
    display: grid;
    grid-template-columns: minmax(120px, 180px) 1fr;
    gap: 8px 16px;
    margin: 0;
}
.summary dt { color: var(--muted); }
.summary dd { margin: 0; word-break: break-word; }

.findings__list { list-style: none; padding: 0; margin: 0; }
.finding {
    background: var(--panel);
    padding: 16px 18px;
    margin: 12px 0;
    border-radius: 12px;
    border-left: 4px solid var(--info);
}
.finding--error { border-left-color: var(--error); }
.finding--warn  { border-left-color: var(--warn); }
.finding__head  { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.finding__head h3 { margin: 0; font-size: 17px; flex: 1 1 auto; min-width: 0; }
.tag {
    background: #1b2540;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    white-space: nowrap;
}
.tag--muted   { opacity: 0.7; }
.tag--error   { background: rgba(255, 94, 94, 0.15);  color: var(--error); }
.tag--warn    { background: rgba(255, 182, 60, 0.15); color: var(--warn); }
.tag--info    { background: rgba(102, 168, 255, 0.15); color: var(--info); }
.evidence {
    background: #0b1220; padding: 10px; border-radius: 6px;
    overflow-x: auto;
    color: var(--muted); font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 100%;
}
.fix { margin-top: 6px; color: var(--text); }

.report__back { margin-top: 32px; }

/* --- pricing ------------------------------------------------------- */
.pricing__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}
.plan { background: var(--panel); padding: 22px; border-radius: 14px; }
.plan__price { font-size: 36px; font-weight: 800; margin: 4px 0; color: var(--brand); }
.plan button {
    width: 100%; padding: 12px; border: 0; border-radius: 8px;
    background: var(--accent); color: #1b1300; font-weight: 700; cursor: pointer;
    min-height: 48px;
}
.pricing__rex { margin-top: 36px; padding: 24px; background: var(--panel); border-radius: 14px; }
.cta { color: var(--accent); font-weight: 700; }

/* --- rexlama banner ------------------------------------------------ */
.rexlama-banner {
    max-width: 960px;
    margin: 24px auto;
    padding: 16px 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, #1b2540, #2a1c40);
    border-radius: 14px;
    border: 1px solid #3b2e60;
    flex-wrap: wrap;
}
.rexlama-banner__text { flex: 1 1 260px; min-width: 0; }
.rexlama-banner__text strong { display: block; font-size: 16px; }
.rexlama-banner__text span { color: var(--muted); }
.rexlama-banner__cta {
    background: var(--accent);
    color: #1b1300;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    flex: 0 0 auto;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

/* --- footer -------------------------------------------------------- */
footer {
    max-width: 960px;
    margin: 40px auto 60px;
    padding: 0 20px;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

/* ----------------------------------------------------------- */
/* Mobile + narrow viewports                                   */
/* ----------------------------------------------------------- */
@media (max-width: 720px) {
    .topbar {
        padding: 14px 16px;
        flex-direction: column;
        align-items: flex-start;
    }
    nav { width: 100%; justify-content: flex-start; gap: 10px 14px; }
    nav a { font-size: 14px; }

    main { padding: 24px 16px; }

    .hero h1 { font-size: 28px; }
    .audit-form { flex-direction: column; align-items: stretch; }
    .audit-form button { width: 100%; }

    .summary dl {
        grid-template-columns: 1fr;
        gap: 2px 0;
    }
    .summary dt {
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-top: 10px;
    }
    .summary dd { margin-bottom: 6px; }

    .finding { padding: 14px; }
    .finding__head h3 { font-size: 16px; }

    .rexlama-banner {
        margin: 20px 16px;
        flex-direction: column;
        align-items: flex-start;
    }
    .rexlama-banner__cta { width: 100%; justify-content: center; }

    .flash { margin: 8px 16px; }

    .pricing__grid { grid-template-columns: 1fr; }
    .plan__price { font-size: 32px; }

    .retry-form { flex-direction: column; }
    .retry-form button { width: 100%; }

    footer { margin: 32px auto 48px; padding: 0 16px; }
    .report__meta { line-height: 1.6; }
}

@media (max-width: 420px) {
    .hero h1 { font-size: 26px; }
    .lede { font-size: 15px; }
    nav { gap: 8px 12px; }
    nav a { font-size: 13px; }
}
