/*
 * Agent Disco — disco-ball-on-dark-matte palette.
 *   magenta  #ff2e8f   primary accent (CTAs, highlights)
 *   cyan     #00e5ff   secondary accent (links, grade A strokes)
 *   gold     #ffd34d   tertiary accent (grade A fills, hover)
 *   bg       #0e0e2a   deep-night matte
 *   surface  #16162e   card backgrounds
 *   text     #e8e8f4   body
 *   muted    #9d9db4   secondary text
 */

:root {
    --disco-bg: #0e0e2a;
    --disco-surface: #16162e;
    --disco-border: #2a2a55;
    --disco-text: #e8e8f4;
    --disco-muted: #9d9db4;
    --disco-magenta: #ff2e8f;
    --disco-cyan: #00e5ff;
    --disco-gold: #ffd34d;
    --disco-red: #e5004b;
    --disco-orange: #e85d2f;
    --disco-amber: #f5a623;

    --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--disco-bg);
    color: var(--disco-text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.55;
    min-height: 100vh;
    /* subtle vignette so the mirror ball sits in its own pool of light */
    background-image:
        radial-gradient(ellipse at 50% 5%, rgba(255, 46, 143, 0.08), transparent 45%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 229, 255, 0.06), transparent 45%);
}

a {
    color: var(--disco-cyan);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover,
a:focus-visible {
    color: var(--disco-magenta);
}

h1, h2, h3 {
    font-weight: 600;
    letter-spacing: -0.01em;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ---------------- hero ---------------- */

.hero {
    padding: 5rem 0 3rem;
    text-align: center;
}

.hero__kicker {
    display: inline-block;
    color: var(--disco-cyan);
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.hero__headline {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    line-height: 1.1;
    margin: 0 0 1rem;
}

.hero__headline em {
    font-style: normal;
    background: linear-gradient(135deg, var(--disco-magenta), var(--disco-gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero__blurb {
    color: var(--disco-muted);
    font-size: 1.1rem;
    max-width: 48rem;
    margin: 0 auto 2.5rem;
}

.hero__ball {
    width: 140px;
    height: 140px;
    margin: 0 auto 1.5rem;
    animation: disco-spin 12s linear infinite;
    filter: drop-shadow(0 20px 40px rgba(255, 46, 143, 0.25));
}

@keyframes disco-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .hero__ball {
        animation: none;
    }
}

/* ---------------- form ---------------- */

.scan-form {
    max-width: 36rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.scan-form__row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.scan-form__label {
    position: absolute;
    left: -9999px;
}

.scan-form__input {
    flex: 1 1 20rem;
    min-width: 0;
    background: var(--disco-surface);
    color: var(--disco-text);
    border: 1px solid var(--disco-border);
    border-radius: 0.5rem;
    padding: 0.9rem 1rem;
    font-size: 1rem;
    font-family: var(--font-mono);
}

.scan-form__input::placeholder {
    color: var(--disco-muted);
}

.scan-form__input:focus-visible {
    outline: 2px solid var(--disco-cyan);
    outline-offset: 2px;
    border-color: var(--disco-cyan);
}

.scan-form__button {
    flex: 0 0 auto;
    background: linear-gradient(135deg, var(--disco-magenta), var(--disco-cyan));
    color: #fff;
    border: 0;
    border-radius: 0.5rem;
    padding: 0.9rem 1.6rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: filter 120ms ease;
}

.scan-form__button:hover:not(:disabled),
.scan-form__button:focus-visible {
    filter: brightness(1.15);
    outline: none;
}

.scan-form__button:focus-visible {
    outline: 2px solid var(--disco-gold);
    outline-offset: 3px;
}

.scan-form__button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.scan-form__button[data-loading="true"] .scan-form__button-label::after {
    content: '…';
}

.scan-form__error {
    color: var(--disco-red);
    font-size: 0.95rem;
    min-height: 1.3rem;
    margin: 0;
}

/* ---------------- example teaser ---------------- */

.example {
    margin: 4rem auto 5rem;
    max-width: 52rem;
    background: var(--disco-surface);
    border: 1px solid var(--disco-border);
    border-radius: 1rem;
    padding: 2rem;
}

.example__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--disco-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.example__grade {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--disco-gold), var(--disco-magenta));
    color: #0e0e2a;
    font-weight: 700;
    font-size: 1.25rem;
    padding: 0.2rem 0.75rem;
    border-radius: 0.5rem;
    letter-spacing: 0;
}

.example__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
    gap: 0.6rem 1.5rem;
}

.example__item {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.3rem 0;
    border-bottom: 1px dashed var(--disco-border);
    font-size: 0.95rem;
}

.example__item:last-child {
    border-bottom: none;
}

.example__item-name {
    color: var(--disco-text);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.example__item-status {
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.example__item-status--pass { color: var(--disco-gold); }
.example__item-status--warn { color: var(--disco-amber); }
.example__item-status--fail { color: var(--disco-red); }
.example__item-status--skip { color: var(--disco-muted); }
.example__item-status--error { color: var(--disco-red); }

.example__footnote {
    margin: 1.25rem 0 0;
    color: var(--disco-muted);
    font-size: 0.85rem;
}

/* ---------------- why Agent Disco ---------------- */
/* AD-36: three-bullet positioning section between hero and example.
   Answers "how is this different from an SEO audit?" in the first
   viewport so a scan-submitting visitor understands the product. */

.why {
    margin: 3rem auto 0;
    max-width: 52rem;
    padding: 0 1rem;
}

.why__title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--disco-text);
}

.why__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1rem;
}

.why__item {
    background: var(--disco-surface);
    border: 1px solid var(--disco-border);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    line-height: 1.55;
    color: var(--disco-muted);
}

.why__item strong {
    color: var(--disco-text);
    display: block;
    margin-bottom: 0.25rem;
}

/* ---------------- /contact form ---------------- */
/* Form-based contact mailer. Sober like /terms — this is a utility page,
   not a marketing moment. The `.contact-form__honeypot` row keeps the
   visually-hidden input rendered (bots see it, real users never encounter
   it) without the non-accessible `display: none` that some anti-spam
   stacks sniff out. */

.contact {
    max-width: 44rem;
    padding: 2rem 1rem;
}

.contact__body h1 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.contact__lead {
    color: var(--disco-muted);
    line-height: 1.6;
    margin-top: 0;
}

.contact__body h2 {
    font-size: 1.15rem;
    margin-top: 2rem;
    color: var(--disco-muted);
}

.contact__body p {
    line-height: 1.65;
}

.contact__flash {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    line-height: 1.45;
}

.contact__flash--success {
    background: rgba(255, 214, 102, 0.12);
    border: 1px solid var(--disco-gold);
    color: var(--disco-gold);
}

.contact__flash--error {
    background: rgba(220, 53, 69, 0.12);
    border: 1px solid var(--disco-red);
    color: var(--disco-red);
}

.contact-form {
    display: grid;
    gap: 1rem;
    margin: 1.25rem 0 2rem;
}

.contact-form > div {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.contact-form label {
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--disco-muted);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--disco-border);
    border-radius: 6px;
    color: var(--disco-text);
    font: inherit;
    padding: 0.6rem 0.8rem;
}

.contact-form textarea {
    min-height: 10rem;
    resize: vertical;
}

.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
    outline: 2px solid var(--disco-gold);
    outline-offset: 1px;
}

