/* Topic 22 family and marriage styles: all selectors scoped to .mh-lesson. */
.mh-lesson .mh-intro{padding:24px;background:#f2f8fd;border:1px solid #d7e8f3;border-radius:16px;margin:0 0 24px}.mh-lesson .mh-intro h3{margin-top:0;color:#194970}.mh-lesson .mh-intro p{line-height:1.7;color:#466075}
.mh-lesson .mh-checklist{list-style:none;padding:0;display:grid;gap:10px;margin:22px 0}.mh-lesson .mh-checklist li{display:flex;gap:15px;align-items:flex-start;border:1px solid #dbe7ee;background:#fff;border-radius:12px;padding:14px;line-height:1.6;min-width:0}.mh-lesson .mh-checklist b{min-width:90px;color:#576f82}.mh-lesson .mh-checklist .is-done{background:#eff9f3;border-color:#bcdfcb}.mh-lesson .mh-checklist .is-done b{color:#226b4e}
.mh-lesson .gg-btn:disabled{cursor:not-allowed}.mh-lesson .gg-btn.gg-primary{background:#176ac0;border-color:#176ac0;color:#fff}.mh-lesson summary{cursor:pointer;min-height:44px;line-height:1.6;padding:8px 0}.mh-lesson .mh-phrase-exercise{background:#f3f8fc;border:1px solid #d5e7f1;padding:14px;border-radius:12px;margin-top:18px}.mh-lesson .mh-substitutions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:16px 0}.mh-lesson .mh-substitutions>div{border:1px solid #dce7ee;border-radius:10px;padding:14px;min-width:0}.mh-lesson .mh-substitutions strong{font-size:22px}.mh-lesson .mh-inline-terms .gg-btn{display:inline-block;vertical-align:baseline;min-height:44px;padding:3px 0;border:0;border-radius:3px;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:6px;font:inherit;color:inherit;background:transparent}.mh-lesson .mh-inline-terms .gg-btn:hover{background:#e6f2fb;color:#145d9b}
.mh-lesson .mh-review{border:1px solid #d4e6ee;border-radius:12px;background:#f6fbfe;padding:18px;margin:24px 0;text-align:left}.mh-lesson .mh-review ul{padding:0;list-style:none;display:grid;gap:12px}.mh-lesson .mh-review li{display:grid;gap:5px}.mh-lesson .mh-review button{white-space:normal;text-align:left;line-height:1.6}.mh-lesson .mh-review small{color:#5a7284}
.mh-lesson .mh-simulator{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,.7fr);gap:28px;align-items:start;margin-top:24px}.mh-lesson .mh-remote,.mh-lesson .mh-message-in{background:#edf6fd;border:1px solid #d3e6f2;border-radius:4px 15px 15px 15px;padding:16px;margin:22px 0 16px;min-width:0}.mh-lesson .mh-remote>span{font-size:12px;color:#56738b}.mh-lesson .mh-practice-guide{min-width:0;background:#f3f9fc;border:1px solid #d6e8ef;border-radius:16px;padding:22px}.mh-lesson .mh-practice-guide h3{margin-top:0}.mh-lesson .mh-practice-guide p{line-height:1.7;color:#4f687c}.mh-lesson .mh-practice-guide .mh-checklist li{flex-direction:column;gap:4px}.mh-lesson .mh-practice-guide .gg-btn{white-space:normal;min-height:44px}.mh-lesson [draggable="true"]{cursor:grab}.mh-lesson #mh-drop-answer{min-height:70px;border:2px dashed #83b2d7}
@media(max-width:1000px){.mh-lesson .mh-simulator{grid-template-columns:minmax(0,1fr)}.mh-lesson .mh-practice-guide .mh-checklist{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.mh-lesson .mh-intro,.mh-lesson .mh-practice-guide{padding:16px}.mh-lesson .mh-checklist li{flex-direction:column;gap:5px}.mh-lesson .mh-substitutions{grid-template-columns:minmax(0,1fr)}.mh-lesson .mh-practice-guide .mh-checklist{grid-template-columns:minmax(0,1fr)}.mh-lesson .mh-simulator{gap:18px}}
@media(prefers-reduced-motion:reduce){.mh-lesson .fd-celebrate{animation:none}.mh-lesson *{scroll-behavior:auto}}
.mh-lesson .mh-speaking article{outline:3px solid #9bceb9;background:#ecfaf3}
.mh-lesson .mh-mini-line{padding:12px 0;border-bottom:1px solid #e0eaf1}
.mh-lesson .mh-keywords{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.mh-lesson .mh-simulator{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,.7fr);gap:20px;align-items:start}
.mh-lesson .mh-practice-card,.mh-lesson .mh-practice-guide{min-width:0;padding:20px;border:1px solid #dce8ef;border-radius:22px;background:#fff}
.mh-lesson .mh-practice-guide{background:#f1f8ff}
.mh-lesson .mh-practice-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:18px}
.mh-lesson .mh-practice-tabs button{min-height:48px;white-space:normal;text-align:left}
.mh-lesson .mh-schedule{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:16px;background:#effaf5;border-radius:16px;margin:16px 0}
.mh-lesson .mh-schedule label{display:grid;gap:6px;font-weight:600;min-width:0}
.mh-lesson .mh-schedule input,.mh-lesson .mh-schedule select{width:100%;min-width:0;min-height:48px;border:1px solid #bdd3dc;border-radius:10px;padding:10px;background:white;font:inherit}
.mh-lesson .mh-phrase-exercise{border-top:1px solid #dce8ef;padding-top:12px}
.mh-lesson .mh-phrase-exercise summary,.mh-lesson .mh-review summary{cursor:pointer;padding:10px 0;font-weight:700}
.mh-lesson .mh-inline-terms .gg-btn{font-size:inherit;border:0;padding:0 2px;min-height:44px;background:transparent;color:inherit;text-decoration:underline;text-decoration-color:#aacabc;text-underline-offset:7px}
.mh-lesson .mh-substitutions{display:grid;gap:10px}
@media(max-width:1000px){.mh-lesson .mh-simulator{grid-template-columns:minmax(0,1fr)}}
@media(max-width:600px){.mh-lesson .mh-schedule,.mh-lesson .mh-keywords{grid-template-columns:minmax(0,1fr)}.mh-lesson .mh-practice-card,.mh-lesson .mh-practice-guide{padding:14px}}

.mh-lesson .mh-practice-card .gg-choices{grid-template-columns:minmax(0,1fr)}
.mh-lesson .mh-practice-card .gg-btn{white-space:normal;min-height:44px}
.mh-lesson .mh-generated{padding:18px;border:1px solid #bcdcca;border-radius:16px;background:#effaf4;margin:20px 0;overflow-wrap:anywhere}
.mh-lesson .mh-generated .gg-triple strong{font-size:24px;line-height:1.7}
.mh-lesson .mh-sim-status{min-height:24px;color:#226b4e}
.mh-lesson .fd-order-answer{flex-wrap:wrap}.mh-lesson .fd-order-answer button,.mh-lesson .fd-word-bank button{white-space:normal;max-width:100%;line-height:1.6}
.mh-lesson .mh-product-grid,.mh-lesson .mh-activity-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:18px 0}
.mh-lesson .mh-product-grid>article,.mh-lesson .mh-activity-grid>article{min-width:0;border:1px solid #dce8ef;border-radius:16px;overflow:hidden;background:#fff;padding-bottom:12px}
.mh-lesson .mh-product-grid>article.is-selected{border-color:#60b78b;background:#effbf5}
.mh-lesson .mh-product-grid img,.mh-lesson .mh-activity-grid img{width:100%;height:145px;object-fit:cover}
.mh-lesson .mh-product-grid .gg-triple,.mh-lesson .mh-product-grid article>b,.mh-lesson .mh-product-grid .gg-audio{padding:0 10px}
.mh-lesson .mh-product-grid .gg-triple strong{font-size:23px;line-height:1.6;margin-top:10px}
.mh-lesson .mh-product-grid .gg-audio{flex-wrap:wrap;margin:10px 0}
.mh-lesson .mh-quantity{display:flex;align-items:center;justify-content:center;gap:14px;margin-top:12px}.mh-lesson .mh-quantity output{min-width:24px;text-align:center;font-size:20px;font-weight:700}
.mh-lesson .mh-activity-grid article>button{width:100%;padding:0 0 12px;display:flex;flex-direction:column;align-items:stretch}.mh-lesson .mh-activity-grid .gg-triple{padding:10px}
.mh-lesson .mh-cost{max-width:100%;overflow-x:auto;margin:20px 0;border:1px solid #d7e7ee;border-radius:12px}.mh-lesson .mh-cost table{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;font-size:14px}.mh-lesson .mh-cost th,.mh-lesson .mh-cost td{padding:10px 7px;text-align:left;border-bottom:1px solid #deebf1}.mh-lesson .mh-cost caption{padding:14px;background:#eef7fc;font-weight:700}.mh-lesson .mh-cost small{display:block;color:#567084}.mh-lesson .mh-cost tfoot{background:#eef9f2}
@media(max-width:450px){.mh-lesson .mh-product-grid,.mh-lesson .mh-activity-grid{grid-template-columns:minmax(0,1fr)}}

.mh-lesson .mh-summary-photo{width:100%;height:220px;object-fit:cover;border-radius:18px;margin-bottom:24px}
/* The diagram scrolls inside its card; the page itself remains one-column on mobile. */
.mh-lesson .mh-family-tree{max-width:100%;overflow:auto;border:1px solid #cde3df;border-radius:18px;background:#f6fbfa;margin:16px 0;overscroll-behavior-x:contain}
.mh-lesson .mh-tree-board{position:relative;width:920px;height:870px}
.mh-lesson .mh-tree-board>svg{position:absolute;inset:0;width:920px;height:870px;pointer-events:none}
.mh-lesson .mh-tree-node{position:absolute;box-sizing:border-box;width:138px;min-height:116px;border:2px solid #cadfdc;background:#fff;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:5px;text-align:center;padding:6px}
.mh-lesson .mh-tree-node strong{display:block;font-size:24px;font-weight:750}.mh-lesson .mh-tree-node small{font-size:12px;color:#455e61}.mh-lesson .mh-tree-node span{font-size:13px;color:#456475}
.mh-lesson .mh-tree-slot{width:100%;min-height:98px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;border:0;background:transparent;cursor:pointer;color:inherit}
.mh-lesson .mh-tree-node>.gg-btn{position:absolute;right:-8px;top:-14px;min-height:32px;min-width:32px;padding:2px;background:#fff}
.mh-lesson .mh-tree-node.is-wrong{border-color:#cc635a;background:#fff4f2}.mh-lesson .mh-tree-node.is-right{border-color:#289777;background:#edf9f4}.mh-lesson .mh-tree-ego{border-color:#198aa1;background:#e6f5fa}.mh-lesson .mh-tree-partner{background:#ecf7ef}
.mh-lesson .mh-tree-caption{position:absolute;margin:0;font-size:12px;font-weight:700;color:#3a6670;background:#f6fbfa;padding:2px 8px}.mh-lesson .mh-tree-in{left:185px;top:184px}.mh-lesson .mh-tree-out{left:640px;top:184px}.mh-lesson .mh-tree-siblings{left:280px;top:388px}.mh-lesson .mh-tree-children{left:330px;top:640px}
.mh-lesson .mh-tree-bank,.mh-lesson .mh-family-cards{display:flex;flex-wrap:wrap;gap:8px}.mh-lesson .mh-tree-bank .gg-btn{min-height:44px;touch-action:manipulation;cursor:grab}
.mh-lesson .mh-tree-info{padding:16px;border:1px solid #cae1d9;border-radius:16px;background:#f2faf7;margin-top:12px}.mh-lesson .mh-tree-info img{width:100%;max-height:230px;object-fit:cover;border-radius:12px}.mh-lesson .mh-tree-info figure{max-width:360px}
.mh-lesson .mh-kinship-path{border-left:4px solid #7ab8a6;padding:8px 16px;background:#f0f8f5;line-height:1.9}.mh-lesson .mh-tree-reference{margin:18px 0}.mh-lesson .mh-tree-reference summary{padding:12px;border-radius:12px;background:#eaf6f9;cursor:pointer;min-height:44px}
.mh-lesson .mh-tree-feedback{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.mh-lesson .mh-family-cards>.gg-btn{flex:1 1 160px}.mh-lesson .mh-family-cards .gg-triple strong{font-size:24px}.mh-lesson .mh-generated .fd-word-image{max-width:300px}
@media(max-width:600px){.mh-lesson .mh-tree-feedback{grid-template-columns:minmax(0,1fr)}.mh-lesson .mh-family-tree{margin:12px 0}.mh-lesson .mh-tree-bank{gap:6px}}
@media(prefers-reduced-motion:reduce){.mh-lesson *{animation:none!important;scroll-behavior:auto!important}}
.mh-lesson .fd-word-image img[src$=".svg"],.mh-lesson .fd-question-image[src$=".svg"]{object-fit:contain;background:#f3faf7}
.mh-lesson .fd-question-image[src$=".svg"]{max-height:none;height:auto;width:100%;max-width:720px}
