/* ===== Topo Flat: طبقة الموبايل ===== */
:root { --topbar-h: 112px; --sl: env(safe-area-inset-left,0px); --sr: env(safe-area-inset-right,0px); --sb: env(safe-area-inset-bottom,0px); }
html, body { height: 100%; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
body.mini-gleason { height: 100dvh; }
#azimCanvas { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.mini-gleason #top-bar { height: var(--topbar-h); }
body.mini-gleason #azimuth-panel { top: var(--topbar-h) !important; }
a#yaqeen-mark { text-decoration: none; cursor: pointer; }
#drawer-btn, #drawer-backdrop, #zoom-ctl { display: none; }

@media (max-width: 820px), (max-height: 520px) {
  :root { --topbar-h: 56px; }
  body.mini-gleason #top-bar { padding: 0 var(--sr) 0 var(--sl); }
  body.mini-gleason #mini-logo { width: 104px; }
  body.mini-gleason #yaqeen-mark { right: calc(10px + var(--sr)); gap: 6px; }

  /* زر القائمة */
  #drawer-btn { display: flex; position: absolute; left: calc(10px + var(--sl)); top: 50%; transform: translateY(-50%);
    width: 42px; height: 42px; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    background: #1c2541; border: 1px solid #3a506b; border-radius: 10px; padding: 0; cursor: pointer; }
  #drawer-btn i { display: block; width: 18px; height: 2px; background: #4cc9f0; border-radius: 2px; transition: transform .2s, opacity .2s; }
  body.drawer-open #drawer-btn i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.drawer-open #drawer-btn i:nth-child(2) { opacity: 0; }
  body.drawer-open #drawer-btn i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* لوحة التحكم = درج جانبي */
  body.mini-gleason #azim-date-panel { position: fixed !important; top: var(--topbar-h) !important; bottom: 0; left: 0 !important; right: auto !important;
    width: min(86vw, 320px) !important; max-height: none !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch;
    border-radius: 0 14px 14px 0; padding-bottom: var(--sb); z-index: 60; transform: translateX(-104%); transition: transform .25s ease; }
  body.drawer-open.mini-gleason #azim-date-panel { transform: none; box-shadow: 8px 0 28px rgba(0,0,0,.55); }
  #drawer-backdrop { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(0,0,0,.4); z-index: 55;
    opacity: 0; pointer-events: none; transition: opacity .25s; }
  body.drawer-open #drawer-backdrop { opacity: 1; pointer-events: auto; }
  #azim-date-panel button, #azim-date-panel .tool-item-btn { min-height: 44px; font-size: .9rem; }
  #azim-date-panel input[type=date], #azim-date-panel input[type=time] { min-height: 40px; font-size: 16px !important; }
  #azim-date-panel input[type=range] { height: 30px; }

  /* أزرار التكبير + مؤشره */
  #zoom-ctl { display: flex; flex-direction: column; gap: 8px; position: fixed; right: calc(12px + var(--sr)); bottom: calc(16px + var(--sb)); z-index: 40; }
  #zoom-ctl button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid #3a506b; background: rgba(28,37,65,.92);
    color: #4cc9f0; font: 700 1.3rem 'Tajawal', sans-serif; cursor: pointer; }
  #zoom-ctl button:active { background: #3a506b; }
  #azim-zoom-info { left: calc(12px + var(--sl)); bottom: calc(16px + var(--sb)); font-size: .72rem; padding: 5px 9px; }
}

/* ===== شعار يقين: مطابق تمامًا لـ Navbar الموقع الأم (الوضع الداكن) ===== */
body.mini-gleason #yaqeen-mark { gap: 12px; direction: ltr; }
#yaqeen-mark .ym-text { direction: rtl; display: flex; flex-direction: column; align-items: flex-start; }
#yaqeen-mark .ym-title { font-family: 'Amiri', serif; font-weight: 700; font-size: 1.5rem; line-height: 1.25; letter-spacing: .1em; color: #e5b342; white-space: nowrap; }
#yaqeen-mark .ym-sub { font-family: system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif; font-size: 10px; letter-spacing: .05em; color: #9c8a73; white-space: nowrap; }
#yaqeen-mark .ym-tile { width: 44px; height: 44px; padding: 4px; box-sizing: border-box; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: #1e1914; border: 1px solid #332920; transition: border-color .2s; }
#yaqeen-mark:hover .ym-tile { border-color: #e5b342; }
body.mini-gleason #yaqeen-logo { width: 36px; height: 36px; max-width: none; max-height: none; object-fit: contain; display: block; }
@media (max-width: 820px), (max-height: 520px) {
  body.mini-gleason #yaqeen-mark { gap: 8px; }
  #yaqeen-mark .ym-title { font-size: 1.2rem; }
  #yaqeen-mark .ym-sub { font-size: 9px; }
  #yaqeen-mark .ym-tile { width: 38px; height: 38px; padding: 3px; border-radius: 10px; }
  body.mini-gleason #yaqeen-logo { width: 32px; height: 32px; }
}

/* ===== بطاقة المطوّر (تظهر عند لمس شعار Topo) ===== */
.brand-wrap { position: relative; display: flex; align-items: center; }
#topo-brand { background: none; border: 0; padding: 6px; margin: -6px; cursor: pointer; display: flex; border-radius: 12px; }
#topo-brand:focus, #topo-brand:focus-visible { outline: none; }
#topo-brand[aria-expanded="true"] img { filter: drop-shadow(0 0 8px rgba(76,201,240,.5)); }
#credit-card { position: absolute; top: calc(100% + 10px); left: 50%; width: 236px; margin-left: -118px; padding: 14px 16px 13px; text-align: center; direction: rtl;
  background: rgba(15,23,48,.97); border: 1px solid #3a506b; border-radius: 14px; box-shadow: 0 14px 36px rgba(0,0,0,.55); z-index: 70;
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.97); transform-origin: top center; transition: opacity .18s, transform .18s, visibility .18s; }
#credit-card.open { opacity: 1; visibility: visible; transform: none; }
#credit-card::before { content: ""; position: absolute; top: -6px; left: 50%; margin-left: -5px; width: 10px; height: 10px; background: inherit;
  border-left: 1px solid #3a506b; border-top: 1px solid #3a506b; transform: rotate(45deg); }
.cc-role { font-size: .7rem; color: #8899aa; letter-spacing: .04em; }
.cc-name { font: 700 1.2rem/1.5 'Amiri', serif; color: #c89b33; margin-top: 2px; }
.cc-en { font-size: .82rem; letter-spacing: .14em; color: #e2e8f0; direction: ltr; }
.cc-line { height: 1px; width: 46px; margin: 10px auto 8px; background: linear-gradient(90deg, transparent, #c89b33, transparent); }
.cc-app { font-size: .68rem; color: #8899aa; }