/* round-verifier — deliberately plain, self-contained styling. No shared
 * game chrome: this page is a reading instrument, and its source is part of
 * the published verifiable set, so it carries no dependencies it doesn't
 * strictly need. */

:root {
    --bg: #101418;
    --panel: #171d24;
    --text: #e6e9ec;
    --muted: #9aa4ad;
    --accent: #4ade80;
    --fail: #f87171;
    --line: #2a323b;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0 auto;
    max-width: 60rem;
    padding: 1.5rem 1rem 4rem;
    background: var(--bg);
    color: var(--text);
    font:
        16px/1.55 system-ui,
        -apple-system,
        'Segoe UI',
        sans-serif;
}

h1 {
    margin: 0 0 0.25rem;
    font-size: 1.6rem;
}

h2 {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
}

h3 {
    margin: 1.25rem 0 0.5rem;
    font-size: 1rem;
}

.tagline {
    color: var(--accent);
    margin: 0 0 1rem;
    font-weight: 600;
}

.intro {
    color: var(--muted);
    margin: 0.5rem 0;
}

ol.intro {
    padding-left: 1.25rem;
}

code {
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 0.85em;
    background: #0b0e12;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.05em 0.3em;
    word-break: break-all;
}

a {
    color: var(--accent);
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
}

/* One field per row on a phone, two from a tablet up (48rem, an iPad held
   upright). Never three: the values are long hashes and addresses, and a third
   of the page is too narrow to read one. */
.grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem 1rem;
}

@media (min-width: 48rem) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--muted);
}

/* A grid row is as tall as its tallest cell, and a label can wrap to two
   lines, so the control used to sit wherever its own label's height left it
   and one row's inputs landed at different heights. Pinning the control to
   the bottom of the stretched cell keeps a row's inputs on one baseline;
   the label text stays at the top. (A datalist renders nothing, so it takes
   no slot.) */
.grid label > input,
.grid label > select {
    margin-top: auto;
}

input,
select,
textarea {
    background: #0b0e12;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.45rem 0.6rem;
    font:
        0.9rem ui-monospace,
        'SF Mono',
        Menlo,
        monospace;
    width: 100%;
}

input[readonly] {
    opacity: 0.6;
}

textarea {
    margin-top: 0.5rem;
}

.note {
    color: var(--muted);
    font-size: 0.85rem;
    /* A note can quote a URL or a hash with no space in it; on a phone it
       must break inside the value rather than widen the page. */
    overflow-wrap: anywhere;
}

.actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

/* The whole row of a collapsible section toggles it, so it takes the hand. */
summary {
    cursor: pointer;
}

/* Where the round's messages come from: two radio buttons drawn as one
   segmented control. The inputs stay in the page (and in the tab order) but
   out of sight; the label shows the choice and the keyboard focus. */
.source {
    display: flex;
    flex-wrap: wrap;
    margin: 1.5rem 0 0.75rem;
    padding: 0;
    border: 0;
    min-width: 0;
}

.source legend {
    padding: 0;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.source label {
    position: relative;
    flex-direction: row;
    align-items: center;
    padding: 0.45rem 1rem;
    border: 1px solid var(--line);
    background: #0b0e12;
    color: var(--muted);
    font-size: 0.9rem;
    cursor: pointer;
}

.source label + label {
    margin-left: -1px;
}

.source label:first-of-type {
    border-radius: 6px 0 0 6px;
}

.source label:last-of-type {
    border-radius: 0 6px 6px 0;
}

.source input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.source label:has(input:checked) {
    z-index: 1;
    border-color: var(--accent);
    background: #232c36;
    color: var(--text);
}

.source label:has(input:focus-visible) {
    z-index: 2;
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button {
    background: #232c36;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
}

button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #06130a;
    font-weight: 600;
}

button:disabled {
    opacity: 0.5;
    cursor: wait;
}

#progress,
#payout-progress {
    color: var(--muted);
    font-size: 0.85rem;
}

#payout-report {
    margin-top: 0.75rem;
}

/* Focused only so a screen reader announces a new report; no ring. */
#report-panel:focus,
#payout-report:focus {
    outline: none;
}

