/* Keep the guide outside microscopy pixels so it can never obscure the target. */
.viewer .coach {
  position: relative;
  inset: auto;
  max-width: none;
  border-width: 1px 0 0;
  border-radius: 0;
  background: #fffef2;
}

.secondary {
  border: 1px solid var(--teal);
  border-radius: 12px;
  background: white;
  color: var(--teal);
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
}

.view-pair { display: grid; grid-template-columns: 1.385fr 1fr; align-items: start; gap: 2px; background: #c9a2b8; }
.view-pair figure { min-width: 0; margin: 0; background: #ead5df; }
.view-pair canvas { display: block; width: 100%; }
.view-pair figcaption { padding: 7px 9px; background: #142a2b; color: white; text-align: center; font-size: 12px; font-weight: 750; }
.edge-notice { padding: 10px 12px; border-top: 1px solid #e0bd45; background: #fff4cf; color: #604900; font-size: 13px; }
.edge-notice b { display: block; }

.quick-compare {
  display: block;
  width: 100%;
  color: var(--ink);
  text-align: left;
  font: inherit;
  max-width: 760px;
  margin: 14px auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7faf8;
  cursor: pointer;
}
.quick-compare > b,.quick-compare > small { display: block; }
.quick-compare > small { color: var(--muted); margin-top: 7px; }
.quick-compare > div { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 8px; }
.quick-compare figure { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: white; }
.quick-compare canvas { width: 100%; display: block; }
.quick-compare figcaption { padding: 6px 4px; text-align: center; font-size: 11px; font-weight: 750; }

.modal-open { overflow: hidden; }
.guide-modal[hidden] { display: none; }
.guide-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: #102525c7;
  backdrop-filter: blur(6px);
}
.guide-sheet {
  width: min(920px,100%);
  max-height: calc(100dvh - 30px);
  overflow: auto;
  border-radius: 20px;
  background: white;
  padding: 25px;
  box-shadow: 0 24px 70px #0005;
}
.guide-sheet h2 { margin: 5px 0; font-size: 28px; }
.guide-sheet > p { color: var(--muted); }
.guide-examples { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 18px 0; }
.guide-group { border: 2px solid var(--line); border-radius: 15px; overflow: hidden; background: #fafcfb; }
.guide-group.tumor { border-color: #8c5591; }
.guide-group.immune { border-color: #398b82; }
.guide-group.stromal { border-color: #b08829; }
.guide-group h3,.guide-group p { margin: 0; padding: 10px 12px; }
.guide-group h3 { font-size: 16px; }
.guide-group p { color: var(--muted); font-size: 13px; }
.example-pair { display: grid; grid-template-columns: 1fr; background: var(--line); }
.example-pair canvas { display: block; width: 100%; background: #e9ccda; }
.decision-card { border-radius: 14px; background: #edf6f2; padding: 14px 18px; }
.decision-card ol { margin: 8px 0 0; padding-left: 22px; }
.decision-card li { margin: 6px 0; }
.guide-warning { color: #7c5000!important; background: #fff4cf; border-radius: 10px; padding: 10px 12px; font-weight: 650; }
.guide-sheet > .primary { width: 100%; position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -8px 18px #fff; }

.practice { margin: 16px 0; padding: 15px; border: 2px solid #a8cec4; border-radius: 15px; background: #f8fcfa; }
.practice h3 { margin: 3px 0 10px; }
.practice canvas { display: block; width: 100%; max-height: 330px; object-fit: contain; border-radius: 12px; background: #e9ccda; }
.practice > p { margin: 10px 0; font-weight: 700; }
.practice-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.practice-answers button { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font-weight: 750; }
.practice-answers button.correct { border-color: var(--green); background: #def4e8; }
.practice-answers button.incorrect { border-color: var(--red); background: #fbe5e5; }
.practice-feedback { padding: 10px; border-radius: 10px; }
.practice-feedback.correct { color: #17633f; background: #def4e8; }
.practice-feedback.correction { color: #725400; background: #fff4cf; }
.practice #nextPractice { width: 100%; }
.practice.complete { border-color: var(--green); }

.gauge-legend { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; margin-top: 2px; }
.friday-teaser { margin-top: 18px; padding: 12px; border: 1px solid #d6b85b; border-radius: 12px; background: #fff9df; text-align: left; }
.friday-teaser b,.friday-teaser span { display: block; }
.friday-teaser span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.friday-card { margin-bottom: 14px; padding: 17px 20px; border-color: #d6b85b; background: linear-gradient(135deg,#fffdf3,#fff); }
.friday-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; cursor: pointer; list-style: none; }
.friday-heading::-webkit-details-marker { display: none; }
.friday-heading h2 { margin: 3px 0 11px; font-size: 20px; }
.test-badge { white-space: nowrap; border-radius: 999px; background: #fff0b8; color: #6b5100; padding: 6px 9px; font-size: 10px; font-weight: 850; }
.friday-grid { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: center; }
.friday-progress b,.friday-progress span { display: block; }
.friday-progress span { margin-top: 4px; color: var(--muted); font-size: 13px; }
.mini-progress { height: 8px; margin-top: 9px; overflow: hidden; border-radius: 99px; background: #ecefe9; }
.mini-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--yellow),var(--green)); transition: width .4s; }
.entry-routes { display: flex; justify-content: center; justify-self: center; place-self: center; width: 100%; gap: 8px; text-align: center; }
.entry-routes button { min-width: 150px; padding: 10px 13px; }
.entry-routes .primary { width: min(100%,360px); }
.entry-routes .wallet-check { min-width: 120px; }
.completion-routes { margin: 18px auto 0; }
.entry-routes button b,.entry-routes button small { display: block; }
.entry-routes button small { margin-top: 2px; font-weight: 500; opacity: .8; }
.entry-routes button:disabled { cursor: default; opacity: .5; }
.entry-routes.chosen button { display: none; }
.wallet-preflight { grid-column: 1/-1; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; width: 100%; max-width: 680px; justify-self: center; padding: 11px; border: 1px solid #a8cec4; border-radius: 12px; background: #f4fbf8; text-align: left; }
.wallet-preflight[hidden] { display: none; }
.wallet-preflight div { min-width: 0; padding: 6px 8px; border-radius: 8px; background: white; }
.wallet-preflight span,.wallet-preflight b { display: block; }
.wallet-preflight span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.wallet-preflight b { overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.wallet-preflight p { grid-column: 1/-1; margin: 2px 7px 0; color: #205e4a; font-size: 12px; font-weight: 700; }
.wallet-preflight.not-ready { border-color: #d6b85b; background: #fff9df; }
.completion-wallet { margin: 12px auto 0; }
.friday-card > .fine { margin: 11px 0 0; }
.response-panel { max-width: 820px; margin: 0 auto; }
.feature-step { margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #f8faf9; }
.response-title { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; }
.response-title > span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: var(--teal); color: white; font-size: 12px; }
.response-panel .answers { grid-template-columns: repeat(4,1fr); }
.response-panel .size-answers button { min-height: 52px; padding: 8px; }
.response-panel .size-answers button:disabled { cursor: default; opacity: .45; }
.response-panel .size-answers button.selected:disabled { opacity: 1; }
.size-help { display: block; margin-top: 7px; color: var(--muted); }
.derived-readout { margin-top: 10px; padding: 10px 12px; border-left: 4px solid var(--teal); border-radius: 8px; background: #edf6f2; color: #204b46; font-size: 13px; font-weight: 700; }
.more-controls { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f8faf9; }
.more-controls summary { padding: 10px 12px; cursor: pointer; font-weight: 750; }
.more-controls summary span { color: var(--muted); font-weight: 400; }
.more-controls .quality { margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.more-controls .confidence { padding: 0 14px 14px; margin: 12px auto 0; }
.response-panel .submit { margin-top: 12px; }

.quality {
  max-width: 760px;
  margin: 18px auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7faf8;
}

.quality > span { display: block; font-weight: 700; margin-bottom: 10px; }
.quality small { color: var(--muted); font-weight: 400; }
.flag-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.flag-buttons button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  padding: 8px 13px;
  font-weight: 650;
}
.flag-buttons button.selected {
  border-color: var(--yellow);
  background: #fff4cf;
  color: #604900;
}

@media (max-width: 650px) {
  .friday-card { padding: 14px; }
  .friday-card:not([open]) { padding-block: 11px; }
  .friday-card:not([open]) .friday-heading h2 { margin-bottom: 0; font-size: 15px; }
  .friday-heading h2 { font-size: 18px; }
  .friday-grid { grid-template-columns: 1fr; gap: 12px; }
  .entry-routes { display: grid; grid-template-columns: 1fr; width: min(100%,360px); margin-inline: auto; }
  .entry-routes button { min-width: 0; padding: 10px 6px; font-size: 12px; }
  .entry-routes button small { font-size: 9px; }
  .wallet-preflight { grid-template-columns: 1fr 1fr; }
  .wallet-preflight div:first-child { grid-column: 1/-1; }
  .flag-buttons { display: grid; grid-template-columns: 1fr 1fr; }
  .flag-buttons button { border-radius: 10px; padding: 8px; }
  .quick-compare > div { gap: 5px; }
  .quick-compare figcaption { font-size: 9px; }
  .guide-modal { align-items: flex-end; padding: 0; }
  .guide-sheet { max-height: 94dvh; border-radius: 20px 20px 0 0; padding: 18px 14px calc(18px + env(safe-area-inset-bottom)); }
  .guide-sheet h2 { font-size: 23px; }
  .guide-examples { grid-template-columns: 1fr; }
  .guide-group { display: block; }
  .guide-group h3 { padding-bottom: 5px; }
  .guide-group p { padding-top: 8px; }
  .example-pair { width: 100%; }
  #game .workspace { padding-bottom: 18px; }
  .view-pair figcaption { min-height: 38px; padding: 6px 3px; font-size: 10px; }
  .viewer .coach { font-size: 11px; }
  .feature-step { padding: 7px; }
  .response-panel {
    position: relative;
    margin: 8px 0 0;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px #10252520;
  }
  .response-title { margin: 0 0 6px; font-size: 13px; }
  .response-title > span { width: 20px; height: 20px; }
  .response-panel .answers { grid-template-columns: 1fr 1fr; gap: 6px; }
  .response-panel .answers button { display: block; min-height: 49px; padding: 5px; text-align: center; border-radius: 10px; }
  .response-panel .answers button span { font-size: 16px; line-height: 1; }
  .response-panel .answers button b { font-size: 12px; }
  .response-panel .answers button small { display: none; }
  .more-controls { margin-top: 7px; }
  .more-controls summary { padding: 7px 9px; font-size: 11px; }
  .response-panel .submit { margin-top: 7px; padding: 11px; }
  .research-note { display: none; }
  .practice { padding: 10px; }
  .practice-answers { gap: 6px; }
}