.contact-form .form-error-message,
.contact-form ul li {
    color: var(--disco-red);
    font-size: 0.85rem;
    margin: 0;
}

.contact-form__submit {
    background: linear-gradient(135deg, var(--disco-gold), var(--disco-magenta));
    color: #0e0e2a;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    justify-self: start;
}

.contact-form__submit:hover,
.contact-form__submit:focus-visible {
    filter: brightness(1.1);
    outline: 2px solid var(--disco-gold);
    outline-offset: 2px;
}

/* Honeypot: visually hidden from humans, still present in the DOM so
   the bot-side DOM walker encounters it. `display: none` would be
   simpler but some anti-spam stacks fingerprint that; a position-
   based hide is more resilient. */
.contact-form__honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* ---------------- legal pages ---------------- */
/* AD-37: sober two-column-free layout for /terms, /privacy.
   Operators reading ToS want to see serious, not cute — resist the
   disco maximalism here. */

.legal {
    max-width: 44rem;
    padding: 2rem 1rem;
}

.legal__body h1 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.legal__body h2 {
    font-size: 1.15rem;
    margin-top: 2rem;
    color: var(--disco-muted);
}

.legal__body p,
.legal__body ul {
    line-height: 1.65;
}

.legal__updated {
    color: var(--disco-muted);
    font-size: 0.85rem;
    margin-top: 0;
}

.legal__email {
    font-size: 1.1rem;
    margin: 1.5rem 0;
}

/* ---------------- /bot page ---------------- */
/* AD-36: operator-facing explanation of the scanner. Shares the sober
   tone of /terms; no hero, no disco flair — it's the page people read
   before deciding to allow-list us. */

.bot-page {
    max-width: 44rem;
    padding: 2rem 1rem;
}

