/* ===== 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; }
body.mini-gleason #yaqeen-mark span { font-family: 'Amiri', serif !important; font-weight: 700; letter-spacing: 0; }
#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; }
  body.mini-gleason #yaqeen-mark span { font-size: 1.15rem; }
  body.mini-gleason #yaqeen-logo { height: 32px; }

  /* زر القائمة */
  #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; }
}
