/* أنماط أدوات القسم الإسلامي — امتداد لنظام الموقع العنابي: بلا ظلال، حدود واضحة، Tahoma، عناصر مدمجة. */
.am-tool {
  direction: rtl;
  font-family: Tahoma, Arial, sans-serif;
  color: #241E1D;
  margin: 0 0 28px;
}
.am-tool *, .am-tool *::before, .am-tool *::after { box-sizing: border-box; }
.am-tool h2, .am-tool h3 { font-family: Tahoma, Arial, sans-serif; font-weight: 700; color: #241E1D; }
.am-tool p, .am-tool li, .am-tool label, .am-tool output { line-height: 1.8; }
.am-tool a { color: #B8322B; }
.am-tool a:hover, .am-tool a:focus { color: #7B211B; }

.am-tool-intro { font-size: 15px; color: #6F6260; margin: 0 0 18px; }

.am-panel { background: #FFFFFF; border: 1px solid #E5DBD7; border-radius: 12px; padding: 16px; margin: 0 0 16px; }
.am-panel--cream { background: #FFFCF5; border-color: #E8DABB; }
.am-panel--tint { background: #F5ECEA; border-color: #E5DBD7; }
.am-panel-title { font-size: 16px; font-weight: 700; margin: 0 0 12px; color: #241E1D; }

.am-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.am-grid--2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.am-field { display: block; margin: 0 0 12px; }
.am-field > span, .am-label { display: block; font-size: 13px; font-weight: 700; margin: 0 0 6px; color: #241E1D; }
.am-hint { display: block; font-size: 12px; color: #6F6260; margin-top: 4px; font-weight: 400; }
/* القالب يفرض select{height:30px} مع box-sizing:border-box عام، فيبقى للعربية عشرة بكسل فقط من أصل سطر 25.6: الارتفاع التلقائي هو الإصلاح، و44 بكسل حد أدنى يوحّد التحكمات ولمسات الإصبع. */
.am-tool input[type=text], .am-tool input[type=number], .am-tool input[type=search], .am-tool input[type=date], .am-tool select, .am-tool textarea {
  width: 100%; height: auto; min-height: 44px; direction: rtl; text-align: start;
  font: 400 14px/1.6 Tahoma, Arial, sans-serif; color: #241E1D;
  padding: 9px 10px; background: #FFFFFF; border: 1px solid #E5DBD7; border-radius: 8px;
  -webkit-appearance: none; appearance: none;
}
/* حذف القالب سهمه بمظهر مُخصّط يتطلب سهمًا مرسومًا وحيزًا لا يلمسه النص. */
.am-tool select {
  padding-inline-end: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236F6260' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center;
}
.am-tool textarea { min-height: 92px; resize: vertical; }
.am-tool input:focus-visible, .am-tool select:focus-visible, .am-tool textarea:focus-visible,
.am-tool button:focus-visible, .am-tool a:focus-visible, .am-tool [tabindex]:focus-visible {
  outline: 3px solid #B8322B; outline-offset: 2px;
}
.am-tool input[aria-invalid=true], .am-tool input.is-invalid, .am-tool select.is-invalid { border-color: #B8322B; background-color: #FDF6F5; }

.am-checks { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.am-check { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 8px 10px; border: 1px solid #E5DBD7; border-radius: 8px; background: #FFFFFF; cursor: pointer; }
.am-check input { width: 18px; height: 18px; margin: 0; accent-color: #B8322B; flex: none; }
.am-check.is-on { border-color: #B8322B; background: #F5ECEA; }

.am-btn { display: inline-block; font: 700 14px/1 Tahoma, Arial, sans-serif; padding: 11px 18px; border-radius: 8px; border: 1px solid #B8322B; background: #B8322B; color: #FFFFFF; cursor: pointer; }
.am-btn:hover, .am-btn:focus { background: #7B211B; border-color: #7B211B; color: #FFFFFF; }
.am-btn--ghost { background: #FFFFFF; color: #7B211B; border-color: #E5DBD7; }
.am-btn--ghost:hover, .am-btn--ghost:focus { background: #F5ECEA; color: #7B211B; border-color: #B8322B; }
.am-btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 0; }

.am-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.am-tabs button { font: 700 13px/1 Tahoma, Arial, sans-serif; padding: 9px 14px; border-radius: 8px; border: 1px solid #E5DBD7; background: #FFFFFF; color: #6F6260; cursor: pointer; }
.am-tabs button[aria-selected=true] { background: #B8322B; border-color: #B8322B; color: #FFFFFF; }

.am-result { margin: 0; }
.am-result[hidden] { display: none; }
.am-result-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 17px; font-weight: 700; padding: 14px 16px; background: #F5ECEA; border: 1px solid #E5DBD7; border-radius: 12px; margin: 0 0 14px; }
.am-result-total b { font-size: 22px; color: #7B211B; }
.am-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #E5DBD7; font-size: 14px; }
.am-line:last-child { border-bottom: 0; }
.am-line span:first-child { color: #6F6260; }
.am-line b { font-weight: 700; color: #241E1D; text-align: left; }
.am-line--strong b { color: #7B211B; }

.am-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.am-table th, .am-table td { padding: 9px 10px; border: 1px solid #E5DBD7; text-align: right; }
.am-table th { background: #F5ECEA; font-weight: 700; }
.am-table caption { caption-side: top; text-align: right; font-size: 13px; color: #6F6260; padding-bottom: 8px; }

.am-note { font-size: 13px; line-height: 1.75; color: #6F581F; background: #FFFCF5; border: 1px solid #E8DABB; border-radius: 8px; padding: 12px 14px; margin: 14px 0 0; }
.am-note--alert { color: #7B211B; background: #F5ECEA; border-color: #E5DBD7; }
.am-error { color: #B8322B; font-size: 14px; font-weight: 700; margin: 10px 0 0; min-height: 1.4em; }
.am-error:empty { margin: 0; }

.am-isl-text { font-size: 17px; line-height: 2.1; color: #241E1D; }
.am-isl-text--quran { font-family: "Traditional Arabic", "Amiri", Tahoma, serif; }
.am-src { display: block; font-size: 12px; color: #6F6260; margin-top: 6px; }

.am-count-pill { display: inline-flex; align-items: baseline; gap: 6px; font-size: 13px; color: #6F6260; background: #FFFFFF; border: 1px solid #E5DBD7; border-radius: 8px; padding: 5px 10px; }
.am-count-pill b { font-size: 15px; color: #7B211B; }

.am-list { list-style: none; margin: 0; padding: 0; }
.am-list > li { padding: 10px 0; border-bottom: 1px solid #E5DBD7; font-size: 14px; }
.am-list > li:last-child { border-bottom: 0; }

.am-crumb { font-size: 12px; color: #6F6260; margin: 0 0 12px; }
.am-crumb a { color: #6F6260; text-decoration: underline; }

.am-related { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-top: 14px; }
.am-related a { display: block; padding: 12px 14px; border: 1px solid #E5DBD7; border-radius: 12px; text-decoration: none !important; font-size: 14px; font-weight: 700; background: #FFFFFF; }
.am-related a:hover { border-color: #B8322B; background: #F5ECEA; }

@media (max-width: 520px) {
  .am-panel { padding: 12px; }
  .am-grid, .am-checks { grid-template-columns: 1fr; }
  .am-result-total { font-size: 15px; }
  .am-result-total b { font-size: 19px; }
  .am-isl-text { font-size: 16px; }
}
/* واجهة المواقيت: بطاقات أوقات وشريط العدّ وروابط مدن.
   كل اختيار لوني من نظام الموقع العنابي نفسه (#7B211B / #B8322B / #F5ECEA / #E5DBD7)،
   والوسوم مُقيَّدة بـ .am-tool لأن islamic.css يُلون الروابط داخل الأداة بقاعدة أعلى خاصة. */

.am-tool .am-prays { display: grid; grid-template-columns: repeat(auto-fit, minmax(94px, 1fr)); gap: 8px; margin: 0 0 10px; padding: 0; list-style: none; }
.am-tool .am-pray { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; background: #FFFFFF; border: 1px solid #E5DBD7; border-radius: 12px; box-shadow: 0 1px 2px rgba(36, 30, 29, .05); }
.am-tool .am-pray-name { font-size: 13px; font-weight: 700; color: #6F6260; }
.am-tool .am-pray-clock { font-size: 21px; font-weight: 700; color: #241E1D; font-variant-numeric: tabular-nums; }
.am-tool .am-pray-tag { font-size: 11px; min-height: 15px; color: #6F6260; }
.am-tool .am-pray.is-now { background: #7B211B; border-color: #7B211B; }
.am-tool .am-pray.is-now .am-pray-name, .am-tool .am-pray.is-now .am-pray-tag { color: #F5D9D5; }
.am-tool .am-pray.is-now .am-pray-clock { color: #FFFFFF; }
.am-tool .am-pray.is-next { border-color: #B8322B; }
.am-tool .am-pray.is-next .am-pray-clock { color: #B8322B; }
.am-tool .am-pray.is-next .am-pray-tag { color: #B8322B; }
.am-tool .am-pray.is-na .am-pray-clock { color: #A99A96; }
.am-tool .am-prays-meta { font-size: 12px; color: #6F6260; margin: 0 0 14px; }

.am-tool .am-now { background: #7B211B; color: #FFFFFF; border-radius: 12px; padding: 14px 16px; margin: 0 0 14px; }
.am-tool .am-now-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; color: #F0D2CE; }
.am-tool .am-now-clock { font-weight: 700; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.am-tool .am-now-cur b { color: #FFFFFF; }
.am-tool .am-now-next { margin: 6px 0 10px; font-size: 15px; color: #FFFFFF; }
.am-tool .am-now-next b { font-size: 18px; }
.am-tool .am-now-timer { display: inline-block; margin-inline-start: 6px; padding: 2px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.18); font-weight: 700; font-variant-numeric: tabular-nums; }
.am-tool .am-now-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.22); overflow: hidden; }
.am-tool .am-now-bar i { display: block; height: 100%; background: #FFFFFF; border-radius: 3px; transition: width .45s linear; }
.am-tool .am-now-note { margin: 8px 0 0; font-size: 11px; line-height: 1.7; color: #E9C6C1; }

.am-tool .am-chips { margin: 0 0 14px; padding-top: 12px; border-top: 1px solid #E5DBD7; }
.am-tool .am-chips-title { font-size: 13px; font-weight: 700; color: #6F6260; margin: 0 0 8px; }
.am-tool .am-chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.am-tool .am-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 12px; border: 1px solid #E5DBD7; border-radius: 999px; background: #FFFFFF; color: #7B211B; font-size: 13px; font-weight: 700; text-decoration: none; }
.am-tool .am-chip small { font-size: 11px; font-weight: 400; color: #6F6260; }
.am-tool .am-chip:hover, .am-tool .am-chip:focus { background: #F5ECEA; border-color: #B8322B; color: #7B211B; text-decoration: none; }
.am-tool .am-chip.is-on { background: #B8322B; border-color: #B8322B; color: #FFFFFF; }
.am-tool .am-chip.is-on small { color: #F5D9D5; }
.am-tool .am-chips-note { margin: 0; font-size: 11px; color: #6F6260; }

/* ===== بطاقات مدن السعودية: شبكة تلتف ذاتها فلا تمرير أفقي على الهاتف ===== */
.am-tool .am-cities { margin: 0 0 18px; }
.am-tool .am-cities-title { font-size: 21px; font-weight: 700; color: #241E1D; margin: 0 0 6px; }
.am-tool .am-cities-sub { font-size: 14px; line-height: 1.8; color: #6F6260; margin: 0 0 14px; max-width: 68ch; }
.am-tool .am-cities-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(152px, 100%), 1fr)); gap: 8px; }
.am-tool .am-city-card { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid #E5DBD7; border-radius: 12px; background: #FFFFFF; color: #7B211B; text-decoration: none; box-shadow: 0 1px 2px rgba(36, 30, 29, .05); min-width: 0; }
.am-tool button.am-city-card { font: inherit; line-height: inherit; text-align: start; cursor: pointer; }
.am-tool .am-city-card > span { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.am-tool .am-city-card > small { font-size: 11px; font-weight: 400; color: #6F6260; overflow-wrap: anywhere; }
.am-tool .am-city-card:hover, .am-tool .am-city-card:focus { background: #F5ECEA; border-color: #B8322B; color: #7B211B; text-decoration: none; }
.am-tool .am-city-card.is-on { background: #B8322B; border-color: #B8322B; color: #FFFFFF; }
.am-tool .am-city-card.is-on > small { color: #F5D9D5; }
.am-tool .am-cities-note { margin: 12px 0 0; font-size: 11px; line-height: 1.7; color: #6F6260; }

/* ===== البوابة: سؤال الموقع قبل أي وقت ===== */
.am-tool .am-gate { text-align: center; padding: 26px 18px 22px; }
.am-tool .am-gate-title { font-size: 21px; font-weight: 700; margin: 0 0 6px; color: #241E1D; }
.am-tool .am-gate-sub { font-size: 14px; color: #6F6260; margin: 0 auto 18px; max-width: 46ch; }
.am-tool .am-gate-form { max-width: 520px; margin: 0 auto; text-align: right; }
.am-tool .am-gate-note { font-size: 12px; line-height: 1.7; color: #6F6260; margin: 8px 0 0; }
.am-tool .am-btn--geo { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 18px; font-size: 15px; }
.am-tool .am-btn--geo[disabled] { opacity: .7; cursor: progress; }
.am-tool .am-btn-ico { width: 19px; height: 19px; flex: none; }
.am-tool .am-sep { display: flex; align-items: center; gap: 12px; margin: 16px 0; font-size: 12px; color: #6F6260; }
.am-tool .am-sep::before, .am-tool .am-sep::after { content: ""; flex: 1; height: 1px; background: #E5DBD7; }
.am-tool .am-sep span { flex: none; }

/* البحث عن المدينة: قائمة مقترحة تحت الحقل، والأسماء المتكررة تُفرَّق بالبلد. */
.am-tool .am-combo { position: relative; margin: 0 0 14px; }
.am-tool .am-combo-input { padding-inline-end: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236F6260' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='m20 20-4.5-4.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 10px center; background-size: 16px 16px; }
.am-tool .am-field-cap { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.am-tool .am-suggest { position: absolute; z-index: 5; inset-inline: 0; top: calc(100% + 4px); max-height: 264px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: #FFFFFF; border: 1px solid #E5DBD7; border-radius: 10px; box-shadow: 0 6px 18px rgba(123, 33, 27, .10); }
.am-tool .am-suggest[hidden] { display: none; }
.am-tool .am-suggest li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.am-tool .am-suggest li:hover, .am-tool .am-suggest li[aria-selected=true] { background: #F5ECEA; }
.am-tool .am-suggest-city { font-weight: 700; color: #241E1D; }
.am-tool .am-suggest-country { color: #6F6260; font-size: 13px; }
.am-tool .am-gate-select { margin: 10px 0 0; }

/* ===== اللوحة: رأسٌ بالموقع والتاريخين والساعة ===== */
.am-tool .am-dash-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid #E5DBD7; }
.am-tool .am-dash-headline { flex: 1 1 260px; }
.am-tool .am-dash-head .am-panel-title { margin: 0 0 6px; font-size: 19px; }
.am-tool .am-dash-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; font-size: 13px; color: #6F6260; }
.am-tool .am-dash-line { display: inline-flex; gap: 6px; align-items: baseline; }
.am-tool .am-dash-hijri { color: #7B211B; font-weight: 700; }
.am-tool .am-hd-k { color: #A99A96; font-size: 12px; }
.am-tool .am-hd-clock { color: #241E1D; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; }
.am-tool .am-change { flex: none; }

/* التنقل بين الأيام والشهور: أزرار روابط، فتعمل بلا جافاسكريبت وتبقى في مسار واحد. */
.am-tool .am-navrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 14px; }
.am-tool .am-navbtn { flex: 1 1 auto; text-align: center; padding: 9px 12px; border: 1px solid #E5DBD7; border-radius: 8px; background: #FFFFFF; color: #7B211B; font-size: 13px; font-weight: 700; text-decoration: none; }
.am-tool .am-navbtn:hover, .am-tool .am-navbtn:focus { background: #F5ECEA; border-color: #B8322B; color: #7B211B; text-decoration: none; }
.am-tool .am-navrow-now { flex: 2 1 auto; text-align: center; padding: 9px 12px; border-radius: 8px; background: #F5ECEA; border: 1px solid #E5DBD7; color: #7B211B; font-size: 13px; font-weight: 700; }

/* أيقونة الوقت: خط مرسوم بلون النص نفسه، فلا لون ثانٍ يُكسر النظام. */
.am-tool .am-pray-ico { display: block; width: 22px; height: 22px; color: #B8322B; }
.am-tool .am-pray-ico svg { display: block; width: 100%; height: 100%; }
.am-tool .am-pray.is-now .am-pray-ico { color: #F5D9D5; }
.am-tool .am-pray.is-na .am-pray-ico { color: #A99A96; }

/* جدول الشهر: عمود اليوم مضغوط، والأرقام أرقام غربية بلا أصفار تُزاحم القراءة. */
.am-tool .am-table { font-variant-numeric: tabular-nums; }
.am-tool .am-td-day { text-align: center; font-weight: 700; color: #7B211B; width: 42px; padding: 9px 4px; }

/* إعدادات متقدمة مطوية: الزائر العادي لا يراها، ومن يريدها يجدها بلا انتظار صفحة جديدة. */
.am-tool .am-advanced { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid #E5DBD7; }
.am-tool .am-advanced-cap { cursor: pointer; font-size: 14px; font-weight: 700; color: #7B211B; padding: 6px 0; }
.am-tool .am-advanced-cap:focus-visible { outline: 3px solid #B8322B; outline-offset: 2px; }
.am-tool .am-advanced-form { padding-top: 14px; }
/* الأزرار وتفضيلات الموقع تحت صندوق طول النهار مباشرة: مسافة الفواصل نفسها بقية أقسام اللوحة،
   والأزرار تلتف فلا تُحدث تمريرًا أفقيًا على الشاشات الضيقة. */
.am-tool .am-actions { margin: 0 0 16px; }
.am-tool .am-actions > .am-btn-row { margin: 0; }
.am-tool .am-actions > .am-saved-row { margin: 10px 0 0; }
.am-tool .am-actions > .am-note { margin: 10px 0 0; }
.am-tool .am-saved-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 0; }
.am-tool .am-linkish { background: none; border: 0; padding: 0; font: 400 13px/1.6 Tahoma, Arial, sans-serif; color: #B8322B; text-decoration: underline; cursor: pointer; }
.am-tool .am-linkish:hover, .am-tool .am-linkish:focus { color: #7B211B; }

/* هيكل الانتظار: يظهر حين يتولّد جدول شهر أو حين يُطلب الموقع، ويختفي برسم النتيجة. */
.am-tool .am-skel-holder { display: grid; gap: 8px; margin: 0 0 16px; padding: 16px; background: #FFFFFF; border: 1px solid #E5DBD7; border-radius: 12px; }
.am-tool .am-skel-holder[hidden] { display: none; }
.am-tool .am-skel-cap { font-size: 13px; font-weight: 700; color: #7B211B; }
.am-tool .am-skel { display: block; height: 16px; border-radius: 8px; background: linear-gradient(90deg, #F5ECEA 0%, #E5DBD7 40%, #F5ECEA 80%); background-size: 300% 100%; animation: am-skel-move 1.25s linear infinite; }
@keyframes am-skel-move { from { background-position: 100% 0; } to { background-position: -100% 0; } }

@media (prefers-reduced-motion: reduce) {
  .am-tool .am-skel { animation: none; background: #F5ECEA; }
  .am-tool .am-now-bar i { transition: none; }
}

@media (max-width: 620px) {
  /* جدول الشهر على الهاتف: ستة أعمدة في سطر واحد بلا أفق يضيع الزائر فيه. */
  .am-tool .am-table { font-size: 12px; }
  .am-tool .am-table th, .am-tool .am-table td { padding: 7px 4px; }
  .am-tool .am-td-day { width: 30px; }
  .am-tool .am-gate { padding: 20px 12px 18px; }
  .am-tool .am-gate-title { font-size: 19px; }
  .am-tool .am-cities-title { font-size: 19px; }
  .am-tool .am-dash-head .am-panel-title { font-size: 17px; }
  .am-tool .am-navbtn, .am-tool .am-navrow-now { flex: 1 1 30%; }
}


@media (max-width: 430px) {
  .am-tool .am-prays { grid-template-columns: repeat(3, 1fr); }
  .am-tool .am-pray-clock { font-size: 18px; }
}
