#hpd-overlay {
  position: fixed; inset: 0; z-index: 100050;
  background: #0b1220; color: #0f172a;
  display: flex; flex-direction: column;
  font-family: Cairo, Tajawal, "Segoe UI", sans-serif;
  direction: rtl;
}
#hpd-overlay * { box-sizing: border-box; }
.hpd-top {
  height: 58px; flex: 0 0 58px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px; background: #0f172a; color: #fff;
  border-bottom: 1px solid #1e293b;
}
.hpd-top h3 { margin: 0; font-size: 15px; font-weight: 800; white-space: nowrap; }
.hpd-top .grow { flex: 1; }
.hpd-dev {
  border: 1px solid #334155; background: #1e293b; color: #e2e8f0;
  border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 12px; font-weight: 700;
}
.hpd-dev.active { background: #0868D7; border-color: #0868D7; color: #fff; }
.hpd-btn {
  border: 0; border-radius: 8px; padding: 7px 12px; cursor: pointer;
  font-size: 12px; font-weight: 700; background: #1e293b; color: #e2e8f0;
}
.hpd-btn:hover { background: #334155; }
.hpd-btn-primary { background: #0868D7; color: #fff; }
.hpd-btn-primary:hover { background: #0654ad; }
.hpd-btn-danger { background: #7f1d1d; color: #fecaca; }
.hpd-btn-ghost { background: transparent; border: 1px solid #334155; }
.hpd-body { flex: 1; display: flex; min-height: 0; }
.hpd-side {
  width: 270px; flex: 0 0 270px; background: #fff;
  border-left: 1px solid #e2e8f0; overflow: auto; padding: 10px;
}
.hpd-side-right { width: 310px; flex: 0 0 310px; border-right: 1px solid #e2e8f0; border-left: 0; }
.hpd-stage {
  flex: 1; min-width: 0; background: #1a2336;
  display: flex; flex-direction: column; align-items: center;
  overflow: auto; padding: 18px 12px 40px; position: relative;
}
.hpd-stage-hint {
  color: #94a3b8; font-size: 12px; margin-bottom: 10px; text-align: center;
}
.hpd-phone-shell {
  background: #111827; border-radius: 36px; padding: 14px 12px 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  position: relative;
}
.hpd-phone-notch {
  width: 120px; height: 18px; background: #0b1220; border-radius: 0 0 12px 12px;
  margin: 0 auto 8px;
}
.hpd-phone {
  background: #F4F7FB; border-radius: 22px; overflow: hidden;
  width: 360px; min-height: 640px; max-height: 72vh;
  display: flex; flex-direction: column; color: #0f172a;
  position: relative;
}
.hpd-phone.ipad { width: 520px; }
.hpd-phone.iphone { width: 340px; }
.hpd-phone-scroll {
  flex: 1; overflow: auto; position: relative;
}
.hpd-block {
  margin: 6px 10px; border-radius: 12px; cursor: grab;
  border: 2px solid transparent; background: #fff;
  box-shadow: 0 2px 8px rgba(15,23,42,.06);
  position: relative; user-select: none;
  min-height: 48px;
}
.hpd-block:active { cursor: grabbing; }
.hpd-block.selected { border-color: #38bdf8; box-shadow: 0 0 0 2px rgba(56,189,248,.35); }
.hpd-block.hidden-block { opacity: .4; }
.hpd-block.drag-over { border-color: #0868D7; background: #eff6ff; }
.hpd-block-head {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; background: #f8fafc; border-bottom: 1px solid #e2e8f0;
  font-size: 11px; font-weight: 800;
}
.hpd-block-body { padding: 10px; font-size: 12px; }
.hpd-block-actions { margin-right: auto; display: flex; gap: 2px; }
.hpd-block-actions button {
  border: 0; background: transparent; cursor: pointer; font-size: 11px; padding: 2px 4px;
}
.hpd-fake-banner {
  height: 90px; border-radius: 10px;
  background: linear-gradient(135deg, #0868D7, #38bdf8);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.hpd-fake-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.hpd-fake-tile {
  background: #f1f5f9; border-radius: 10px; padding: 10px 4px; text-align: center; font-size: 10px;
}
.hpd-fake-btns {
  display: grid; gap: 8px;
}
.hpd-fake-btn {
  border-radius: 12px; padding: 12px 8px; text-align: center; font-size: 11px; font-weight: 700;
}
.hpd-fake-row {
  display: flex; gap: 8px; overflow: hidden;
}
.hpd-fake-card {
  min-width: 110px; height: 70px; border-radius: 10px; background: #e2e8f0;
}
.hpd-bottom {
  background: #fff; border-top: 1px solid #e2e8f0;
  display: flex; align-items: flex-end; justify-content: space-around;
  padding: 6px 4px 8px; min-height: 58px; flex: 0 0 auto;
}
.hpd-nav-item {
  flex: 1; text-align: center; font-size: 10px; color: #64748b; cursor: pointer;
  padding: 4px 2px; border-radius: 8px;
}
.hpd-nav-item.selected { outline: 2px solid #38bdf8; }
.hpd-nav-item .ico { font-size: 16px; display: block; margin-bottom: 2px; }
.hpd-nav-fab {
  width: 44px; height: 44px; border-radius: 50%; background: #0868D7; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; margin-top: -22px; border: 3px solid #fff;
}
.hpd-panel-title {
  font-size: 12px; font-weight: 800; margin: 4px 0 10px;
  padding-bottom: 6px; border-bottom: 1px solid #e2e8f0;
}
.hpd-toolbox-item {
  background: #f8fafc; border: 1px dashed #94a3b8; border-radius: 10px;
  padding: 8px 10px; margin-bottom: 6px; cursor: grab; font-size: 12px; font-weight: 700;
}
.hpd-layer {
  display: flex; align-items: center; gap: 6px; padding: 7px 8px;
  border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 6px;
  background: #f8fafc; cursor: pointer; font-size: 12px;
}
.hpd-layer.active { border-color: #0868D7; background: #eff6ff; }
.hpd-layer .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hpd-layer.off { opacity: .5; }
.hpd-mini { border: 0; background: transparent; cursor: pointer; font-size: 12px; padding: 2px; }
.hpd-field { margin-bottom: 10px; }
.hpd-field label { display: block; font-size: 11px; color: #64748b; margin-bottom: 4px; font-weight: 700; }
.hpd-field input, .hpd-field select, .hpd-field textarea {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 7px 9px; font-size: 12px;
}
.hpd-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hpd-tabs { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.hpd-tab {
  border: 0; border-radius: 8px; padding: 6px 10px; cursor: pointer;
  font-size: 11px; font-weight: 800; background: #e2e8f0; color: #0f172a;
}
.hpd-tab.active { background: #0868D7; color: #fff; }
.hpd-hint { font-size: 11px; color: #64748b; line-height: 1.5; margin: 0 0 8px; }
.hpd-toast {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: #065f46; color: #fff; padding: 8px 14px; border-radius: 999px;
  font-size: 12px; z-index: 20; display: none;
}
.hpd-empty {
  margin: 40px 16px; text-align: center; color: #64748b; font-size: 13px;
  border: 2px dashed #cbd5e1; border-radius: 12px; padding: 24px;
}