.bot-page__header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.bot-page__lead {
    color: var(--disco-muted);
    line-height: 1.6;
    margin-top: 0;
}

.bot-page__body h2 {
    font-size: 1.15rem;
    margin-top: 2rem;
    color: var(--disco-muted);
}

.bot-page__body p,
.bot-page__body ul {
    line-height: 1.65;
}

.bot-page__code {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--disco-border);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    font-size: 0.9rem;
    margin: 0.5rem 0 1rem;
}

/* ---------------- footer ---------------- */
/* AD-37: shared site-wide footer. UK Companies Act attribution is
   required on every page; keeps it sober and out of the way of the
   disco hero. */

.site-footer {
    border-top: 1px solid var(--disco-border);
    padding: 2rem 1rem 3rem;
    margin-top: 3rem;
    color: var(--disco-muted);
    font-size: 0.85rem;
    text-align: center;
    line-height: 1.6;
}

.site-footer__legal p {
    margin: 0.25rem 0;
}

.site-footer__company strong {
    color: var(--disco-muted);
    font-weight: 600;
}

.site-footer__office {
    font-size: 0.8rem;
}

.site-footer__nav {
    margin: 1rem 0 0.5rem;
}

.site-footer__nav a,
.site-footer__contact a {
    color: var(--disco-muted);
    margin: 0 0.4rem;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: text-decoration-color 0.15s;
}

.site-footer__nav a:hover,
.site-footer__contact a:hover {
    color: var(--disco-cyan);
    text-decoration-color: var(--disco-cyan);
}

/* ---------------- report page ---------------- */

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

.report {
    padding-bottom: 4rem;
}

.report-hero {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    padding: 3rem 0 2rem;
    flex-wrap: wrap;
}

.report-hero__ball {
    position: relative;
    width: 180px;
    height: 180px;
    flex: 0 0 180px;
    animation: disco-spin 18s linear infinite;
    filter: drop-shadow(0 20px 40px rgba(255, 46, 143, 0.25));
}

.report-hero__ball img {
    width: 100%;
    height: 100%;
}

.report-hero__grade {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    font-weight: 800;
    color: #0e0e2a;
    text-shadow: 0 2px 0 rgba(255, 211, 77, 0.9);
    /* counter-rotate so the letter stays upright while the ball spins */
    animation: disco-spin-counter 18s linear infinite;
}

@keyframes disco-spin-counter {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .report-hero__ball,
    .report-hero__grade {
        animation: none;
    }
}

.report-hero__meta {
    flex: 1 1 20rem;
}

.report-hero__kicker {
    color: var(--disco-cyan);
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.report-hero__title {
    font-family: var(--font-mono);
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    margin: 0.25rem 0 0.75rem;
    word-break: break-all;
}

.report-hero__score {
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
}

.report-hero__score strong {
    color: var(--disco-gold);
}

.report-hero__when {
    color: var(--disco-muted);
    font-size: 0.9rem;
    margin: 0;
}

.report-hero--pending .report-hero__grade {
    color: var(--disco-muted);
    text-shadow: none;
    animation: none;
}

.report-section {
    padding: 1.5rem 0;
    border-top: 1px solid var(--disco-border);
}

.report-section:first-of-type {
    border-top: none;
}

/* AD-51: the one-paragraph "why this grade" summary that lives between
   the hero and the quick-wins. Deliberately not wrapped in .report-section
   so it doesn't carry the section border — it reads as a continuation
   of the hero, not a new section. */

.report-why {
    padding: 0.5rem 0 1.5rem;
}

.report-why__title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: var(--disco-muted);
    font-weight: 600;
}

.report-why__body {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.5;
    max-width: 42rem;
}

.report-section__title {
    margin: 0 0 0.25rem;
    font-size: 1.3rem;
}

.report-section__lead {
    color: var(--disco-muted);
    margin: 0 0 1rem;
    font-size: 0.95rem;
}

.quick-wins,
.blocking-issues {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.5rem;
}

.quick-win,
.blocking-issue {
    display: grid;
    gap: 0.1rem;
    padding: 0.75rem 1rem;
    background: var(--disco-surface);
    border: 1px solid var(--disco-border);
    border-radius: 0.5rem;
}

.quick-win__label,
.blocking-issue__label {
    font-weight: 600;
}

.quick-win__hint,
.blocking-issue__notes {
    color: var(--disco-muted);
    font-size: 0.92rem;
}

.breakdown {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.breakdown th,
.breakdown td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--disco-border);
}

