/* Adapted selectors from quality-lab/dist/style.css. Load after ui-foundation.css.
   Declarations retain their ISO values; selectors map onto geography's DOM. */

/* ISO: .exercise h1 */
.geo-session .quiz-content h1 {
  font-size:29px;font-weight:900;margin:10px 0 24px;line-height:1.5;
}

/* ISO: .option, followed by its later MAQUA identity and motion overrides. */
.geo-session .quiz-content .option {
  display:flex;width:100%;align-items:center;gap:16px;background:#fff;
  border:2px solid #e5e5e5;border-bottom-width:4px;border-radius:13px;
  min-height:64px;padding:14px 18px;margin-bottom:12px;color:#4b4b4b;
  font-size:17px;text-align:left;font-weight:700;line-height:1.6;
  border-color:var(--maqua-blue40);
  transition:background .15s,border-color .15s,box-shadow .15s;
}

/* ISO: .option:hover:not(:disabled) */
.geo-session .quiz-content .option:hover:not(:disabled) {
  background:var(--maqua-blue20);
}

/* ISO: .option.selected */
.geo-session .quiz-content .option.selected {
  background:var(--maqua-blue20);border-color:var(--maqua-blue80);color:#000;
  box-shadow:0 3px 0 var(--maqua-blue60);
}

/* ISO: .option-index; geography uses .option-key. */
.geo-session .quiz-content .option-key {
  display:grid;place-items:center;width:29px;height:29px;min-width:29px;
  border:2px solid #e5e5e5;border-radius:8px;color:#afafaf;font-size:14px;
  font-family:'Nunito',sans-serif;line-height:1;background:#fff;
}

/* ISO: .selected .option-index */
.geo-session .quiz-content .selected .option-key {
  background:var(--maqua-blue40);border-color:var(--maqua-blue60);color:#000;
}

/* ISO: .option.right and .option.right .option-index */
.geo-session .quiz-content .option.is-correct {
  background:var(--maqua-green-tint);border-color:var(--maqua-green);color:#000;
}
.geo-session .quiz-content .option.is-correct .option-key {
  color:#000;border-color:var(--maqua-green);background:var(--maqua-green-tint);
}

/* ISO: .option.wrong and .option.wrong .option-index */
.geo-session .quiz-content .option.is-wrong {
  background:var(--maqua-pink-tint);border-color:var(--maqua-pink);
  color:var(--maqua-pink-shadow);
}
.geo-session .quiz-content .option.is-wrong .option-key {
  background:var(--maqua-pink-tint);border-color:var(--maqua-pink);
  color:var(--maqua-pink-shadow);
}

/* ISO: .feedback-good and .feedback-retry. Restrict to answered questions. */
.geo-session:has(> .quiz-content.answered) > .geo-footer.correct {
  background:var(--maqua-green-tint);border-color:var(--maqua-green-tint);
}
.geo-session:has(> .quiz-content.answered) > .geo-footer.incorrect {
  background:var(--maqua-pink-tint);border-color:var(--maqua-pink-tint);
}