.verdict {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-weight: 600;
}

.verdict.verified {
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid var(--accent);
    color: var(--accent);
}

.verdict.failed {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid var(--fail);
    color: var(--fail);
}

/*
 * The four "not alleging anything" verdicts share the muted treatment, because
 * none of them is a finding: `incomplete` (a proof had no inputs),
 * `inconclusive` (the range was too narrow), `undetermined` (not on chain yet,
 * and nothing says it never will be) and `attested` (checked, but only
 * weakly). Giving any of them a warning colour would read as an accusation the
 * verdict is specifically declining to make. The preliminary pass's label
 * shares it: it states no verdict at all.
 */
.verdict.incomplete,
.verdict.inconclusive,
.verdict.undetermined,
.verdict.attested,
.verdict.preliminary {
    background: rgba(154, 164, 173, 0.12);
    border: 1px solid var(--muted);
    color: var(--muted);
}

/* The one accusatory verdict, styled like a failure because it is one. */
.verdict.suppressed {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid var(--fail);
    color: var(--fail);
}

/*
 * The session payout's outcomes, under the same rule as the verdicts: the
 * one that alleges something (`overpaid`) and the one that found a check not
 * holding (`unbacked`) read as failures; `backed` as a pass; and the four that
 * are not findings (`short`, `pending`, `unpaid`, `unavailable`) stay muted,
 * because a warning colour on "nothing to compare yet" would read as an
 * accusation the outcome is specifically declining to make.
 */
.verdict.payout-backed {
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid var(--accent);
    color: var(--accent);
}

.verdict.payout-overpaid,
.verdict.payout-unbacked {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid var(--fail);
    color: var(--fail);
}

.verdict.payout-short,
.verdict.payout-pending,
.verdict.payout-unpaid,
.verdict.payout-unavailable {
    background: rgba(154, 164, 173, 0.12);
    border: 1px solid var(--muted);
    color: var(--muted);
}

#checks,
#references,
#payout-checks,
#payout-references {
    list-style: none;
    margin: 0;
    padding: 0;
}

.check {
    display: flex;
    gap: 0.6rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line);
}

.check .badge {
    flex: 0 0 1.4rem;
    text-align: center;
    font-weight: 700;
}

.check.pass .badge {
    color: var(--accent);
}

.check.fail .badge {
    color: var(--fail);
}

.check.unavailable {
    opacity: 0.7;
}

.check p {
    margin: 0.15rem 0 0;
    color: var(--muted);
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

#working details {
    border: 1px solid var(--line);
    border-radius: 6px;
    margin: 0.4rem 0;
    padding: 0.4rem 0.75rem;
}

#working summary {
    font-size: 0.9rem;
}

#working dl {
    display: grid;
    grid-template-columns: minmax(12rem, auto) 1fr;
    gap: 0.2rem 1rem;
    margin: 0.5rem 0 0.25rem;
    font-size: 0.82rem;
}

#working dt {
    color: var(--muted);
}

#working dd {
    margin: 0;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    overflow-wrap: anywhere;
}

#references li {
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.85rem;
    color: var(--muted);
    overflow-wrap: anywhere;
}

/* A value in the report the reader copies with a click (identifiers.ts finds
   them). It stays inline so a long hash wraps with the sentence around it. */
code.copy {
    cursor: pointer;
    /* The sentence's own colour: the box, the cursor and the hover border mark
       it as copyable without making it louder than the text around it. */
    color: inherit;
    /* Move a value to the next line whole, and break inside it only when it
       is wider than a line (a hash on a phone): a level split as 158 / 15367
       reads as two numbers. */
    word-break: normal;
    overflow-wrap: anywhere;
    transition:
        border-color 0.15s,
        color 0.15s;
}

code.copy:hover {
    border-color: var(--muted);
}

code.copy:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

code.copy.copied {
    border-color: var(--accent);
    color: var(--accent);
}

/* Read by screen readers, never shown: announces a copy. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

footer {
    margin-top: 2rem;
    color: var(--muted);
    font-size: 0.8rem;
}