.breakdown thead th {
    color: var(--disco-muted);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.breakdown__cat { font-weight: 600; }

.breakdown__num {
    font-family: var(--font-mono);
    color: var(--disco-muted);
    width: 7rem;
}

.breakdown__bar-header,
.breakdown__bar-cell {
    width: 55%;
}

.bar {
    position: relative;
    height: 1.4rem;
    background: var(--disco-bg);
    border: 1px solid var(--disco-border);
    border-radius: 0.4rem;
    overflow: hidden;
}

.bar__fill {
    position: absolute;
    inset: 0 auto 0 0;
    background: linear-gradient(90deg, var(--disco-magenta), var(--disco-cyan));
    transition: width 300ms ease;
}

.bar__label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    padding-right: 0.5rem;
    color: var(--disco-text);
    font-size: 0.75rem;
    font-weight: 600;
    mix-blend-mode: difference;
}

.findings {
    margin-bottom: 1rem;
    background: var(--disco-surface);
    border: 1px solid var(--disco-border);
    border-radius: 0.6rem;
    padding: 0.5rem 1rem;
}

.findings__summary {
    cursor: pointer;
    font-weight: 600;
    padding: 0.25rem 0;
}

.findings__summary:focus-visible {
    outline: 2px solid var(--disco-cyan);
    outline-offset: 2px;
    border-radius: 0.3rem;
}

.findings__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    margin-top: 0.75rem;
}

.findings__table th,
.findings__table td {
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid var(--disco-border);
    text-align: left;
    vertical-align: top;
}

.findings__table thead th {
    color: var(--disco-muted);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.findings__key {
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.findings__points {
    font-family: var(--font-mono);
    color: var(--disco-muted);
    width: 6rem;
}

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

.status {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status--pass { background: rgba(255, 211, 77, 0.2); color: var(--disco-gold); }
.status--warn { background: rgba(245, 166, 35, 0.2); color: var(--disco-amber); }
.status--fail { background: rgba(229, 0, 75, 0.2); color: var(--disco-red); }
.status--skip { background: rgba(157, 157, 180, 0.2); color: var(--disco-muted); }
.status--error { background: rgba(232, 93, 47, 0.2); color: var(--disco-orange); }

.embed-snippet {
    background: var(--disco-bg);
    border: 1px solid var(--disco-border);
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--disco-text);
    margin: 0;
}

.embed-snippet code {
    white-space: pre;
}

/* ---------------- scan-progress page ---------------- */

.scan-progress-page {
    padding-bottom: 4rem;
}

.scan-progress-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2.5rem 0 1.5rem;
    flex-wrap: wrap;
}

.scan-progress-hero .hero__ball {
    animation: disco-spin 10s linear infinite;
    margin: 0;
    width: 96px;
    height: 96px;
    filter: drop-shadow(0 10px 20px rgba(0, 229, 255, 0.2));
}

.scan-progress-hero__title {
    font-family: var(--font-mono);
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    margin: 0.25rem 0;
    word-break: break-all;
}

.scan-progress-hero__url {
    color: var(--disco-muted);
    margin: 0;
    font-size: 0.9rem;
    word-break: break-all;
}

.scan-progress-frame {
    display: block;
}

.scan-progress {
    background: var(--disco-surface);
    border: 1px solid var(--disco-border);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
}

.scan-progress__state {
    margin: 0 0 1rem;
    color: var(--disco-muted);
    font-size: 0.95rem;
}

.scan-progress__state strong {
    color: var(--disco-text);
    letter-spacing: 0.06em;
}

.scan-progress__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.4rem;
}

.scan-progress__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0.75rem;
    background: var(--disco-bg);
    border: 1px solid var(--disco-border);
    border-radius: 0.4rem;
    transition: background 160ms ease;
}

.scan-progress__row--pending {
    opacity: 0.55;
}

.scan-progress__check {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.scan-progress__cat {
    color: var(--disco-cyan);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.scan-progress__label {
    font-size: 0.95rem;
}

.scan-progress__status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.scan-progress__points {
    font-family: var(--font-mono);
    color: var(--disco-muted);
    font-size: 0.85rem;
}

.status--pending {
    background: rgba(157, 157, 180, 0.15);
    color: var(--disco-muted);
}

.scan-progress__complete,
.scan-progress__failed {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px dashed var(--disco-border);
}

.scan-progress__complete p,
.scan-progress__failed p {
    margin: 0.25rem 0;
}

.scan-progress__complete {
    color: var(--disco-gold);
}

.scan-progress__failed h2 {
    margin: 0 0 0.5rem;
    color: var(--disco-red);
}

.scan-progress__link {
    font-weight: 600;
}

/* ---- AD-21 scan history ---------------------------------------------- */

.history {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
}

.history thead th {
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--disco-muted);
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--disco-border);
}

