/* Full results page for the OMR post. Chrome and palette come from the site's
   shared.css, the same way the post template gets them; this file styles the
   comparison widgets that sheet-music-test's report.py emits. */
.results.wrapper { max-width: 1240px; }
.results header h1 { font-size: 2.2rem; }
.results .standfirst { margin-top: 14px; max-width: 70ch; color: #c8c0b4; line-height: 1.6; }

/* one card per section, like the post */
.results > section {
  background: var(--card-bg); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 28px 32px; margin-bottom: 16px; min-width: 0;
  color: var(--ink-light); line-height: 1.7; scroll-margin-top: 64px;
}
.results h2 { font-size: 1.4rem; font-weight: 600; line-height: 1.3; color: var(--ink); margin: 1.6em 0 .6em; }
.results > section > h2:first-child { margin-top: 0; }
.results h3 { font-size: 1.05rem; font-weight: 600; color: var(--ink); margin: 1em 0 .4em; }
.results p { margin-bottom: 1em; max-width: 90ch; }
.results a { color: var(--accent); }
.results a:hover { color: var(--teal); }
.results strong { color: var(--ink); font-weight: 600; }
.results ol, .results section ul { margin-bottom: 1em; padding-left: 1.3em; max-width: 90ch; }
.results li { margin-bottom: .4em; }
.results dt { font-weight: 600; color: var(--ink); margin-top: .7em; }
.results .note { font-size: .88rem; }
.results .formula { text-align: center; margin: 20px auto; }
.results a:focus-visible, .results button:focus-visible, .results input:focus-visible, .results summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* run counts, and the section bar that follows the reader down the page */
.overview { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.overview span { background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 30px; padding: 7px 16px; font-size: .9rem; color: var(--ink-light); }
.top-nav {
  position: sticky; top: 8px; z-index: 10; display: flex; gap: 4px; flex-wrap: wrap; width: fit-content; max-width: 100%;
  padding: 4px; margin-bottom: 16px; background: var(--ink); border-radius: 24px; box-shadow: 0 4px 14px rgba(30, 46, 56, .2);
}
.top-nav a { color: #c8c0b4; text-decoration: none; font-size: .85rem; font-weight: 600; padding: 6px 14px; border-radius: 20px; }
.top-nav a:hover, .top-nav a:focus { color: #fff; }

/* tables */
.results table { width: 100%; border-collapse: collapse; font-size: .9rem; line-height: 1.5; margin: 0 0 1.4em; }
.results th { text-align: left; font-weight: 600; color: var(--ink); padding: 9px 12px 9px 0; border-bottom: 1.5px solid var(--border); vertical-align: bottom; }
.results td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.wide { overflow-x: auto; }

/* best page per workflow */
.highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.highlight-card { border: 1.5px solid var(--border); border-radius: 12px; padding: 16px; }
.highlight-card p { margin: 0 0 .3em; font-size: .88rem; }
.highlight-card h3 { margin: 0 0 .3em; }
.highlight-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 8px 0; }
.highlight-card img { width: 100%; height: 125px; object-fit: cover; object-position: top; background: var(--cream); border-radius: 6px; }
.highlight-card a { font-weight: 600; font-size: .9rem; }

/* every attempt, one cell each */
.matrix { overflow-x: auto; border: 1.5px solid var(--border); border-radius: 12px; }
.matrix table { margin: 0; }
.matrix th, .matrix td { min-width: 7.2rem; padding: 9px 12px; }
.matrix thead th { background: var(--cream); }
.matrix th:first-child { position: sticky; left: 0; z-index: 1; min-width: 14rem; background: var(--cream); }
.matrix tr:last-child > * { border-bottom: 0; }
.matrix td a { display: block; font-weight: 700; text-decoration: none; }
.matrix small { display: block; font-weight: 400; font-size: .75rem; color: var(--ink-light); }
.matrix .failed { background: #fbf1ef; }
.matrix .meter { height: 4px; border-radius: 2px; background: var(--accent); margin-top: 5px; }

/* attempt workspace */
.results details { border: 1.5px solid var(--border); border-radius: 12px; margin: 10px 0; background: var(--card-bg); }
.results details[open] { border-color: var(--accent); }
.results summary { cursor: pointer; font-weight: 600; color: var(--ink); padding: 11px 16px; }
.results details[open] > summary { border-bottom: 1px solid var(--border); }
.results details > :not(summary) { margin-left: 16px; margin-right: 16px; }
.results details > table { width: calc(100% - 32px); }
.attempt-workspace { padding: 14px 0; }
.pair, .audio-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pair { align-items: start; margin-top: 14px; }
.audio-pair { margin: 14px 0; }
.audio-track span { font-weight: 600; color: var(--ink); font-size: .9rem; }
.results audio { display: block; width: 100%; margin-top: 6px; }
.crop { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.crop h3 { margin: 0 0 8px; font-size: .95rem; }
.crop img, .image-frame img { display: block; width: 100%; height: auto; }
.viewer { min-width: 0; position: sticky; top: 64px; border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.image-frame { height: min(75vh, 950px); overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
.image-frame img[hidden] { display: none; }
.transport, .chooser { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; }
.chooser { margin: 0 0 10px; }
.chooser span { font-weight: 600; color: var(--ink); font-size: .9rem; margin-right: 6px; }
.results button {
  font: 500 .82rem/1.2 'DM Sans', sans-serif; color: var(--ink); background: var(--cream);
  border: 1px solid var(--border); border-radius: 99px; padding: 6px 12px; cursor: pointer;
}
.results button:hover { border-color: var(--accent); color: var(--accent); }
.results button[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.results input[type=range] { accent-color: var(--accent); }
.results pre { white-space: pre-wrap; font-size: .85rem; padding: 12px 0; }
.attempt-summary { scroll-margin-top: 64px; }
.attempt-summary .back { display: inline-block; margin-top: 8px; font-size: .9rem; }

/* summary charts */
.chart-row { display: grid; grid-template-columns: 8rem 1fr 3.5rem; gap: 8px; align-items: center; margin: 4px 0; font-size: .88rem; }
.bar { height: 12px; border-radius: 0 4px 4px 0; background: var(--teal-muted); }
.bar.high { background: var(--accent); }
.bar.baseline { background: #8a8f94; }
.error-group { margin: 14px 0; }
.error-row { display: grid; grid-template-columns: minmax(9rem, 13rem) 1fr 4rem; gap: 8px; align-items: center; margin: 4px 0; font-size: .88rem; }
.error-bar { height: 12px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--accent); }

@media (max-width: 800px) {
  .results > section { padding: 20px 16px; }
  .results .header-inner { flex-direction: column; }  /* three nav buttons don't fit beside the title */
  .results section table { display: block; overflow-x: auto; }  /* scroll inside the card, not the page */
  .pair, .audio-pair { grid-template-columns: 1fr; }
  .viewer, .top-nav { position: static; }  /* the section bar wraps to two rows on a phone and would cover the text */
  .matrix th:first-child { min-width: 9.5rem; }
  .error-row { grid-template-columns: 7rem 1fr 3rem; }
  .chart-row { grid-template-columns: 5rem 1fr 3.5rem; }
}
