.studies-view { max-width: 1220px; margin: 0 auto; padding: 28px 20px 64px; }
.studies-section { margin-top: 28px; }
.study-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.study-card { background: #182933; border: 1px solid #2e4550; border-radius: 4px; padding: 16px;
  display: flex; flex-direction: column; gap: 8px; }
.study-card h3 { margin: 0; font-size: 16px; line-height: 1.35; font-weight: 600; }
.study-card-link { color: inherit; text-decoration: none; }
.study-card-link:hover, .study-card-link:focus-visible { text-decoration: underline; }
.study-card-meta { margin: 0; font-size: 13px; color: #8b9da5; }
#studies-more { margin-top: 16px; }

/* The study page */
.study-back { font-size: 13px; text-decoration: none; }
.study-head { display: flex; flex-direction: column; gap: 10px; max-width: 860px; margin: 16px 0 20px; }
.study-tag { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase; color: #6e8189; }
.study-head h1 { margin: 0; font-size: 32px; line-height: 1.15; font-weight: 700; }
.study-by { margin: 0; font-size: 14px; color: #8b9da5; }
.study-player { max-width: 640px; }
.study-run { margin: 20px 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.study-needs { margin: 0; font-size: 13px; color: #8b9da5; }
.study-result { margin: 20px 0; max-width: 860px; border: 1px solid #2e4550; border-radius: 4px; padding: 12px 16px; }
.study-result summary { cursor: pointer; font-weight: 600; }
.study-heard p { margin: 10px 0 0; line-height: 1.5; }
.study-how-made { margin: 20px 0; max-width: 860px; border-top: 1px solid #2e4550; padding-top: 12px; }
.study-how-made h2 { font-size: 16px; margin: 0 0 8px; }
.study-how-made p { margin: 8px 0 0; line-height: 1.5; }
.study-how-made-text { white-space: pre-wrap; }
.study-split { color: #8b9da5; font-size: 14px; }
.study-section { margin-top: 28px; max-width: 860px; }
.study-section h2 { font-size: 18px; margin: 0 0 10px; }
.study-plays { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.study-play { background: #182933; border: 1px solid #2e4550; border-radius: 4px; padding: 16px;
  display: flex; flex-direction: column; gap: 6px; }
.study-play-key { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px;
  letter-spacing: .14em; color: #8fd3dd; }
.study-play-label { font-size: 15px; font-weight: 600; }
.study-play-note { font-size: 13px; color: #8b9da5; }
.study-measured { width: 100%; border-collapse: collapse; background: #182933; border: 1px solid #2e4550; }
.study-measured th, .study-measured td { text-align: left; padding: 10px 14px; border-bottom: 1px solid #223640; font-size: 14px; }
.study-measured thead th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #6e8189; }
.study-measured .is-none { color: #8b9da5; font-style: italic; }
.study-report { margin-top: 32px; max-width: 860px; font-size: 13px; color: #8b9da5; }
.study-report-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; max-width: 420px; }
.study-report select, .study-report textarea { color-scheme: dark; background: #0d171d; color: #e8ecee;
  border: 1px solid #2e4550; border-radius: 4px; padding: 8px; font: inherit; }

/* The player: one component in the app, on the link page and in the embed. */
.sp { color-scheme: dark; background: #14212a; border: 1px solid #2e4550; border-radius: 6px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px; color: #e8ecee; max-width: 640px; }
.sp-bar { display: flex; justify-content: space-between; font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #8b9da5; }
.sp-question { margin: 0; font-size: 17px; line-height: 1.35; font-weight: 600; }
.sp-sub, .sp-ask, .sp-hint, .sp-note, .sp-keys, .sp-practice { margin: 0; font-size: 13px; color: #8b9da5; }
.sp-ask { color: #e8ecee; font-size: 14px; }
.sp-starts { display: flex; flex-wrap: wrap; gap: 8px; }
.sp button { font: inherit; cursor: pointer; border-radius: 4px; }
.sp-start, .sp-pick, .sp-tile, .sp-transport { background: transparent; color: #e8ecee; border: 1px solid #2e4550; }
.sp-start { padding: 10px 14px; font-size: 14px; }
.sp-start:hover, .sp-pick:hover { border-color: #8fd3dd; }
.sp-skip { align-self: flex-start; background: none; border: 0; color: #8b9da5; text-decoration: underline; font-size: 13px; padding: 2px 0; }
.sp button:focus-visible, .sp a:focus-visible { outline: 2px solid #8fd3dd; outline-offset: 2px; }
.sp button:disabled { opacity: .5; cursor: default; }
.sp-deck { display: flex; align-items: center; gap: 10px; }
.sp-transport { min-width: 76px; height: 36px; padding: 0 10px; flex: none; }
.sp-seek { flex: 1; min-width: 0; accent-color: #8fd3dd; }
.sp-loop { font-size: 12px; color: #8b9da5; display: inline-flex; align-items: center; gap: 4px; flex: none; }
.sp-time { font-size: 12px; color: #8b9da5; font-variant-numeric: tabular-nums; min-width: 78px; text-align: right; }
.sp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.sp-choice { display: flex; flex-direction: column; gap: 6px; }
.sp-tile { padding: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sp-tile-name { font-weight: 600; }
.sp-tile-state { font-size: 12px; color: #8b9da5; }
.sp-bars { display: flex; gap: 3px; align-items: flex-end; height: 14px; }
.sp-bars i { width: 3px; height: 4px; background: #2e4550; }
.is-playing .sp-tile { border-color: #8fd3dd; }
.is-playing .sp-bars i { background: #8fd3dd; animation: sp-bar 0.9s ease-in-out infinite; }
.is-playing .sp-bars i:nth-child(2) { animation-delay: .15s; }
.is-playing .sp-bars i:nth-child(3) { animation-delay: .3s; }
.is-playing .sp-bars i:nth-child(4) { animation-delay: .45s; }
@keyframes sp-bar { 0%, 100% { height: 4px; } 50% { height: 14px; } }
@media (prefers-reduced-motion: reduce) { .is-playing .sp-bars i { animation: none; height: 10px; } }
.sp-pick { padding: 8px; font-size: 13px; color: #8fd3dd; }
.sp-name { padding: 8px; font-size: 13px; background: #0d171d; color: #e8ecee; border: 1px solid #2e4550; border-radius: 6px; }
.is-chosen .sp-name { border-color: #8fd3dd; }
.is-chosen .sp-pick { background: #8fd3dd; color: #0d171d; border-color: #8fd3dd; }
.sp-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sp-next { background: #8fd3dd; color: #0d171d; border: 1px solid #8fd3dd; padding: 9px 18px; font-weight: 600; }
.sp-score { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.sp-score-big { font-size: 34px; font-weight: 700; }
.sp-score-line { font-size: 15px; }
.sp-marks { display: flex; gap: 6px; }
.sp-marks i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; border: 1px solid #2e4550; }
.sp-marks .is-right { color: #8fd3dd; border-color: #8fd3dd; }
.sp-marks .is-wrong { color: #8b9da5; }
.sp-everyone { margin: 0; font-size: 13px; color: #8b9da5; }
.sp-result-links { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sp-links { margin: 0; font-size: 13px; color: #8b9da5; }
.sp-links a { color: inherit; text-decoration: none; }
.sp-links a:hover, .sp-links a:focus-visible { text-decoration: underline; }
.sp-share { background: none; border: 0; color: #8b9da5; font-size: 16px; }
@media (hover: none) and (pointer: coarse) { .sp-keys { display: none; } }
/* The listening state has to fit 360px of height on a phone (tools/studies-smoke.cjs). */
@media (max-width: 480px) {
  .sp { padding: 10px 12px; gap: 8px; }
  .sp-keys { display: none; }
  .sp-question { font-size: 15px; line-height: 1.3; }
  .sp-tiles { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 6px; }
  .sp-tile { padding: 6px 8px; gap: 2px; }
  .sp-bars { height: 10px; }
  .sp-pick { padding: 6px; }
  .sp-next { padding: 7px 14px; }
  .sp-transport { min-width: 68px; height: 32px; }
}

/* Start a study */
.start-title { margin: 16px 0 8px; font-size: 30px; }
.start { max-width: 760px; display: flex; flex-direction: column; gap: 8px; color-scheme: dark; }
.start-section { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.start-section h2 { margin: 0; font-size: 18px; }
.start-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.start-field small, .start-choice small, .start-note { color: #8b9da5; font-size: 13px; margin: 0; }
.start input[type=text], .start input[type=number], .start select { background: #0d171d; color: #e8ecee;
  border: 1px solid #2e4550; border-radius: 4px; padding: 9px 10px; font: inherit; }
.start-choice { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: baseline; font-size: 14px; }
.start-choice small { grid-column: 2; }
.start-wave-row { display: flex; align-items: center; gap: 10px; }
.start-wave { width: 100%; height: 70px; background: #0d171d; border: 1px solid #2e4550; border-radius: 4px; }
.start-clip { display: flex; flex-direction: column; gap: 10px; }
.start-clip input[type=range] { width: 100%; }
.start-match { margin: 0; font-size: 13px; color: #8fd3dd; }
.start-transport, .start-try-row { display: flex; gap: 10px; flex-wrap: wrap; }
.start-problems { margin: 16px 0 0; padding-left: 18px; color: #8b9da5; font-size: 13px; }
.start-link { align-self: flex-start; margin-bottom: 12px; display: inline-block; }

/* Share, and the link page */
.study-share { margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.share-menu { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.share-menu a.secondary-button { text-decoration: none; display: inline-block; }
.share-embed { flex-basis: 100%; display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.share-embed[hidden] { display: none; }
.share-embed textarea { background: #0d171d; color: #e8ecee; border: 1px solid #2e4550; border-radius: 4px; padding: 8px; font: 12px ui-monospace, monospace; color-scheme: dark; }
#study-link { max-width: 1220px; margin: 0 auto; padding: 28px 20px 64px; }
.start-templates { border: 1px solid #2e4550; border-radius: 4px; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: #14212a; }
.start-templates input[type=search] { background: #0d171d; color: #e8ecee; border: 1px solid #2e4550; border-radius: 4px; padding: 9px 10px; font: inherit; color-scheme: dark; }
.start-templates-groups { display: flex; flex-wrap: wrap; gap: 6px; }
.start-templates-group { background: transparent; color: #e8ecee; border: 1px solid #2e4550; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.start-templates-group[aria-pressed=true] { color: #8fd3dd; border-color: #8fd3dd; background: rgba(143, 211, 221, 0.12); }
.start-templates-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.start-templates-list { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow: auto; }
.start-template { text-align: left; background: transparent; color: #e8ecee; border: 1px solid #2e4550; border-radius: 4px; padding: 8px 10px; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.start-template:hover, .start-template:focus-visible { border-color: #8fd3dd; }
.start-template small { color: #8b9da5; }
.start-templates-preview dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0 12px; font-size: 14px; }
.start-templates-preview dt { color: #8b9da5; } .start-templates-preview dd { margin: 0; }
.start-templates-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.studies-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; } .studies-actions .start-link { margin-bottom: 0; }
#study-gone { max-width: 760px; margin: 0 auto; padding: 48px 20px 64px; }
#study-gone h1 { margin: 0 0 12px; font-size: 28px; }
.study-gone-why, .study-gone-more { color: #8b9da5; line-height: 1.5; }
.studies-intro { max-width: 760px; margin: 0 0 18px; color: #c4d0d5; line-height: 1.55; }
.start-measure { width: 100%; border-collapse: collapse; background: #14212a; border: 1px solid #2e4550; }
.start-measure th, .start-measure td { text-align: left; padding: 8px 12px; border-bottom: 1px solid #223640; font-size: 14px; }
.start-measure thead th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #6e8189; }
.start-measure-group th { background: #101d24; color: #8fd3dd; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.start-measure .is-none { color: #8b9da5; }
.start-measure tr.is-none th { font-weight: 400; }

/* The owner's panel on a study's page (studies/owner-panel.js): spacing only. */
.study-owner { margin: 24px 0; padding-top: 16px; border-top: 1px solid #2e4550; display: flex; flex-direction: column; gap: 10px; }
.study-owner-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.study-owner-warn { margin: 0; }
.study-owner-sheet { display: flex; flex-direction: column; gap: 12px; }

/* The one-page setup (studies/start.js): the form on the left, the real player on the right. */
.start { max-width: 1220px; }
.start-lede { color: #8b9da5; margin: 0 0 14px; max-width: 640px; }
.start-steps { display: flex; flex-wrap: wrap; gap: 6px 22px; list-style: none; padding: 0; margin: 0 0 14px; color: #8b9da5; font-size: 14px; }
.start-steps li { display: inline-flex; align-items: center; gap: 8px; }
.start-steps li[aria-current="step"] { color: #e9f1f4; font-weight: 600; }
.start-steps li[aria-current="step"] .start-n { background: #0b8392; border-color: #0b8392; color: #fff; }
.start-next { width: 100%; margin-top: 12px; position: sticky; bottom: 8px; z-index: 2; }
.start-pick-line { margin: 4px 0 0; }
.start-cols { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: start; }
.start-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.start-side { position: sticky; top: 16px; min-width: 0; }
.start-side-note { font: 10.5px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .12em; color: #8b9da5; text-transform: uppercase; margin: 0 0 8px; }
.start-tabs { display: none; gap: 6px; margin-bottom: 12px; }
.start-tab { background: transparent; color: #8b9da5; border: 1px solid #2e4550; border-radius: 999px; padding: 8px 14px; font: inherit; cursor: pointer; }
.start-tab[aria-selected=true] { color: #8fd3dd; background: rgba(143, 211, 221, 0.12); border-color: transparent; }
.start-section { border: 1px solid #223640; border-radius: 10px; background: #14212a; padding: 16px 18px; margin: 0 0 10px; }
.start-section h2 { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.start-n { width: 22px; height: 22px; border-radius: 50%; background: #0d171d; border: 1px solid #2e4550; color: #8fd3dd; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.start-section[hidden] { display: none; }
.start-hint { color: #8b9da5; font-size: 13px; margin: 0; }
.start-record { border: 1px solid #223640; border-radius: 8px; overflow: hidden; }
.start-record-head { padding: 8px 12px; background: #0d171d; color: #8b9da5; font-size: 12.5px; display: flex; justify-content: space-between; gap: 12px; }
.start-pick { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid #223640; cursor: pointer; }
.start-pick.is-on { background: rgba(143, 211, 221, 0.08); }
.start-pick-text { display: flex; flex-direction: column; flex: 1; }
.start-pick-text small { color: #8b9da5; font-size: 12px; }
.start-chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.start-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.start-chip { border: 1px solid #2e4550; background: #0d171d; border-radius: 8px; padding: 8px 12px; display: flex; gap: 10px; align-items: center; }
.start-chip small { color: #8b9da5; display: block; font-size: 12px; }
.start-chip-key { font: 13px ui-monospace, SFMono-Regular, Consolas, monospace; color: #8fd3dd; }
.start-link-button { background: none; border: 0; color: #8fd3dd; text-decoration: underline; font: inherit; font-size: 13px; cursor: pointer; padding: 0; }
.start-differs { margin: 6px 0 0; }
.start-examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.start-example { text-align: left; border: 1px solid #223640; border-radius: 8px; padding: 10px 12px; background: #0d171d; color: #e8ecee; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.start-example small { color: #8b9da5; font-size: 12px; }
.start-example.is-on, .start-example:hover { border-color: #8fd3dd; }
.start-eg { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.start-ways { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.start-way { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.start-way small { color: #8b9da5; font-size: 12px; }
.start-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.start-opt { border: 1px solid #2e4550; border-radius: 8px; padding: 10px 12px; background: #0d171d; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.start-opt.is-on { border-color: #8fd3dd; background: #14212a; }
.start-opt b { display: block; font-size: 14px; font-weight: 600; }
.start-opt small { color: #8b9da5; font-size: 12.5px; }
.start-options-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.start-options-line { margin: 2px 0 0; color: #8b9da5; font-size: 12.5px; }
.start-options-body { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.start-options-body h3 { margin: 4px 0 0; font-size: 14px; }
.start-options-body[hidden] { display: none; }
.start-names { display: flex; flex-direction: column; gap: 8px; }
.start-name { display: flex; align-items: center; gap: 10px; }
.start-name input { flex: 1; }
.start-pub { border: 1px solid #223640; border-radius: 10px; background: #14212a; padding: 14px 18px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.start-why { margin: 0; color: #8b9da5; font-size: 13px; max-width: 460px; }
.start-placeholder { border: 1px solid #223640; border-radius: 10px; background: #14212a; padding: 16px; }
.start-placeholder h3 { margin: 0 0 8px; font-size: 18px; }
@media (max-width: 860px) {
  .start-cols { grid-template-columns: 1fr; }
  .start-side { position: static; }
  .start-choices { grid-template-columns: 1fr; }
  .start-tabs { display: flex; }
  .start-cols[data-tab=set] .start-side { display: none; }
  .start-cols[data-tab=see] .start-main { display: none; }
}

.start-templates[hidden] { display: none; }

/* The results page: a sentence, one line of figures, the quiet details (studies/study-page.js). */
.study-part { margin: 0 0 18px; padding: 14px 18px; border: 1px solid #223640; border-radius: 10px; background: #14212a; }
.study-part-question { margin: 0 0 6px; font-size: 16px; }
.study-headline { margin: 0; font-size: 22px; font-weight: 700; }
.study-figure { margin: 4px 0 0; font-size: 16px; }
.study-quiet, .study-note { margin: 8px 0 0; color: #8b9da5; font-size: 13px; }
.study-part-detail { margin-top: 10px; }

/* A series, as a listener meets it. */
.sp-parts { margin: 4px 0 8px; padding-left: 20px; color: #e8ecee; }
.sp-parts li { margin: 3px 0; }
.sp-rows { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sp-row { display: grid; gap: 2px; padding: 8px 0; border-top: 1px solid #223640; }
.sp-row-title { color: #8b9da5; font-size: 13px; }
.sp-row-big { font-size: 22px; font-weight: 700; }
.sp-row-line { color: #8b9da5; font-size: 13px; }

/* A series on the setup page: the comparisons as cards, one open at a time (studies/start.js). */
.start-parts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.start-part { border: 1px solid #223640; border-radius: 10px; background: #14212a; }
.start-part.is-open { border-color: #2e4550; }
.start-part-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.start-part-head { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.start-part-q { display: flex; flex-direction: column; min-width: 0; }
.start-part-text { overflow-wrap: anywhere; }
.start-part-q small { color: #8b9da5; font-size: 12px; overflow-wrap: anywhere; }
.start-part-actions { display: flex; gap: 10px; align-items: center; position: relative; flex: none; }
.start-menu-button { font-size: 18px; text-decoration: none; padding: 0 6px; }
.start-menu { position: absolute; right: 0; top: 100%; z-index: 5; min-width: 140px; background: #0d171d; border: 1px solid #2e4550; border-radius: 8px; padding: 4px; display: flex; flex-direction: column; }
.start-menu[hidden] { display: none; }
.start-menu-item { background: none; border: 0; color: #e8ecee; text-align: left; font: inherit; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.start-menu-item:hover:not(:disabled) { background: rgba(143, 211, 221, 0.12); }
.start-menu-item:disabled { color: #6e8189; cursor: default; }
.start-part-body { border-top: 1px solid #223640; padding: 4px 16px 14px; }
.start-part-body .start-section { border: 0; background: transparent; padding: 12px 0 0; margin: 0; }
.start-add-row { margin: 4px 0 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.start-add-row button[hidden] { display: none; }

.start-lineup { display: block; color: #8b9da5; }
.start-lineup.is-good { color: #8fd3dd; }
.start-lineup.is-bad { color: #f0a5a5; }

.start-transport { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.start-seek { flex: 1; min-width: 120px; accent-color: #8fd3dd; }
.start-loop { font-size: 12px; color: #8b9da5; display: inline-flex; align-items: center; gap: 4px; }
