/* Inheritance Explorer: verses, the family diagram, the calculator and worked examples. */
.inh-care {
  display: flex; gap: 1rem; align-items: flex-start; padding: 1.15rem 1.3rem; border-radius: 20px;
  background: linear-gradient(135deg, var(--lf-accent-soft), color-mix(in srgb, var(--lf-hero-c) 12%, var(--lf-card)));
  border: 1px solid color-mix(in srgb, var(--lf-accent) 22%, var(--lf-card-line));
}
.inh-care > i { font-size: 1.5rem; color: var(--lf-accent); }
.inh-care p { margin: .2rem 0 0; line-height: 1.6; }

.inh-verses { display: grid; gap: 1rem; }
.inh-verse { background: var(--lf-card); border: 1px solid var(--lf-card-line); border-radius: 22px; padding: 1.1rem 1.25rem; box-shadow: var(--lf-shadow); }
.inh-verse-title { display: flex; gap: .6rem; align-items: center; font-weight: 600; margin: 0 0 .25rem; }
.inh-verse-title span { display: inline-grid; place-items: center; min-width: 3.2rem; padding: .15rem .55rem; border-radius: 999px; background: var(--lf-accent); color: var(--lf-accent-ink); font-size: .85rem; font-variant-numeric: tabular-nums; }
.inh-verse .ip-verse { margin: .6rem 0 0; border-inline-start-color: var(--lf-accent); background: var(--lf-accent-soft); }

