/* فرائض - حاسبة المواريث التونسية | ثيم الزليج التونسي: زمردي وذهبي وعاجي */
:root {
  --ink: #1c2b26;
  --muted: #5e6d66;
  --paper: #f6f3ec;          /* عاجي */
  --card: #fffdf8;
  --line: #e3ddcf;
  --emerald: #0d5c49;        /* زمردي عميق */
  --emerald-2: #0a473a;
  --emerald-soft: #e4f0ea;
  --gold: #b8860b;
  --gold-soft: #f7ecd4;
  --gold-line: #d4af5f;
  --danger: #a83232;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(28, 43, 38, .07), 0 1px 3px rgba(28, 43, 38, .06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

body {
  font-family: "Segoe UI", "Sakkal Majalla", Tahoma, "Noto Naskh Arabic", sans-serif;
  background:
    radial-gradient(circle at 12% -10%, rgba(212, 175, 95, .12), transparent 34%),
    radial-gradient(circle at 95% 0%, rgba(13, 92, 73, .10), transparent 30%),
    var(--paper);
  color: var(--ink);
  line-height: 1.75;
  direction: rtl;
  min-height: 100vh;
}

/* ================= الرأس ================= */
header.app-header {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.055' stroke-width='1.4'%3E%3Cpath d='M36 6l7.5 11 13-2.5-3.4 12.8L64 36l-10.9 8.7L56.5 57l-13-2.5L36 66l-7.5-11.5-13 2.5 3.4-12.3L8 36l10.9-8.7L15.5 14.5l13 2.5z'/%3E%3Ccircle cx='36' cy='36' r='9'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, #0a3d31 0%, var(--emerald) 55%, #11705a 100%);
  color: #fdfcf8;
  padding: 1.3rem 1.6rem 1.1rem;
  border-bottom: 3px solid var(--gold-line);
}
.brand { display: flex; align-items: center; gap: 1rem; max-width: 1180px; margin: 0 auto; }
.brand-mark { width: 52px; height: 52px; flex: none; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
.brand h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: .5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  line-height: 1.15;
}
.brand .subtitle { font-size: .84rem; opacity: .82; }

/* ================= شريط الأدوات ================= */
nav.toolbar {
  display: flex;
  align-items: stretch;
  gap: .45rem;
  max-width: 1180px;
  margin: -1.05rem auto 1.1rem;
  padding: 0 1rem;
  flex-wrap: wrap;
}
nav.toolbar .tool {
  display: flex;
  align-items: center;
  gap: .55rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .55rem .9rem;
  cursor: pointer;
  font-family: inherit;
  color: var(--muted);
  box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s, color .15s;
  text-align: right;
}
nav.toolbar .tool:hover { transform: translateY(-2px); border-color: var(--gold-line); color: var(--emerald); }
nav.toolbar .tool.active {
  background: linear-gradient(160deg, var(--emerald), var(--emerald-2));
  color: #fdfcf8;
  border-color: var(--emerald-2);
}
nav.toolbar .tool.active small { color: #cfe3da; }
.tool-ico { width: 26px; height: 26px; flex: none; }
.tool-ico svg { width: 100%; height: 100%; }
.tool-txt { display: flex; flex-direction: column; line-height: 1.25; }
.tool-txt strong { font-size: .92rem; }
.tool-txt small { font-size: .68rem; color: var(--muted); }
.toolbar-sep { flex: 1; }
nav.toolbar .tool.aux { padding: .55rem .7rem; }

main { max-width: 1180px; margin: 0 auto; padding: 0 1rem 1.4rem; }
.panel { display: none; }
.panel.active { display: block; animation: fadeUp .28s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* ================= البطاقات ================= */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.05rem;
  box-shadow: var(--shadow);
}
.card-head { margin-bottom: .8rem; }
.card-head h2 {
  font-size: 1.12rem;
  color: var(--emerald);
  display: inline-block;
  position: relative;
  padding-bottom: .25rem;
}
.card-head h2::after {
  content: '';
  position: absolute;
  right: 0; bottom: 0;
  width: 100%; height: 3px;
  border-radius: 2px;
  background: linear-gradient(to left, var(--gold-line), transparent);
}
.hint { font-size: .8rem; color: var(--muted); margin-top: .3rem; }

/* ================= بيانات التركة ================= */
.estate-row { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: center; }
.seg { display: inline-flex; align-items: center; gap: .3rem; background: var(--paper); border-radius: 999px; padding: .28rem .5rem; border: 1px solid var(--line); }
.seg-label { font-size: .88rem; color: var(--muted); margin-left: .2rem; }
.seg input { display: none; }
.seg label {
  padding: .28rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: .92rem;
  transition: background .15s, color .15s;
}
.seg input:checked + label { background: var(--emerald); color: #fff; box-shadow: 0 1px 4px rgba(13,92,73,.4); }
.estate-input { display: inline-flex; align-items: center; gap: .55rem; font-size: .92rem; }
.estate-input input {
  width: 11rem;
  padding: .5rem .8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  background: var(--paper);
}
.estate-input input:focus { outline: 2px solid var(--gold-line); border-color: var(--gold-line); background: #fff; }
.estate-input .unit { color: var(--gold); font-weight: 700; }

/* ================= شبكة الورثة ================= */
.fam-group { margin-bottom: .9rem; }
.fam-group h3 { font-size: .95rem; margin-bottom: .5rem; color: var(--ink); display: flex; align-items: center; gap: .45rem; }
.fam-dot { width: 11px; height: 11px; border-radius: 4px; display: inline-block; }
.fam-dot.spouse { background: #0e7490; } .fam-dot.desc { background: #15803d; }
.fam-dot.asc { background: #a16207; } .fam-dot.sib { background: #1d4ed8; } .fam-dot.coll { background: #7e22ce; }

.heir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: .6rem; }

.heir-card {
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: .6rem .5rem .55rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.heir-card .hv { width: 56px; height: 54px; transition: transform .18s; filter: grayscale(.55) opacity(.75); }
.heir-card .hv svg { width: 100%; height: 100%; }
.heir-card .hname { font-size: .84rem; text-align: center; color: var(--muted); line-height: 1.25; }
.heir-card.on { border-color: var(--emerald); background: var(--emerald-soft); box-shadow: 0 3px 10px rgba(13, 92, 73, .16); }
.heir-card.on .hv { filter: none; transform: scale(1.06); }
.heir-card.on .hname { color: var(--emerald-2); font-weight: 700; }

.stepper { display: flex; align-items: center; gap: .4rem; }
.stepper button {
  width: 26px; height: 26px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  color: var(--emerald);
  line-height: 1;
  transition: background .12s;
}
.stepper button:hover { background: var(--gold-soft); border-color: var(--gold-line); }
.stepper input {
  width: 2.6rem;
  text-align: center;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}
.stepper input:focus { outline: none; }
.heir-card .badge-count {
  position: absolute;
  top: -7px; left: -7px;
  min-width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 .3rem;
  box-shadow: 0 2px 5px rgba(0,0,0,.25);
}
.heir-card.on .badge-count { display: inline-flex; }

/* ================= الأزرار ================= */
.actions { display: flex; justify-content: center; gap: .7rem; margin: 1.1rem 0; flex-wrap: wrap; }
button.primary {
  display: inline-flex; align-items: center; gap: .5rem;
  background: linear-gradient(160deg, var(--emerald), var(--emerald-2));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: .75rem 2.6rem;
  font-size: 1.12rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(13, 92, 73, .35);
  transition: transform .15s, box-shadow .15s;
}
button.primary:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(13, 92, 73, .42); }
button.ghost {
  background: none;
  border: 1.5px solid var(--line);
  color: var(--muted);
  border-radius: 12px;
  padding: .6rem 1.3rem;
  cursor: pointer;
  font-family: inherit;
  font-size: .95rem;
  transition: border-color .15s, color .15s;
}
button.ghost:hover { border-color: var(--gold-line); color: var(--gold); }

/* ================= النتائج ================= */
.res-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: .9rem;
}
.res-chip {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .3rem 1rem;
  font-size: .87rem;
  box-shadow: var(--shadow);
}
.res-chip strong { color: var(--emerald); }
.res-chip.awl { border-color: #e5b6b6; background: #fdf3f3; color: var(--danger); }
.res-chip.radd { border-color: var(--gold-line); background: var(--gold-soft); color: #7c5a09; }

table.results { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.results th {
  background: linear-gradient(160deg, var(--emerald), var(--emerald-2));
  color: #fdfcf8;
  padding: .55rem .6rem;
  font-size: .84rem;
  font-weight: 700;
}
table.results th:first-child { border-radius: 0 10px 0 0; }
table.results th:last-child { border-radius: 10px 0 0 0; }
table.results td { border-bottom: 1px solid var(--line); padding: .5rem .6rem; text-align: center; background: var(--card); }
table.results tr:last-child td { border-bottom: none; }
table.results td.explain { text-align: right; font-size: .83rem; color: var(--muted); max-width: 320px; }
.heir-cell { display: flex; align-items: center; gap: .55rem; text-align: right; }
.heir-cell .av { width: 40px; height: 39px; flex: none; }
.heir-cell .av svg { width: 100%; height: 100%; }
.heir-cell .nm { font-weight: 700; font-size: .92rem; }

.frac { font-weight: 800; color: var(--emerald); white-space: nowrap; font-size: 1.02rem; }
.frac-name { font-size: .76rem; color: var(--muted); display: block; }
.amount { font-weight: 800; color: var(--gold); white-space: nowrap; }
.share-bar { height: 5px; border-radius: 3px; background: var(--line); margin-top: .3rem; overflow: hidden; min-width: 70px; }
.share-bar > i { display: block; height: 100%; background: linear-gradient(to left, var(--gold-line), var(--gold)); border-radius: 3px; }

.badge {
  display: inline-block;
  padding: .12rem .6rem;
  border-radius: 999px;
  font-size: .74rem;
  background: var(--emerald-soft);
  color: var(--emerald-2);
  white-space: nowrap;
  font-weight: 700;
}
.badge.radd { background: var(--gold-soft); color: #7c5a09; }

.art-ref {
  display: inline-block;
  font-size: .73rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 .42rem;
  margin: .05rem .08rem;
  color: var(--muted);
  cursor: pointer;
}
.art-ref:hover { color: var(--emerald); border-color: var(--gold-line); }

.excluded-box, .notes-box { border-radius: 10px; padding: .7rem 1rem; margin-top: .9rem; font-size: .88rem; }
.excluded-box { background: #fdf6f6; border: 1px solid #eBCACA; border-right: 4px solid var(--danger); }
.excluded-box h3 { color: var(--danger); font-size: .9rem; margin-bottom: .35rem; }
.excluded-list { display: flex; flex-wrap: wrap; gap: .55rem; }
.excluded-item { display: flex; align-items: center; gap: .45rem; background: #fff; border: 1px solid #eBCACA; border-radius: 10px; padding: .3rem .6rem; }
.excluded-item .av { width: 34px; height: 33px; filter: grayscale(1) opacity(.6); }
.excluded-item .av svg { width: 100%; height: 100%; }
.excluded-item .why { font-size: .78rem; color: var(--muted); max-width: 240px; }

.notes-box { background: var(--gold-soft); border: 1px solid #eAD9AC; border-right: 4px solid var(--gold); }
.notes-box h3 { color: #7c5a09; font-size: .9rem; margin-bottom: .3rem; }
.notes-box li { margin-bottom: .3rem; margin-right: 1rem; }

.error-msg { background: #fdf3f3; color: var(--danger); padding: .7rem 1.1rem; border-radius: 10px; margin-bottom: .8rem; font-size: .93rem; border: 1px solid #eBCACA; }

/* ================= الأدوات القادمة ================= */
.coming { text-align: center; padding: 3rem 1.5rem; }
.coming-ico { color: var(--gold-line); margin-bottom: .8rem; }
.coming h2 { color: var(--emerald); font-size: 1.35rem; margin-bottom: .5rem; }
.coming p { color: var(--muted); max-width: 560px; margin: 0 auto .4rem; font-size: .95rem; }
.coming .soon {
  display: inline-block;
  margin-top: .8rem;
  background: var(--gold-soft);
  border: 1px dashed var(--gold-line);
  color: #7c5a09;
  border-radius: 999px;
  padding: .35rem 1.3rem;
  font-size: .88rem;
  font-weight: 700;
}

/* ================= الأداة 2: فريضة مشخصة ================= */
.t2-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .7rem .9rem; align-items: end; }
.t2-field { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muted); }
.t2-field.t2-wide { grid-column: span 2; }
.t2-field input {
  padding: .5rem .8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: .97rem;
  background: var(--paper);
  color: var(--ink);
}
.t2-field input:focus { outline: 2px solid var(--gold-line); border-color: var(--gold-line); background: #fff; }
.req { color: var(--danger); }
.t2-seg { align-self: end; }
.t2-admin { margin-top: .8rem; }
.t2-admin summary { cursor: pointer; font-size: .86rem; color: var(--gold); font-weight: 700; }
.t2-admin[open] summary { margin-bottom: .6rem; }

.person-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .3rem;
  border-bottom: 1px dashed var(--line);
}
.person-row:last-of-type { border-bottom: none; }
.person-row .p-av { width: 44px; height: 43px; flex: none; }
.person-row .p-av svg { width: 100%; height: 100%; }
.person-row .p-name {
  flex: 2;
  min-width: 140px;
  padding: .5rem .8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: .95rem;
  background: var(--paper);
}
.person-row .p-name:focus { outline: 2px solid var(--gold-line); background: #fff; }
.person-row .p-rel {
  flex: 1;
  min-width: 120px;
  padding: .48rem .5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: .9rem;
  background: var(--card);
  color: var(--ink);
}
.person-row .p-del {
  border: none;
  background: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1rem;
  padding: .3rem;
  opacity: .55;
}
.person-row .p-del:hover { opacity: 1; }
.add-person {
  display: inline-flex; align-items: center; gap: .4rem;
  margin-top: .6rem;
  background: var(--emerald-soft);
  border: 1.5px dashed var(--emerald);
  color: var(--emerald-2);
  border-radius: 10px;
  padding: .45rem 1.2rem;
  cursor: pointer;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 700;
}
.add-person:hover { background: #d5e9df; }

.report-head { text-align: center; margin-bottom: 1rem; }
.report-title { font-size: 1.25rem; font-weight: 800; color: var(--emerald-2); }
.report-meta { font-size: .82rem; color: var(--muted); margin-top: .2rem; }

.sigha-box {
  margin-top: 1rem;
  border: 1px solid var(--gold-line);
  border-radius: 10px;
  background: var(--gold-soft);
  padding: .8rem 1.1rem;
}
.sigha-box h3 { color: #7c5a09; font-size: .92rem; margin-bottom: .4rem; }
.sigha-text {
  font-size: 1rem;
  line-height: 2.05;
  color: #3d3115;
  font-family: "Sakkal Majalla", "Traditional Arabic", "Segoe UI", serif;
}

/* ================= الأداة 3: المناسخة ================= */
.death-card { border-right: 4px solid var(--gold-line); }
.death-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.death-no {
  background: linear-gradient(160deg, var(--emerald), var(--emerald-2));
  color: #fff;
  border-radius: 999px;
  padding: .25rem 1rem;
  font-size: .85rem;
  font-weight: 800;
  white-space: nowrap;
}
.death-head input[type=text], .death-head input[type=date], .death-head input[type=number], .death-head select {
  padding: .45rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: .92rem;
  background: var(--paper);
  min-width: 0;
}
.death-head input:focus, .death-head select:focus { outline: 2px solid var(--gold-line); background: #fff; }
.d-block { margin-bottom: .6rem; }
.d-title { font-size: .98rem; color: var(--emerald-2); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .4rem; }
table.results.mini td, table.results.mini th { padding: .35rem .5rem; font-size: .86rem; }
tr.mut td { color: var(--muted); background: #faf8f3 !important; font-size: .84rem; }
.res-chip.adila { border-color: #b9d8c9; background: var(--emerald-soft); color: var(--emerald-2); }

/* ================= الأداة 4: بنك المسائل ================= */
.bank-filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.bank-sel {
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: .9rem;
  background: var(--paper);
  color: var(--ink);
  flex: 1;
  min-width: 140px;
}
.bank-item {
  display: flex;
  align-items: center;
  gap: .8rem;
  border-bottom: 1px dashed var(--line);
  padding: .6rem .2rem;
}
.bank-item:hover { background: var(--emerald-soft); border-radius: 8px; }
.bank-main { flex: 1; min-width: 0; }
.bank-title { font-size: .93rem; font-weight: 700; color: var(--ink); }
.bank-id { font-size: .72rem; color: var(--muted); font-weight: 400; }
.bank-heirs { font-size: .82rem; color: var(--emerald-2); }
.bank-exp { font-size: .78rem; color: var(--muted); }
.bank-exp b { color: var(--gold); }
.bank-try { white-space: nowrap; flex: none; }

/* ================= التعليل الفقهي ================= */
.taalil-box {
  background: linear-gradient(180deg, #fdfbf5, var(--card));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  padding: 1.1rem 1.35rem;
  margin-bottom: 1.05rem;
  box-shadow: var(--shadow);
}
.taalil-box > h3 {
  color: var(--emerald-2);
  font-size: 1.08rem;
  margin-bottom: .7rem;
  padding-bottom: .35rem;
  border-bottom: 2px solid var(--gold-line);
  display: inline-block;
}
.taalil-sec { margin-bottom: .85rem; }
.taalil-sec h4 {
  color: var(--gold);
  font-size: .93rem;
  margin-bottom: .3rem;
}
.taalil-sec p, .taalil-sec div, .taalil-heir {
  font-size: .92rem;
  line-height: 2;
  color: #33413a;
  font-family: "Sakkal Majalla", "Traditional Arabic", "Segoe UI", serif;
}
.taalil-sec p { margin-bottom: .4rem; }
.taalil-heir { margin-bottom: .3rem; padding-right: .6rem; border-right: 2px solid var(--emerald-soft); }
.taalil-heir b { color: var(--emerald-2); }
.taalil-quote { color: #5c4a12; }

@media print { .taalil-box { border: 1px solid #999; } }

/* ================= الاختبار ================= */
.quiz-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .7rem; }
.quiz-level {
  display: flex; align-items: center; gap: .7rem;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: .8rem .9rem;
  cursor: pointer;
  font-family: inherit;
  text-align: right;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.quiz-level:hover { transform: translateY(-3px); border-color: var(--lv); box-shadow: 0 5px 14px rgba(28,43,38,.12); }
.ql-badge {
  width: 42px; height: 42px; flex: none;
  border-radius: 12px;
  background: var(--lv);
  color: #fff;
  font-size: 1.3rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(0,0,0,.18);
}
.ql-txt { display: flex; flex-direction: column; line-height: 1.4; }
.ql-txt strong { font-size: .95rem; color: var(--ink); }
.ql-txt small { font-size: .76rem; color: var(--muted); }
.ql-meta { color: var(--gold) !important; font-weight: 700; }

.quiz-top { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .9rem; }
.quiz-q {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.9;
  margin-bottom: .9rem;
  color: var(--ink);
}
.quiz-cat {
  display: inline-block;
  background: var(--emerald-soft);
  color: var(--emerald-2);
  border-radius: 999px;
  font-size: .72rem;
  padding: .1rem .7rem;
  margin-left: .5rem;
  font-weight: 700;
  vertical-align: middle;
}
.quiz-choices { display: grid; gap: .55rem; }
.quiz-choice {
  text-align: right;
  padding: .65rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-family: inherit;
  font-size: .95rem;
  cursor: pointer;
  transition: border-color .12s, background .12s;
  line-height: 1.7;
}
.quiz-choice:hover:not(:disabled) { border-color: var(--emerald); background: var(--emerald-soft); }
.quiz-choice:disabled { cursor: default; opacity: .85; }
.quiz-choice.good { border-color: #15803d; background: #e7f5ec; font-weight: 700; }
.quiz-choice.bad { border-color: var(--danger); background: #fdf0f0; }
.quiz-fb {
  margin-top: .8rem;
  border-radius: 10px;
  padding: .7rem 1rem;
  font-size: .92rem;
  line-height: 1.9;
}
.quiz-fb.ok { background: #e7f5ec; border: 1px solid #bcd9c6; }
.quiz-fb.ko { background: #fdf0f0; border: 1px solid #eBCACA; }
.quiz-fb b { margin-left: .3rem; }

/* ================= المكتبة والمساعدة ================= */
.art-search {
  width: 100%;
  padding: .6rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: .95rem;
  margin-bottom: .8rem;
  background: var(--paper);
}
.art-search:focus { outline: 2px solid var(--gold-line); background: #fff; }
.article-item { border-bottom: 1px dashed var(--line); padding: .75rem 0; }
.article-item h4 { color: var(--emerald); font-size: .97rem; margin-bottom: .2rem; }
.article-item p { font-size: .92rem; white-space: pre-wrap; }
.article-item .modif { font-size: .78rem; color: var(--gold); margin-top: .2rem; }
.article-item .art-note {
  font-size: .82rem;
  background: var(--gold-soft);
  border-right: 3px solid var(--gold);
  border-radius: 7px;
  padding: .45rem .75rem;
  margin-top: .45rem;
  color: #6b5416;
}
.help-list { padding-right: 1.2rem; font-size: .93rem; }
.help-list li { margin-bottom: .4rem; }
.help-p { font-size: .92rem; margin-bottom: .5rem; }

footer { text-align: center; color: var(--muted); font-size: .76rem; padding: 1.2rem 1rem 1.6rem; }
footer .copyright {
  margin-top: .45rem;
  padding-top: .45rem;
  border-top: 1px solid var(--line);
  display: inline-block;
  color: var(--emerald-2);
  font-size: .8rem;
}
footer .copyright strong { color: var(--gold); }
@media print {
  footer { display: block !important; }
  footer .copyright { border-top: 1px solid #999; color: #333; }
}

/* ================= الطباعة ================= */
@media print {
  body { background: #fff; }
  header.app-header, nav.toolbar, .no-print, footer { display: none !important; }
  .card { border: none; box-shadow: none; padding: 0; }
  main { max-width: 100%; padding: 0; }
  #print-header { display: block !important; text-align: center; margin-bottom: 1rem; }
  table.results th { background: #eee !important; color: #000 !important; }
}
#print-header { display: none; }

@media (max-width: 720px) {
  .heir-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
  .brand h1 { font-size: 1.5rem; }
  .tool-txt small { display: none; }
  nav.toolbar { margin-top: .6rem; }
}