/* ISO: .match-board, .match-column and .match-card. */
.geo-session .quiz-content .matching-response {
  display:grid;grid-template-columns:1fr 1fr;gap:14px;max-width:700px;margin:12px auto;
}
/* Geography places the board in a flex column; preserve ISO's block width. */
.geo-session .quiz-content .matching-response {width:100%;}
.geo-session .quiz-content .match-column {display:grid;gap:8px;}
.geo-session .quiz-content .match-card {
  min-height:68px;border:2px solid #9edee4;border-bottom-width:5px;
  border-radius:14px;background:#fff;color:#294f55;display:flex;
  align-items:center;gap:8px;padding:8px 10px;text-align:left;
  font-size:16px;font-weight:750;cursor:pointer;
}
/* ISO: .match-card.match-focus, .match-card.matched and .match-card span. */
.geo-session .quiz-content .match-card.active {border-color:#00aabd;background:#e2f7f9;}
.geo-session .quiz-content .match-card.paired {background:#eefafa;}
.geo-session .quiz-content .match-card span {flex:1;}

/* ISO: .match-badge. Geography's corresponding number is a <b>. */
.geo-session .quiz-content .match-card > b {
  display:grid;place-items:center;width:24px;height:24px;border-radius:50%;
  background:#bdebf0;color:#197b85;flex:none;
}

/* ISO: .match-card.pair-right and .match-card.pair-wrong.
   !important matches geography's existing pair-result priority. */
.geo-session .quiz-content .match-card.pair-right {
  border-color:#4fb89d !important;background:#e8f8f2 !important;
}
.geo-session .quiz-content .match-card.pair-wrong {
  border-color:#df947c !important;background:#fff1ec !important;
}

/* ISO mobile .exercise h1, .option and .option-index. */
@media(max-width:600px) {
  .geo-session .quiz-content h1 {font-size:24px;line-height:1.5;margin:8px 0 22px;}
  .geo-session .quiz-content .option {font-size:15px;padding:12px 14px;gap:13px;min-height:63px;}
  .geo-session .quiz-content .option-key {width:25px;min-width:25px;height:26px;font-size:12px;border-radius:7px;}
}

/* ISO mobile .match-board, .match-column, .match-card and .match-badge. */
@media(max-width:650px) {
  .geo-session .quiz-content .matching-response {gap:7px;margin:8px auto;}
  .geo-session .quiz-content .match-column {gap:6px;}
  .geo-session .quiz-content .match-card {min-height:60px;font-size:14px;padding:6px;gap:4px;}
  .geo-session .quiz-content .match-card > b {width:21px;height:21px;}
}

/* Geography's original geological map has nested wrappers. Constrain the
   whole map to the question figure instead of letting it cover the prompt or
   answers. The SVG keeps its own viewBox and is not cropped. */
.geo-session .chapter-question-figure > .rock-distribution-model,
.geo-session .chapter-question-figure > .rock-distribution-model > div,
.geo-session .chapter-question-figure > .rock-distribution-model > div > div,
.geo-session .chapter-question-figure .g58-map-svg {
  width: 100%; height: 100%; min-height: 0; max-height: 100%;
}
.geo-session .chapter-question-figure .g58-map-svg svg {
  display: block; width: 100%; height: 100%; max-height: 100%;
}
.geo-session .quiz-content .match-card .match-result { flex: none; font-weight: 900; }
/* ISO partner-app.js session feedback: status and explanation share the
   bottom feedback area, rather than inserting a new bubble into the figure. */
.geo-session .geo-footer:is(.correct,.incorrect) .feedback { display:flex; align-items:flex-start; gap:12px; }
.geo-session .geo-footer .feedback-copy { min-width:0; }
.geo-session .geo-footer .feedback-copy p { margin:2px 0 0; line-height:1.4; }
@media (max-width:600px) {
  .geo-session .geo-footer:is(.correct,.incorrect) .footer-inner { display:grid; grid-template-columns:1fr auto; gap:8px; }
  .geo-session .geo-footer:is(.correct,.incorrect) .footer-inner > .feedback { display:flex; grid-column:1 / -1; }
  .geo-session .geo-footer:is(.correct,.incorrect) .footer-inner:not(:has(>.hint-toggle)) > .primary { grid-column:1 / -1; }
  .geo-session .quiz-content.answered .chapter-question-figure { flex:1 1 120px; min-height:120px; max-height:160px; }
  .geo-session .quiz-content.answered .chapter-question-figure:is(.arc-region-comparison,.spring-comparison) { flex:0 0 auto; min-height:210px; max-height:none; }
}

/* ISO button press: local tactile feedback without replaying the page. */
@media (prefers-reduced-motion: no-preference) {
  .geo-session .quiz-content :is(.option,.match-card):not(:disabled):active {
    transform: translateY(2px);
    border-bottom-width: 2px;
  }
}
.geo-session .numeric-tap .numeric-options button{min-height:44px;white-space:normal;overflow-wrap:anywhere}
/* Keep the reclamation map large enough to read on a phone. The matching
   instruction remains available to assistive technology. */
@media (max-width:600px) {
  .geo-session .quiz-content[data-question="G62-map-locations"] > .exercise-hint {
    position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);
  }
  .geo-session .quiz-content[data-question="G62-map-locations"] .chapter-question-figure {
    flex:0 0 clamp(180px,26dvh,230px);min-height:clamp(180px,26dvh,230px);max-height:clamp(180px,26dvh,230px);
  }
}

/* Fit the feedback and answers together on short phones without shrinking type. */
@media (max-width:600px) and (max-height:740px) {
  .geo-session > .quiz-content { justify-content:safe center; gap:6px; padding-block:4px 8px; }
  .geo-session .quiz-content h1 { margin:2px 0 4px; line-height:1.32; }
  .geo-session .quiz-content .options { gap:6px; }
  .geo-session .quiz-content .option { min-height:48px; margin:0; padding:7px 10px; line-height:1.4; }
  .geo-session .quiz-content.answered .chapter-question-figure:is(.arc-region-comparison,.spring-comparison) {
    min-height:160px; flex:0 0 160px;
  }
  .geo-session .quiz-content.answered .arc-region-comparison > .arc-region-model { min-height:106px; }
  .geo-session .geo-footer:is(.correct,.incorrect) { padding-block:8px max(10px,env(safe-area-inset-bottom)); }
  .geo-session .geo-footer:is(.correct,.incorrect) .footer-inner { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  .geo-session .geo-footer:is(.correct,.incorrect) .footer-inner > .primary { min-width:0; }
  .geo-session .geo-footer .hint-toggle { min-height:44px; }
}
.geo-session .river-profile-evidence{display:grid;grid-template-rows:minmax(55px,1fr) minmax(55px,1fr);align-items:stretch}
.geo-session .river-profile-evidence > svg{height:100%;width:100%;min-height:0}
.geo-session .river-profile-evidence > .g61-g64-neutral-panels{height:100%;min-height:0}

/* Compact matching keeps the current concept and its choices in view. The
   original two-column board remains available at wider sizes. */
.geo-session .match-mobile-rail,.geo-session .match-mobile-answer{display:none}
@media (max-width:600px) {
 .geo-session .quiz-content .matching-response{grid-template-columns:minmax(0,1fr);gap:5px;margin-block:3px}
 .geo-session .matching-response .match-mobile-rail{display:flex;gap:5px;justify-content:center}
 .geo-session .match-mobile-rail > button{min-width:44px;min-height:44px;padding:4px 6px;display:flex;align-items:center;justify-content:center;gap:3px}
 .geo-session .match-mobile-rail > button.chosen{background:#ccf2f7;border-color:#008b9c}
 .geo-session .matching-response:not(.match-show-all) .match-concepts > :not(.active){display:none}
 .geo-session .matching-response:not(.match-editing):not(.match-show-all) .match-definitions > .paired{display:none}
 .geo-session .matching-response.match-show-all .match-definitions{display:none}
 .geo-session .matching-response.match-show-all .match-mobile-answer{display:block;font-size:inherit;font-weight:500;margin-top:2px}
 .geo-session .quiz-content .matching-response .match-card{min-height:44px;padding:5px 8px;line-height:1.35}
 .geo-session .quiz-content .matching-response .match-concepts .match-card.active{background:#ccf2f7}
 .geo-session .quiz-content .matching-response .match-status{margin:0;line-height:1.35;text-align:center}
 .geo-session .quiz-content:has(.matching-response) .chapter-question-figure{flex:1 0 112px;min-height:112px;max-height:165px}
 .geo-session .quiz-content:has(.matching-response) .exercise-hint{margin:0}
}
@media (max-width:600px) {
 .geo-session .matching-response.match-start .match-mobile-rail{display:none}
 .geo-session .matching-response.match-show-all .match-mobile-rail{display:none}
 .geo-session .quiz-content:has(.matching-response) h1{font-size:clamp(19px,5.4vw,24px)}
 .geo-session .quiz-content:has(.matching-response) .chapter-question-figure{flex:0 0 105px;min-height:105px}
 .geo-session .quiz-content:has(.matching-response) .chapter-question-figure .g61-g64-neutral-panels{height:100%}
}
@media (max-width:600px) and (max-height:740px) {
 .geo-session .quiz-content.answered:has(.matching-response) .chapter-question-figure{flex-basis:82px;min-height:82px;max-height:82px}
 .geo-session .quiz-content.answered .matching-response .match-mobile-answer{display:inline;margin:0}
 .geo-session .quiz-content.answered .matching-response .match-mobile-answer::before{content:' · '}
 .geo-session .quiz-content.answered .matching-response .match-status{display:none}
 .geo-session .quiz-content.answered .matching-response .match-card{padding:4px 7px;line-height:1.25}
}
/* Keep sorting cards readable at full width, with space left for evidence. */
@media (max-width:600px) and (max-height:740px) {
 .geo-session > .quiz-content:not(:has(.question-figure)){justify-content:safe center}
 .geo-session .quiz-content:is(:has(.arrange-workspace),:has(.iso-order)) h1{font-size:clamp(20px,5.4vw,24px);line-height:1.3;margin:0 0 2px}
 .geo-session .quiz-content:is(:has(.arrange-workspace),:has(.iso-order)) .chapter-question-figure{flex:0 0 103px;min-height:103px;max-height:103px}
 .geo-session .quiz-content:is(:has(.arrange-workspace),:has(.iso-order)) .exercise-hint{margin:0}
 .geo-session .quiz-content:has(.arrange-empty) > .exercise-hint{display:none}
 .geo-session .arrange-workspace .arrange-list{min-height:0;padding:4px;margin:0 0 5px;gap:4px}
 .geo-session .arrange-workspace .arrange-empty{min-height:37px}
 .geo-session .arrange-workspace .arrange-pool{display:grid;grid-template-columns:minmax(0,1fr);gap:5px}
 .geo-session .arrange-workspace :is(.arrange-pool-card,.arrange-placed-card){min-height:44px;padding:4px 8px;line-height:1.32}
 .geo-session .quiz-content .iso-order{margin:0}
 .geo-session .quiz-content .iso-order-label{margin:5px 0 2px}
 .geo-session .quiz-content .iso-order-slots{min-height:0;padding:4px;margin-bottom:5px;gap:4px}
 .geo-session .quiz-content .iso-order-slots > .iso-order-empty{min-height:36px}
 .geo-session .quiz-content .iso-order-choice{min-height:44px;padding:4px 8px;line-height:1.32}
 .geo-session .quiz-content.answered:has(.arrange-workspace) .chapter-question-figure{flex-basis:82px;min-height:82px;max-height:82px}
}
@media (max-width:600px) and (max-height:740px) {
 .geo-session .quiz-content:has(.matching-response) > .exercise-hint{display:none}
 .geo-session .quiz-content .matching-response .match-card > b{flex:0 0 21px}
}
@media (max-width:600px) and (max-height:740px) {
 .geo-session .geo-footer:is(.correct,.incorrect) .feedback-copy p{display:inline;margin:0}
 .geo-session .geo-footer:is(.correct,.incorrect) .feedback-copy p::before{content:' '}
 .geo-session .geo-footer:is(.correct,.incorrect) .feedback{gap:7px}
 .geo-session .geo-footer:is(.correct,.incorrect) .feedback-mark{width:24px;height:24px}
 .geo-session .quiz-content.answered .arrange-workspace .arrange-placed-card{border-bottom-width:2px;padding-block:2px}
}

@media (max-width:600px) and (max-height:740px) {
 .geo-session > .quiz-content {--lesson-title-size:23px;scrollbar-gutter:auto}
 .geo-session > .quiz-content:has(>.options) > .chapter-question-figure:not(:has(button,input,select)):not(.river-profile-evidence) {
   flex:1 0 120px;min-height:120px;max-height:175px;
 }
 .geo-session > .quiz-content.answered:has(>.options) > .chapter-question-figure:not(:has(button,input,select)):not(.river-profile-evidence){
   flex:1 0 100px;min-height:100px;max-height:140px;
 }
}
@media (max-width:600px) and (max-height:740px) {
 .geo-session .quiz-content.answered .spring-comparison > .spring-comparison-model{min-height:106px}
 .geo-session .quiz-content.answered .spring-comparison-model .tourism-keyed-model > svg{min-height:0;max-height:110px}
}
/* Checked cards are read-only. Keep every answer available and reserve
   full-size touch targets for the figure tabs, review and Continue. */
@media (max-width:600px) and (max-height:740px) {
 .geo-session .quiz-content.answered .options{gap:4px}
 .geo-session .quiz-content.answered .option:disabled{min-height:0;padding:3px 7px;border-bottom-width:2px}
 .geo-session .quiz-content.answered .option-key{width:22px;min-width:22px;height:22px;flex-basis:22px}
 .geo-session .quiz-content.answered .matching-response .match-card:disabled,
 .geo-session .quiz-content.answered .arrange-workspace .arrange-placed-card[aria-disabled="true"]{min-height:0;padding:2px 6px;border-bottom-width:2px}
 .geo-session .quiz-content.answered .matching-response .match-column{gap:4px}
}
.geo-session .numeric-options > .numeric-correct{background:#e5f6e4;border-color:#58a961;color:#275d32}
.geo-session .numeric-options > .numeric-wrong{background:#fff0e7;border-color:#d58968;color:#814f23}
@media (max-width:600px) and (max-height:740px) {
 .geo-session .quiz-content.answered .numeric-tap{padding:4px 6px!important;margin:0!important}
 .geo-session .quiz-content.answered .numeric-tap > label{display:none}
 .geo-session .quiz-content.answered .numeric-tap .numeric-options{margin-top:3px;gap:4px}
 .geo-session .quiz-content.answered .numeric-tap .numeric-options button{min-height:0;padding:2px 4px}
 .geo-session .quiz-content.answered .numeric-tap > p{margin:3px 0 0}
}