.history__row td {
    padding: 0.5rem;
    border-bottom: 1px dashed var(--disco-border);
    vertical-align: middle;
}

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

/* AD-52: expandable "what flipped" panel under each history row. No
   border — it visually belongs to the row above. Defaults to <details open>
   so the panel is visible without JS; Stimulus can strip the attribute
   later to make it click-to-expand. */

.history__flips-cell {
    padding: 0 0.5rem 0.75rem;
    border-bottom: 1px solid var(--disco-border);
    background: rgba(14, 14, 42, 0.4);
}

.history__flips-summary {
    font-size: 0.85rem;
    color: var(--disco-muted);
    cursor: pointer;
    padding: 0.25rem 0;
}

.history__flips-list {
    margin: 0.4rem 0 0;
    padding-left: 0;
    list-style: none;
}

.history__flip {
    display: flex;
    gap: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 0.15rem 0;
}

.history__flip-icon {
    width: 1rem;
    font-weight: bold;
    text-align: center;
    flex-shrink: 0;
}

.history__flip--pass .history__flip-icon { color: var(--disco-gold); }
.history__flip--fail .history__flip-icon { color: var(--disco-red); }
.history__flip--more { color: var(--disco-muted); font-style: italic; }

.history__flips-empty {
    margin: 0.4rem 0 0;
    color: var(--disco-muted);
    font-style: italic;
    font-size: 0.9rem;
}

.history__score,
.history__checks {
    font-variant-numeric: tabular-nums;
}

.history__link a {
    color: var(--disco-cyan);
    text-decoration: none;
    font-weight: 600;
}

.history__link a:hover,
.history__link a:focus {
    text-decoration: underline;
}

.history__more {
    margin: 0.75rem 0 0;
}

.history-sparkline {
    display: block;
    margin-bottom: 0.5rem;
    max-width: 100%;
    height: auto;
}

.grade-chip {
    display: inline-block;
    min-width: 1.5rem;
    padding: 0.1rem 0.5rem;
    border-radius: 0.5rem;
    font-weight: 700;
    text-align: center;
    background: #1a1a2e;
    color: var(--disco-cyan);
}

.grade-chip--a { background: var(--disco-magenta); color: var(--disco-gold); }
.grade-chip--b { background: #1a1a2e; color: var(--disco-cyan); }
.grade-chip--c { background: #1a1a2e; color: #f5a623; }
.grade-chip--d { background: #1a1a2e; color: #e85d2f; }
.grade-chip--f { background: #1a1a2e; color: #e5004b; }

.arrow {
    display: inline-block;
    font-weight: 700;
}

.arrow--up { color: var(--disco-cyan); }
.arrow--down { color: var(--disco-red); }
.arrow--same { color: var(--disco-muted); }
.arrow--none { color: var(--disco-border); }

/* ---- AD-22 checks catalogue ----------------------------------------- */

.checks {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.checks thead th {
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--disco-muted);
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--disco-border);
}

.checks tbody td {
    padding: 0.5rem;
    vertical-align: top;
    border-bottom: 1px dashed var(--disco-border);
}

.checks__label a {
    color: var(--disco-cyan);
    font-weight: 600;
    text-decoration: none;
}

.checks__label a:hover,
.checks__label a:focus {
    text-decoration: underline;
}

.checks__key {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    color: var(--disco-muted);
    margin-top: 0.1rem;
}

.checks__weight {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.checks__desc {
    color: var(--disco-muted);
    max-width: 36rem;
}

.phase {
    display: inline-block;
    padding: 0.05rem 0.45rem;
    border-radius: 0.4rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.phase--passive { background: rgba(0, 229, 255, 0.15); color: var(--disco-cyan); }
.phase--active  { background: rgba(255, 46, 143, 0.18); color: var(--disco-magenta); }

.check-detail {
    color: var(--disco-text);
    line-height: 1.6;
    max-width: 48rem;
}

.check-detail h1,
.check-detail h2,
.check-detail h3 {
    color: var(--disco-gold);
    margin-top: 1.5rem;
}

.check-detail a {
    color: var(--disco-cyan);
}

.check-detail code {
    background: #1a1a2e;
    padding: 0.1rem 0.35rem;
    border-radius: 0.3rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9em;
}

.check-detail pre {
    background: #1a1a2e;
    padding: 0.75rem;
    border-radius: 0.5rem;
    overflow-x: auto;
}

.check-detail table {
    border-collapse: collapse;
    margin: 0.5rem 0;
}

.check-detail th,
.check-detail td {
    border: 1px solid var(--disco-border);
    padding: 0.35rem 0.6rem;
    text-align: left;
}
