/* ============================================================
   ثمرات — طبقة عرض صفحات المحاصيل (نموذج أولي)
   تُحمَّل بعد نظام التصميم المضمّن في الصفحة، فتلغي ما تحتاجه فقط.
   لا خطوط خارجية، لا أيقونات من CDN: كل الأيقونات SVG مضمّنة في HTML.
   ============================================================ */

:root {
  --ui-shadow-1: 0 1px 2px rgba(10, 46, 29, .05);
  --ui-shadow-2: 0 2px 4px rgba(10, 46, 29, .05), 0 10px 24px rgba(10, 46, 29, .07);
  --ui-top-h: 56px;
  --ui-nav-h: 58px;
  --ui-mute: #5c6b63;
  --ui-gold-ink: #6b5209;
  --ui-line-soft: #efe9db;
}

/* ---------- أساسيات: مقاس أكبر ومسافات أوسع ---------- */
.th-root {
  overflow-x: clip;            /* بدل hidden: hidden بيمنع sticky */
  font-size: 16px;
  line-height: 1.8;
  padding-bottom: 40px;
  -webkit-text-size-adjust: 100%;
}
.th-root p { margin: 0; }
.th-root h1, .th-root h2, .th-root h3 { line-height: 1.35; }
.th-root :focus-visible { outline: 3px solid var(--th-gold); outline-offset: 2px; border-radius: 6px; }

/* الهيدر بيسكرول مع الصفحة زي الحالي، وشريط الأقسام هو اللي يثبت */
.th-topbar { position: relative; }

/* ---------- عنوان قسم موحّد ---------- */
.ui-sec { margin: 30px 0 0; }
.ui-sec-h {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0 0 12px; padding: 0 2px;
}
.ui-sec-h .ui-ic { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--th-g50); color: var(--th-g800); }
.ui-sec-h .ui-ic svg { width: 20px; height: 20px; }
.ui-sec-h > div { min-width: 0; }
.ui-eyebrow {
  display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .6px;
  color: #8a7433; margin: 0 0 1px;
}
.ui-sec-h h2 { font-size: 21px; color: var(--th-g800); margin: 0; }
.ui-sec-h p { font-size: 13.5px; color: var(--ui-mute); line-height: 1.7; margin-top: 3px; }

