/* Report canvas and section rhythm */
.results.shell {
  --frame: 2px solid var(--stroke);
  --offset: var(--site-header-height, 4rem);
  width: min(100%, 73rem);
  margin-inline: auto;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.report-document { min-width: 0; padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1rem, 4vw, 3.25rem) 4rem; }
.results :is(h1,h2,h3,h4,p,dl,dd) { margin: 0; }
.results h2 { font: 700 clamp(1.75rem, 3.2vw, 2.65rem)/1.04 var(--heading); letter-spacing: -.055em; }
.results :is(section[id],li[id],.protocol-extra[id],.finding-group) { scroll-margin-top: calc(var(--offset) + 1rem); }
.report-document > section:not(.score-document) { margin-top: clamp(2.25rem, 5vw, 4rem); }
.report-section-header,.section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .7rem 1rem; margin-bottom: 1rem; }
.section-heading p,.results .protocol-intro { margin-top: .65rem; color: var(--muted); font-size: .95rem; line-height: 1.6; }
.report-section-header a,.library-jump,.security-details > a { font: 650 .83rem/1.5 var(--mono); }
.report-messages p:empty,.matched-checks:empty { display: none; }
.report-messages p:not(:empty) { margin-top: .75rem; font-size: .9rem; }
.no-checks { padding: 1rem; color: var(--muted); }
.results :is(button,input,select) { border-radius: 0; }

/* Report identity, exports, and copyable command */
.report-heading { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: .8rem 1rem; }
.domain-row { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .7rem; min-width: 0; }
.domain-row > .ui-icon { width: 1.9rem; height: 1.9rem; }
.report-heading h1 { min-width: 0; font: 700 clamp(1.85rem, 4.5vw, 3.65rem)/1 var(--heading); letter-spacing: -.065em; overflow-wrap: anywhere; }
.report-heading h1 a { color: inherit; text-decoration: none; }
.report-heading h1 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
#report-title:focus:not(:focus-visible) { outline: 0; }
.report-meta { flex-basis: 100%; margin-top: .25rem; color: var(--muted); font: .77rem/1.5 var(--mono); overflow-wrap: anywhere; }
#copy-report-link { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid var(--stroke); background: var(--panel); color: var(--ink); }
#copy-report-link .ui-icon { width: 1.02rem; height: 1.02rem; }
#copy-report-link:hover { background: var(--hover); }
.score-stamp { position: relative; z-index: 2; }
.score-stamp > summary,.report-actions :is(button,a),.report-back,.dialog-action {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 2.55rem; padding: .48rem .85rem; border: var(--frame);
  background: var(--panel); color: var(--ink); font: 700 .9rem/1.25 var(--heading); text-decoration: none;
}
.score-stamp > summary { background: var(--iris); color: #19191d; box-shadow: 3px 3px var(--shadow-ink); list-style: none; }
.score-stamp > summary::after { content: ''; width: .45rem; height: .45rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-.1rem) rotate(45deg); }
.score-stamp[open] > summary::after { transform: translateY(.1rem) rotate(225deg); }
.score-stamp summary::-webkit-details-marker,.finding-group > summary::-webkit-details-marker,.fix > summary::-webkit-details-marker { display: none; }
.stamp-options { position: absolute; right: 0; top: calc(100% + 6px); display: grid; width: max-content; max-width: 85vw; border: var(--frame); background: var(--panel); box-shadow: 4px 4px var(--shadow-ink); }
.stamp-options button,.stamp-options .export-score { padding: .55rem .8rem; }
.stamp-options button { border: 0; background: transparent; color: var(--ink); font: 600 .86rem/1.4 var(--heading); text-align: left; }
.stamp-options button:hover { background: var(--hover); }
.export-score { border-bottom: 1px solid var(--line); color: var(--muted); font: .72rem/1.5 var(--mono); }