/* Family diagram */
.inh-tree { margin: 0; background: var(--lf-card); border: 1px solid var(--lf-card-line); border-radius: 22px; padding: 1rem; box-shadow: var(--lf-shadow); }
.inh-tree svg { width: 100%; height: auto; display: block; direction: ltr; }
.inh-links path { stroke: color-mix(in srgb, var(--lf-muted) 55%, transparent); stroke-width: 2; stroke-dasharray: 5 6; }
.inh-node rect { fill: var(--lf-card); stroke: var(--lf-card-line); stroke-width: 1.5; transition: fill .3s, stroke .3s, opacity .3s; }
.inh-node-dot { fill: var(--lf-accent-soft); transition: fill .3s; }
.inh-node-icon { fill: none; stroke: var(--lf-accent); stroke-width: 3; stroke-linecap: round; }
.inh-node-label { font: 600 12.5px var(--ip-font-sans, sans-serif); fill: var(--lf-ink); }
.inh-node-sub { font: 500 11px var(--ip-font-sans, sans-serif); fill: rgba(255, 255, 255, .8); }
.inh-node-share { font: 700 12px var(--ip-font-sans, sans-serif); fill: var(--lf-accent); }
.inh-node--self rect { fill: var(--lf-hero-a); stroke: var(--lf-hero-c); stroke-width: 2; }
.inh-node--self .inh-node-label { fill: #fff; font-size: 14px; }
.inh-node.is-absent { opacity: .38; }
.inh-node.is-absent rect { stroke-dasharray: 4 4; }
.inh-node.is-present rect { stroke: var(--lf-accent); stroke-width: 2; }
.inh-node.is-heir rect { fill: var(--lf-accent-soft); stroke: var(--lf-accent); stroke-width: 2.5; }
.inh-node.is-heir .inh-node-dot { fill: var(--lf-accent); }
.inh-node.is-heir .inh-node-icon { stroke: var(--lf-accent-ink); }
.inh-node.is-excluded rect { fill: var(--lf-card); stroke: #c98a8a; stroke-dasharray: 3 3; }
.inh-node.is-excluded .inh-node-share { fill: #b4474f; font-size: 11px; font-weight: 600; }
[data-theme="dark"] .inh-node.is-excluded .inh-node-share { fill: #f19aa1; }
.inh-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; justify-content: center; font-size: .82rem; color: var(--lf-muted); margin-block-start: .5rem; }
.inh-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.inh-key { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--lf-accent); }
.inh-key.is-heir { background: var(--lf-accent-soft); }
.inh-key.is-excluded { border-color: #c98a8a; border-style: dashed; }
.inh-key.is-absent { opacity: .45; border-style: dashed; }

.inh-explorer { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.inh-explorer-pick { display: grid; gap: .4rem; background: var(--lf-card); border: 1px solid var(--lf-card-line); border-radius: 20px; padding: .8rem; box-shadow: var(--lf-shadow); max-height: 560px; overflow: auto; }
.inh-pick { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; justify-content: space-between; text-align: start; width: 100%; padding: .65rem .8rem; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--lf-ink); font-size: .93rem; cursor: pointer; }
.inh-pick:hover { background: var(--lf-accent-soft); }
.inh-pick[aria-pressed="true"] { background: var(--lf-accent-soft); border-color: var(--lf-accent); font-weight: 600; }
.inh-explorer-note { margin-block-start: .75rem; padding: .8rem 1rem; border-radius: 14px; background: var(--lf-accent-soft); font-size: .95rem; }
.inh-group-title { font-size: 1.05rem; font-weight: 700; margin: 1.25rem 0 .75rem; color: var(--lf-accent); }

/* Calculator */
.inh-calc { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 1.5rem; align-items: start; }
.inh-form { display: grid; gap: 1rem; }
.inh-step { background: var(--lf-card); border: 1px solid var(--lf-card-line); border-radius: 22px; padding: 1.15rem 1.25rem 1.25rem; box-shadow: var(--lf-shadow); margin: 0; min-width: 0; }
.inh-step legend { float: inline-start; width: 100%; display: flex; align-items: center; gap: .6rem; font-size: 1.08rem; font-weight: 700; margin-block-end: .7rem; padding: 0; }
.inh-step legend + * { clear: both; }
.inh-step legend small { font-weight: 500; color: var(--lf-muted); font-size: .85rem; }
.inh-step-num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--lf-accent); color: var(--lf-accent-ink); font-size: .9rem; }
.inh-help { color: var(--lf-muted); font-size: .92rem; margin: -.2rem 0 .9rem; line-height: 1.55; }
.inh-segment { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.inh-segment label { position: relative; }
.inh-segment input { position: absolute; opacity: 0; inset: 0; }
.inh-segment span { display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 52px; border-radius: 14px; border: 1.5px solid var(--lf-card-line); font-weight: 600; cursor: pointer; transition: border-color .2s, background-color .2s; }
.inh-segment input:checked + span { border-color: var(--lf-accent); background: var(--lf-accent-soft); color: var(--lf-accent); }
.inh-segment input:focus-visible + span { outline: 3px solid var(--ip-focus, #b07f22); outline-offset: 2px; }
.inh-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: .75rem 1rem; }
.inh-field { display: flex; flex-direction: column; gap: .35rem; justify-content: flex-end; }
.inh-field[hidden] { display: none; }
.inh-field > label { font-weight: 600; font-size: .92rem; }
.inh-stepper { display: grid; grid-template-columns: 44px 1fr 44px; border: 1px solid var(--lf-card-line); border-radius: 14px; overflow: hidden; background: var(--ip-bg, #f8f5ec); }
.inh-stepper button { border: 0; background: transparent; color: var(--lf-accent); font-size: 1.3rem; font-weight: 700; min-height: 44px; cursor: pointer; }
.inh-stepper button:hover { background: var(--lf-accent-soft); }
.inh-stepper input { border: 0; background: transparent; text-align: center; font-weight: 700; font-size: 1.05rem; color: var(--lf-ink); width: 100%; -moz-appearance: textfield; }
.inh-stepper input::-webkit-outer-spin-button, .inh-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.inh-toggle { display: flex; align-items: center; gap: .65rem; min-height: 46px; padding: .5rem .85rem; border-radius: 14px; border: 1.5px solid var(--lf-card-line); cursor: pointer; font-weight: 600; }
.inh-toggle input { width: 1.15rem; height: 1.15rem; accent-color: var(--lf-accent); }
.inh-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: .5rem; }
.inh-checks--stack { grid-template-columns: 1fr; }
.inh-checks label { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .7rem; border-radius: 12px; cursor: pointer; line-height: 1.45; }
.inh-checks label:hover { background: var(--lf-accent-soft); }
.inh-checks input { margin-top: .2rem; width: 1.1rem; height: 1.1rem; flex: none; accent-color: var(--lf-accent); }
.inh-fields--money input { border-radius: 12px; min-height: 44px; }
.inh-submit { display: flex; flex-wrap: wrap; gap: .75rem; }

.inh-result { position: sticky; top: calc(var(--ip-header-h, 72px) + 1rem); display: grid; gap: 1rem; }
.inh-result-card { background: var(--lf-card); border: 1px solid var(--lf-card-line); border-radius: 22px; padding: 1.25rem; box-shadow: var(--lf-shadow); }
.inh-result-title { font-family: var(--ip-font-display); font-weight: 600; font-size: 1.35rem; margin: 0 0 .75rem; }
.inh-result-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-block-end: .9rem; }
.inh-result-badges:not(:has(> :not([hidden]))) { display: none; }
.inh-bar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--lf-accent-soft); margin-block-end: 1rem; }
.inh-bar span { display: block; height: 100%; }
.inh-bar span + span { box-shadow: inset 2px 0 0 var(--lf-card); }
.inh-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.inh-table th, .inh-table td { padding: .6rem .4rem; border-bottom: 1px solid var(--lf-card-line); text-align: start; vertical-align: top; }
.inh-table thead th { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--lf-muted); font-weight: 600; }
.inh-table small { display: block; color: var(--lf-muted); font-size: .82rem; }
.inh-table tr.is-excluded { color: var(--lf-muted); }
.inh-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-inline-end: .5rem; vertical-align: middle; border: 1px solid var(--lf-card-line); }
.inh-steps { margin-block-start: 1rem; }
.inh-steps summary { font-weight: 600; cursor: pointer; }
.inh-steps ol { margin: .6rem 0 0; padding-inline-start: 1.3rem; display: grid; gap: .35rem; font-size: .93rem; line-height: 1.55; }
.inh-small { font-size: .85rem; color: var(--lf-muted); margin: .75rem 0 0; line-height: 1.55; }
.inh-radd-note { font-size: .9rem; padding: .7rem .85rem; border-radius: 12px; background: var(--lf-accent-soft); margin: .9rem 0 0; }
.inh-refused { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem; border-radius: 16px; background: #fff6e8; border: 1px solid #f0d49c; }
[data-theme="dark"] .inh-refused { background: rgba(240, 212, 156, .08); border-color: rgba(240, 212, 156, .3); }
.inh-refused > i { font-size: 1.6rem; color: #b07f22; }
.inh-refused ul { margin: .4rem 0 .6rem; padding-inline-start: 1.1rem; }
.inh-refused p { margin: 0; font-weight: 600; }

/* Worked example */
.inh-example { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.5rem; align-items: start; }
.inh-example-aside { position: sticky; top: calc(var(--ip-header-h, 72px) + 1rem); }
.inh-assume { list-style: none; padding: 0; margin: 0 0 .75rem; display: grid; gap: .5rem; }
.inh-assume li { display: grid; grid-template-columns: auto 1fr; gap: .6rem; line-height: 1.55; }
.inh-assume i { color: var(--lf-accent); }

/* Terminology chart */
.inh-print-head { display: none; }
.inh-terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 1rem; }
.inh-term { background: var(--lf-card); border: 1px solid var(--lf-card-line); border-radius: 18px; padding: 1.1rem 1.25rem; break-inside: avoid; }
.inh-term h2 { font-size: 1.12rem; font-weight: 700; margin: 0 0 .4rem; color: var(--lf-accent); }

@media (max-width: 991.98px) {
  .inh-explorer, .inh-calc, .inh-example { grid-template-columns: 1fr; }
  .inh-result, .inh-example-aside { position: static; }
  .inh-explorer-pick { max-height: none; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); overflow-x: auto; }
}
@media print {
  .inh-print-head { display: flex; justify-content: space-between; border-bottom: 2px solid #333; padding-bottom: .5rem; margin-bottom: 1rem; }
  .inh-terms { grid-template-columns: 1fr 1fr; }
  .inh-term { box-shadow: none; border-color: #999; }
}

/* ---------- The calculator as a stepper (inheritance.js adds .inh-form--wizard) ---------- */
.inh-rail { --inh-progress: 0; position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .25rem; list-style: none; margin: 0; padding: .85rem .75rem; border-radius: 22px; background: var(--lf-card); border: 1px solid var(--lf-card-line); box-shadow: var(--lf-shadow); }
.inh-rail::before, .inh-rail::after { content: ""; position: absolute; top: calc(.85rem + 21px); inset-inline: calc(10% + .75rem); height: 3px; border-radius: 3px; background: var(--ip-surface-3); }
.inh-rail::after { background: var(--ip-grad-brand); transform: scaleX(calc(var(--inh-progress) * 1)); transform-origin: left center; transition: transform .45s var(--ip-ease); }
[dir="rtl"] .inh-rail::after { transform-origin: right center; }
.inh-rail li { position: relative; z-index: 1; display: flex; justify-content: center; }
.inh-rail-step { display: grid; justify-items: center; gap: .35rem; padding: 0; border: 0; background: none; color: var(--lf-muted); font-size: .78rem; font-weight: 600; cursor: pointer; }
.inh-rail-step:focus-visible { outline: 3px solid var(--ip-focus); outline-offset: 4px; border-radius: 12px; }
.inh-rail-dot { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--lf-card); border: 2px solid var(--lf-card-line); color: var(--lf-muted); font-size: 1.05rem; transition: transform .3s var(--ip-spring), background-color .3s, border-color .3s, color .3s; }
.inh-rail-step.is-done .inh-rail-dot { background: var(--ip-primary-soft); border-color: var(--ip-primary); color: var(--ip-primary); }
.inh-rail-step.is-current { color: var(--lf-ink); }
.inh-rail-step.is-current .inh-rail-dot { background: var(--ip-primary); border-color: var(--ip-primary); color: var(--ip-primary-ink); transform: scale(1.1); box-shadow: var(--ip-shadow-glow); }
.inh-rail-label { text-align: center; line-height: 1.2; }
.inh-rail-count { margin: -.25rem .25rem 0; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--lf-accent); }
.inh-form--wizard .inh-step { min-height: 240px; }
@media (max-width: 575.98px) { .inh-form--wizard .inh-step { min-height: 0; } }
.inh-form--wizard .inh-step.is-in-next { animation: inh-in-next .4s var(--ip-ease); }
.inh-form--wizard .inh-step.is-in-back { animation: inh-in-back .4s var(--ip-ease); }
@keyframes inh-in-next { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes inh-in-back { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
[dir="rtl"] .inh-form--wizard .inh-step.is-in-next { animation-name: inh-in-back; }
[dir="rtl"] .inh-form--wizard .inh-step.is-in-back { animation-name: inh-in-next; }
.inh-wizard-nav { display: flex; justify-content: space-between; gap: .75rem; }
.inh-wizard-nav [hidden] { display: none; }
.inh-wizard-nav .lf-btn-accent { margin-inline-start: auto; }
[dir="rtl"] .inh-flip { display: inline-block; transform: scaleX(-1); }
.inh-form--wizard .inh-submit { display: none; }
.inh-form--wizard .inh-submit.is-ready { display: flex; animation: inh-in-next .35s var(--ip-ease); }
@media (max-width: 575.98px) { .inh-rail-label { font-size: .68rem; } .inh-rail-dot { width: 36px; height: 36px; font-size: .95rem; } .inh-rail::before, .inh-rail::after { top: calc(.85rem + 18px); } }
@media (prefers-reduced-motion: reduce) { .inh-form--wizard .inh-step.is-in-next, .inh-form--wizard .inh-step.is-in-back, .inh-form--wizard .inh-submit.is-ready { animation: none; } .inh-rail::after, .inh-rail-dot { transition: none; } }

/* The verses as tabs (inheritance.js). */
.inh-verse-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; padding: .3rem; border-radius: 18px; background: var(--lf-card); border: 1px solid var(--lf-card-line); box-shadow: var(--lf-shadow); width: fit-content; max-width: 100%; }
.inh-verse-tab { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding-block: .35rem .35rem; padding-inline: .4rem .9rem; border: 0; border-radius: 14px; background: transparent; color: var(--lf-ink); font-weight: 600; font-size: .9rem; cursor: pointer; }
.inh-verse-tab-num { display: inline-grid; place-items: center; min-width: 46px; padding: .2rem .5rem; border-radius: 10px; background: var(--ip-primary-soft); color: var(--ip-primary); font-weight: 800; font-size: .82rem; font-variant-numeric: tabular-nums; }
.inh-verse-tab[aria-selected="true"] { background: var(--ip-primary); color: var(--ip-primary-ink); }
.inh-verse-tab[aria-selected="true"] .inh-verse-tab-num { background: var(--ip-primary-ink); color: var(--ip-primary); }
.inh-verse-tab:focus-visible { outline: 3px solid var(--ip-focus); outline-offset: 2px; }
.inh-verses.is-tabbed .inh-verse-title { display: none; }
.inh-verses.is-tabbed .inh-verse:not([hidden]) { animation: inh-in-next .35s var(--ip-ease); }
@media (prefers-reduced-motion: reduce) { .inh-verses.is-tabbed .inh-verse:not([hidden]) { animation: none; } }

/* ==========================================================================
   Learning around the guide: the chapter rail on a worked example, "try it
   with a figure of your own", the growing distribution bar, the road of
   topics, the calculator card, find-a-term, flashcards and "what next".
   ========================================================================== */
.inh-xrail .lx-rail__link.is-active { background: var(--lf-accent); color: var(--lf-accent-ink, #fff); }
.lf .lf-topic[id], .lf .lf-scn[id] { scroll-margin-top: calc(var(--ip-header-h, 72px) + 70px); }
.inh-example-aside { top: calc(var(--ip-header-h, 72px) + 70px); }

.inh-tryout { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin: 0 0 1rem; padding: .75rem .9rem; border-radius: 16px; background: var(--lf-accent-soft); }
.inh-tryout label { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--lf-ink); }
.inh-tryout label i { color: var(--lf-accent); }
.inh-tryout input { width: 11rem; min-height: 42px; padding: .4rem .8rem; border-radius: 12px; border: 1px solid var(--lf-card-line); background: var(--lf-card); color: var(--lf-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.inh-tryout input:focus { outline: 3px solid var(--ip-focus, #e6b85c); outline-offset: 1px; }
.inh-tryout__help { flex-basis: 100%; font-size: .8rem; color: var(--lf-muted); }
.inh-amount { font-variant-numeric: tabular-nums; color: var(--lf-accent-strong, var(--lf-accent)) !important; font-weight: 700; }
.inh-amount:empty { display: none !important; }
.inh-amount.is-new { animation: inh-pop .35s ease-out; }
@keyframes inh-pop { from { opacity: .3; transform: translateY(3px); } }
.inh-bar--grow span { transform-origin: left center; transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
[dir="rtl"] .inh-bar--grow span { transform-origin: right center; }
.lx-reveal.inh-bar--grow { opacity: 1; transform: none; }
.lx-reveal.inh-bar--grow:not(.is-in) span { transform: scaleX(0); }

/* The road of topics */
.inh-road { display: flex; align-items: center; gap: .8rem; margin: 0 0 1.5rem; padding-block: .5rem .5rem; padding-inline: 1rem .6rem; border-radius: 999px; background: var(--lf-card); border: 1px solid var(--lf-card-line); box-shadow: var(--lf-shadow); }
.inh-road__count { flex: none; font-size: .78rem; font-weight: 700; color: var(--lf-accent); white-space: nowrap; }
.inh-road__list { flex: 1; min-width: 0; display: flex; gap: .3rem; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.inh-road__list::-webkit-scrollbar { display: none; }
.lf .inh-road__stop, .inh-road__stop { display: inline-flex; align-items: center; gap: .4rem; padding-block: .3rem .3rem; padding-inline: .3rem .7rem; border-radius: 999px; text-decoration: none; color: var(--lf-muted); white-space: nowrap; font-size: .82rem; font-weight: 600; transition: background-color .2s, color .2s; }
.inh-road__stop:hover { background: var(--lf-accent-soft); color: var(--lf-ink); }
.inh-road__num { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1.5px solid var(--lf-card-line); font-size: .72rem; font-weight: 800; }
.inh-road__title { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; }
.inh-road__stop.is-read .inh-road__num { background: var(--lf-accent-soft); border-color: var(--lf-accent); color: var(--lf-accent); }
.lf .inh-road__stop.is-current, .inh-road__stop.is-current { background: var(--lf-accent); color: var(--lf-accent-ink, #fff); }
.inh-road__stop.is-current .inh-road__num { border-color: rgba(255, 255, 255, .7); color: inherit; background: rgba(255, 255, 255, .15); }
.inh-road__stop:not(.is-current) .inh-road__title { display: none; }
.inh-try-card { display: grid; gap: .6rem; margin-top: 1rem; padding: 1rem; border-radius: 18px; background: linear-gradient(150deg, var(--lf-accent-soft), var(--lf-card) 70%); border: 1px solid var(--lf-card-line); }
.inh-try-card > i { font-size: 1.5rem; color: var(--lf-accent); }
.inh-try-card p { margin: 0; color: var(--lf-ink); font-size: .9rem; line-height: 1.5; }

/* Terminology: find a term, and flashcards */
.inh-terms-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0 0 1.25rem; padding: .6rem; border-radius: 22px; background: var(--lf-card); border: 1px solid var(--lf-card-line); box-shadow: var(--lf-shadow); }
.inh-terms-tools[hidden] { display: none; }
.inh-terms-search { position: relative; flex: 1 1 260px; margin: 0; }
.inh-terms-search[hidden] { display: none; }
.inh-terms-search i { position: absolute; inset-inline-start: 1rem; top: 50%; translate: 0 -50%; color: var(--lf-accent); }
.inh-terms-search input { width: 100%; min-height: 44px; padding-inline: 2.6rem 1rem; border-radius: 999px; border: 1px solid var(--lf-card-line); background: var(--lf-card); color: var(--lf-ink); }
.inh-terms-search input:focus { outline: 3px solid var(--ip-focus, #e6b85c); outline-offset: 1px; }
.inh-terms-modes { display: inline-flex; gap: .3rem; padding: 3px; border-radius: 999px; background: var(--lf-accent-soft); }
.inh-terms-modes .lf-btn { border: 0; background: transparent; color: var(--lf-ink); }
.inh-terms-modes .lf-btn.is-active { background: var(--lf-accent); color: var(--lf-accent-ink, #fff); }
.inh-terms-count { font-size: .82rem; color: var(--lf-muted); font-weight: 600; }
.inh-terms-print { margin-inline-start: auto; }
.inh-terms-none { padding: 1rem; color: var(--lf-muted); }
.inh-terms li.is-match { background: var(--lf-accent-soft); border-radius: 8px; }
.inh-terms[hidden], .inh-cards[hidden] { display: none; }

.inh-cards { display: grid; gap: 1rem; justify-items: center; max-width: 40rem; margin: 0 auto; }
.inh-cards__top { display: flex; align-items: center; gap: .8rem; width: 100%; font-size: .82rem; font-weight: 700; color: var(--lf-muted); font-variant-numeric: tabular-nums; }
.inh-cards__top .lx-bar { flex: 1; }
.inh-card { position: relative; width: 100%; min-height: 240px; padding: 0; border: 0; background: none; cursor: pointer; perspective: 1200px; color: var(--lf-ink); }
.inh-card:disabled { cursor: default; }
.inh-card__face {
  position: absolute; inset: 0; display: grid; place-content: center; gap: .6rem; padding: 1.5rem; border-radius: 26px; text-align: center;
  background: radial-gradient(120% 90% at 50% 0%, var(--lf-accent-soft), transparent 70%), var(--lf-card); border: 1px solid var(--lf-card-line); box-shadow: var(--lf-shadow);
  backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}
.inh-card__front strong { font-family: var(--ip-font-display); font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.2rem); }
.inh-card__hint { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--lf-muted); }
.inh-card__back { transform: rotateY(180deg); }
.inh-card__back strong { font-size: 1.1rem; color: var(--lf-accent); }
.inh-card__back span { line-height: 1.6; }
.inh-card.is-flipped .inh-card__front { transform: rotateY(-180deg); }
.inh-card.is-flipped .inh-card__back { transform: rotateY(0); }
.inh-card:focus-visible .inh-card__face { outline: 3px solid var(--ip-focus, #e6b85c); outline-offset: 3px; }
.inh-cards__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.inh-cards__actions [hidden], .inh-cards__reset[hidden] { display: none; }
.inh-cards__reset { border: 0; background: none; color: var(--lf-accent); font-weight: 700; cursor: pointer; display: inline-flex; gap: .35rem; align-items: center; }
.inh-next { padding-top: 0; }

@media (max-width: 767.98px) {
  .inh-road { border-radius: 18px; flex-wrap: wrap; }
  .inh-road__count { width: 100%; }
  .inh-tryout input { width: 100%; }
  .inh-terms-print { margin-inline-start: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .inh-card__face, .inh-bar--grow span { transition: none; }
  .lx-reveal.inh-bar--grow:not(.is-in) span { transform: none; }
  .inh-amount.is-new { animation: none; }
}
@media print {
  .inh-terms-tools, .inh-cards, .inh-road, .inh-next { display: none !important; }
  .inh-terms[hidden] { display: grid !important; }
}

/* ---------- The wider family (Hanafi: every heir) ---------- */
.inh-intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: .9rem; }
.inh-intro .inh-care { padding: 1rem 1.15rem; }
.inh-care--soft { background: var(--lf-card); border-style: dashed; }
.inh-care--soft > i { color: var(--ip-primary, var(--lf-accent)); }
.inh-care strong { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.inh-school, .inh-tag-school { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 700; letter-spacing: .02em; background: var(--lf-accent); color: var(--lf-accent-ink); }
.inh-tag-special { background: color-mix(in srgb, var(--ip-primary, #3f4fa8) 14%, var(--lf-card)); color: var(--ip-primary, #3f4fa8); border: 1px solid color-mix(in srgb, var(--ip-primary, #3f4fa8) 35%, transparent); font-weight: 700; }
[data-theme="dark"] .inh-tag-special { color: #b9c3ff; }
.inh-specials { display: contents; }
.inh-note-link { margin-inline-start: .25rem; font-weight: 700; text-decoration: none; }

.inh-verses-fold { background: var(--lf-card); border: 1px solid var(--lf-card-line); border-radius: 18px; padding: .2rem 1rem; box-shadow: var(--lf-shadow); }
.inh-verses-fold > summary { display: flex; align-items: center; gap: .7rem; min-height: 48px; cursor: pointer; list-style: none; }
.inh-verses-fold > summary::-webkit-details-marker { display: none; }
.inh-verses-fold > summary::after { content: "\F282"; font-family: bootstrap-icons; margin-inline-start: auto; transition: transform .25s; color: var(--lf-muted); }
.inh-verses-fold[open] > summary::after { transform: rotate(180deg); }
.inh-verses-fold > summary > i { font-size: 1.2rem; color: var(--lf-accent); }
.inh-verses-fold summary small { color: var(--lf-muted); font-variant-numeric: tabular-nums; margin-inline-start: .35rem; }
.inh-verses-fold[open] { padding-block-end: 1rem; }
.inh-verses-fold .inh-verse { box-shadow: none; }

.inh-groups { display: grid; gap: .55rem; }
.inh-group { border: 1.5px solid var(--lf-card-line); border-radius: 16px; background: color-mix(in srgb, var(--lf-accent-soft) 35%, var(--lf-card)); transition: border-color .2s, background-color .2s; }
.inh-group[open] { border-color: color-mix(in srgb, var(--lf-accent) 45%, var(--lf-card-line)); background: var(--lf-card); }
.inh-group > summary { display: flex; align-items: center; gap: .65rem; min-height: 52px; padding: .45rem .8rem; cursor: pointer; list-style: none; font-weight: 600; }
.inh-group > summary::-webkit-details-marker { display: none; }
.inh-group > summary:focus-visible { outline: 3px solid var(--ip-focus, #b07f22); outline-offset: 2px; border-radius: 14px; }
.inh-group-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--lf-accent-soft); color: var(--lf-accent); flex: none; }
.inh-group-name { flex: 1 1 auto; line-height: 1.3; }
.inh-group-count { flex: none; font-size: .76rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; color: var(--lf-muted); background: var(--ip-surface-3, rgba(0, 0, 0, .05)); white-space: nowrap; }
.inh-group-count.is-on { color: var(--lf-accent-ink); background: var(--lf-accent); }
.inh-group > :not(summary) { margin-inline: .8rem; }
.inh-group > :last-child { margin-block-end: .85rem; }
.inh-fields--dense { grid-template-columns: repeat(auto-fill, minmax(min(100%, 178px), 1fr)); gap: .55rem .75rem; }
.inh-fields--dense .inh-field > label { font-size: .84rem; line-height: 1.3; }
.inh-fields--dense .inh-stepper { grid-template-columns: 40px 1fr 40px; }
.inh-fields--dense .inh-stepper button { min-height: 40px; }
.inh-fields--dense .inh-toggle { min-height: 44px; font-size: .88rem; }
.inh-onepar { display: flex; gap: .6rem; align-items: flex-start; margin-block-start: .7rem; padding: .6rem .75rem; border-radius: 12px; background: var(--lf-accent-soft); font-size: .88rem; line-height: 1.45; cursor: pointer; }
.inh-onepar input { margin-top: .2rem; width: 1.1rem; height: 1.1rem; flex: none; accent-color: var(--lf-accent); }

/* The family map: every relative the calculator knows, lit as they are added. */
.inh-tree-scroll { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; border-radius: 14px; }
.inh-tree-scroll:focus-visible { outline: 3px solid var(--ip-focus, #b07f22); outline-offset: 2px; }
.inh-tree-scroll svg { min-width: 560px; }
.inh-cols text { font: 700 10px var(--ip-font-sans, sans-serif); letter-spacing: .08em; text-transform: uppercase; fill: var(--lf-muted); }
.inh-node .inh-node-label { font-size: 12px; }
.inh-node .inh-node-share { font-size: 11.5px; }
.inh-node.is-wide.is-absent { opacity: .2; }
.inh-node.is-heir, .inh-node.is-excluded, .inh-node.is-present { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .inh-node.is-heir rect { animation: inh-glow .6s ease-out; }
}
@keyframes inh-glow { from { stroke-width: 6; } to { stroke-width: 2.5; } }
.inh-table-wrap { overflow-x: auto; }
.inh-table .inh-amount { color: var(--lf-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.inh-steps li.inh-step-akdariyyah, .inh-steps li.inh-step-mushtarakah, .inh-steps li.inh-step-grandfather-siblings,
.inh-steps li.inh-step-umariyyah, .inh-steps li.inh-step-umariyyah-grandfather, .inh-steps li.inh-step-blessed-relative,
.inh-steps li.inh-step-unlucky-relative, .inh-steps li.inh-step-spouse-radd, .inh-steps li.inh-step-distant {
  padding: .35rem .6rem; border-radius: 10px; background: var(--lf-accent-soft); border-inline-start: 3px solid var(--lf-accent);
}

@media (max-width: 991.98px) {
  .inh-intro { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
  .inh-intro .inh-care { padding: .85rem .9rem; gap: .7rem; }
  .inh-intro .inh-care p { font-size: .9rem; }
  .inh-step { padding: .95rem .9rem 1rem; }
  .inh-fields--dense { grid-template-columns: 1fr 1fr; }
  .inh-table th, .inh-table td { padding: .5rem .3rem; font-size: .9rem; }
}
.inh-map { margin-block-start: 1.5rem; }
.inh-map-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1rem; margin-block-end: .6rem; }
.inh-map-title { font-family: var(--ip-font-display); font-weight: 600; font-size: 1.3rem; margin: 0; display: inline-flex; gap: .5rem; align-items: center; }
.inh-map-title i { color: var(--lf-accent); }
.inh-map .inh-tree { padding: .75rem 1rem; }
.inh-node .inh-node-label { font-size: 13px; }
.inh-node .inh-node-share { font-size: 12.5px; }
@media (max-width: 767.98px) {
  .inh-tree-scroll svg { min-width: 720px; }
}
.inh-example-map { margin-block: 1rem 1.25rem; }
.inh-tree-scroll { direction: ltr; }
