/*
 * Numerology Metadata
 *
 * Served from this origin only. The Content-Security-Policy forbids inline
 * styles, so every rule lives in this file and nothing in the markup carries a
 * style attribute.
 */

:root {
    --bg: #080a0e;
    --bg-glow: #10151f;
    --surface: #11151d;
    --surface-raised: #161c26;
    --surface-sunken: #0b0e14;
    --border: #232b39;
    --border-bright: #35415580;
    --text: #e7ecf3;
    --text-muted: #8a95a8;
    --text-dim: #626c7d;
    --accent: #e0b169;
    --accent-soft: #e0b16922;
    --cyan: #5fc6d4;
    --master: #b18cf0;
    --karmic: #ef8b8b;
    --terminal: #7fd6a0;
    --radius: 10px;
    --radius-sm: 6px;
    --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background:
        radial-gradient(circle at 12% -10%, var(--bg-glow) 0%, transparent 55%),
        radial-gradient(circle at 88% 0%, #1a1424 0%, transparent 45%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

[hidden] {
    display: none !important;
}

.page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.25rem 4rem;
}

.mono {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
}

/*
 * Overflow containment.
 *
 * Grid and flex children default to min-width:auto, which lets wide content -
 * a calculation trace with long lines - push its track wider than the viewport
 * and give the whole page a horizontal scrollbar. Setting min-width:0 lets the
 * track shrink so the <pre> scrolls inside its own box instead.
 */
.cards > *,
.grid > *,
.fingerprint__grid > *,
.detail__head > *,
.component__head > *,
.normalization__row > *,
.finding > *,
.masthead > * {
    min-width: 0;
}

pre,
table {
    max-width: 100%;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ---------- Masthead ---------- */

.masthead {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1.25rem;
    padding: 1.75rem 0 1.25rem;
    border-bottom: 1px solid var(--border);
}

.masthead__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.masthead__glyph {
    color: var(--accent);
    font-size: 0.7rem;
    line-height: 1;
}

.masthead__tag {
    margin: 0;
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* ---------- Hero and form ---------- */

.hero {
    padding: 3.5rem 0 2rem;
    max-width: 46rem;
}

.hero--narrow {
    max-width: 34rem;
}

.hero__title {
    margin: 0 0 1rem;
    overflow-wrap: anywhere;
    font-size: clamp(2.1rem, 6vw, 3.2rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    background: linear-gradient(96deg, var(--text) 25%, var(--accent) 120%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero__subtitle {
    margin: 0 0 2.25rem;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.hero__disclaimer {
    margin: 2rem 0 0;
    padding: 1rem 1.1rem;
    border-left: 2px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted);
    font-size: 0.87rem;
}

.form {
    display: grid;
    gap: 1.5rem;
    padding: 1.75rem;
    background: linear-gradient(180deg, var(--surface-raised), var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.form__field {
    display: grid;
    gap: 0.45rem;
}

.form__label {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.form__input {
    width: 100%;
    padding: 0.8rem 0.9rem;
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--sans);
    font-size: 1rem;
}

.form__input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: transparent;
}

.form__input--invalid {
    border-color: var(--karmic);
}

.form__hint {
    margin: 0;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.button {
    display: inline-block;
    padding: 0.85rem 1.6rem;
    background: linear-gradient(180deg, var(--accent), #c9974f);
    border: none;
    border-radius: var(--radius-sm);
    color: #1a1206;
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    filter: brightness(1.08);
}

.button:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

.button--ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.55rem 1.1rem;
    font-size: 0.85rem;
}

.button--ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
    filter: none;
}

.alert {
    margin-bottom: 1.5rem;
    padding: 1rem 1.1rem;
    background: #2a1618;
    border: 1px solid #5c2c2f;
    border-radius: var(--radius-sm);
}

.alert__title {
    margin: 0 0 0.4rem;
    font-weight: 600;
    color: var(--karmic);
}

.alert__list {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---------- Explainer ---------- */

.explainer {
    padding: 2rem 0 1rem;
    border-top: 1px solid var(--border);
}

.explainer__heading {
    margin: 0 0 1.25rem;
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.explainer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.explainer__item {
    padding: 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.explainer__item h3 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    color: var(--accent);
}

.explainer__item p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.87rem;
}

/* ---------- Result header ---------- */

.result__head {
    padding: 2.5rem 0 1.75rem;
}

.result__eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}

.result__name {
    margin: 0 0 1.5rem;
    overflow-wrap: anywhere;
    font-size: clamp(1.7rem, 4.5vw, 2.5rem);
    line-height: 1.15;
    letter-spacing: -0.015em;
}

.result__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin: 0 0 1.5rem;
    padding: 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.result__metaItem dt {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.result__metaItem dd {
    margin: 0.2rem 0 0;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.result__disclaimer {
    margin: 0 0 1.25rem;
    padding: 0.9rem 1.1rem;
    border-left: 2px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.result__actions {
    margin: 0;
}

.tagline {
    color: var(--text-dim);
    font-size: 0.8rem;
}

/* ---------- Tabs ---------- */

.tabs {
    position: sticky;
    top: 0;
    z-index: 10;
    margin-bottom: 2rem;
    /* Opaque: content scrolls underneath this bar and must not show through. */
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.tabs__list {
    display: flex;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    white-space: nowrap;
}

.tabs__link {
    display: inline-block;
    padding: 0.75rem 0.9rem;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.88rem;
    text-decoration: none;
}

.tabs__link:hover {
    color: var(--text);
}

.tabs__link--active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tabs__link:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: -2px;
}

/* ---------- Panels ---------- */

.panel {
    padding-bottom: 3rem;
    scroll-margin-top: 4rem;
}

.panel__heading {
    margin: 0 0 0.6rem;
    font-size: 1.4rem;
    letter-spacing: -0.01em;
}

.panel__subheading {
    margin: 2.25rem 0 1rem;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.panel__lead {
    margin: 0 0 1.75rem;
    max-width: 62ch;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.panel__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1rem;
}

.copy-status {
    color: var(--terminal);
    font-size: 0.82rem;
}

/* ---------- Cards ---------- */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
}

.card {
    position: relative;
    padding: 1.25rem;
    background: linear-gradient(180deg, var(--surface-raised), var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent 70%);
}

.card--master::before {
    background: linear-gradient(90deg, var(--master), transparent 70%);
}

.card--karmic::before {
    background: linear-gradient(90deg, var(--karmic), transparent 70%);
}

.card__label {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.card__value {
    margin: 0;
    font-size: clamp(1.9rem, 7vw, 2.3rem);
    overflow-wrap: anywhere;
    line-height: 1;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.card--master .card__value {
    color: var(--master);
}

.card__title {
    margin: 0.6rem 0 0;
    font-size: 0.9rem;
    color: var(--text);
}

.card__flags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
}

.flag {
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--border-bright);
    border-radius: 999px;
    font-size: 0.7rem;
    color: var(--text-dim);
    font-family: var(--mono);
}

.flag--master {
    border-color: var(--master);
    color: var(--master);
}

.flag--karmic {
    border-color: var(--karmic);
    color: var(--karmic);
}

.flag--current {
    border-color: var(--terminal);
    color: var(--terminal);
    margin-left: 0.5rem;
}

/* ---------- Fingerprint ---------- */

.fingerprint {
    margin: 0 0 2.25rem;
    padding: 1.5rem;
    background:
        linear-gradient(180deg, var(--surface-raised), var(--surface-sunken));
    border: 1px solid var(--border-bright);
    border-radius: var(--radius);
}

.fingerprint__heading {
    margin: 0 0 1.25rem;
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}

.fingerprint__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem 1.5rem;
}

.fingerprint__cell--wide {
    grid-column: 1 / -1;
}

.fingerprint__label {
    margin: 0 0 0.3rem;
    font-size: 0.7rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.fingerprint__value {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    overflow-wrap: anywhere;
}

/*
 * The core signature. The separator between the values is real text in the
 * markup, so it is copied along with them and read by assistive technology; the
 * space that follows each separator is non-breaking, which means a line can only
 * break before a separator and never strands one at the end of a line.
 *
 * The size is tuned so all seven values stay on a single line down to 320px.
 */
.fingerprint__cell--wide .fingerprint__value {
    /*
     * 4.9vw was measured, not guessed: at 280px the seven values plus their six
     * separators need a font no larger than 5.06vw to stay on one line, and the
     * constraint relaxes at every wider viewport. Should a device still wrap it,
     * the non-breaking spaces keep the result correct rather than merely narrow.
     */
    font-size: clamp(0.85rem, 4.9vw, 1.9rem);
    letter-spacing: 0.04em;
    color: var(--accent);
}

/*
 * Occurrences are separate elements for the same reason: HTML collapses runs of
 * whitespace, so joining them into one string would render "13 × 1 14 × 3" as an
 * unreadable run-on line.
 */
.fingerprint__occurrences {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15em 1.1em;
}

.fingerprint__value--master {
    color: var(--master);
}

.fingerprint__value--karmic {
    color: var(--karmic);
}

.fingerprint__note {
    margin: 0.3rem 0 0;
    color: var(--text-dim);
    font-size: 0.75rem;
}

.fingerprint__legend {
    margin: 1.25rem 0 0;
    padding: 0.75rem 0.9rem;
    background: var(--surface);
    border-left: 2px solid var(--cyan);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    max-width: 68ch;
}

.fingerprint__spectrum {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.spectrum {
    margin: 0.6rem 0 0;
    padding: 0;
    list-style: none;
}

.spectrum__row {
    display: grid;
    grid-template-columns: 1.5rem 1fr 1.6rem;
    align-items: center;
    gap: 0.6rem;
    padding: 0.12rem 0;
}

.spectrum__number {
    color: var(--text-dim);
    font-size: 0.82rem;
}

.spectrum__bar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    min-height: 0.7rem;
    align-items: center;
}

.spectrum__unit {
    display: block;
    width: 0.7rem;
    height: 0.7rem;
    background: var(--accent);
    border-radius: 1px;
    opacity: 0.7;
}

.spectrum__row--top .spectrum__unit {
    opacity: 1;
    background: var(--cyan);
}

.spectrum__count {
    color: var(--text-dim);
    font-size: 0.74rem;
    text-align: right;
}

.spectrum__row--missing .spectrum__number,
.spectrum__row--missing .spectrum__count {
    color: var(--karmic);
}

/* ---------- Detail blocks ---------- */

.detail {
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.detail--compact {
    margin-bottom: 0;
}

.detail--current {
    border-color: var(--terminal);
}

.detail__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}

.detail__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.detail__value {
    margin: 0;
    font-size: clamp(1.25rem, 5vw, 1.5rem);
    overflow-wrap: anywhere;
    font-weight: 600;
    color: var(--accent);
}

.detail__note {
    margin: 0.4rem 0 0;
    color: var(--text-dim);
    font-size: 0.82rem;
}

.grid {
    display: grid;
    gap: 1rem;
}

.grid--two {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid--three {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

/* ---------- Interpretation ---------- */

.interpretation {
    margin: 1rem 0 0;
    padding: 0.9rem 1rem;
    background: var(--surface-sunken);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}

.interpretation__label {
    margin: 0 0 0.3rem;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.interpretation__title {
    margin: 0 0 0.25rem;
    font-weight: 600;
    color: var(--cyan);
    font-size: 0.92rem;
}

.interpretation__text {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.notes {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* ---------- Trace ---------- */

.trace {
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.trace__summary {
    cursor: pointer;
    color: var(--cyan);
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    list-style: none;
}

.trace__summary::-webkit-details-marker {
    display: none;
}

.trace__summary::before {
    content: "\25B8\00a0";
}

.trace[open] > .trace__summary::before {
    content: "\25BE\00a0";
}

.trace__summary:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

.trace__body {
    margin: 0.7rem 0 0;
    padding: 0.9rem 1rem;
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 0.8rem;
    line-height: 1.65;
    color: var(--text-muted);
    white-space: pre;
}

/* ---------- Name section ---------- */

.normalization {
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.normalization__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 0 0 0.5rem;
    overflow-wrap: anywhere;
}

.normalization__label {
    min-width: 9rem;
    color: var(--text-dim);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
}

.chip {
    padding: 0.2rem 0.55rem;
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.76rem;
    color: var(--text-muted);
}

.warning {
    margin: 1rem 0 0;
    padding: 0.75rem 0.9rem;
    background: #2a2116;
    border: 1px solid #5c452c;
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 0.85rem;
}

.component {
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.component__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}

.component__name {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 1.05rem;
    letter-spacing: 0.12em;
}

.component__value {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent);
}

.component__source {
    margin: 0.3rem 0 0;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.component__totals {
    margin: 0.9rem 0 0;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.letters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.letter {
    display: grid;
    place-items: center;
    min-width: 2.4rem;
    padding: 0.35rem 0.2rem;
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--mono);
}

.letter__char {
    font-size: 0.95rem;
    color: var(--text);
}

.letter__value {
    font-size: 0.72rem;
    color: var(--text-dim);
}

.letter--vowel {
    border-color: var(--cyan);
}

.letter--vowel .letter__char {
    color: var(--cyan);
}

.letter--unmapped {
    border-style: dashed;
    opacity: 0.65;
}

/* ---------- Tables ---------- */

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.table th,
.table td {
    padding: 0.7rem 1rem;
    overflow-wrap: anywhere;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.table tr:last-child th,
.table tr:last-child td {
    border-bottom: none;
}

.table th {
    color: var(--text-muted);
    font-weight: 500;
    width: 40%;
}

/* ---------- Frequency visualisation ---------- */

.frequency {
    margin: 0;
    padding: 1.1rem;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.frequency__row {
    display: grid;
    grid-template-columns: 1.5rem 1fr 2rem auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0;
}

.frequency__number {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.frequency__bar {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    min-height: 0.9rem;
    align-items: center;
}

.frequency__unit {
    display: block;
    width: 0.85rem;
    height: 0.85rem;
    background: var(--accent);
    border-radius: 2px;
    opacity: 0.75;
}

.frequency__row--top .frequency__unit {
    opacity: 1;
    background: var(--cyan);
}

.frequency__count {
    color: var(--text-dim);
    font-size: 0.8rem;
    text-align: right;
}

.frequency__tag {
    color: var(--text-dim);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.frequency__row--top .frequency__tag {
    color: var(--cyan);
}

.frequency__row--missing .frequency__number,
.frequency__row--missing .frequency__tag {
    color: var(--karmic);
}

.legend {
    margin: 0.9rem 0 0;
    color: var(--text-dim);
    font-size: 0.8rem;
    max-width: 62ch;
}

/* ---------- Findings ---------- */

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

.finding {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    padding: 0.65rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
}

.finding__value {
    min-width: 2.2rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--accent);
}

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

.finding--hit {
    border-color: var(--border-bright);
}

.finding--master .finding__value {
    color: var(--master);
}

.finding--karmic .finding__value {
    color: var(--karmic);
}

.empty {
    margin: 0;
    padding: 0.75rem 0.9rem;
    background: var(--surface-sunken);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* ---------- Code view ---------- */

.code {
    display: grid;
    gap: 0.5rem;
}

.code__block {
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.code__summary {
    padding: 0.7rem 1rem;
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    color: var(--terminal);
    list-style: none;
}

.code__summary::-webkit-details-marker {
    display: none;
}

.code__summary::before {
    content: "$\00a0";
    color: var(--text-dim);
}

.code__summary:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: -2px;
}

.code__body {
    margin: 0;
    padding: 1rem;
    border-top: 1px solid var(--border);
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--text-muted);
    white-space: pre;
}

.code__body--tall {
    max-height: 32rem;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

/* ---------- Footer ---------- */

.footer {
    padding: 2rem 0 0;
    border-top: 1px solid var(--border);
}

.footer__note {
    margin: 0 0 0.5rem;
    max-width: 62ch;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.footer__note--muted {
    color: #4e5766;
}

.footer__credit {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem;
    margin: 1.25rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

.footer__brand {
    color: var(--accent);
    font-weight: 600;
}

.footer__sep {
    color: var(--border-bright);
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
    body {
        /* iOS Safari handles fixed attachment poorly and repaints on scroll. */
        background-attachment: scroll;
    }

    .page {
        padding: 0 1rem 3rem;
    }

    .masthead {
        padding: 1.25rem 0 1rem;
    }

    .hero {
        padding: 2.25rem 0 1.5rem;
    }

    .form {
        padding: 1.25rem;
        gap: 1.25rem;
    }

    .button {
        display: block;
        width: 100%;
        text-align: center;
    }

    .button--ghost {
        display: inline-block;
        width: auto;
    }

    /* Let the tab strip scroll edge to edge instead of inside the gutters. */
    .tabs {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .result__head {
        padding: 1.75rem 0 1.25rem;
    }

    .result__meta {
        grid-template-columns: 1fr;
        gap: 0.85rem;
        padding: 1rem;
    }

    .fingerprint,
    .detail,
    .component,
    .normalization {
        padding: 1.1rem;
    }

    .fingerprint__grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .panel {
        padding-bottom: 2rem;
    }

    .frequency__row {
        grid-template-columns: 1.5rem 1fr 2rem;
    }

    .frequency__tag {
        grid-column: 2 / -1;
        padding-left: 2.25rem;
    }

    .table th {
        width: auto;
    }

    .trace__body,
    .code__body {
        font-size: 0.74rem;
        padding: 0.75rem;
    }
}

@media (max-width: 420px) {
    .page {
        padding: 0 0.85rem 2.5rem;
    }

    .tabs {
        margin-left: -0.85rem;
        margin-right: -0.85rem;
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .cards,
    .grid--two,
    .grid--three {
        grid-template-columns: 1fr;
    }

    .detail__head,
    .component__head {
        /* Stack the label above the value rather than squeezing both. */
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .letter {
        min-width: 2.1rem;
    }

    .finding {
        flex-direction: column;
        gap: 0.2rem;
    }

    .normalization__label {
        min-width: 0;
    }

    .footer__note {
        font-size: 0.76rem;
    }
}

/*
 * Touch devices: every interactive element needs a target big enough to hit
 * reliably, which the compact desktop sizes do not give.
 */
@media (pointer: coarse) {
    .tabs__link {
        padding: 0.9rem 1rem;
    }

    .button--ghost {
        padding: 0.7rem 1.2rem;
    }

    .trace__summary,
    .code__summary {
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
    }

    .masthead__brand {
        padding: 0.25rem 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