/* ---------- هيرو صفحة المحصول ---------- */
.ui-hero {
  position: relative; overflow: hidden; border-radius: var(--th-r-lg);
  margin: 6px 0 14px; min-height: 230px;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--th-g900);
  border-bottom: 3px solid var(--th-gold);
  box-shadow: var(--ui-shadow-2);
}
.ui-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ui-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,46,29,.28) 0%, rgba(10,46,29,.62) 46%, rgba(10,46,29,.93) 100%);
}
.ui-hero-in { position: relative; z-index: 1; padding: 18px 18px 16px; color: #fff; }
.ui-hero-in .th-chip { margin-bottom: 8px; }
.ui-hero-in h1 { font-size: 28px; color: #fff; margin: 0 0 4px; text-shadow: 0 1px 10px rgba(0,0,0,.35); }
.ui-hero-in p { color: #e9e3d1; font-size: 14.5px; line-height: 1.7; max-width: 44ch; }
.ui-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ui-fact {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.24);
  color: #fff; border-radius: 999px; padding: 6px 11px; font-size: 12.5px; font-weight: 600;
  backdrop-filter: blur(2px);
}
.ui-fact svg { width: 14px; height: 14px; opacity: .9; }

/* ---------- كارت الخلاصة ---------- */
.ui-sum {
  background: var(--th-surface); border: 1px solid var(--th-line); border-radius: var(--th-r-lg);
  padding: 16px 16px 14px; box-shadow: var(--ui-shadow-1); margin: 0 0 14px;
}
.ui-sum-top { display: flex; align-items: flex-start; gap: 10px; }
.ui-sum-top .ui-ic { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--th-gold-soft); color: var(--ui-gold-ink); }
.ui-sum-top h2 { font-size: 19px; color: var(--th-g800); margin: 0; }
.ui-sum-lead { font-size: 15px; line-height: 1.8; margin: 10px 0 0; color: var(--th-ink); }
.ui-sum-lead b { color: var(--th-g800); }
.ui-prior { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.ui-prior li {
  display: flex; gap: 10px; align-items: flex-start;
  background: #fbfaf6; border: 1px solid var(--ui-line-soft); border-radius: 14px; padding: 11px 12px;
  border-inline-start: 4px solid var(--th-gold);
}
.ui-prior .ui-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: #fff; border: 1px solid var(--th-line); color: var(--th-g800); }
.ui-prior .ui-ic svg { width: 17px; height: 17px; }
.ui-prior b { display: block; font-size: 15px; color: var(--th-g800); line-height: 1.5; }
.ui-prior span.ui-t { display: block; font-size: 14px; line-height: 1.75; color: var(--th-ink); margin-top: 2px; }
.ui-rule {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 10px;
  background: #fdf0e4; border: 1px solid #f0d7bb; border-inline-start: 4px solid var(--th-orange);
  border-radius: 14px; padding: 11px 12px;
}
.ui-rule .ui-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: #fff; color: var(--th-orange); border: 1px solid #f0d7bb; }
.ui-rule b { display: block; font-size: 14.5px; color: #7d3f06; }
.ui-rule span.ui-t { display: block; font-size: 14px; line-height: 1.75; color: #4a3418; margin-top: 2px; }
.ui-sum-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ui-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border-radius: 12px; text-decoration: none;
  font-size: 14px; font-weight: 700; border: 1px solid var(--th-line); background: #fff; color: var(--th-g800);
}
.ui-btn svg { width: 16px; height: 16px; }
.ui-btn-primary { background: var(--th-g800); border-color: var(--th-g800); color: #fff; }
.ui-btn:active { transform: translateY(1px); }

/* ---------- شريط التنقل داخل الصفحة ---------- */
.ui-nav {
  position: sticky; top: 0; z-index: 50;
  margin: 0 -16px 6px; padding: 8px 16px;
  background: rgba(250, 248, 244, .96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--th-line);
  box-shadow: 0 6px 14px rgba(10, 46, 29, .05);
}
.ui-nav-in { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; max-width: 760px; margin: 0 auto; }
.ui-nav-in::-webkit-scrollbar { display: none; }
.ui-nav a {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  min-height: 42px; padding: 0 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--th-line); color: var(--th-g800);
  text-decoration: none; font-size: 13.5px; font-weight: 700; white-space: nowrap;
}
.ui-nav a svg { width: 15px; height: 15px; opacity: .8; }
.ui-nav a.on, .ui-nav a[aria-current="true"] { background: var(--th-g800); border-color: var(--th-g800); color: #fff; }
.ui-nav a.on svg, .ui-nav a[aria-current="true"] svg { opacity: 1; }

/* مسافة تحت الهيدر عند القفز للعناوين */
[id] { scroll-margin-top: calc(var(--ui-nav-h) + 12px); }

/* ---------- شريط الطقس (من حزمة الأرصاد) — إعادة تنسيق فقط ---------- */
.wx-strip {
  margin: 0 0 14px; padding: 13px 14px;
  background: linear-gradient(180deg, #f6faf7, #fff);
  border: 1px solid #cfe0d5; border-radius: var(--th-r-lg);
  box-shadow: var(--ui-shadow-1);
}
.wx-strip .wxs-head { gap: 10px; }
.wx-strip .wxs-title { font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.wx-strip .wxs-title::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: #1faa59; display: inline-block;
}
.wx-strip .wxs-areas { gap: 6px; margin: 9px 0 6px; }
.wx-strip .wxs-area {
  min-height: 36px; padding: 0 12px; font-size: 12.5px; border-radius: 999px;
}
.wx-strip .wxs-line { font-size: 14px; line-height: 1.8; }
.wx-strip .wxs-adv {
  font-size: 13.5px; line-height: 1.75; margin-top: 6px; padding-inline-start: 10px;
  border-inline-start: 3px solid var(--th-gold);
}
.wx-strip .wxs-link { min-height: 36px; display: inline-flex; align-items: center; }
.wx-strip .wxs-flag { font-size: 12px; padding: 3px 10px; margin: 0 0 4px 4px; }

/* ---------- اختيار المنطقة ---------- */
.th-region {
  background: var(--th-surface); border: 1px solid var(--th-line); border-radius: var(--th-r-lg);
  padding: 14px 16px; margin: 0 0 14px; box-shadow: var(--ui-shadow-1);
}
.th-region .th-regh { font-size: 16px; color: var(--th-g800); margin: 0 0 8px; }
.th-rp { background: #fbfaf6; border: 1px solid var(--ui-line-soft); border-radius: 14px; padding: 12px 14px; }
.th-rp ul { padding-inline-start: 20px; font-size: 14.5px; line-height: 1.8; }
.th-rp li { margin: 4px 0; }
.th-rp li::marker { color: var(--th-gold); }
.th-rbadge { font-size: 12px; padding: 3px 11px; margin-bottom: 4px; }
.th-rnote { font-size: 13px; line-height: 1.7; }

/* ---------- مراحل البرنامج ---------- */
.ui-stagechips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.ui-stagechips::-webkit-scrollbar { display: none; }
.ui-stagechips a {
  flex: 0 0 auto; min-height: 44px; display: inline-flex; align-items: center;
  padding: 0 13px; border-radius: 12px; background: #fff; border: 1px solid var(--th-line);
  color: var(--th-g800); text-decoration: none; font-size: 13.5px; font-weight: 600;
}
.ui-stagechips a.is-now { background: var(--th-gold-soft); border-color: var(--th-gold); color: var(--ui-gold-ink); }

.th-pd.ui-stage, .th-pd.ui-pgroup {
  border-radius: var(--th-r-lg); box-shadow: var(--ui-shadow-1); border-color: var(--th-line);
}
.th-pd.ui-stage summary, .th-pd.ui-pgroup summary {
  padding: 14px 14px; gap: 10px; align-items: center; min-height: 60px;
}
.th-pd.ui-stage summary::after, .th-pd.ui-pgroup summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-inline-start: auto;
  border-inline-end: 2px solid var(--th-gold); border-block-end: 2px solid var(--th-gold);
  transform: rotate(45deg); transition: transform .18s;
}
.th-pd.ui-stage[open] summary::after, .th-pd.ui-pgroup[open] summary::after { transform: rotate(-135deg); }
.th-pd.ui-stage[open] summary, .th-pd.ui-pgroup[open] summary { background: var(--th-cream); }
.ui-st-n {
  flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: var(--th-g800); color: #fff; font-size: 14px; font-weight: 800;
}
.ui-st-t { font-size: 16.5px; color: var(--th-g800); font-weight: 700; }
.ui-st-m { display: block; font-size: 12px; color: #8a7433; font-weight: 600; margin-top: 1px; }
.ui-stage.is-now { border-color: var(--th-gold); box-shadow: 0 0 0 2px var(--th-gold-soft), var(--ui-shadow-1); }
.ui-stage.is-now .ui-st-n { background: var(--th-gold); color: #3a2c00; }
.ui-nowbadge {
  flex: none; font-size: 11px; font-weight: 800; background: var(--th-gold); color: #3a2c00;
  border-radius: 999px; padding: 3px 9px;
}

.ui-st-body { padding: 12px 12px 14px; gap: 12px; }
.ui-row { background: #fbfaf6; border: 1px solid var(--ui-line-soft); border-radius: 14px; padding: 12px; border-inline-start: 4px solid var(--th-gold); }
.ui-row-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ui-row-ic { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: #fff; border: 1px solid var(--th-line); color: var(--th-g800); }
.ui-row-ic svg { width: 16px; height: 16px; }
.ui-row-h b { font-size: 15.5px; color: var(--th-g800); }
.ui-row-h small { font-size: 12px; color: var(--ui-mute); font-weight: 600; }

/* ---------- عناصر الإرشاد ---------- */
.ui-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.ui-items > li {
  display: flex; gap: 9px; align-items: flex-start;
  background: #fff; border: 1px solid var(--th-line); border-radius: 12px;
  padding: 10px 11px; font-size: 14.5px; line-height: 1.75;
}
.ui-items > li.th-lt { border-inline-start: 4px solid var(--th-g800); }
.ui-items > li.th-lg { border-inline-start: 4px solid var(--th-gold); }
.ui-it-b { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ui-it-b b { font-size: 14.8px; color: var(--th-g800); line-height: 1.55; }
.ui-it-t { color: var(--th-ink); }
.ui-it-t a { color: var(--th-g700); }

.th-tag {
  flex: none; font-size: 11px; font-weight: 800; padding: 3px 8px; margin: 0; border-radius: 7px;
  background: var(--th-g800); color: #fff; line-height: 1.6; white-space: nowrap;
}
.ui-tag-gen { background: var(--th-gold-soft); color: var(--ui-gold-ink); }
.ui-tag-sym { background: #fdf0e4; color: #7d3f06; }
.ui-tag-mgmt { background: var(--th-g50); color: var(--th-g700); }

/* صورة داخل عنصر */
.ui-items > li.ui-photo { display: block; padding: 8px; }
.ui-items > li.ui-photo img { width: 100%; border-radius: 10px; display: block; margin-bottom: 6px; }
.ui-items > li.ui-photo .th-credit { font-size: 11.5px; color: var(--ui-mute); }

/* ---------- المشاكل ---------- */
.ui-count { flex: none; font-size: 11.5px; font-weight: 800; color: var(--ui-mute); background: var(--th-cream); border: 1px solid var(--th-line); border-radius: 999px; padding: 2px 9px; }
.ui-pbody { padding: 12px; gap: 12px; }
.ui-problem {
  background: #fff; border: 1px solid var(--th-line); border-radius: 16px; padding: 14px;
  border-top: 3px solid var(--th-g800);
}
.ui-prob-h h3 { font-size: 17px; color: var(--th-g800); margin: 0; line-height: 1.5; }
.ui-prob-h h3 .th-latin { display: block; font-size: 12px; color: #8a7433; margin-top: 1px; }
.ui-timing {
  display: inline-flex; align-items: flex-start; gap: 6px; margin: 8px 0 0;
  font-size: 12.5px; line-height: 1.7; color: #5b4708; background: #fdf6e3;
  border: 1px solid var(--th-gold-soft); border-radius: 10px; padding: 6px 10px;
}
.ui-timing svg { flex: none; width: 14px; height: 14px; margin-top: 3px; }
.ui-prob-photo { margin: 10px 0 0; }
.ui-prob-photo img { width: 100%; border-radius: 12px; display: block; }
.ui-prob-photo .th-credit { display: block; font-size: 11.5px; color: var(--ui-mute); margin-top: 4px; }
.ui-prob-block { margin-top: 10px; }
.ui-prob-lab {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 800; border-radius: 999px; padding: 3px 10px; margin-bottom: 6px;
}
.ui-prob-lab.sym { background: #fdf0e4; color: #7d3f06; }
.ui-prob-lab.mgmt { background: var(--th-g50); color: var(--th-g700); }
.ui-prob-block ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ui-prob-block li {
  background: #fbfaf6; border: 1px solid var(--ui-line-soft); border-radius: 11px;
  padding: 9px 11px; font-size: 14.3px; line-height: 1.75;
}
.ui-prob-block li .th-credit { display: block; font-size: 11px; color: var(--ui-mute); margin-top: 4px; }

/* ---------- جدول المواعيد: جدول حقيقي على الشاشات الكبيرة، كروت على الموبايل ---------- */
.ui-tablewrap { border: 1px solid var(--th-line); border-radius: var(--th-r-lg); overflow: hidden; background: #fff; box-shadow: var(--ui-shadow-1); }
.ui-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ui-table caption { text-align: start; font-size: 12.5px; color: var(--ui-mute); padding: 10px 14px; }
.ui-table th {
  background: var(--th-g800); color: #fff; font-size: 12.5px; font-weight: 700;
  text-align: start; padding: 10px 12px; line-height: 1.6;
}
.ui-table td { padding: 10px 12px; border-top: 1px solid var(--ui-line-soft); vertical-align: top; line-height: 1.7; }
.ui-table tbody tr:nth-child(even) td { background: #fbfaf6; }
.ui-table .ui-td-name { font-weight: 700; color: var(--th-g800); }
.ui-table .ui-td-page { color: var(--ui-mute); font-size: 12.5px; white-space: nowrap; }
@media (max-width: 620px) {
  .ui-table, .ui-table tbody, .ui-table tr, .ui-table td { display: block; width: 100%; }
  .ui-table thead { display: none; }
  .ui-table tbody tr { border-top: 1px solid var(--th-line); padding: 12px 12px 6px; background: #fff; }
  .ui-table tbody tr:nth-child(even) { background: #fbfaf6; }
  .ui-table td { border: 0; padding: 0 0 8px; }
  .ui-table td::before {
    content: attr(data-label); display: block; font-size: 11.5px; font-weight: 800;
    color: #8a7433; margin-bottom: 2px;
  }
  .ui-table .ui-td-name { font-size: 16px; }
  .ui-table caption { padding: 10px 12px; background: #fff; }
}

/* ---------- المصادر ---------- */
.ui-src { background: var(--th-surface); border: 1px solid var(--th-line); border-radius: var(--th-r-lg); padding: 14px 16px; box-shadow: var(--ui-shadow-1); }
.ui-src ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ui-src li { font-size: 13.5px; line-height: 1.8; color: var(--th-ink); padding-inline-start: 18px; position: relative; }
.ui-src li::before { content: ""; position: absolute; inset-inline-start: 0; top: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--th-gold); }
.ui-src a { color: var(--th-g700); }
.ui-src .ui-src-note { font-size: 12.5px; color: var(--ui-mute); margin-top: 10px; line-height: 1.75; }

/* ---------- منتجات المحصول ---------- */
.th-matched { background: var(--th-surface); border: 1px solid var(--th-line); border-radius: var(--th-r-lg); padding: 14px 16px; box-shadow: var(--ui-shadow-1); margin: 0 0 14px; }
.th-matched h2 { font-size: 18px; color: var(--th-g800); margin: 0 0 10px; }
.th-chips { gap: 8px; }
.th-chipl {
  min-height: 44px; padding: 0 14px; border-radius: 12px; font-size: 13.5px; font-weight: 700;
  background: #fff; border: 1px solid var(--th-line); color: var(--th-g800);
  display: inline-flex; align-items: center; gap: 6px;
}
.th-chipl::after { content: "›"; color: var(--th-gold); font-weight: 800; }

/* ---------- كروت عامة (تقارير، تنبيهات) ---------- */
.th-band, .file-callout, .file-group { border-radius: var(--th-r-lg); }
.file-callout.file-bar { font-size: 14px; line-height: 1.75; }
.file-closing { font-size: 12.5px; color: var(--ui-mute); }

/* ---------- فهرس المحاصيل ---------- */
.ui-idx-hero {
  border-radius: var(--th-r-lg); padding: 22px 18px 18px; margin: 6px 0 14px;
  background: linear-gradient(165deg, var(--th-g700) 0%, var(--th-g900) 100%);
  border-bottom: 3px solid var(--th-gold); box-shadow: var(--ui-shadow-2); color: #fff;
}
.ui-idx-hero .ui-eyebrow { color: var(--th-gold); }
.ui-idx-hero h1 { font-size: 30px; color: #fff; margin: 2px 0 6px; }
.ui-idx-hero p { font-size: 14.5px; line-height: 1.75; color: #e9e3d1; max-width: 46ch; }

.ui-tools { margin: 0 0 6px; }
.ui-search { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--th-line); border-radius: 14px; padding: 0 14px; min-height: 52px; box-shadow: var(--ui-shadow-1); }
.ui-search svg { flex: none; width: 20px; height: 20px; color: var(--ui-mute); }
.ui-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 16px;
  padding: 14px 0; color: var(--th-ink);
}
.ui-search input:focus { outline: none; }
.ui-search:focus-within { border-color: var(--th-gold); box-shadow: 0 0 0 3px var(--th-gold-soft); }
.ui-search button { flex: none; border: 0; background: var(--th-cream); color: var(--th-g800); width: 32px; height: 32px; border-radius: 50%; font-size: 16px; cursor: pointer; display: none; }
.ui-search.has-q button { display: block; }

.ui-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 2px 10px; }
.ui-count { font-size: 13px; font-weight: 700; color: var(--ui-mute); }
.ui-quick { margin: 0 0 12px; }
.ui-quick summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px; border-radius: 12px; background: #fff;
  border: 1px solid var(--th-line); color: var(--th-g800); font-size: 13.5px; font-weight: 700;
}
.ui-quick summary::-webkit-details-marker { display: none; }
.ui-quick summary::after { content: "›"; color: var(--th-gold); font-weight: 800; transform: rotate(90deg); }
.ui-quick[open] summary::after { transform: rotate(-90deg); }
.ui-quick .th-field { margin: 10px 0 0; }

.ui-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .ui-grid { gap: 12px; } }
@media (min-width: 700px) { .ui-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.th-crop.ui-card {
  display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden;
  border: 1px solid var(--th-line); border-top: 0; border-radius: 16px; background: #fff;
  box-shadow: var(--ui-shadow-1); color: var(--th-ink); text-decoration: none;
  transition: box-shadow .16s, transform .16s;
}
.th-crop.ui-card:active { transform: scale(.985); }
@media (hover: hover) { .th-crop.ui-card:hover { box-shadow: var(--ui-shadow-2); } }
.ui-card-img { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--th-cream); }
.ui-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ui-card-body { padding: 10px 11px 11px; display: flex; flex-direction: column; gap: 4px; }
.ui-card-body b { font-size: 15.5px; color: var(--th-g800); line-height: 1.4; }
.ui-card-stage {
  align-self: flex-start; font-size: 11.5px; font-weight: 700; color: var(--ui-gold-ink);
  background: var(--th-gold-soft); border-radius: 999px; padding: 2px 9px; line-height: 1.7;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ui-card-meta { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ui-mute); margin-top: 1px; }
.ui-card-meta svg { width: 12px; height: 12px; flex: none; }
.ui-empty { display: none; text-align: center; padding: 30px 16px; background: #fff; border: 1px dashed var(--th-line); border-radius: 16px; color: var(--ui-mute); font-size: 14px; }
.ui-empty.show { display: block; }
.th-imgcred { font-size: 11px !important; color: #8a8a8a; line-height: 1.9 !important; margin: 14px 2px 0 !important; }

/* ---------- الموبايل ---------- */
@media (max-width: 400px) {
  .ui-hero-in h1 { font-size: 25px; }
  .ui-idx-hero h1 { font-size: 27px; }
  .ui-card-body b { font-size: 15px; }
  .ui-items > li { font-size: 14.2px; }
}

@media (min-width: 900px) {
  .th-root { max-width: 820px; }
  .ui-nav-in { max-width: 820px; }
  .ui-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ui-hero { min-height: 280px; }
}

/* احترام تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- ملاحظة القسم (نص المنهجية كما هو) ---------- */
.ui-note {
  font-size: 13.5px; line-height: 1.85; color: #6b5619;
  background: #fdf6e3; border: 1px solid var(--th-gold-soft);
  border-radius: 14px; padding: 11px 13px; margin: 0 0 12px;
}
.ui-it-t .ui-pre, .ui-it-b b.ui-pre { display: block; font-size: 14.5px; color: var(--th-g800); }
.ui-it-t b.ui-pre { font-weight: 700; }

/* ---------- نقص العناصر: البلوك الجاهز ياخد نفس شكل باقي الصفحة ---------- */
#deficiency { margin: 30px 0 0; }
#deficiency > h2 { font-size: 21px; color: var(--th-g800); margin: 0 0 6px; }
#deficiency > p { font-size: 14px !important; line-height: 1.85 !important; color: var(--th-ink) !important; margin: 0 0 10px !important; }
#deficiency > .th-credit { display: block; font-size: 11.5px; color: var(--ui-mute); margin: 2px 0 10px; }
#deficiency .th-pd { border-radius: var(--th-r-lg); box-shadow: var(--ui-shadow-1); }
#deficiency .th-pd summary { min-height: 56px; padding: 13px 14px; font-size: 16px; }
#deficiency .th-prog { padding: 12px; gap: 12px; }
#deficiency .th-prow {
  background: #fff; border: 1px solid var(--th-line); border-radius: 16px;
  padding: 12px; border-inline-start: 0;
}
#deficiency .th-prow ul { margin: 0; padding: 0; display: grid; gap: 7px; }
#deficiency .th-prow li {
  display: flex; gap: 9px; align-items: flex-start; background: #fbfaf6;
  border: 1px solid var(--ui-line-soft); border-radius: 12px; padding: 10px 11px;
  font-size: 14.3px; line-height: 1.75;
}
#deficiency .th-prow li.th-lt { border-inline-start: 4px solid var(--th-g800); }
#deficiency .th-prow li.th-lg { border-inline-start: 4px solid var(--th-gold); }
#deficiency .th-tag { flex: none; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 7px; background: var(--th-g800); color: #fff; white-space: nowrap; }
#deficiency .th-credit { font-size: 11px; color: var(--ui-mute); }
#deficiency .gd-th { flex: none; }

/* ---------- التقارير المرتبطة ---------- */
.file-group { background: var(--th-surface); border: 1px solid var(--th-line); border-radius: var(--th-r-lg); padding: 14px 16px; margin: 20px 0 0; box-shadow: var(--ui-shadow-1); }
.file-group-head { margin: 0 0 8px; }
.file-group-label { font-size: 11.5px; font-weight: 700; color: #8a7433; margin: 0 0 2px; }
.file-group-heading { font-size: 18px; color: var(--th-g800); margin: 0; }

/* ---------- أزرار التواصل في النهاية ---------- */
.file-callout.file-bar { padding: 12px 14px; margin: 20px 0 0; }
.th-actions .file-button { min-height: 48px; border-radius: 12px; }
.th-pricewrap { margin-top: 10px; }

/* شريط الطقس: ما يظهرش صندوق فاضي لو السكربت ما اتحمّلش */
.wx-strip:empty { display: none; }

/* ---------- أدوات الفهرس: العدد + القائمة السريعة في سطر واحد ---------- */
.ui-toolbar { flex-wrap: wrap; }
.ui-toolbar .ui-quick { margin: 0; }
.ui-toolbar .ui-quick[open] { flex-basis: 100%; }
.ui-quick summary { background: #fff; }

/* ---------- تناسق شيفرون نقص العناصر ---------- */
#deficiency .th-pd summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-inline-start: auto;
  border-inline-end: 2px solid var(--th-gold); border-block-end: 2px solid var(--th-gold);
  transform: rotate(45deg); transition: transform .18s;
}
#deficiency .th-pd[open] summary::after { transform: rotate(-135deg); }
#deficiency .th-pd summary { display: flex; align-items: center; gap: 10px; }

/* ---------- مقاس أنسب على الشاشات الكبيرة ---------- */
@media (min-width: 900px) {
  .th-root { font-size: 16.5px; }
  .ui-sum-lead { font-size: 15.5px; }
}

/* ============================================================
   طبقة المكوّنات العامة — نفس الشكل في كل صفحة على الموقع
   أزرار، تذييل، تنبيهات، حقول، حالات فراغ وخطأ
   ============================================================ */

/* ---------- الأزرار ---------- */
.ui-btn, .th-root .file-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 12px;
  font: inherit; font-size: 14.5px; font-weight: 700; line-height: 1.2;
  text-decoration: none; border: 1px solid var(--th-line); background: #fff; color: var(--th-g800);
  cursor: pointer; transition: background .15s, border-color .15s, transform .12s;
}
.ui-btn:active, .th-root .file-button:active { transform: translateY(1px); }
.ui-btn-primary, .th-root .file-button[data-variant="primary"] {
  background: var(--th-g800); border-color: var(--th-g800); color: #fff;
}
.ui-btn-primary *, .th-root .file-button[data-variant="primary"] * { color: #fff !important; }
.ui-btn-gold { background: var(--th-gold); border-color: var(--th-gold); color: #3a2c00; }
.ui-btn-ghost { background: transparent; border-color: transparent; color: var(--th-g800); padding-inline: 8px; }
.th-root .file-button[data-variant="secondary"] { background: #fff; color: var(--th-g800) !important; border: 1px solid var(--th-line); }
.th-root .file-button[data-variant="secondary"] * { color: var(--th-g800) !important; }
.ui-btn svg, .th-root .file-button svg { width: 17px; height: 17px; }

/* ---------- تنبيهات ---------- */
.file-callout.file-bar {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-start;
  border-radius: 14px; padding: 12px 14px; margin: 16px 0 0;
  background: #fbfaf6; border: 1px solid var(--th-line); border-inline-start: 4px solid var(--th-g800);
  font-size: 14px; line-height: 1.8; color: var(--th-ink);
}
.file-callout.file-bar[data-tone="warning"] { background: #fdf0e4; border-color: #f0d7bb; border-inline-start-color: var(--th-orange); color: #4a3418; }
.file-callout.file-bar[data-tone="info"] { background: #fdf6e3; border-color: var(--th-gold-soft); border-inline-start-color: var(--th-gold); color: #4a3a12; }
.file-callout .file-strong { font-weight: 800; color: inherit; }

/* ---------- تذييل ---------- */
.file-closing {
  display: block; text-align: center; font-size: 12.5px; color: var(--ui-mute);
  padding: 18px 8px 6px; margin-top: 6px; border-top: 1px solid var(--th-line);
}

/* ---------- حقول ---------- */
.th-field { gap: 6px; margin: 12px 0 6px; }
.th-field label { font-size: 12.5px; font-weight: 700; color: var(--ui-mute); }
.th-select { min-height: 50px; border-radius: 12px; font-size: 15.5px; }

/* ---------- حالات فراغ / خطأ ---------- */
.ui-empty {
  display: none; text-align: center; padding: 28px 18px; border-radius: 16px;
  background: #fff; border: 1px dashed var(--th-line); color: var(--ui-mute); font-size: 14.5px; line-height: 1.8;
}
.ui-empty.show { display: block; }
.ui-empty b { display: block; color: var(--th-g800); font-size: 16px; margin-bottom: 4px; }

/* ---------- شارة/عدّاد ---------- */
.ui-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800;
  border-radius: 999px; padding: 3px 10px; background: var(--th-g50); color: var(--th-g700);
}
.ui-badge-gold { background: var(--th-gold-soft); color: var(--ui-gold-ink); }

/* ---------- تحسينات الهيدر ---------- */
.th-topbar .th-nav a { min-height: 42px; }
@media (min-width: 768px) {
  .th-topbar .th-nav { justify-content: center; }
  .th-topbar .th-topin { padding-bottom: 2px; }
}

/* ============================================================
   المكوّنات المشتركة على صفحات الموقع التانية
   (نفس الكروت والحدود والظلال — تتأكد صفحة صفحة عند النشر)
   ============================================================ */
.th-band {
  border-radius: var(--th-r-lg); padding: 6px 18px 20px; margin: 18px 0;
  box-shadow: var(--ui-shadow-1);
}
.th-band h2 { font-size: 20px; }
.th-grid .th-card, .th-cropgrid .th-card { border-radius: 16px; box-shadow: var(--ui-shadow-1); padding: 10px; }
.th-ncard { border-radius: 16px; box-shadow: var(--ui-shadow-1); }
.th-tablewrap { border-radius: 16px; box-shadow: var(--ui-shadow-1); }
.th-report p, .th-report li { font-size: 15.5px; line-height: 1.9; }
.th-steps .th-step { border-radius: 16px; }
.th-price { border-radius: 16px; }

/* ============================================================
   نظام التصميم — طبقة موحّدة لكل صفحات الموقع
   تحمّل بعد نظام التصميم المضمّن في كل صفحة، فتلغي ما تحتاجه فقط.
   ============================================================ */

/* ---------- مقياس الخط والمسافات ---------- */
:root {
  --ui-fs-1: 28px;  /* h1 */
  --ui-fs-2: 21px;  /* h2 */
  --ui-fs-3: 17px;  /* h3 */
  --ui-fs-4: 15.5px;/* نص */
  --ui-fs-5: 14px;  /* نص ثانوي */
  --ui-fs-6: 12.5px;/* ميتا */
  --ui-sp-1: 6px; --ui-sp-2: 10px; --ui-sp-3: 14px; --ui-sp-4: 18px; --ui-sp-5: 26px;
  --ui-r-card: 16px; --ui-r-band: 20px; --ui-r-pill: 999px;
}

/* ---------- الهيدر ---------- */
.th-topbar { border-bottom: 2px solid var(--th-gold); box-shadow: 0 2px 12px rgba(10,46,29,.16); }
.th-topin { padding: 8px 16px 2px; gap: 2px; }
.th-brand span { font-size: 21px; }
.th-nav a { font-size: 14.5px; min-height: 44px; padding: 8px 14px; }
.th-burger { border-radius: 12px; }
.th-bottombar { padding: 8px 12px 10px; }
.th-bb { font-size: 15px; border-radius: 12px; }

/* ---------- الهيرو ---------- */
.th-hero, .th-phero { border-radius: var(--ui-r-band); box-shadow: 0 8px 22px rgba(10,46,29,.14); }
.th-phero { padding: 22px 20px; margin: 4px 0 16px; }
.th-phero h1 { font-size: var(--ui-fs-1); line-height: 1.3; }
.th-phero p { font-size: var(--ui-fs-5); line-height: 1.75; }
.th-hero { padding: 28px 20px 24px; }
.th-hero h1 { font-size: 26px; }
.th-hero p { font-size: 15px; line-height: 1.75; }
.th-hero img { width: 96px; height: 96px; }
.th-chip { font-size: 12.5px; padding: 4px 12px; }

/* ---------- البطاقات والأقسام ---------- */
.th-band {
  background: var(--th-surface); border: 1px solid var(--th-line);
  border-radius: var(--ui-r-band); padding: 16px 18px 20px; margin: 18px 0;
  box-shadow: var(--ui-shadow-1);
}
.th-band h2 { font-size: var(--ui-fs-2); line-height: 1.4; margin: 0 0 10px; }
.th-band p, .th-band li { font-size: var(--ui-fs-4); line-height: 1.85; }
.th-band.th-dark { box-shadow: 0 8px 22px rgba(10,46,29,.18); }
.th-band.th-dark h2 { color: var(--th-gold); }

/* ---------- كروت المنتجات ---------- */
.th-grid { gap: 12px; }
.th-card {
  border-radius: var(--ui-r-card); box-shadow: var(--ui-shadow-1);
  padding: 10px 10px 12px; border-top-width: 3px;
}
.th-card-img { border-radius: 12px; }
.th-card-name { font-size: var(--ui-fs-4); margin-top: 6px; }
.th-card-sub { font-size: var(--ui-fs-6); line-height: 1.65; color: var(--ui-mute); }
.th-card-size { font-size: var(--ui-fs-6); }
.th-order { border-radius: 12px; min-height: 46px; font-size: 13.5px; display: flex; align-items: center; justify-content: center; }

/* ---------- كروت التقارير ---------- */
.th-carousel { padding: 6px 2px 12px; gap: 12px; }
.th-slide { flex-basis: 78%; }
.th-ncard { border-radius: var(--ui-r-card); box-shadow: var(--ui-shadow-1); border-top-width: 0; padding-bottom: 14px; }
.th-ncard-t { font-size: var(--ui-fs-4); line-height: 1.55; padding: 0 14px; }
.th-ncard-d { font-size: var(--ui-fs-6); padding: 0 14px; }
.th-newsitem { border-radius: 14px; padding: 14px 16px; }

/* ---------- الأكورديون والعناصر (كل صفحات المحاصيل) ---------- */
.th-programs { margin: 26px 0 0; }
.th-programs h2 { font-size: var(--ui-fs-2); margin: 0 0 8px; }
.th-pnote {
  font-size: var(--ui-fs-5); line-height: 1.85; color: #6b5619;
  background: #fdf6e3; border: 1px solid var(--th-gold-soft);
  border-radius: 14px; padding: 12px 14px; margin: 0 0 12px; white-space: normal; overflow: visible;
}
.th-pd { border-radius: var(--ui-r-card); box-shadow: var(--ui-shadow-1); margin: 10px 0; }
.th-pd summary { min-height: 56px; padding: 14px 16px; font-size: 16px; color: var(--th-g800); }
.th-prog { padding: 12px; gap: 12px; }
.th-prow {
  background: #fff; border: 1px solid var(--th-line); border-radius: var(--ui-r-card);
  padding: 12px; border-inline-start: 0;
}
.th-prow-h { gap: 8px; margin-bottom: 6px; }
.th-prow-h b { font-size: 15.5px; }
.th-prow-h small { font-size: var(--ui-fs-6); }
.th-prow ul { margin: 0; padding: 0; display: grid; gap: 7px; }
.th-prow li {
  display: flex; gap: 9px; align-items: flex-start;
  background: #fbfaf6; border: 1px solid var(--cx-line-soft, #efe9db);
  border-radius: 12px; padding: 10px 11px; font-size: 14.3px; line-height: 1.75;
}
.th-prow li.th-lt { border-inline-start: 4px solid var(--th-g800); }
.th-prow li.th-lg { border-inline-start: 4px solid var(--th-gold); }
.th-tag { flex: none; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 7px; white-space: nowrap; }
.th-prow .th-credit { font-size: 11px; color: var(--ui-mute); display: block; }
.th-pphoto { display: block; }
.th-pphoto img { width: 100%; border-radius: 12px; display: block; margin-bottom: 6px; }

/* ---------- الجداول ---------- */
.th-tablewrap { border-radius: var(--ui-r-card); border: 1px solid var(--th-line); box-shadow: var(--ui-shadow-1); overflow: hidden; }
.th-tablewrap table { font-size: 14px; }
.th-tablewrap th { font-size: 12.5px; padding: 10px 12px; }
.th-tablewrap td { padding: 10px 12px; line-height: 1.7; }

/* ---------- الأزرار ---------- */
.th-actions { gap: 10px; margin: 16px 0 6px; }
.th-more, .th-chipl { min-height: 46px; border-radius: 12px; font-size: 14px; }
.th-chipl { padding: 0 15px; }
.th-back { font-size: 14.5px; }
.th-price { border-radius: var(--ui-r-card); box-shadow: var(--ui-shadow-1); }
.th-who a { border-radius: 12px; min-height: 46px; }

/* ---------- الحقول ---------- */
.th-select { border-radius: 12px; min-height: 50px; font-size: 15.5px; }
.th-field label { font-size: 12.5px; }

/* ---------- عناصر متفرقة ---------- */
.th-stats div { border-radius: 14px; }
.th-steps .th-step { border-radius: var(--ui-r-card); }
.th-item { border-radius: 14px; }
.th-pimg { border-radius: var(--ui-r-band); }
.th-vcard { border-radius: var(--ui-r-card); }
.th-rbox { border-radius: 14px; }
.th-report h2 { font-size: var(--ui-fs-2); margin: 26px 0 8px; }
.th-report h3 { font-size: var(--ui-fs-3); margin: 18px 0 6px; }
.th-report p, .th-report li { font-size: 15.5px; line-height: 1.9; }
.th-src { font-size: 12px; }
.file-group { border-radius: var(--ui-r-band); box-shadow: var(--ui-shadow-1); padding: 16px 18px; }
.file-group-heading { font-size: 19px; }
.file-group-label { font-size: 11.5px; color: #8a7433; }
.file-p { font-size: var(--ui-fs-4); line-height: 1.85; }

/* ---------- الموبايل ---------- */
@media (max-width: 400px) {
  .th-hero h1 { font-size: 24px; }
  .th-phero h1 { font-size: 25px; }
  .th-band, .file-group { padding: 14px 14px 16px; }
  .th-prog { padding: 10px; }
  .th-prow { padding: 10px; }
  .th-prow li { font-size: 14.2px; padding: 9px 10px; }
}

/* ---------- صفحة الأرصاد /weather/ ---------- */
.wx-areas { gap: 14px; margin: 14px 0 20px; }
.wx-card { border-radius: var(--ui-r-band); box-shadow: var(--ui-shadow-1); border-top-width: 4px; padding: 14px 16px 16px; }
.wx-head h3 { font-size: 19px; }
.wx-now { gap: 14px; margin: 10px 0 4px; }
.wx-temp { font-size: 34px; }
.wx-cond { font-size: 15px; }
.wx-stats { gap: 8px; margin: 12px 0; }
.wx-stat { border-radius: 12px; padding: 10px 6px; }
.wx-stat b { font-size: 15.5px; }
.wx-days { gap: 8px; margin: 10px 0 6px; }
.wx-day { border-radius: 12px; padding: 10px 8px; }
.wx-day b { font-size: 13px; }
.wx-flags { gap: 6px; margin-top: 10px; }
.wx-flag { font-size: 12.5px; padding: 5px 11px; }
.wx-thresh li { font-size: 15px; line-height: 1.9; margin: 7px 0; }
.wx-note { font-size: 13.5px; line-height: 1.85; }
.wx-src { font-size: 12.5px; line-height: 1.8; }

/* ---------- تصحيحات التكوين ---------- */
/* أزرار داخل الهيرو الغامق والأقسام الغامقة: تباين كافٍ */
.th-hero .file-button[data-variant="primary"],
.th-band.th-dark .file-button[data-variant="primary"],
.th-hero .ui-btn-primary, .th-band.th-dark .ui-btn-primary {
  background: var(--th-gold); border-color: var(--th-gold); color: #2b2100;
}
.th-hero .file-button[data-variant="primary"] *,
.th-band.th-dark .file-button[data-variant="primary"] *,
.th-hero .ui-btn-primary *, .th-band.th-dark .ui-btn-primary * { color: #2b2100 !important; }
.th-hero .file-button[data-variant="secondary"],
.th-band.th-dark .file-button[data-variant="secondary"] {
  background: #fff; border-color: #fff; color: var(--th-g900) !important;
}
.th-hero .file-button[data-variant="secondary"] *,
.th-band.th-dark .file-button[data-variant="secondary"] * { color: var(--th-g900) !important; }

/* ممنوع كارت جوه كارت: الأقسام المتداخلة تتعرّى من الحدود */
.th-band .file-group, .th-band .th-band, .file-group .file-group {
  background: transparent; border: 0; box-shadow: none; padding: 0; margin: 0;
}

/* ---------- الأقسام الغامقة (بلوك التواصل) ---------- */
.th-band.th-dark .file-group, .th-band.th-dark .th-band {
  background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important;
}
.th-band.th-dark .file-group p,
.th-band.th-dark .file-group span,
.th-band.th-dark .file-group bdi,
.th-band.th-dark .file-group .file-p { color: #efe9d6 !important; }
.th-band.th-dark .file-group h2,
.th-band.th-dark .file-group .file-group-heading { color: var(--th-gold) !important; }
.th-band.th-dark .file-group .file-group-label { color: #d9c58a !important; }
.th-band.th-dark .file-group .file-button[data-variant="primary"] { background: var(--th-gold) !important; border-color: var(--th-gold) !important; }
.th-band.th-dark .file-group .file-button[data-variant="primary"] * { color: #2b2100 !important; }
.th-band.th-dark .file-group .file-button[data-variant="secondary"] { background: #fff !important; border-color: #fff !important; }
.th-band.th-dark .file-group .file-button[data-variant="secondary"] * { color: var(--th-g900) !important; }
