/* History-geography lessons: Arabic, right to left. Builds on app.css and maths.css. */
.mx-hg { --hg-ink: #2a2116; --hg-paper: #fffaf0; --hg-sand: #f6ead2; --hg-brown: #8a5a2b; --hg-terra: #c2410c; --hg-sea: #cfe6f3; --hg-land: #efe6cf; --hg-teal: #0f766e; --hg-green: #3f8f2f; }
.mx-hg, .mx-hg .pc-prose { font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Naskh Arabic", "Geeza Pro", Arial, sans-serif; }
.mx-hg .pc-prose { font-size: 18px; line-height: 1.95; }
.mx-hg h1 { line-height: 1.45; }
.mx-hg .pc-lead { line-height: 1.9; }
.mx-hg .pc-prose h2 { line-height: 1.5; }
.mx-hg .pc-prose h3 { line-height: 1.6; }

/* Right to left: the shared styles were written for French. */
[dir="rtl"] .pc-prose ul, [dir="rtl"] .pc-prose ol, [dir="rtl"] .pc-prose .custom-ul { padding-left: 0; padding-right: 24px; }
[dir="rtl"] .pc-prose .mx-box { border-left-width: 1px; border-right-width: 5px; }
[dir="rtl"] .pc-prose .mx-def { border-right-color: var(--pc-blue); }
[dir="rtl"] .pc-prose .mx-prop { border-right-color: var(--pc-teal); }
[dir="rtl"] .pc-prose .mx-ex { border-right-color: var(--pc-navy); }
[dir="rtl"] .pc-prose .mx-tip { border-right-color: var(--pc-amber); }
[dir="rtl"] .pc-prose .mx-trap { border-right-color: var(--mx-red); }
[dir="rtl"] .pc-prose .mx-method { border-right-color: var(--mx-violet); }
[dir="rtl"] .pc-prose .mx-box__t { letter-spacing: 0; text-transform: none; font-size: 15px; }
[dir="rtl"] .pc-toc a { border-left: 0; border-right: 3px solid var(--pc-line); }
[dir="rtl"] .pc-crumbs li + li::before { content: "‹"; margin-right: 0; margin-left: 6px; }
[dir="rtl"] .pc-toc a:hover, [dir="rtl"] .pc-toc a.is-active, [dir="rtl"] .pc-toc a[aria-current] { border-right-color: var(--pc-teal); }
[dir="rtl"] .pc-prose .pc-num { margin-right: 0; margin-left: 6px; }
[dir="rtl"] .mx-pdfnote__arrow { transform: none; }
[dir="rtl"] .pc-pager a[rel="next"] { text-align: left; }
[dir="rtl"] .pc-pager a[rel="prev"] { text-align: right; }
.mx-hg .mx-widget:not(.is-live)::after { content: "أداة تفاعلية: فعّل JavaScript لاستعمالها."; }
.mx-hg .pc-prose .mx-widget > .mx-box__t { font-size: 17px; color: var(--hg-brown); }
.mx-hg .pc-prose .mx-exo summary { font-size: 17px; }
.mx-hg .pc-quiz__q, .mx-hg .pc-opt__t { line-height: 1.8; }

/* Lesson head: the problem question and the "plan" of the lesson */
.pc-prose .hg-problem { margin: 16px 0; padding: 16px 18px; border-radius: 14px; background: linear-gradient(135deg, #fff4e0, #fdeee6); border: 1px solid #f1d6b4; }
.pc-prose .hg-problem strong:first-child { display: block; color: var(--hg-terra); font-size: 15px; margin-bottom: 4px; }
.pc-prose .hg-keys { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; padding: 0; list-style: none; }
.pc-prose .hg-keys li { margin: 0; padding: 6px 12px; border-radius: 999px; background: #eef6f4; color: #0b5d56; font-size: 15px; font-weight: 700; }
.pc-prose .hg-keys li::before { content: none; }

/* Illustrations */
.pc-prose .hg-fig { margin: 20px 0; padding: 12px; border: 1px solid #ecdcc0; border-radius: 16px; background: var(--hg-paper); }
.pc-prose .hg-fig svg { display: block; width: 100%; height: auto; max-height: 420px; }
.pc-prose .hg-fig figcaption { margin-top: 8px; font-size: 15px; color: #6a5a45; text-align: center; line-height: 1.7; }
.pc-prose .hg-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.pc-prose .hg-figs .hg-fig { margin: 0; }

/* Characters of the lesson */
.pc-prose .hg-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; margin: 18px 0; }
.pc-prose .hg-persona { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px; border: 1px solid #ecdcc0; border-radius: 16px; background: #fff; }
.pc-prose .hg-persona__av { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; font-size: 36px; background: radial-gradient(circle at 35% 30%, #fff7e6, #f4dcb0); box-shadow: inset 0 0 0 3px #fff, 0 0 0 2px #e6c48d; }
.pc-prose .hg-persona strong { display: block; font-size: 18px; color: var(--hg-ink); }
.pc-prose .hg-persona small { display: block; color: #7a6a55; font-size: 14px; line-height: 1.6; }
.pc-prose .hg-persona p { position: relative; margin: 8px 0 0; padding: 8px 12px; border-radius: 12px; background: #f7f1e5; font-size: 15px; line-height: 1.8; }
.pc-prose .hg-persona p::before { content: "💬 "; }

/* Preparation: questions with hidden answers */
.pc-prose .hg-prep { margin: 14px 0; padding: 0; list-style: none; counter-reset: q; }
.pc-prose .hg-prep > li { margin: 10px 0; padding: 0; counter-increment: q; }
.pc-prose .hg-prep > li::before { content: none; }
.pc-prose .hg-prep details { border: 1px solid var(--pc-line); border-radius: 12px; background: #fff; }
.pc-prose .hg-prep summary { min-height: 44px; padding: 10px 14px; font-weight: 700; cursor: pointer; line-height: 1.7; }
.pc-prose .hg-prep summary::before { content: counter(q) ". "; color: var(--hg-terra); }
.pc-prose .hg-prep details > div { padding: 0 16px 12px; }
.pc-prose .hg-prep details[open] summary { color: #0b5d56; }

/* Summary card */
.pc-prose .hg-sum { margin: 16px 0; padding: 18px 20px; border-radius: 16px; background: #f4faf8; border: 1px solid #cfe7e1; }
.pc-prose .hg-sum h3 { margin-top: 6px; color: #0b5d56; }
.pc-prose .hg-sum ul { margin-bottom: 6px; }

/* Shared tool parts */
.hg-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.hg-btn { display: inline-block; min-height: 44px; text-align: center; line-height: 1.6; padding: 8px 16px; border: 0; border-radius: 12px; background: var(--hg-brown, #8a5a2b); color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.hg-btn:hover { filter: brightness(1.08); }
.hg-btn--soft { background: #f4ead8; color: #4b3418; border: 1px solid #e3cfa9; }
.hg-chip { display: inline-block; min-height: 40px; padding: 6px 12px; border: 1px solid #e0d2b8; border-radius: 999px; background: #fff; color: #3b2a12; font: inherit; font-size: 15px; cursor: pointer; line-height: 1.5; text-align: start; }
.hg-chip i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.hg-chip.is-on { background: #3b2a12; color: #fff; border-color: #3b2a12; }
.hg-chip--big { min-height: 46px; border-radius: 12px; padding: 8px 14px; font-size: 16px; }
.hg-chip.is-good, .hg-chip:disabled.is-good { background: #e3f4e6; border-color: #63a96f; color: #1d5e2a; }
.hg-chip.is-bad { background: #fde8e4; border-color: #e0816f; color: #8f2414; animation: hg-shake .35s; }
@keyframes hg-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.hg-say, .hg-fb { min-height: 1.6em; margin: 10px 0 0; font-weight: 700; color: #0b5d56; }
.hg-muted { color: #6f6352; font-size: 15px; }
.hg-range { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-weight: 700; }
.hg-range input { width: min(260px, 100%); accent-color: var(--hg-terra, #c2410c); }
.hg-range--wide input { width: min(420px, 100%); }

/* Map */
.hg-map { position: relative; margin-top: 10px; border-radius: 12px; overflow: hidden; overflow-x: auto; direction: ltr; overscroll-behavior-x: contain; border: 1px solid #c9dbe6; background: var(--hg-sea, #cfe6f3); }
.hg-map__svg { display: block; width: 100%; height: auto; }
.hg-sea { fill: #cfe6f3; }
.hg-land { fill: #efe6cf; stroke: #b9a98a; stroke-width: .6; }
.hg-borders { fill: none; stroke: #b6a688; stroke-linejoin: round; opacity: .8; }
.hg-ma { fill: #e39a7f; fill-opacity: .4; stroke: #b0452a; }
.hg-ma--soft { fill: #f6e3c9; stroke: #a07850; }
.hg-hit { cursor: pointer; transition: opacity .2s; }
.hg-route__halo { fill: none; stroke: transparent; }
.hg-route__line { stroke-linecap: round; stroke-linejoin: round; }
.hg-route.is-on .hg-route__line, .hg-route.is-lit .hg-route__line { stroke-width: 5; filter: drop-shadow(0 0 2px #fff); }
.hg-zone.is-on, .hg-zone.is-lit { fill-opacity: .6; }
.hg-map__svg.is-focus .hg-hit:not(.is-lit):not(.hg-pin) { opacity: .25; }
.hg-pin__dot { filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .35)); }
.hg-pin.is-on .hg-pin__dot { fill: #fff3c4; }
.hg-pin__t { font-weight: 700; fill: #2a2116; paint-order: stroke; stroke: #fff; stroke-linejoin: round; }
.hg-label { font-weight: 800; fill: #4b3a22; paint-order: stroke; stroke: rgba(255, 255, 255, .85); stroke-linejoin: round; pointer-events: none; }
.hg-label.is-sea { fill: #2c6a93; font-style: italic; font-weight: 700; }
.is-quiz .hg-pin__t { display: none; }
.hg-pin.is-good .hg-pin__dot { fill: #b9efc3; }
.hg-pin.is-bad .hg-pin__dot { fill: #ffc4b8; }
.hg-pin:focus { outline: none; }
.hg-pin:focus-visible .hg-pin__dot { stroke-width: 4; }
.hg-map__info, .hg-tl__info, .hg-climo__out { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid #eadfcb; line-height: 1.85; }
.hg-map__info strong { color: #6b3d12; }
.hg-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.hg-circle circle { fill: rgba(194, 65, 12, .55); stroke: #8f2f08; stroke-width: 1; }

/* Timeline (oldest on the right) */
.hg-tl { display: flex; gap: 0; margin: 12px 0 0; padding: 18px 4px 8px !important; list-style: none; overflow-x: auto; scroll-snap-type: x proximity; position: relative; }
.hg-tl::before { content: ""; position: absolute; top: 44px; right: 0; left: 0; height: 4px; border-radius: 4px; background: linear-gradient(to left, #e9c58e, #c2410c); min-width: 100%; }
.pc-prose .hg-tl__item { flex: 0 0 auto; width: 150px; margin: 0; padding: 0; scroll-snap-align: start; position: relative; }
.pc-prose .hg-tl__item::before { content: none; }
.hg-tl__btn { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 0 6px; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: center; }
.hg-tl__e { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: #fff; border: 3px solid #e1b979; font-size: 24px; position: relative; z-index: 1; transition: transform .2s; }
.hg-tl__btn.is-on .hg-tl__e { border-color: #c2410c; transform: scale(1.12); background: #fff3e2; }
.hg-tl__d { font-size: 16px; color: #8a3b0c; }
.hg-tl__t { font-size: 14px; line-height: 1.55; color: #3d3021; }
.hg-tl__info p { margin: 6px 0 0; }
.hg-order { margin-top: 10px; }
.hg-order__pool { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pc-prose .hg-order__done { margin: 10px 0 0; }
.pc-prose .hg-order__done li { margin: 4px 0; }
.hg-order__done strong { color: #8a3b0c; }

/* Ordered chain */
.pc-prose .hg-chain { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; padding: 0 !important; list-style: none; margin: 12px 0 0; }
.pc-prose .hg-chain li { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0; padding: 8px 12px; border-radius: 12px; background: #eef7ee; border: 1px solid #b9dcb9; position: relative; min-width: 90px; text-align: center; }
.pc-prose .hg-chain li + li::before { content: "←"; position: absolute; right: -14px; top: 50%; transform: translateY(-50%); color: #3f8f2f; font-weight: 800; }
.hg-chain__e { font-size: 26px; line-height: 1.2; }
.pc-prose .hg-chain small { font-size: 13px; color: #4b5d4b; line-height: 1.5; }

/* Mind map card */
.hg-mind { display: grid; grid-template-columns: minmax(0, 1fr) minmax(170px, 230px) minmax(0, 1fr); gap: 16px; align-items: center; margin-top: 12px; padding: 16px; border-radius: 18px; background: radial-gradient(circle at 50% 50%, #fffdf7 0, #fbf3e3 70%); border: 2px dashed #e4cfa6; }
.hg-mind__col { display: grid; gap: 12px; }
.hg-mind__center { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 12px; border-radius: 50%; aspect-ratio: 1; justify-content: center; text-align: center; background: radial-gradient(circle at 35% 30%, #fff, #ffe0b3); border: 3px solid #e09a4a; box-shadow: 0 6px 18px rgba(176, 99, 25, .18); }
.hg-mind__ce { font-size: 42px; line-height: 1; }
.hg-mind__center strong { font-size: 18px; line-height: 1.5; color: #4a2a08; }
.hg-mind__center small { font-size: 13px; color: #7a5a35; line-height: 1.5; }
.hg-mind__br { border-radius: 14px; background: #fff; border: 2px solid var(--b, #0f766e); overflow: hidden; }
.hg-mind__h { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; background: var(--b, #0f766e); color: #fff; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; text-align: start; }
.hg-mind__e { font-size: 22px; line-height: 1; }
.pc-prose .hg-mind__br ul { margin: 0; padding: 8px 12px 10px 10px; list-style: none; }
.pc-prose .hg-mind__br li { margin: 4px 0; padding: 0 18px 0 0; position: relative; font-size: 15px; line-height: 1.75; }
.pc-prose .hg-mind__br li::before { content: "◆"; position: absolute; right: 0; top: 0; color: var(--b, #0f766e); font-size: 11px; }
.hg-c-teal { --b: #0f766e; } .hg-c-red { --b: #c2410c; } .hg-c-blue { --b: #1d5fbf; } .hg-c-violet { --b: #6d4fd6; } .hg-c-green { --b: #3f8f2f; } .hg-c-amber { --b: #b7791f; } .hg-c-pink { --b: #be3a76; } .hg-c-brown { --b: #8a5a2b; }
.hg-mind.is-review .hg-mind__br li { color: transparent; text-shadow: 0 0 9px rgba(60, 40, 10, .55); cursor: pointer; user-select: none; }
.hg-mind.is-review .hg-mind__br li.is-shown, .hg-mind.is-review .hg-mind__br.is-shown li { color: inherit; text-shadow: none; }
.hg-mind__people { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.hg-mind__pt { font-weight: 800; color: #6b3d12; }
.hg-mind__p { padding: 5px 12px; border-radius: 999px; background: #fff; border: 1px solid #e6d3b0; font-size: 15px; }
.hg-mind__p b { font-size: 18px; }
@media (max-width: 760px) {
  .hg-mind { grid-template-columns: 1fr; padding: 12px; }
  .hg-mind__center { order: -1; aspect-ratio: auto; border-radius: 18px; }
}

/* Flash cards */
.hg-flip { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; margin-top: 12px; }
.hg-card { position: relative; min-height: 150px; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; perspective: 800px; }
.hg-card__f, .hg-card__b { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 12px; border-radius: 14px; backface-visibility: hidden; transition: transform .45s; text-align: center; }
.hg-card__f { background: #fff; border: 2px solid #e6d0a8; }
.hg-card__b { background: #fff7e8; border: 2px solid #c2410c; transform: rotateY(180deg); font-size: 15px; line-height: 1.75; }
.hg-card.is-flipped .hg-card__f { transform: rotateY(180deg); }
.hg-card.is-flipped .hg-card__b { transform: rotateY(0); }
.hg-card__e { font-size: 34px; line-height: 1.1; }
.hg-card__f strong { font-size: 18px; }
.hg-card__f small { color: #8a7a62; font-size: 13px; }
.hg-card__b strong { color: #8a3b0c; }

/* Matching and sorting */
.hg-match { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; margin-top: 12px; }
.hg-match__col { display: flex; flex-direction: column; gap: 8px; }
.hg-match__h { margin: 0; font-weight: 800; color: #6b3d12; }
.hg-sort { text-align: center; }
.hg-sort__card { margin: 12px auto; max-width: 560px; padding: 16px; border-radius: 14px; background: #fff; border: 2px solid #e1b979; font-size: 19px; font-weight: 700; box-shadow: 0 4px 12px rgba(120, 80, 20, .12); }
.hg-sort__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.hg-sort__bins { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 10px; margin-top: 14px; }
.hg-sort__bin { padding: 10px 12px; border-radius: 12px; background: #fbf6ec; border: 1px dashed #d9c39a; }
.pc-prose .hg-sort__bin ul { margin: 6px 0 0; padding: 0; list-style: none; }
.pc-prose .hg-sort__bin li { margin: 4px 0; padding: 0; font-size: 15px; }
.pc-prose .hg-sort__bin li::before { content: none; }
.hg-sort__bin li.is-good { color: #1d5e2a; }
.hg-sort__bin li.is-bad { color: #9b2a14; }
@media (max-width: 560px) { .hg-match { grid-template-columns: 1fr; } }

/* Quick checks */
.hg-q { margin: 12px 0; }
.hg-q__t { margin: 0 0 8px; font-weight: 700; }
.hg-q__opts { display: flex; flex-wrap: wrap; gap: 8px; }

/* Climate chart */
.hg-tabs .hg-chip { font-size: 15px; }
.hg-climo { margin-top: 10px; padding: 8px; border-radius: 12px; background: #fff; border: 1px solid #e3e7ea; }
.hg-climo__svg { display: block; width: 100%; height: auto; font-family: inherit; }
.hg-grid { stroke: #e3e7ea; }
.hg-ax { font-size: 12px; fill: #5f6b75; }
.hg-ax--p { fill: #1d5fbf; }
.hg-ax--t { fill: #c2410c; }
.hg-rain { fill: #5b9be0; }
.hg-temp { fill: none; stroke: #c2410c; stroke-width: 2.6; stroke-linejoin: round; }
.hg-temp__dot { fill: #c2410c; }
.hg-dry { fill: #fbe3b8; opacity: .7; }
.hg-climo__out p { margin: 4px 0; }

/* Map-making: classes */
.hg-classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 8px; margin-top: 10px; }
.hg-class { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(0, 0, 0, .08); font-size: 14px; line-height: 1.5; }
.hg-class small { font-size: 15px; font-weight: 700; }
.hg-classes__leg { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.hg-classes__leg i { display: inline-block; width: 16px; height: 12px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .15); vertical-align: middle; }
.hg-carto .hg-tools { margin-bottom: 8px; }

/* Formulas inside Arabic sentences */
.hg-ltr { unicode-bidi: isolate; direction: ltr; font-weight: 700; color: #6b3d12; white-space: nowrap; }
@media (max-width: 600px) { .hg-ltr { white-space: normal; } }

/* Density calculator */
.hg-calc { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 12px; }
.hg-calc__f { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 15px; }
.hg-calc__f input { width: 170px; min-height: 44px; padding: 6px 10px; border: 1px solid #d9c7a5; border-radius: 10px; font: inherit; font-size: 17px; }
.hg-calc__f small { font-weight: 400; color: #6f6352; }

/* Bars */
.hg-bars { display: grid; gap: 10px; margin-top: 12px; }
.hg-bar { display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr); align-items: center; gap: 10px; overflow: hidden; }
.hg-bars:not(.is-in) .hg-bar__f b { display: none; }
.hg-bar__l { font-weight: 700; font-size: 15px; line-height: 1.5; }
.hg-bar__f { position: relative; display: block; height: 30px; width: 0; border-radius: 8px; background: #c2410c; transition: width 1s ease; }
.hg-bars.is-in .hg-bar__f { width: var(--w); }
.hg-bar__f b { position: absolute; inset-inline-start: calc(100% + 6px); top: 3px; white-space: nowrap; font-size: 14px; color: #3b2a12; }
.hg-bar__f.is-full b { inset-inline-start: auto; inset-inline-end: 8px; color: #fff; }

/* Slider scale */
.hg-scale { --lvl: 0; display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 4px 12px; align-items: center; margin-top: 12px; padding: 14px; border-radius: 14px; border: 2px solid; border-color: hsl(calc(120 - 120 * var(--lvl)), 60%, 45%); background: hsl(calc(120 - 120 * var(--lvl)), 70%, 96%); }
.hg-scale__e { grid-row: span 2; font-size: 46px; text-align: center; }
.hg-scale strong { font-size: 19px; }
.hg-scale p { margin: 0; line-height: 1.8; }

/* Comparison table */
.pc-prose .hg-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 16px; }
.pc-prose .hg-table th, .pc-prose .hg-table td { padding: 10px 12px; border: 1px solid #e6d8bd; vertical-align: top; text-align: start; line-height: 1.75; }
.pc-prose .hg-table th { background: #f6ead2; color: #4b3418; }
.pc-prose .hg-tablewrap { overflow-x: auto; }

@media (max-width: 600px) {
  .mx-hg .pc-prose { font-size: 17px; }
  .hg-map__svg.is-wide { min-width: 600px; }
  .hg-tl__item { width: 128px; }
  .pc-prose .hg-persona { grid-template-columns: 52px minmax(0, 1fr); }
  .pc-prose .hg-persona__av { width: 52px; height: 52px; font-size: 30px; }
  .hg-bar { grid-template-columns: 1fr; gap: 4px; }
  .hg-scale { grid-template-columns: 54px minmax(0, 1fr); }
  .hg-scale__e { font-size: 36px; }
}
@media print { .hg-tools, .hg-legend { display: none; } .hg-mind.is-review .hg-mind__br li { color: inherit; text-shadow: none; } }
/* Wide tables become one card per row on phones (cells carry data-label). */
@media (max-width: 640px) {
  .mx-hg .pc-prose .hg-table.is-stack thead { display: none; }
  .mx-hg .pc-prose .hg-table.is-stack, .mx-hg .pc-prose .hg-table.is-stack tbody, .mx-hg .pc-prose .hg-table.is-stack tr, .mx-hg .pc-prose .hg-table.is-stack td { display: block; width: auto; }
  .mx-hg .pc-prose .hg-table.is-stack tr { margin: 0 0 12px; border: 1px solid #cfe7dc; border-radius: 12px; overflow: hidden; background: #fff; }
  .mx-hg .pc-prose .hg-table.is-stack td { border: 0; border-bottom: 1px solid #e7f1ec; padding: 8px 12px; text-align: right; }
  .mx-hg .pc-prose .hg-table.is-stack td:last-child { border-bottom: 0; }
  .mx-hg .pc-prose .hg-table.is-stack td:first-child { background: #eef7f3; font-weight: 700; color: #0f5132; }
  .mx-hg .pc-prose .hg-table.is-stack td[data-label]:not([data-label=""]):not(:first-child)::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 700; color: #5a6b80; margin-bottom: 2px; }
}