/* The actual score is the central graphic. Unrated layers keep a hatched track. */
.score-document { display: grid; grid-template-columns: minmax(14rem, .76fr) minmax(0, 1.4fr); margin-top: 1.4rem; border: var(--frame); box-shadow: 6px 6px var(--shadow-ink); background: var(--panel); }
.score-face,.score-interpretation { min-width: 0; padding: clamp(1.35rem, 3.3vw, 2.5rem); }
.score-face { position: relative; display: grid; align-content: space-between; gap: 1.6rem; border-right: var(--frame); background: var(--signal); color: #19191d; }
.score-face::after { content: ''; position: absolute; top: 1.1rem; bottom: 1.1rem; right: 0; width: .4rem; background: repeating-linear-gradient(to bottom, #19191d 0 1px, transparent 1px 8px); }
.score-face #score-title { font: 700 .8rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.score-value { display: flex; align-items: baseline; gap: .55rem; }
.score-value strong { font: 700 clamp(4.3rem, 8.9vw, 8.05rem)/.85 var(--heading); letter-spacing: -.085em; }
.score-value strong * { font: inherit; letter-spacing: inherit; color: inherit; }
.score-value > span { font: 600 clamp(1.05rem, 2.4vw, 1.9rem)/1 var(--heading); letter-spacing: -.055em; white-space: nowrap; }
.score-interpretation { display: grid; align-content: center; justify-items: start; gap: .7rem; }
.score-caption { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .7rem; }
#score-grade { padding: .18rem .45rem; border: 1px solid #19191d; background: var(--iris); color: #19191d; font: 700 .78rem/1.4 var(--mono); }
#score-grade:empty { display: none; }
#score-summary { font: 700 clamp(1.55rem, 3.1vw, 2.45rem)/1.07 var(--heading); letter-spacing: -.05em; }
#score-insight { max-width: 50ch; font: 450 1rem/1.55 Geist,sans-serif; color: var(--muted); }
#page-access { display: grid; width: 100%; grid-template-columns: fit-content(35%) minmax(0,1fr); gap: .4rem .85rem; border-top: 1px solid var(--light-line); padding-top: .75rem; font-size: .88rem; }
#page-access dt { font-weight: 650; }
#page-access dd { overflow-wrap: anywhere; }
.results .model-note { color: var(--muted); font: .81rem/1.55 var(--mono); }
.report-actions,.dialog-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.report-actions { margin-top: .4rem; }
.report-actions button:first-child,.dialog-action { background: var(--action); color: var(--action-ink); }
.report-actions :is(button:not(:disabled),a):hover,.report-back:hover,.dialog-action:hover { box-shadow: 2px 2px var(--shadow-ink); }
.report-actions button:active:not(:disabled),.score-stamp > summary:active,.report-back:active { transform: translate(1px,1px); box-shadow: none; }
.layer-strip { grid-column: 1/-1; }
#categories { display: flex; flex-wrap: wrap; gap: 1px; border-top: var(--frame); background: var(--stroke); }
#categories:empty { display: none; }
.layer-segment { flex: 1 1 9rem; display: grid; align-content: start; gap: .14rem; min-width: 0; padding: .85rem 1rem; color: var(--ink); background: var(--panel); text-decoration: none; }
.layer-segment:hover { background: var(--hover); }
.layer-segment strong { font: 700 .91rem/1.25 var(--heading); }
.layer-segment small { font: .74rem/1.4 var(--mono); color: var(--muted); }
.layer-segment progress,.unrated-track { display: block; width: 100%; height: .53rem; margin-bottom: .4rem; border: 1px solid var(--stroke); border-radius: 0; appearance: none; background: var(--field); }
.layer-segment progress::-webkit-progress-bar { background: var(--field); }
.layer-segment progress::-webkit-progress-value { background: var(--ink); }
.layer-segment progress::-moz-progress-bar { background: var(--ink); }
.unrated-track { background: repeating-linear-gradient(135deg,var(--line) 0 1px,var(--field) 1px 5px); }

/* Expandable fixes and checklist */
#recommendations,#checks { display: grid; gap: .55rem; }
.finding-group,.fix { min-width: 0; border: var(--frame); background: var(--panel); }
.fix { overflow-wrap: anywhere; }
.finding-group > summary,.fix > summary { display: grid; grid-template-columns: minmax(0,1fr) auto .75rem; align-items: center; gap: .55rem .85rem; padding: .95rem 1rem; list-style: none; }
.finding-group > summary:hover,.fix > summary:hover { background: var(--hover); }
.finding-group > summary::after,.fix > summary::after { content: ''; width: .5rem; height: .5rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-.1rem) rotate(45deg); }
.finding-group[open] > summary::after,.fix[open] > summary::after { transform: translateY(.1rem) rotate(225deg); }
.finding-group[open] > summary,.fix[open] > summary { background: var(--field); border-bottom: 1px solid var(--line); }
.group-label { display: grid; min-width: 0; gap: .45rem; }
.group-label strong,h3.group-label,.fix h3,.highlights h3 { font: 700 clamp(.99rem, 2vw, 1.2rem)/1.3 var(--heading); letter-spacing: -.025em; }
.goal-number,.group-label small { color: var(--muted); }
.group-label small,.group-metric,.check-label code,.check-verdict small,.local-check { font: .74rem/1.5 var(--mono); overflow-wrap: anywhere; }
.group-metric { align-self: start; padding: .12rem .36rem; border: 1px solid var(--line); color: var(--ink); background: var(--field); font-weight: 650; }
.protocol-tags { display: flex; flex-wrap: wrap; gap: .25rem; }
.results .status-badge,.section-heading .badge { display: inline-block; width: fit-content; padding: .16rem .42rem; background: #e6e5e3; color: #403e44; border: 1px solid #938e95; font: 600 .74rem/1.4 var(--mono); }
.results .protocol-tags .status-badge { font-size: .7rem; }
.results .status-pass { color: #15452f; background: #c8edce; border-color: #649c77; }
.results .status-missing { color: #7d202f; background: #ffd6d8; border-color: #c9858b; }
.results .status-warning { color: #654100; background: #ffe7aa; border-color: #ba914c; }
[data-theme="dark"] .results .status-badge,[data-theme="dark"] .section-heading .badge { color: #e3e0de; background: #3c3b42; border-color: #77737b; }
[data-theme="dark"] .results .status-pass { color: #c0edc8; background: #1c3b2b; border-color: #57866a; }
[data-theme="dark"] .results .status-missing { color: #ffc9cc; background: #49282f; border-color: #99606b; }
[data-theme="dark"] .results .status-warning { color: #ffde97; background: #423522; border-color: #897044; }
.results .fix-steps { display: grid; grid-template-columns: minmax(6.75rem,17%) minmax(0,1fr); gap: .55rem 1rem; padding: 1rem; }
.fix-steps dt { font: 680 .86rem/1.55 var(--heading); }
.fix-steps dd,.check-evidence,.highlights li p { color: var(--muted); font-size: .93rem; line-height: 1.6; overflow-wrap: anywhere; }
.more-fixes > summary,.library-setup summary,.library-jump { width: fit-content; }
.more-fixes > summary,.library-setup summary { font: 650 .84rem/1.5 var(--mono); }
.more-fixes > summary { margin: .45rem 0; }
.more-fixes[open] > .fix { margin-top: .55rem; }
.library-jump { display: inline-block; margin-top: .75rem; }
.findings > h2 { margin-bottom: 1rem; }
.findings-toolbar,.group-options { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.findings-toolbar { justify-content: space-between; margin-bottom: .85rem; }
.group-options > span { margin-right: .3rem; color: var(--muted); font: .77rem/1.5 var(--mono); }
.group-options button,#filter-toggle { min-height: 2.25rem; padding: .3rem .65rem; border: 1px solid var(--stroke); background: var(--panel); color: var(--ink); font: 650 .83rem/1.45 var(--heading); }
.group-options button:hover,#filter-toggle:hover { background: var(--hover); }
.group-options button[aria-pressed="true"],#filter-toggle[aria-expanded="true"] { background: var(--iris); color: #19191d; box-shadow: 2px 2px var(--shadow-ink); }
#finding-filters { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: .85rem; }
#finding-filters :is(input,select) { max-width: 100%; width: 100%; min-height: 2.45rem; padding: .35rem .55rem; border: var(--frame); background: var(--panel); color: var(--ink); font: .89rem/1.5 Geist,sans-serif; }
.check-search { flex: 1 1 12rem; }
#finding-filters select { width: auto; }
#check-counts,#security-counts,.matched-checks { padding: .75rem 0; color: var(--muted); font: .77rem/1.5 var(--mono); }
.results .coverage-note { color: var(--muted); font-size: .88rem; line-height: 1.6; }
.highlights ul,.change-list,.check-list,.library-list { margin: 0; padding: 0; list-style: none; }
.check-list { padding-inline: 1rem; }
.check-list li { display: grid; grid-template-columns: minmax(0,1fr) 7rem minmax(0,1.65fr); align-items: start; gap: .45rem 1rem; padding: .9rem 0; }
.check-list li + li { border-top: 1px solid var(--line); }
.check-list li:target { outline: 2px solid var(--accent); outline-offset: -2px; }
.check-label,.check-verdict { display: grid; min-width: 0; gap: .2rem; }
.check-label strong { font-size: .94rem; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.check-label code,.check-verdict small,.local-check { color: var(--muted); }
#website-security { margin-top: .55rem; }
.security-details { padding: 1rem; }
.security-details .protocol-intro { margin-block: 0; }
.security-details > a { display: inline-block; margin-top: .85rem; }
#security-checks .check-list { padding-inline: 0; border-block: 1px solid var(--line); }
.security-category h4 { margin: .8rem 0 .55rem; font: 700 1.05rem/1.4 var(--heading); }
.security-category + .security-category { margin-top: 1.25rem; }
#security-checks .security-fix { margin-top: .45rem; }
.security-fix strong { color: var(--ink); }

/* Supplemental findings, install guides, and export dialogs */
#protocol-evidence,.highlights ul,.library-list { border: var(--frame); background: var(--panel); }
#protocol-evidence { margin-top: 1rem; }
.protocol-extra { display: grid; grid-template-columns: minmax(7rem,1fr) minmax(0,3fr); gap: .85rem; padding: 1rem; }
.protocol-extra + .protocol-extra,.highlights li + li,.library-list li + li { border-top: 1px solid var(--line); }
.protocol-extra dt strong,.protocol-extra dt small { display: block; }
.protocol-extra dt strong,.library-list strong { font: 700 1.1rem/1.35 var(--heading); }
.protocol-extra dt small,.library-list small { margin-top: .15rem; color: var(--muted); font-size: .82rem; }
.extra-status { display: inline-flex; align-items: center; gap: .42rem; font: 650 .86rem/1.5 var(--mono); }
.extra-status::before { content: ''; width: .53rem; height: .53rem; border: 1px solid currentColor; }
.extra-observed::before { color: #368558; background: currentColor; }
.extra-partial::before { color: #967328; background: linear-gradient(90deg,currentColor 50%,transparent 50%); }
.extra-not-detected::before { height: 2px; background: currentColor; }
.protocol-extra dd p { margin-top: .18rem; color: var(--muted); font-size: .93rem; line-height: 1.6; overflow-wrap: anywhere; }
.highlights li { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: baseline; gap: .35rem .8rem; padding: 1rem; }
.highlights li p { grid-row: 2; grid-column: 1/-1; max-width: 82ch; }
.highlight-impact { grid-row: 1; grid-column: 2; color: var(--muted); font: .75rem/1.5 var(--mono); }
.comparison { padding: 1.2rem; border: var(--frame); border-left: .5rem solid var(--accent); background: var(--panel); }
.comparison p { margin-top: .65rem; }
.change-list li { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; margin-top: .55rem; }
.library-list li { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .55rem 1rem; padding: 1rem; overflow-wrap: anywhere; }
.library-list li > div { display: grid; }
.library-list a { font: 600 .82rem/1.55 var(--mono); }
.library-setup { flex-basis: 100%; min-width: 0; }
.library-setup p { margin-top: .5rem; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.library-setup pre,.fix-brief { padding: .75rem; border: 1px solid var(--line); background: var(--field); font: .82rem/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.library-setup a { display: inline-block; margin: .5rem 1rem 0 0; }
.report-back { margin-top: 2rem; }
#report-dialog { width: min(39rem,calc(100% - 2rem)); max-height: 84svh; margin: auto; padding: clamp(1rem,3vw,1.75rem); border: var(--frame); background: var(--panel); color: var(--ink); box-shadow: 6px 6px var(--shadow-ink); }
#report-dialog::backdrop { background: rgb(21 18 28 / 58%); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; padding-bottom: .9rem; margin-bottom: 1rem; border-bottom: var(--frame); }
#close-report-dialog { flex: none; width: 2.25rem; height: 2.25rem; border: var(--frame); background: var(--iris); color: #19191d; font: 700 1.35rem/1 var(--heading); }
#report-dialog-content :is(p,li) { margin-top: .5rem; color: var(--muted); font-size: .94rem; line-height: 1.6; overflow-wrap: anywhere; }
#report-dialog-content ul { padding-left: 1.2rem; }
#report-dialog h3 { font: 700 1.3rem/1.3 var(--heading); overflow-wrap: anywhere; }
.fix-brief { max-height: 36svh; overflow: auto; }
.dialog-actions { align-items: center; margin-top: 1rem; }
.dialog-actions a { margin: .2rem; font: 650 .84rem/1.5 var(--heading); }
#dialog-notice:not(:empty) { margin-top: .75rem; font-size: .85rem; }

@media (max-width: 44rem) {
  .report-document { padding: 1.6rem 1rem 3rem; }
  .score-document { grid-template-columns: minmax(0,1fr); box-shadow: 4px 4px var(--shadow-ink); }
  .score-face { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .8rem; padding-right: 1.75rem; border-right: 0; border-bottom: var(--frame); }
  .score-value strong { font-size: clamp(4rem,14vw,5.7rem); }
  .layer-segment { flex-basis: 8rem; }
  .check-list li { grid-template-columns: minmax(0,1fr) auto; }
  .check-evidence { grid-column: 1/-1; }
}
@media (max-width: 32rem) {
  .report-heading { gap: .7rem; }
  .report-heading h1 { font-size: clamp(1.55rem,6vw,2rem); }
  .domain-row { gap: .25rem .4rem; }
  .domain-row > .ui-icon { display: none; }
  .report-meta { font-size: .71rem; }
  .score-stamp > summary { min-height: 2.15rem; padding: .35rem .5rem; font-size: .8rem; }
  .score-face,.score-interpretation { padding: 1.15rem; }
  .score-face { padding-right: 1.65rem; }
  .layer-segment { padding: .7rem; }
  .results .fix-steps { grid-template-columns: minmax(0,1fr); gap: .15rem; }
  .fix-steps dd + dt { margin-top: .45rem; }
  .finding-group > summary,.fix > summary { padding: .75rem .65rem; gap: .5rem; }
  .findings-toolbar { align-items: start; gap: .65rem; }
  .group-options { row-gap: .35rem; }
  .protocol-extra { grid-template-columns: 1fr; gap: .45rem; }
}
